diff --git a/bin/sandbox b/bin/sandbox new file mode 100755 index 000000000..ee74261b9 --- /dev/null +++ b/bin/sandbox @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -e + +DIR=$(cd `dirname $0` && pwd) + +bash "${DIR}/sandbox-dotnet" +bash "${DIR}/sandbox-java-v1" +bash "${DIR}/sandbox-java-v2" +bash "${DIR}/sandbox-node" +bash "${DIR}/sandbox-php" diff --git a/copy-sdks b/copy-sdks index 8de44644d..a2366b1d5 100755 --- a/copy-sdks +++ b/copy-sdks @@ -102,8 +102,30 @@ function copy_files() git reset --hard origin/${REPO_MAIN_BRANCH} git pull origin ${REPO_MAIN_BRANCH} git checkout -b "release-${VERSION}" + cp -r "${DIR}/sdks/${SDK}/." "${SDK_DIR}" + rm -f "${SDK_DIR}/openapi-sdk.yaml" + rm -rf "${SDK_DIR}/examples" + mkdir -p "${SDK_DIR}/examples" + + cp -r "${DIR}/openapi-sdk.yaml" "${SDK_DIR}/openapi-sdk.yaml" + + if [[ "${SDK}" == "dotnet" ]]; then + cp -r "${DIR}/examples/"*.cs "${SDK_DIR}/examples/" + elif [[ "${SDK}" == "java-v2" ]] || [[ "${SDK}" == "java-v1" ]]; then + cp -r "${DIR}/examples/"*.java "${SDK_DIR}/examples/" + elif [[ "${SDK}" == "node" ]]; then + cp -r "${DIR}/examples/"*.js "${SDK_DIR}/examples/" + cp -r "${DIR}/examples/"*.ts "${SDK_DIR}/examples/" + elif [[ "${SDK}" == "php" ]]; then + cp -r "${DIR}/examples/"*.php "${SDK_DIR}/examples/" + elif [[ "${SDK}" == "python" ]]; then + cp -r "${DIR}/examples/"*.py "${SDK_DIR}/examples/" + elif [[ "${SDK}" == "ruby" ]]; then + cp -r "${DIR}/examples/"*.rb "${SDK_DIR}/examples/" + fi + php "${DIR}/bin/update-sdk-version.php" ${SDK} ${VERSION} popd diff --git a/examples/FaxLineAddUser.cs b/examples/FaxLineAddUser.cs new file mode 100644 index 000000000..de22f454f --- /dev/null +++ b/examples/FaxLineAddUser.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 faxLineApi = new FaxLineApi(config); + + var data = new FaxLineAddUserRequest( + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com" + ); + + try + { + var result = faxLineApi.FaxLineAddUser(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/FaxLineAddUser.java b/examples/FaxLineAddUser.java new file mode 100644 index 000000000..34e455d5a --- /dev/null +++ b/examples/FaxLineAddUser.java @@ -0,0 +1,30 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineAddUserRequest() + .number("[FAX_NUMBER]") + .emailAddress("member@dropboxsign.com"); + + try { + FaxLineResponse result = faxLineApi.faxLineAddUser(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/FaxLineAddUser.js b/examples/FaxLineAddUser.js new file mode 100644 index 000000000..84e1e2c0e --- /dev/null +++ b/examples/FaxLineAddUser.js @@ -0,0 +1,19 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data = { + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com", +}; + +const result = faxLineApi.faxLineAddUser(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/FaxLineAddUser.php b/examples/FaxLineAddUser.php new file mode 100644 index 000000000..8fb6c0fef --- /dev/null +++ b/examples/FaxLineAddUser.php @@ -0,0 +1,23 @@ +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +$data = new Dropbox\Sign\Model\FaxLineAddUserRequest(); +$data->setNumber("[FAX_NUMBER]") + ->setEmailAddress("member@dropboxsign.com"); + +try { + $result = $faxLineApi->faxLineAddUser($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/FaxLineAddUser.py b/examples/FaxLineAddUser.py new file mode 100644 index 000000000..49d362ccb --- /dev/null +++ b/examples/FaxLineAddUser.py @@ -0,0 +1,23 @@ +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_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineAddUserRequest( + number="[FAX_NUMBER]", + email_address="member@dropboxsign.com", + ) + + try: + response = fax_line_api.fax_line_add_user(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineAddUser.rb b/examples/FaxLineAddUser.rb new file mode 100644 index 000000000..1ad855373 --- /dev/null +++ b/examples/FaxLineAddUser.rb @@ -0,0 +1,19 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +data = Dropbox::Sign::FaxLineAddUserRequest.new +data.number = "[FAX_NUMBER]" +data.email_address = "member@dropboxsign.com" + +begin + result = fax_line_api.fax_line_add_user(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxLineAddUser.sh b/examples/FaxLineAddUser.sh new file mode 100644 index 000000000..d0d223f90 --- /dev/null +++ b/examples/FaxLineAddUser.sh @@ -0,0 +1,4 @@ +curl -X POST 'https://api.hellosign.com/v3/fax_line/add_user' \ + -u 'YOUR_API_KEY:' \ + -F 'number=[FAX_NUMBER]' \ + -F 'email_address=member@dropboxsign.com' diff --git a/examples/FaxLineAddUser.ts b/examples/FaxLineAddUser.ts new file mode 100644 index 000000000..e5d705e94 --- /dev/null +++ b/examples/FaxLineAddUser.ts @@ -0,0 +1,19 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data: DropboxSign.FaxLineAddUserRequest = { + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com", +}; + +const result = faxLineApi.faxLineAddUser(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/FaxLineAreaCodeGet.cs b/examples/FaxLineAreaCodeGet.cs new file mode 100644 index 000000000..3beedfef1 --- /dev/null +++ b/examples/FaxLineAreaCodeGet.cs @@ -0,0 +1,29 @@ +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 faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineAreaCodeGet("US", "CA"); + 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/FaxLineAreaCodeGet.java b/examples/FaxLineAreaCodeGet.java new file mode 100644 index 000000000..1df071ab9 --- /dev/null +++ b/examples/FaxLineAreaCodeGet.java @@ -0,0 +1,26 @@ +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 faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineAreaCodeGetResponse result = faxLineApi.faxLineAreaCodeGet("US", "CA"); + 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/FaxLineAreaCodeGet.js b/examples/FaxLineAreaCodeGet.js new file mode 100644 index 000000000..bfc908f18 --- /dev/null +++ b/examples/FaxLineAreaCodeGet.js @@ -0,0 +1,14 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineAreaCodeGet("US", "CA"); +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/FaxLineAreaCodeGet.php b/examples/FaxLineAreaCodeGet.php new file mode 100644 index 000000000..c19f9e187 --- /dev/null +++ b/examples/FaxLineAreaCodeGet.php @@ -0,0 +1,19 @@ +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +try { + $result = $faxLineApi->faxLineAreaCodeGet("US", "CA"); + 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/FaxLineAreaCodeGet.py b/examples/FaxLineAreaCodeGet.py new file mode 100644 index 000000000..8a4637352 --- /dev/null +++ b/examples/FaxLineAreaCodeGet.py @@ -0,0 +1,18 @@ +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_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_area_code_get("US", "CA") + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineAreaCodeGet.rb b/examples/FaxLineAreaCodeGet.rb new file mode 100644 index 000000000..571fb4f58 --- /dev/null +++ b/examples/FaxLineAreaCodeGet.rb @@ -0,0 +1,15 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +begin + result = fax_line_api.fax_line_area_code_get("US", "CA") + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxLineAreaCodeGet.sh b/examples/FaxLineAreaCodeGet.sh new file mode 100644 index 000000000..8664c650e --- /dev/null +++ b/examples/FaxLineAreaCodeGet.sh @@ -0,0 +1,4 @@ +curl -X GET 'https://api.hellosign.com/v3/fax_line/area_codes' \ + -u 'YOUR_API_KEY:' \ + -F 'country=US' \ + -F 'state=CA' diff --git a/examples/FaxLineAreaCodeGet.ts b/examples/FaxLineAreaCodeGet.ts new file mode 100644 index 000000000..bfc908f18 --- /dev/null +++ b/examples/FaxLineAreaCodeGet.ts @@ -0,0 +1,14 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineAreaCodeGet("US", "CA"); +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/FaxLineCreate.cs b/examples/FaxLineCreate.cs new file mode 100644 index 000000000..4d96ae5b0 --- /dev/null +++ b/examples/FaxLineCreate.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 faxLineApi = new FaxLineApi(config); + + var data = new FaxLineCreateRequest( + areaCode: 209, + country: "US" + ); + + try + { + var result = faxLineApi.FaxLineCreate(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/FaxLineCreate.java b/examples/FaxLineCreate.java new file mode 100644 index 000000000..fca101895 --- /dev/null +++ b/examples/FaxLineCreate.java @@ -0,0 +1,30 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineCreateRequest() + .areaCode(209) + .country("US"); + + try { + FaxLineResponse result = faxLineApi.faxLineCreate(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/FaxLineCreate.js b/examples/FaxLineCreate.js new file mode 100644 index 000000000..c4ee72c59 --- /dev/null +++ b/examples/FaxLineCreate.js @@ -0,0 +1,19 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data = { + areaCode: 209, + country: "US", +}; + +const result = faxLineApi.faxLineCreate(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/FaxLineCreate.php b/examples/FaxLineCreate.php new file mode 100644 index 000000000..27a0d2b8a --- /dev/null +++ b/examples/FaxLineCreate.php @@ -0,0 +1,23 @@ +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +$data = new Dropbox\Sign\Model\FaxLineCreateRequest(); +$data->setAreaCode(209) + ->setCountry("US"); + +try { + $result = $faxLineApi->faxLineCreate($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/FaxLineCreate.py b/examples/FaxLineCreate.py new file mode 100644 index 000000000..14ef9c97c --- /dev/null +++ b/examples/FaxLineCreate.py @@ -0,0 +1,23 @@ +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_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineCreateRequest( + area_code=209, + country="US", + ) + + try: + response = fax_line_api.fax_line_create(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineCreate.rb b/examples/FaxLineCreate.rb new file mode 100644 index 000000000..2619678ae --- /dev/null +++ b/examples/FaxLineCreate.rb @@ -0,0 +1,19 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +data = Dropbox::Sign::FaxLineCreateRequest.new +data.area_code = 209 +data.country = "US" + +begin + result = fax_line_api.fax_line_create(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxLineCreate.sh b/examples/FaxLineCreate.sh new file mode 100644 index 000000000..054011b2e --- /dev/null +++ b/examples/FaxLineCreate.sh @@ -0,0 +1,4 @@ +curl -X POST 'https://api.hellosign.com/v3/fax_line/create' \ + -u 'YOUR_API_KEY:' \ + -F 'area_code=209' \ + -F 'country=US' diff --git a/examples/FaxLineCreate.ts b/examples/FaxLineCreate.ts new file mode 100644 index 000000000..6ceeb71da --- /dev/null +++ b/examples/FaxLineCreate.ts @@ -0,0 +1,19 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data: DropboxSign.FaxLineCreateRequest = { + areaCode: 209, + country: "US", +}; + +const result = faxLineApi.faxLineCreate(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/FaxLineDelete.cs b/examples/FaxLineDelete.cs new file mode 100644 index 000000000..a2cf8a9f1 --- /dev/null +++ b/examples/FaxLineDelete.cs @@ -0,0 +1,32 @@ +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 faxLineApi = new FaxLineApi(config); + + var data = new FaxLineDeleteRequest( + number: "[FAX_NUMBER]", + ); + + try + { + faxLineApi.FaxLineDelete(data); + } + 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/FaxLineDelete.java b/examples/FaxLineDelete.java new file mode 100644 index 000000000..6b989d287 --- /dev/null +++ b/examples/FaxLineDelete.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.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineDeleteRequest() + .number("[FAX_NUMBER]"); + + try { + faxLineApi.faxLineDelete(data); + } 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/FaxLineDelete.js b/examples/FaxLineDelete.js new file mode 100644 index 000000000..1e8bdda7c --- /dev/null +++ b/examples/FaxLineDelete.js @@ -0,0 +1,17 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data = { + number: "[FAX_NUMBER]", +}; + +const result = faxLineApi.faxLineDelete(data); + +result.catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxLineDelete.php b/examples/FaxLineDelete.php new file mode 100644 index 000000000..8cc4ee01f --- /dev/null +++ b/examples/FaxLineDelete.php @@ -0,0 +1,21 @@ +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +$data = new Dropbox\Sign\Model\FaxLineDeleteRequest(); +$data->setNumber("[FAX_NUMBER]"); + +try { + $faxLineApi->faxLineDelete($data); +} catch (Dropbox\Sign\ApiException $e) { + $error = $e->getResponseObject(); + echo "Exception when calling Dropbox Sign API: " + . print_r($error->getError()); +} diff --git a/examples/FaxLineDelete.py b/examples/FaxLineDelete.py new file mode 100644 index 000000000..7b828b01f --- /dev/null +++ b/examples/FaxLineDelete.py @@ -0,0 +1,21 @@ +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_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineDeleteRequest( + number="[FAX_NUMBER]", + ) + + try: + fax_line_api.fax_line_delete(data) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineDelete.rb b/examples/FaxLineDelete.rb new file mode 100644 index 000000000..001cf6275 --- /dev/null +++ b/examples/FaxLineDelete.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_line_api = Dropbox::Sign::FaxLineApi.new + +data = Dropbox::Sign::FaxLineDeleteRequest.new +data.number = "[FAX_NUMBER]" + +begin + fax_line_api.fax_line_delete(data) +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxLineDelete.sh b/examples/FaxLineDelete.sh new file mode 100644 index 000000000..d732b3db8 --- /dev/null +++ b/examples/FaxLineDelete.sh @@ -0,0 +1,3 @@ +curl -X DELETE 'https://api.hellosign.com/v3/fax_line' \ + -u 'YOUR_API_KEY:' \ + -F 'number=[FAX_NUMBER]' diff --git a/examples/FaxLineDelete.ts b/examples/FaxLineDelete.ts new file mode 100644 index 000000000..14efef4dc --- /dev/null +++ b/examples/FaxLineDelete.ts @@ -0,0 +1,17 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data: DropboxSign.FaxLineDeleteRequest = { + number: "[FAX_NUMBER]", +}; + +const result = faxLineApi.faxLineDelete(data); + +result.catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); diff --git a/examples/FaxLineGet.cs b/examples/FaxLineGet.cs new file mode 100644 index 000000000..d18c82fab --- /dev/null +++ b/examples/FaxLineGet.cs @@ -0,0 +1,29 @@ +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 faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineGet("[FAX_NUMBER]"); + 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/FaxLineGet.java b/examples/FaxLineGet.java new file mode 100644 index 000000000..69281b342 --- /dev/null +++ b/examples/FaxLineGet.java @@ -0,0 +1,26 @@ +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 faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineResponse result = faxLineApi.faxLineGet("[FAX_NUMBER]"); + 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/FaxLineGet.js b/examples/FaxLineGet.js new file mode 100644 index 000000000..e9643abe9 --- /dev/null +++ b/examples/FaxLineGet.js @@ -0,0 +1,14 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineGet("[FAX_NUMBER]"); +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/FaxLineGet.php b/examples/FaxLineGet.php new file mode 100644 index 000000000..75dd77b5c --- /dev/null +++ b/examples/FaxLineGet.php @@ -0,0 +1,19 @@ +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +try { + $result = $faxLineApi->faxLineGet("[FAX_NUMBER]"); + 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/FaxLineGet.py b/examples/FaxLineGet.py new file mode 100644 index 000000000..3f66de9e7 --- /dev/null +++ b/examples/FaxLineGet.py @@ -0,0 +1,18 @@ +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_get("[FAX_NUMBER]") + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineGet.rb b/examples/FaxLineGet.rb new file mode 100644 index 000000000..090c2bdd8 --- /dev/null +++ b/examples/FaxLineGet.rb @@ -0,0 +1,15 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +begin + result = fax_line_api.fax_line_get("[NUMBER]") + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxLineGet.sh b/examples/FaxLineGet.sh new file mode 100644 index 000000000..513522062 --- /dev/null +++ b/examples/FaxLineGet.sh @@ -0,0 +1,2 @@ +curl -X GET 'https://api.hellosign.com/v3/fax_line?number=[FAX_NUMBER]' \ + -u 'YOUR_API_KEY:' diff --git a/examples/FaxLineGet.ts b/examples/FaxLineGet.ts new file mode 100644 index 000000000..e9643abe9 --- /dev/null +++ b/examples/FaxLineGet.ts @@ -0,0 +1,14 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineGet("[FAX_NUMBER]"); +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/FaxLineList.cs b/examples/FaxLineList.cs new file mode 100644 index 000000000..96d7f0c28 --- /dev/null +++ b/examples/FaxLineList.cs @@ -0,0 +1,29 @@ +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 faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineList(); + 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/FaxLineList.java b/examples/FaxLineList.java new file mode 100644 index 000000000..df1d0bd13 --- /dev/null +++ b/examples/FaxLineList.java @@ -0,0 +1,26 @@ +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 faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineListResponse result = faxLineApi.faxLineList(); + 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/FaxLineList.js b/examples/FaxLineList.js new file mode 100644 index 000000000..f40c60dfa --- /dev/null +++ b/examples/FaxLineList.js @@ -0,0 +1,14 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineList(); +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/FaxLineList.php b/examples/FaxLineList.php new file mode 100644 index 000000000..6056a2427 --- /dev/null +++ b/examples/FaxLineList.php @@ -0,0 +1,19 @@ +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +try { + $result = $faxLineApi->faxLineList(); + 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/FaxLineList.py b/examples/FaxLineList.py new file mode 100644 index 000000000..49cf69a59 --- /dev/null +++ b/examples/FaxLineList.py @@ -0,0 +1,18 @@ +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_list() + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineList.rb b/examples/FaxLineList.rb new file mode 100644 index 000000000..23a0ec845 --- /dev/null +++ b/examples/FaxLineList.rb @@ -0,0 +1,15 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +begin + result = fax_line_api.fax_line_list() + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxLineList.sh b/examples/FaxLineList.sh new file mode 100644 index 000000000..d5b4ea4df --- /dev/null +++ b/examples/FaxLineList.sh @@ -0,0 +1,2 @@ +curl -X GET 'https://api.hellosign.com/v3/fax_line/list' \ + -u 'YOUR_API_KEY:' diff --git a/examples/FaxLineList.ts b/examples/FaxLineList.ts new file mode 100644 index 000000000..f40c60dfa --- /dev/null +++ b/examples/FaxLineList.ts @@ -0,0 +1,14 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineList(); +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/FaxLineRemoveUser.cs b/examples/FaxLineRemoveUser.cs new file mode 100644 index 000000000..1dd562ed6 --- /dev/null +++ b/examples/FaxLineRemoveUser.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 faxLineApi = new FaxLineApi(config); + + var data = new FaxLineRemoveUserRequest( + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com" + ); + + try + { + var result = faxLineApi.FaxLineRemoveUser(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/FaxLineRemoveUser.java b/examples/FaxLineRemoveUser.java new file mode 100644 index 000000000..7864b05ab --- /dev/null +++ b/examples/FaxLineRemoveUser.java @@ -0,0 +1,30 @@ +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.api.*; +import com.dropbox.sign.auth.*; +import com.dropbox.sign.model.*; + +import java.util.List; + +public class Example { + public static void main(String[] args) { + var apiClient = Configuration.getDefaultApiClient() + .setApiKey("YOUR_API_KEY"); + + var faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineRemoveUserRequest() + .number("[FAX_NUMBER]") + .emailAddress("member@dropboxsign.com"); + + try { + FaxLineResponse result = faxLineApi.faxLineRemoveUser(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/FaxLineRemoveUser.js b/examples/FaxLineRemoveUser.js new file mode 100644 index 000000000..64f247924 --- /dev/null +++ b/examples/FaxLineRemoveUser.js @@ -0,0 +1,19 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data = { + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com", +}; + +const result = faxLineApi.faxLineRemoveUser(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/FaxLineRemoveUser.php b/examples/FaxLineRemoveUser.php new file mode 100644 index 000000000..60132fedc --- /dev/null +++ b/examples/FaxLineRemoveUser.php @@ -0,0 +1,23 @@ +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +$data = new Dropbox\Sign\Model\FaxLineRemoveUserRequest(); +$data->setNumber("[FAX_NUMBER]") + ->setEmailAddress("member@dropboxsign.com"); + +try { + $result = $faxLineApi->faxLineRemoveUser($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/FaxLineRemoveUser.py b/examples/FaxLineRemoveUser.py new file mode 100644 index 000000000..4d8c19668 --- /dev/null +++ b/examples/FaxLineRemoveUser.py @@ -0,0 +1,23 @@ +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_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineRemoveUserRequest( + number="[FAX_NUMBER]", + email_address="member@dropboxsign.com", + ) + + try: + response = fax_line_api.fax_line_remove_user(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineRemoveUser.rb b/examples/FaxLineRemoveUser.rb new file mode 100644 index 000000000..98bb7a047 --- /dev/null +++ b/examples/FaxLineRemoveUser.rb @@ -0,0 +1,19 @@ +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +data = Dropbox::Sign::FaxLineRemoveUserRequest.new +data.number = "[FAX_NUMBER]" +data.email_address = "member@dropboxsign.com" + +begin + result = fax_line_api.fax_line_remove_user(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end diff --git a/examples/FaxLineRemoveUser.sh b/examples/FaxLineRemoveUser.sh new file mode 100644 index 000000000..7c7a1580a --- /dev/null +++ b/examples/FaxLineRemoveUser.sh @@ -0,0 +1,4 @@ +curl -X POST 'https://api.hellosign.com/v3/fax_line/remove_user' \ + -u 'YOUR_API_KEY:' \ + -F 'number=[FAX_NUMBER]' \ + -F 'email_address=member@dropboxsign.com' diff --git a/examples/FaxLineRemoveUser.ts b/examples/FaxLineRemoveUser.ts new file mode 100644 index 000000000..91dc3066b --- /dev/null +++ b/examples/FaxLineRemoveUser.ts @@ -0,0 +1,19 @@ +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data: DropboxSign.FaxLineRemoveUserRequest = { + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com", +}; + +const result = faxLineApi.faxLineRemoveUser(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/FaxLineAddUserRequestExample.json b/examples/json/FaxLineAddUserRequestExample.json new file mode 100644 index 000000000..405f23102 --- /dev/null +++ b/examples/json/FaxLineAddUserRequestExample.json @@ -0,0 +1,4 @@ +{ + "number": "[FAX_NUMBER]", + "email_address": "member@dropboxsign.com" +} diff --git a/examples/json/FaxLineAreaCodeGetResponseExample.json b/examples/json/FaxLineAreaCodeGetResponseExample.json new file mode 100644 index 000000000..b83e80cc2 --- /dev/null +++ b/examples/json/FaxLineAreaCodeGetResponseExample.json @@ -0,0 +1,34 @@ +{ + "area_codes": [ + 209, + 213, + 310, + 323, + 408, + 415, + 424, + 510, + 530, + 559, + 562, + 619, + 626, + 650, + 657, + 661, + 669, + 707, + 714, + 747, + 760, + 805, + 818, + 831, + 858, + 909, + 916, + 925, + 949, + 951 + ] +} diff --git a/examples/json/FaxLineCreateRequestExample.json b/examples/json/FaxLineCreateRequestExample.json new file mode 100644 index 000000000..f80f6e421 --- /dev/null +++ b/examples/json/FaxLineCreateRequestExample.json @@ -0,0 +1,4 @@ +{ + "area_code": 209, + "country": "US" +} diff --git a/examples/json/FaxLineDeleteRequestExample.json b/examples/json/FaxLineDeleteRequestExample.json new file mode 100644 index 000000000..4bc5f0b67 --- /dev/null +++ b/examples/json/FaxLineDeleteRequestExample.json @@ -0,0 +1,3 @@ +{ + "number": "[FAX_NUMBER]", +} diff --git a/examples/json/FaxLineListResponseExample.json b/examples/json/FaxLineListResponseExample.json new file mode 100644 index 000000000..39ec60ac3 --- /dev/null +++ b/examples/json/FaxLineListResponseExample.json @@ -0,0 +1,24 @@ +{ + "list_info": { + "num_pages": 1, + "num_results": 1, + "page": 1, + "page_size": 1 + }, + "fax_lines": [ + { + "number": "[FAX_NUMBER]", + "created_at": 1723231831, + "updated_at": 1723231831, + "accounts": [ + { + "account_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "email_address": "me@dropboxsign.com", + "is_locked": false, + "is_paid_hs": false, + "is_paid_hf": true + } + ] + } + ] +} diff --git a/examples/json/FaxLineRemoveUserRequestExample.json b/examples/json/FaxLineRemoveUserRequestExample.json new file mode 100644 index 000000000..405f23102 --- /dev/null +++ b/examples/json/FaxLineRemoveUserRequestExample.json @@ -0,0 +1,4 @@ +{ + "number": "[FAX_NUMBER]", + "email_address": "member@dropboxsign.com" +} diff --git a/examples/json/FaxLineResponseExample.json b/examples/json/FaxLineResponseExample.json new file mode 100644 index 000000000..9e4656f7c --- /dev/null +++ b/examples/json/FaxLineResponseExample.json @@ -0,0 +1,16 @@ +{ + "fax_line": { + "number": "[FAX_NUMBER]", + "created_at": 1723231831, + "updated_at": 1723231831, + "accounts": [ + { + "account_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "email_address": "me@dropboxsign.com", + "is_locked": false, + "is_paid_hs": false, + "is_paid_hf": true + } + ] + } +} diff --git a/markdown/en/tags/fax-lines-tag-description.md b/markdown/en/tags/fax-lines-tag-description.md new file mode 100644 index 000000000..9adc1f687 --- /dev/null +++ b/markdown/en/tags/fax-lines-tag-description.md @@ -0,0 +1 @@ +Contains information about the fax lines you and your team have created \ No newline at end of file diff --git a/openapi-raw.yaml b/openapi-raw.yaml index b5f3915fb..a0d21f20e 100644 --- a/openapi-raw.yaml +++ b/openapi-raw.yaml @@ -1403,6 +1403,803 @@ paths: seo: title: '_t__EmbeddedSignUrl::SEO::TITLE' description: '_t__EmbeddedSignUrl::SEO::DESCRIPTION' + /fax_line/add_user: + put: + tags: + - 'Fax Line' + summary: '_t__FaxLineAddUser::SUMMARY' + description: '_t__FaxLineAddUser::DESCRIPTION' + operationId: faxLineAddUser + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineAddUserRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineAddUserRequestExample' + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineAddUser.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineAddUser.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineAddUser.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineAddUser.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineAddUser.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineAddUser.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineAddUser.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineAddUser.sh + x-meta: + seo: + title: '_t__FaxLineAddUser::SEO::TITLE' + description: '_t__FaxLineAddUser::SEO::DESCRIPTION' + /fax_line/area_codes: + get: + tags: + - 'Fax Line' + summary: '_t__FaxLineAreaCodeGet::SUMMARY' + description: '_t__FaxLineAreaCodeGet::DESCRIPTION' + operationId: faxLineAreaCodeGet + parameters: + - + name: country + in: query + description: '_t__FaxLineAreaCodeGet::COUNTRY' + required: true + schema: + type: string + enum: + - CA + - US + - UK + - + name: state + in: query + description: '_t__FaxLineAreaCodeGet::STATE' + schema: + type: string + enum: + - 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 + - + name: province + in: query + description: '_t__FaxLineAreaCodeGet::PROVINCE' + schema: + type: string + enum: + - AB + - BC + - MB + - NB + - NL + - NT + - NS + - NU + - 'ON' + - PE + - QC + - SK + - YT + - + name: city + in: query + description: '_t__FaxLineAreaCodeGet::CITY' + schema: + type: string + 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/FaxLineAreaCodeGetResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineAreaCodeGetResponseExample' + 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/FaxLineAreaCodeGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineAreaCodeGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineAreaCodeGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineAreaCodeGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineAreaCodeGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineAreaCodeGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineAreaCodeGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineAreaCodeGet.sh + x-meta: + seo: + title: '_t__FaxLineAreaCodeGet::SEO::TITLE' + description: '_t__FaxLineAreaCodeGet::SEO::DESCRIPTION' + /fax_line/create: + post: + tags: + - 'Fax Line' + summary: '_t__FaxLineCreate::SUMMARY' + description: '_t__FaxLineCreate::DESCRIPTION' + operationId: faxLineCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineCreateRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineCreateRequestExample' + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineCreate.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineCreate.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineCreate.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineCreate.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineCreate.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineCreate.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineCreate.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineCreate.sh + x-meta: + seo: + title: '_t__FaxLineCreate::SEO::TITLE' + description: '_t__FaxLineCreate::SEO::DESCRIPTION' + /fax_line: + get: + tags: + - 'Fax Line' + summary: '_t__FaxLineGet::SUMMARY' + description: '_t__FaxLineGet::DESCRIPTION' + operationId: faxLineGet + parameters: + - + name: number + in: query + description: '_t__FaxLineGet::NUMBER' + required: true + schema: + type: string + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineGet.sh + x-meta: + seo: + title: '_t__FaxLineGet::SEO::TITLE' + description: '_t__FaxLineGet::SEO::DESCRIPTION' + delete: + tags: + - 'Fax Line' + summary: '_t__FaxLineDelete::SUMMARY' + description: '_t__FaxLineDelete::DESCRIPTION' + operationId: faxLineDelete + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineDeleteRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineDeleteRequestExample' + responses: + '200': + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: { } + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineDelete.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineDelete.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineDelete.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineDelete.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineDelete.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineDelete.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineDelete.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineDelete.sh + x-meta: + seo: + title: '_t__FaxLineDelete::SEO::TITLE' + description: '_t__FaxLineDelete::SEO::DESCRIPTION' + /fax_line/list: + get: + tags: + - 'Fax Line' + summary: '_t__FaxLineList::SUMMARY' + description: '_t__FaxLineList::DESCRIPTION' + operationId: faxLineList + parameters: + - + name: account_id + in: query + description: '_t__FaxLineList::ACCOUNT_ID' + schema: + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + - + name: page + in: query + description: '_t__FaxLineList::PAGE' + schema: + type: integer + default: 1 + example: 1 + - + name: page_size + in: query + description: '_t__FaxLineList::PAGE_SIZE' + schema: + type: integer + default: 20 + example: 20 + - + name: show_team_lines + in: query + description: '_t__FaxLineList::SHOW_TEAM_LINES' + schema: + type: boolean + 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/FaxLineListResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineListResponseExample' + 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/FaxLineList.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineList.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineList.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineList.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineList.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineList.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineList.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineList.sh + x-meta: + seo: + title: '_t__FaxLineList::SEO::TITLE' + description: '_t__FaxLineList::SEO::DESCRIPTION' + /fax_line/remove_user: + put: + tags: + - 'Fax Line' + summary: '_t__FaxLineRemoveUser::SUMMARY' + description: '_t__FaxLineRemoveUser::DESCRIPTION' + operationId: faxLineRemoveUser + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineRemoveUserRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineRemoveUserRequestExample' + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineRemoveUser.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineRemoveUser.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineRemoveUser.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineRemoveUser.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineRemoveUser.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineRemoveUser.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineRemoveUser.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineRemoveUser.sh + x-meta: + seo: + title: '_t__FaxLineRemoveUser::SEO::TITLE' + description: '_t__FaxLineRemoveUser::SEO::DESCRIPTION' /oauth/token: post: tags: @@ -6315,6 +7112,145 @@ components: type: boolean default: false type: object + FaxLineAddUserRequest: + required: + - number + properties: + number: + description: '_t__FaxLineAddUser::NUMBER' + type: string + account_id: + description: '_t__FaxLineAddUser::ACCOUNT_ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + email_address: + description: '_t__FaxLineAddUser::EMAIL_ADDRESS' + type: string + format: email + type: object + FaxLineAreaCodeGetStateEnum: + type: string + enum: + - 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 + FaxLineAreaCodeGetProvinceEnum: + type: string + enum: + - AB + - BC + - MB + - NB + - NL + - NT + - NS + - NU + - 'ON' + - PE + - QC + - SK + - YT + FaxLineAreaCodeGetCountryEnum: + type: string + enum: + - CA + - US + - UK + FaxLineCreateRequest: + required: + - area_code + - country + properties: + area_code: + description: '_t__FaxLineCreate::AREA_CODE' + type: integer + country: + description: '_t__FaxLineCreate::COUNTRY' + type: string + enum: + - CA + - US + - UK + city: + description: '_t__FaxLineCreate::CITY' + type: string + account_id: + description: '_t__FaxLineCreate::ACCOUNT_ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + type: object + FaxLineDeleteRequest: + required: + - number + properties: + number: + description: '_t__FaxLineDelete::NUMBER' + type: string + type: object + FaxLineRemoveUserRequest: + required: + - number + properties: + number: + description: '_t__FaxLineRemoveUser::NUMBER' + type: string + account_id: + description: '_t__FaxLineRemoveUser::ACCOUNT_ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + email_address: + description: '_t__FaxLineRemoveUser::EMAIL_ADDRESS' + type: string + format: email + type: object OAuthTokenGenerateRequest: required: - client_id @@ -8510,6 +9446,8 @@ components: default: false type: object AccountCreateResponse: + required: + - account properties: account: $ref: '#/components/schemas/AccountResponse' @@ -8523,6 +9461,8 @@ components: type: object x-internal-class: true AccountGetResponse: + required: + - account properties: account: $ref: '#/components/schemas/AccountResponse' @@ -8545,6 +9485,8 @@ components: type: object x-internal-class: true ApiAppGetResponse: + required: + - api_app properties: api_app: $ref: '#/components/schemas/ApiAppResponse' @@ -8556,6 +9498,9 @@ components: type: object x-internal-class: true ApiAppListResponse: + required: + - api_apps + - list_info properties: api_apps: description: '_t__ApiAppListResponse::DESCRIPTION' @@ -8572,6 +9517,10 @@ components: type: object x-internal-class: true BulkSendJobGetResponse: + required: + - bulk_send_job + - list_info + - signature_requests properties: bulk_send_job: $ref: '#/components/schemas/BulkSendJobResponse' @@ -8590,6 +9539,9 @@ components: type: object x-internal-class: true BulkSendJobListResponse: + required: + - bulk_send_jobs + - list_info properties: bulk_send_jobs: description: '_t__BulkSendJobListResponse::BULK_SEND_JOBS' @@ -8606,6 +9558,8 @@ components: type: object x-internal-class: true BulkSendJobSendResponse: + required: + - bulk_send_job properties: bulk_send_job: $ref: '#/components/schemas/BulkSendJobResponse' @@ -8617,6 +9571,8 @@ components: type: object x-internal-class: true EmbeddedEditUrlResponse: + required: + - embedded properties: embedded: $ref: '#/components/schemas/EmbeddedEditUrlResponseEmbedded' @@ -8628,6 +9584,8 @@ components: type: object x-internal-class: true EmbeddedSignUrlResponse: + required: + - embedded properties: embedded: $ref: '#/components/schemas/EmbeddedSignUrlResponseEmbedded' @@ -8645,7 +9603,45 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxLineResponse: + required: + - fax_line + properties: + fax_line: + $ref: '#/components/schemas/FaxLineResponseFaxLine' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true + FaxLineAreaCodeGetResponse: + required: + - area_codes + properties: + area_codes: + type: array + items: + type: integer + type: object + x-internal-class: true + FaxLineListResponse: + required: + - fax_lines + - list_info + properties: + list_info: + $ref: '#/components/schemas/ListInfoResponse' + fax_lines: + type: array + items: + $ref: '#/components/schemas/FaxLineResponseFaxLine' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FileResponse: + required: + - file_url + - expires_at properties: file_url: description: '_t__FileResponse::FILE_URL' @@ -8656,6 +9652,8 @@ components: type: object x-internal-class: true FileResponseDataUri: + required: + - data_uri properties: data_uri: description: '_t__FileResponse::DATA_URI' @@ -8663,6 +9661,8 @@ components: type: object x-internal-class: true ReportCreateResponse: + required: + - report properties: report: $ref: '#/components/schemas/ReportResponse' @@ -8674,6 +9674,8 @@ components: type: object x-internal-class: true SignatureRequestGetResponse: + required: + - signature_request properties: signature_request: $ref: '#/components/schemas/SignatureRequestResponse' @@ -8685,6 +9687,9 @@ components: type: object x-internal-class: true SignatureRequestListResponse: + required: + - signature_requests + - list_info properties: signature_requests: description: '_t__SignatureRequestListResponse::DESCRIPTION' @@ -8976,6 +9981,23 @@ components: description: '_t__ErrorResponseError::ERROR_NAME' type: string type: object + FaxLineResponseFaxLine: + properties: + number: + description: '_t__FaxLineResponseFaxLine::NUMBER' + type: string + created_at: + description: '_t__FaxLineResponseFaxLine::CREATED_AT' + type: integer + updated_at: + description: '_t__FaxLineResponseFaxLine::UPDATED_AT' + type: integer + accounts: + type: array + items: + $ref: '#/components/schemas/AccountResponse' + type: object + x-internal-class: true ListInfoResponse: description: '_t__ListInfoResponse::DESCRIPTION' properties: @@ -9133,6 +10155,7 @@ components: signer: description: '_t__SignatureRequestResponseAttachment::SIGNER' type: string + x-int-or-string: true name: description: '_t__SignatureRequestResponseAttachment::NAME' type: string @@ -9755,6 +10778,7 @@ components: description: '_t__TemplateResponseDocumentCustomField::SIGNER' type: string nullable: true + x-int-or-string: true x: description: '_t__TemplateResponseDocumentCustomField::X' type: integer @@ -9857,6 +10881,7 @@ components: signer: description: '_t__TemplateResponseDocumentFormField::SIGNER' type: string + x-int-or-string: true x: description: '_t__TemplateResponseDocumentFormField::X' type: integer @@ -10308,6 +11333,8 @@ components: type: string type: object TeamGetResponse: + required: + - team properties: team: $ref: '#/components/schemas/TeamResponse' @@ -10319,6 +11346,8 @@ components: type: object x-internal-class: true TeamGetInfoResponse: + required: + - team properties: team: $ref: '#/components/schemas/TeamInfoResponse' @@ -10330,6 +11359,8 @@ components: type: object x-internal-class: true TeamInvitesResponse: + required: + - team_invites properties: team_invites: description: '_t__TeamInvitesResponse::DESCRIPTION' @@ -10343,6 +11374,9 @@ components: type: object x-internal-class: true TeamMembersResponse: + required: + - team_members + - list_info properties: team_members: description: '_t__TeamMembersResponse::DESCRIPTION' @@ -10358,6 +11392,9 @@ components: type: object x-internal-class: true TeamSubTeamsResponse: + required: + - sub_teams + - list_info properties: sub_teams: description: '_t__SubTeamResponse::DESCRIPTION' @@ -10373,6 +11410,8 @@ components: type: object x-internal-class: true TemplateCreateResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateCreateResponseTemplate' @@ -10384,6 +11423,8 @@ components: type: object x-internal-class: true TemplateCreateEmbeddedDraftResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateCreateEmbeddedDraftResponseTemplate' @@ -10395,12 +11436,16 @@ components: type: object x-internal-class: true TemplateEditResponse: + required: + - template_id properties: template_id: description: '_t__TemplateResponse::TEMPLATE_ID' type: string type: object TemplateGetResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateResponse' @@ -10412,6 +11457,9 @@ components: type: object x-internal-class: true TemplateListResponse: + required: + - templates + - list_info properties: templates: description: '_t__TemplateListResponse::DESCRIPTION' @@ -10428,12 +11476,16 @@ components: type: object x-internal-class: true TemplateUpdateFilesResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateUpdateFilesResponseTemplate' type: object x-internal-class: true UnclaimedDraftCreateResponse: + required: + - unclaimed_draft properties: unclaimed_draft: $ref: '#/components/schemas/UnclaimedDraftResponse' @@ -10558,6 +11610,22 @@ components: summary: 'Default Example' value: $ref: examples/json/EmbeddedEditUrlRequestDefaultExample.json + FaxLineAddUserRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineAddUserRequestExample.json + FaxLineCreateRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineCreateRequestExample.json + FaxLineDeleteRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineDeleteRequestExample.json + FaxLineRemoveUserRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineRemoveUserRequestExample.json OAuthTokenGenerateRequestExample: summary: 'OAuth Token Generate Example' value: @@ -10802,6 +11870,18 @@ components: summary: '_t__Error::4XX' value: $ref: examples/json/Error4XXResponseExample.json + FaxLineResponseExample: + summary: '_t__FaxLineResponseExample::SUMMARY' + value: + $ref: examples/json/FaxLineResponseExample.json + FaxLineAreaCodeGetResponseExample: + summary: '_t__FaxLineAreaCodeGetResponseExample::SUMMARY' + value: + $ref: examples/json/FaxLineAreaCodeGetResponseExample.json + FaxLineListResponseExample: + summary: '_t__FaxLineListResponseExample::SUMMARY' + value: + $ref: examples/json/FaxLineListResponseExample.json ReportCreateResponseExample: summary: '_t__ReportCreateResponseExample::SUMMARY' value: @@ -11081,6 +12161,9 @@ tags: - name: 'Callbacks and Events' description: '_md__OpenApi::TAG::CALLBACKS_AND_EVENTS::DESCRIPTION' + - + name: 'Fax Line' + description: '_md__OpenApi::TAG::TAG_FAX_LINE::DESCRIPTION' externalDocs: description: 'Legacy API Reference' url: 'https://app.hellosign.com/api/reference' diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index 9bf5a68ea..c7189fd24 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -1409,6 +1409,803 @@ 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_line/add_user: + put: + tags: + - 'Fax Line' + summary: 'Add Fax Line User' + description: 'Grants a user access to the specified Fax Line.' + operationId: faxLineAddUser + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineAddUserRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineAddUserRequestExample' + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineAddUser.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineAddUser.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineAddUser.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineAddUser.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineAddUser.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineAddUser.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineAddUser.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineAddUser.sh + x-meta: + seo: + title: 'Fax Line Add User | API Documentation | Dropbox Fax for Developers' + 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.' + /fax_line/area_codes: + get: + tags: + - 'Fax Line' + summary: 'Get Available Fax Line Area Codes' + description: 'Returns a response with the area codes available for a given state/provice and city.' + operationId: faxLineAreaCodeGet + parameters: + - + name: country + in: query + description: 'Filter area codes by country.' + required: true + schema: + type: string + enum: + - CA + - US + - UK + - + name: state + in: query + description: 'Filter area codes by state.' + schema: + type: string + enum: + - 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 + - + name: province + in: query + description: 'Filter area codes by province.' + schema: + type: string + enum: + - AB + - BC + - MB + - NB + - NL + - NT + - NS + - NU + - 'ON' + - PE + - QC + - SK + - YT + - + name: city + in: query + description: 'Filter area codes by city.' + schema: + type: string + 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/FaxLineAreaCodeGetResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineAreaCodeGetResponseExample' + 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/FaxLineAreaCodeGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineAreaCodeGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineAreaCodeGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineAreaCodeGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineAreaCodeGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineAreaCodeGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineAreaCodeGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineAreaCodeGet.sh + x-meta: + seo: + title: 'Fax Line Get Area Codes | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to purchase a new fax line, click here.' + /fax_line/create: + post: + tags: + - 'Fax Line' + summary: 'Purchase Fax Line' + description: 'Purchases a new Fax Line.' + operationId: faxLineCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineCreateRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineCreateRequestExample' + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineCreate.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineCreate.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineCreate.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineCreate.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineCreate.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineCreate.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineCreate.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineCreate.sh + x-meta: + seo: + title: 'Purchase Fax Line | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to purchase a new fax line, click here.' + /fax_line: + get: + tags: + - 'Fax Line' + summary: 'Get Fax Line' + description: 'Returns the properties and settings of a Fax Line.' + operationId: faxLineGet + parameters: + - + name: number + in: query + description: 'The Fax Line number.' + required: true + schema: + type: string + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineGet.sh + x-meta: + seo: + title: 'Get Fax Line | 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 line, click here.' + delete: + tags: + - 'Fax Line' + summary: 'Delete Fax Line' + description: 'Deletes the specified Fax Line from the subscription.' + operationId: faxLineDelete + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineDeleteRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineDeleteRequestExample' + responses: + 200: + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: {} + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineDelete.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineDelete.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineDelete.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineDelete.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineDelete.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineDelete.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineDelete.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineDelete.sh + x-meta: + seo: + title: 'Delete Fax Line | 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 line, click here.' + /fax_line/list: + get: + tags: + - 'Fax Line' + summary: 'List Fax Lines' + description: 'Returns the properties and settings of multiple Fax Lines.' + operationId: faxLineList + parameters: + - + name: account_id + in: query + description: 'Account ID' + schema: + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + - + name: page + in: query + description: Page + schema: + type: integer + default: 1 + example: 1 + - + name: page_size + in: query + description: 'Page size' + schema: + type: integer + default: 20 + example: 20 + - + name: show_team_lines + in: query + description: 'Show team lines' + schema: + type: boolean + 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/FaxLineListResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineListResponseExample' + 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/FaxLineList.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineList.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineList.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineList.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineList.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineList.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineList.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineList.sh + x-meta: + seo: + title: 'List Fax Lines | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to list your fax lines, click here.' + /fax_line/remove_user: + put: + tags: + - 'Fax Line' + summary: 'Remove Fax Line Access' + description: 'Removes a user''s access to the specified Fax Line.' + operationId: faxLineRemoveUser + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineRemoveUserRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineRemoveUserRequestExample' + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineRemoveUser.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineRemoveUser.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineRemoveUser.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineRemoveUser.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineRemoveUser.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineRemoveUser.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineRemoveUser.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineRemoveUser.sh + x-meta: + 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.' /oauth/token: post: tags: @@ -6409,6 +7206,145 @@ components: type: boolean default: false type: object + FaxLineAddUserRequest: + required: + - number + properties: + number: + description: 'The Fax Line number.' + type: string + account_id: + description: 'Account ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + email_address: + description: 'Email address' + type: string + format: email + type: object + FaxLineAreaCodeGetStateEnum: + type: string + enum: + - 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 + FaxLineAreaCodeGetProvinceEnum: + type: string + enum: + - AB + - BC + - MB + - NB + - NL + - NT + - NS + - NU + - 'ON' + - PE + - QC + - SK + - YT + FaxLineAreaCodeGetCountryEnum: + type: string + enum: + - CA + - US + - UK + FaxLineCreateRequest: + required: + - area_code + - country + properties: + area_code: + description: 'Area code' + type: integer + country: + description: Country + type: string + enum: + - CA + - US + - UK + city: + description: City + type: string + account_id: + description: 'Account ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + type: object + FaxLineDeleteRequest: + required: + - number + properties: + number: + description: 'The Fax Line number.' + type: string + type: object + FaxLineRemoveUserRequest: + required: + - number + properties: + number: + description: 'The Fax Line number.' + type: string + account_id: + description: 'Account ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + email_address: + description: 'Email address' + type: string + format: email + type: object OAuthTokenGenerateRequest: required: - client_id @@ -9118,6 +10054,8 @@ components: default: false type: object AccountCreateResponse: + required: + - account properties: account: $ref: '#/components/schemas/AccountResponse' @@ -9131,6 +10069,8 @@ components: type: object x-internal-class: true AccountGetResponse: + required: + - account properties: account: $ref: '#/components/schemas/AccountResponse' @@ -9153,6 +10093,8 @@ components: type: object x-internal-class: true ApiAppGetResponse: + required: + - api_app properties: api_app: $ref: '#/components/schemas/ApiAppResponse' @@ -9164,6 +10106,9 @@ components: type: object x-internal-class: true ApiAppListResponse: + required: + - api_apps + - list_info properties: api_apps: description: 'Contains information about API Apps.' @@ -9180,6 +10125,10 @@ components: type: object x-internal-class: true BulkSendJobGetResponse: + required: + - bulk_send_job + - list_info + - signature_requests properties: bulk_send_job: $ref: '#/components/schemas/BulkSendJobResponse' @@ -9198,6 +10147,9 @@ components: type: object x-internal-class: true BulkSendJobListResponse: + required: + - bulk_send_jobs + - list_info properties: bulk_send_jobs: description: 'Contains a list of BulkSendJobs that the API caller has access to.' @@ -9214,6 +10166,8 @@ components: type: object x-internal-class: true BulkSendJobSendResponse: + required: + - bulk_send_job properties: bulk_send_job: $ref: '#/components/schemas/BulkSendJobResponse' @@ -9225,6 +10179,8 @@ components: type: object x-internal-class: true EmbeddedEditUrlResponse: + required: + - embedded properties: embedded: $ref: '#/components/schemas/EmbeddedEditUrlResponseEmbedded' @@ -9236,6 +10192,8 @@ components: type: object x-internal-class: true EmbeddedSignUrlResponse: + required: + - embedded properties: embedded: $ref: '#/components/schemas/EmbeddedSignUrlResponseEmbedded' @@ -9253,7 +10211,45 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxLineResponse: + required: + - fax_line + properties: + fax_line: + $ref: '#/components/schemas/FaxLineResponseFaxLine' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true + FaxLineAreaCodeGetResponse: + required: + - area_codes + properties: + area_codes: + type: array + items: + type: integer + type: object + x-internal-class: true + FaxLineListResponse: + required: + - fax_lines + - list_info + properties: + list_info: + $ref: '#/components/schemas/ListInfoResponse' + fax_lines: + type: array + items: + $ref: '#/components/schemas/FaxLineResponseFaxLine' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FileResponse: + required: + - file_url + - expires_at properties: file_url: description: 'URL to the file.' @@ -9264,6 +10260,8 @@ components: type: object x-internal-class: true FileResponseDataUri: + required: + - data_uri properties: data_uri: description: 'File as base64 encoded string.' @@ -9271,6 +10269,8 @@ components: type: object x-internal-class: true ReportCreateResponse: + required: + - report properties: report: $ref: '#/components/schemas/ReportResponse' @@ -9282,6 +10282,8 @@ components: type: object x-internal-class: true SignatureRequestGetResponse: + required: + - signature_request properties: signature_request: $ref: '#/components/schemas/SignatureRequestResponse' @@ -9293,6 +10295,9 @@ components: type: object x-internal-class: true SignatureRequestListResponse: + required: + - signature_requests + - list_info properties: signature_requests: description: 'Contains information about signature requests.' @@ -9584,6 +10589,23 @@ components: description: 'Name of the error.' type: string type: object + FaxLineResponseFaxLine: + properties: + number: + description: Number + type: string + created_at: + description: 'Created at' + type: integer + updated_at: + description: 'Updated at' + type: integer + accounts: + type: array + items: + $ref: '#/components/schemas/AccountResponse' + type: object + x-internal-class: true ListInfoResponse: description: 'Contains pagination information about the data returned.' properties: @@ -9745,6 +10767,7 @@ components: signer: description: 'The Signer this attachment is assigned to.' type: string + x-int-or-string: true name: description: 'The name of this attachment.' type: string @@ -10374,6 +11397,7 @@ components: description: 'The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).' type: string nullable: true + x-int-or-string: true x: description: 'The horizontal offset in pixels for this form field.' type: integer @@ -10489,6 +11513,7 @@ components: signer: description: 'The signer of the Form Field.' type: string + x-int-or-string: true x: description: 'The horizontal offset in pixels for this form field.' type: integer @@ -11100,6 +12125,8 @@ components: type: string type: object TeamGetResponse: + required: + - team properties: team: $ref: '#/components/schemas/TeamResponse' @@ -11111,6 +12138,8 @@ components: type: object x-internal-class: true TeamGetInfoResponse: + required: + - team properties: team: $ref: '#/components/schemas/TeamInfoResponse' @@ -11122,6 +12151,8 @@ components: type: object x-internal-class: true TeamInvitesResponse: + required: + - team_invites properties: team_invites: description: 'Contains a list of team invites and their roles.' @@ -11135,6 +12166,9 @@ components: type: object x-internal-class: true TeamMembersResponse: + required: + - team_members + - list_info properties: team_members: description: 'Contains a list of team members and their roles for a specific team.' @@ -11150,6 +12184,9 @@ components: type: object x-internal-class: true TeamSubTeamsResponse: + required: + - sub_teams + - list_info properties: sub_teams: description: 'Contains a list with sub teams.' @@ -11165,6 +12202,8 @@ components: type: object x-internal-class: true TemplateCreateResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateCreateResponseTemplate' @@ -11176,6 +12215,8 @@ components: type: object x-internal-class: true TemplateCreateEmbeddedDraftResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateCreateEmbeddedDraftResponseTemplate' @@ -11187,12 +12228,16 @@ components: type: object x-internal-class: true TemplateEditResponse: + required: + - template_id properties: template_id: description: 'The id of the Template.' type: string type: object TemplateGetResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateResponse' @@ -11204,6 +12249,9 @@ components: type: object x-internal-class: true TemplateListResponse: + required: + - templates + - list_info properties: templates: description: 'List of templates that the API caller has access to.' @@ -11220,12 +12268,16 @@ components: type: object x-internal-class: true TemplateUpdateFilesResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateUpdateFilesResponseTemplate' type: object x-internal-class: true UnclaimedDraftCreateResponse: + required: + - unclaimed_draft properties: unclaimed_draft: $ref: '#/components/schemas/UnclaimedDraftResponse' @@ -11350,6 +12402,22 @@ components: summary: 'Default Example' value: $ref: examples/json/EmbeddedEditUrlRequestDefaultExample.json + FaxLineAddUserRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineAddUserRequestExample.json + FaxLineCreateRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineCreateRequestExample.json + FaxLineDeleteRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineDeleteRequestExample.json + FaxLineRemoveUserRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineRemoveUserRequestExample.json OAuthTokenGenerateRequestExample: summary: 'OAuth Token Generate Example' value: @@ -11594,6 +12662,18 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponseExample.json + FaxLineResponseExample: + summary: 'Sample Fax Line Response' + value: + $ref: examples/json/FaxLineResponseExample.json + FaxLineAreaCodeGetResponseExample: + summary: 'Sample Area Code Response' + value: + $ref: examples/json/FaxLineAreaCodeGetResponseExample.json + FaxLineListResponseExample: + summary: 'Sample Fax Line List Response' + value: + $ref: examples/json/FaxLineListResponseExample.json ReportCreateResponseExample: summary: Report value: diff --git a/openapi.yaml b/openapi.yaml index 63b2059ab..304a8d67b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1409,6 +1409,803 @@ 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_line/add_user: + put: + tags: + - 'Fax Line' + summary: 'Add Fax Line User' + description: 'Grants a user access to the specified Fax Line.' + operationId: faxLineAddUser + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineAddUserRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineAddUserRequestExample' + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineAddUser.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineAddUser.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineAddUser.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineAddUser.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineAddUser.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineAddUser.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineAddUser.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineAddUser.sh + x-meta: + seo: + title: 'Fax Line Add User | API Documentation | Dropbox Fax for Developers' + 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.' + /fax_line/area_codes: + get: + tags: + - 'Fax Line' + summary: 'Get Available Fax Line Area Codes' + description: 'Returns a response with the area codes available for a given state/provice and city.' + operationId: faxLineAreaCodeGet + parameters: + - + name: country + in: query + description: 'Filter area codes by country.' + required: true + schema: + type: string + enum: + - CA + - US + - UK + - + name: state + in: query + description: 'Filter area codes by state.' + schema: + type: string + enum: + - 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 + - + name: province + in: query + description: 'Filter area codes by province.' + schema: + type: string + enum: + - AB + - BC + - MB + - NB + - NL + - NT + - NS + - NU + - 'ON' + - PE + - QC + - SK + - YT + - + name: city + in: query + description: 'Filter area codes by city.' + schema: + type: string + 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/FaxLineAreaCodeGetResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineAreaCodeGetResponseExample' + 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/FaxLineAreaCodeGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineAreaCodeGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineAreaCodeGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineAreaCodeGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineAreaCodeGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineAreaCodeGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineAreaCodeGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineAreaCodeGet.sh + x-meta: + seo: + title: 'Fax Line Get Area Codes | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to purchase a new fax line, click here.' + /fax_line/create: + post: + tags: + - 'Fax Line' + summary: 'Purchase Fax Line' + description: 'Purchases a new Fax Line.' + operationId: faxLineCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineCreateRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineCreateRequestExample' + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineCreate.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineCreate.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineCreate.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineCreate.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineCreate.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineCreate.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineCreate.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineCreate.sh + x-meta: + seo: + title: 'Purchase Fax Line | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to purchase a new fax line, click here.' + /fax_line: + get: + tags: + - 'Fax Line' + summary: 'Get Fax Line' + description: 'Returns the properties and settings of a Fax Line.' + operationId: faxLineGet + parameters: + - + name: number + in: query + description: 'The Fax Line number.' + required: true + schema: + type: string + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineGet.sh + x-meta: + seo: + title: 'Get Fax Line | 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 line, click here.' + delete: + tags: + - 'Fax Line' + summary: 'Delete Fax Line' + description: 'Deletes the specified Fax Line from the subscription.' + operationId: faxLineDelete + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineDeleteRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineDeleteRequestExample' + responses: + 200: + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: {} + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineDelete.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineDelete.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineDelete.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineDelete.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineDelete.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineDelete.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineDelete.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineDelete.sh + x-meta: + seo: + title: 'Delete Fax Line | 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 line, click here.' + /fax_line/list: + get: + tags: + - 'Fax Line' + summary: 'List Fax Lines' + description: 'Returns the properties and settings of multiple Fax Lines.' + operationId: faxLineList + parameters: + - + name: account_id + in: query + description: 'Account ID' + schema: + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + - + name: page + in: query + description: Page + schema: + type: integer + default: 1 + example: 1 + - + name: page_size + in: query + description: 'Page size' + schema: + type: integer + default: 20 + example: 20 + - + name: show_team_lines + in: query + description: 'Show team lines' + schema: + type: boolean + 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/FaxLineListResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineListResponseExample' + 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/FaxLineList.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineList.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineList.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineList.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineList.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineList.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineList.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineList.sh + x-meta: + seo: + title: 'List Fax Lines | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to list your fax lines, click here.' + /fax_line/remove_user: + put: + tags: + - 'Fax Line' + summary: 'Remove Fax Line Access' + description: 'Removes a user''s access to the specified Fax Line.' + operationId: faxLineRemoveUser + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineRemoveUserRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineRemoveUserRequestExample' + 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/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineRemoveUser.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineRemoveUser.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineRemoveUser.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineRemoveUser.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineRemoveUser.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineRemoveUser.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineRemoveUser.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineRemoveUser.sh + x-meta: + 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.' /oauth/token: post: tags: @@ -6409,6 +7206,145 @@ components: type: boolean default: false type: object + FaxLineAddUserRequest: + required: + - number + properties: + number: + description: 'The Fax Line number.' + type: string + account_id: + description: 'Account ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + email_address: + description: 'Email address' + type: string + format: email + type: object + FaxLineAreaCodeGetStateEnum: + type: string + enum: + - 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 + FaxLineAreaCodeGetProvinceEnum: + type: string + enum: + - AB + - BC + - MB + - NB + - NL + - NT + - NS + - NU + - 'ON' + - PE + - QC + - SK + - YT + FaxLineAreaCodeGetCountryEnum: + type: string + enum: + - CA + - US + - UK + FaxLineCreateRequest: + required: + - area_code + - country + properties: + area_code: + description: 'Area code' + type: integer + country: + description: Country + type: string + enum: + - CA + - US + - UK + city: + description: City + type: string + account_id: + description: 'Account ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + type: object + FaxLineDeleteRequest: + required: + - number + properties: + number: + description: 'The Fax Line number.' + type: string + type: object + FaxLineRemoveUserRequest: + required: + - number + properties: + number: + description: 'The Fax Line number.' + type: string + account_id: + description: 'Account ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + email_address: + description: 'Email address' + type: string + format: email + type: object OAuthTokenGenerateRequest: required: - client_id @@ -9096,6 +10032,8 @@ components: default: false type: object AccountCreateResponse: + required: + - account properties: account: $ref: '#/components/schemas/AccountResponse' @@ -9109,6 +10047,8 @@ components: type: object x-internal-class: true AccountGetResponse: + required: + - account properties: account: $ref: '#/components/schemas/AccountResponse' @@ -9131,6 +10071,8 @@ components: type: object x-internal-class: true ApiAppGetResponse: + required: + - api_app properties: api_app: $ref: '#/components/schemas/ApiAppResponse' @@ -9142,6 +10084,9 @@ components: type: object x-internal-class: true ApiAppListResponse: + required: + - api_apps + - list_info properties: api_apps: description: 'Contains information about API Apps.' @@ -9158,6 +10103,10 @@ components: type: object x-internal-class: true BulkSendJobGetResponse: + required: + - bulk_send_job + - list_info + - signature_requests properties: bulk_send_job: $ref: '#/components/schemas/BulkSendJobResponse' @@ -9176,6 +10125,9 @@ components: type: object x-internal-class: true BulkSendJobListResponse: + required: + - bulk_send_jobs + - list_info properties: bulk_send_jobs: description: 'Contains a list of BulkSendJobs that the API caller has access to.' @@ -9192,6 +10144,8 @@ components: type: object x-internal-class: true BulkSendJobSendResponse: + required: + - bulk_send_job properties: bulk_send_job: $ref: '#/components/schemas/BulkSendJobResponse' @@ -9203,6 +10157,8 @@ components: type: object x-internal-class: true EmbeddedEditUrlResponse: + required: + - embedded properties: embedded: $ref: '#/components/schemas/EmbeddedEditUrlResponseEmbedded' @@ -9214,6 +10170,8 @@ components: type: object x-internal-class: true EmbeddedSignUrlResponse: + required: + - embedded properties: embedded: $ref: '#/components/schemas/EmbeddedSignUrlResponseEmbedded' @@ -9231,7 +10189,45 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxLineResponse: + required: + - fax_line + properties: + fax_line: + $ref: '#/components/schemas/FaxLineResponseFaxLine' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true + FaxLineAreaCodeGetResponse: + required: + - area_codes + properties: + area_codes: + type: array + items: + type: integer + type: object + x-internal-class: true + FaxLineListResponse: + required: + - fax_lines + - list_info + properties: + list_info: + $ref: '#/components/schemas/ListInfoResponse' + fax_lines: + type: array + items: + $ref: '#/components/schemas/FaxLineResponseFaxLine' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FileResponse: + required: + - file_url + - expires_at properties: file_url: description: 'URL to the file.' @@ -9242,6 +10238,8 @@ components: type: object x-internal-class: true FileResponseDataUri: + required: + - data_uri properties: data_uri: description: 'File as base64 encoded string.' @@ -9249,6 +10247,8 @@ components: type: object x-internal-class: true ReportCreateResponse: + required: + - report properties: report: $ref: '#/components/schemas/ReportResponse' @@ -9260,6 +10260,8 @@ components: type: object x-internal-class: true SignatureRequestGetResponse: + required: + - signature_request properties: signature_request: $ref: '#/components/schemas/SignatureRequestResponse' @@ -9271,6 +10273,9 @@ components: type: object x-internal-class: true SignatureRequestListResponse: + required: + - signature_requests + - list_info properties: signature_requests: description: 'Contains information about signature requests.' @@ -9562,6 +10567,23 @@ components: description: 'Name of the error.' type: string type: object + FaxLineResponseFaxLine: + properties: + number: + description: Number + type: string + created_at: + description: 'Created at' + type: integer + updated_at: + description: 'Updated at' + type: integer + accounts: + type: array + items: + $ref: '#/components/schemas/AccountResponse' + type: object + x-internal-class: true ListInfoResponse: description: 'Contains pagination information about the data returned.' properties: @@ -9723,6 +10745,7 @@ components: signer: description: 'The Signer this attachment is assigned to.' type: string + x-int-or-string: true name: description: 'The name of this attachment.' type: string @@ -10352,6 +11375,7 @@ components: description: 'The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).' type: string nullable: true + x-int-or-string: true x: description: 'The horizontal offset in pixels for this form field.' type: integer @@ -10467,6 +11491,7 @@ components: signer: description: 'The signer of the Form Field.' type: string + x-int-or-string: true x: description: 'The horizontal offset in pixels for this form field.' type: integer @@ -11078,6 +12103,8 @@ components: type: string type: object TeamGetResponse: + required: + - team properties: team: $ref: '#/components/schemas/TeamResponse' @@ -11089,6 +12116,8 @@ components: type: object x-internal-class: true TeamGetInfoResponse: + required: + - team properties: team: $ref: '#/components/schemas/TeamInfoResponse' @@ -11100,6 +12129,8 @@ components: type: object x-internal-class: true TeamInvitesResponse: + required: + - team_invites properties: team_invites: description: 'Contains a list of team invites and their roles.' @@ -11113,6 +12144,9 @@ components: type: object x-internal-class: true TeamMembersResponse: + required: + - team_members + - list_info properties: team_members: description: 'Contains a list of team members and their roles for a specific team.' @@ -11128,6 +12162,9 @@ components: type: object x-internal-class: true TeamSubTeamsResponse: + required: + - sub_teams + - list_info properties: sub_teams: description: 'Contains a list with sub teams.' @@ -11143,6 +12180,8 @@ components: type: object x-internal-class: true TemplateCreateResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateCreateResponseTemplate' @@ -11154,6 +12193,8 @@ components: type: object x-internal-class: true TemplateCreateEmbeddedDraftResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateCreateEmbeddedDraftResponseTemplate' @@ -11165,12 +12206,16 @@ components: type: object x-internal-class: true TemplateEditResponse: + required: + - template_id properties: template_id: description: 'The id of the Template.' type: string type: object TemplateGetResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateResponse' @@ -11182,6 +12227,9 @@ components: type: object x-internal-class: true TemplateListResponse: + required: + - templates + - list_info properties: templates: description: 'List of templates that the API caller has access to.' @@ -11198,12 +12246,16 @@ components: type: object x-internal-class: true TemplateUpdateFilesResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateUpdateFilesResponseTemplate' type: object x-internal-class: true UnclaimedDraftCreateResponse: + required: + - unclaimed_draft properties: unclaimed_draft: $ref: '#/components/schemas/UnclaimedDraftResponse' @@ -11328,6 +12380,22 @@ components: summary: 'Default Example' value: $ref: examples/json/EmbeddedEditUrlRequestDefaultExample.json + FaxLineAddUserRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineAddUserRequestExample.json + FaxLineCreateRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineCreateRequestExample.json + FaxLineDeleteRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineDeleteRequestExample.json + FaxLineRemoveUserRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineRemoveUserRequestExample.json OAuthTokenGenerateRequestExample: summary: 'OAuth Token Generate Example' value: @@ -11572,6 +12640,18 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponseExample.json + FaxLineResponseExample: + summary: 'Sample Fax Line Response' + value: + $ref: examples/json/FaxLineResponseExample.json + FaxLineAreaCodeGetResponseExample: + summary: 'Sample Area Code Response' + value: + $ref: examples/json/FaxLineAreaCodeGetResponseExample.json + FaxLineListResponseExample: + summary: 'Sample Fax Line List Response' + value: + $ref: examples/json/FaxLineListResponseExample.json ReportCreateResponseExample: summary: Report value: @@ -11870,6 +12950,10 @@ tags: name: 'Callbacks and Events' description: $ref: ./markdown/en/tags/callbacks-tag-description.md + - + name: 'Fax Line' + description: + $ref: ./markdown/en/tags/fax-lines-tag-description.md externalDocs: description: 'Legacy API Reference' url: 'https://app.hellosign.com/api/reference' diff --git a/sandbox/.gitignore b/sandbox/.gitignore index 610051b88..36ef23211 100644 --- a/sandbox/.gitignore +++ b/sandbox/.gitignore @@ -3,33 +3,43 @@ dotnet/* !dotnet/hellosign_sandbox.csproj !dotnet/NuGet.Config !dotnet/Program.cs +!dotnet/src +!dotnet/test_fixtures java-v1/* !java-v1/pom.xml !java-v1/src java-v1/src/main/java/com/dropbox/sign_sandbox/* !java-v1/src/main/java/com/dropbox/sign_sandbox/Main.java +!java-v1/test_fixtures java-v2/* !java-v2/pom.xml !java-v2/src java-v2/src/main/java/com/dropbox/sign_sandbox/* !java-v2/src/main/java/com/dropbox/sign_sandbox/Main.java +!java-v2/test_fixtures node/* !node/Example.ts !node/package.json +!node/tests +!node/test_fixtures php/* -!php/Example.php !php/composer.json +!php/Example.php +!php/test +!php/test_fixtures python/* !python/Example.py !python/requirements.txt +!python/tests +!python/test_fixtures ruby/* !ruby/Example.rb !ruby/Gemfile - -!**/pdf-sample.pdf +!ruby/spec +!ruby/test_fixtures diff --git a/sandbox/dotnet/Program.cs b/sandbox/dotnet/Program.cs deleted file mode 100644 index 8e4258739..000000000 --- a/sandbox/dotnet/Program.cs +++ /dev/null @@ -1,36 +0,0 @@ -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"; - - // or, configure Bearer (JWT) authorization: oauth2 - // config.AccessToken = "YOUR_BEARER_TOKEN"; - - var apiInstance = new AccountApi(config); - - var data = new AccountCreateRequest( - emailAddress: "newuser@dropboxsign.com" - ); - - try - { - var result = apiInstance.AccountCreate(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/sandbox/dotnet/dropbox_sign_sandbox.csproj b/sandbox/dotnet/dropbox_sign_sandbox.csproj deleted file mode 100644 index c8c816809..000000000 --- a/sandbox/dotnet/dropbox_sign_sandbox.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - Exe - net6.0 - enable - enable - - - - - - - diff --git a/sandbox/dotnet/src/Dropbox.SignSandbox.Test/.config.dist.json b/sandbox/dotnet/src/Dropbox.SignSandbox.Test/.config.dist.json new file mode 100644 index 000000000..601c6a5f9 --- /dev/null +++ b/sandbox/dotnet/src/Dropbox.SignSandbox.Test/.config.dist.json @@ -0,0 +1,6 @@ +{ + "BASE_URL": "https://api.hellosign.com/v3", + "API_KEY": "", + "CLIENT_ID": "", + "USE_XDEBUG": 0 +} diff --git a/sandbox/dotnet/src/Dropbox.SignSandbox.Test/.gitignore b/sandbox/dotnet/src/Dropbox.SignSandbox.Test/.gitignore new file mode 100644 index 000000000..a9b8cc8b8 --- /dev/null +++ b/sandbox/dotnet/src/Dropbox.SignSandbox.Test/.gitignore @@ -0,0 +1 @@ +.config.json diff --git a/sandbox/dotnet/src/Dropbox.SignSandbox.Test/Dropbox.SignSandbox.Test.csproj b/sandbox/dotnet/src/Dropbox.SignSandbox.Test/Dropbox.SignSandbox.Test.csproj new file mode 100644 index 000000000..4f8b41f9d --- /dev/null +++ b/sandbox/dotnet/src/Dropbox.SignSandbox.Test/Dropbox.SignSandbox.Test.csproj @@ -0,0 +1,24 @@ + + + + Dropbox.SignSandbox.Test + Dropbox.SignSandbox.Test + net6.0 + false + Dropbox.SignSandbox.Test + + + + + + + + + + + + + + + + diff --git a/sandbox/dotnet/src/Dropbox.SignSandbox.Test/SignatureRequestTests.cs b/sandbox/dotnet/src/Dropbox.SignSandbox.Test/SignatureRequestTests.cs new file mode 100644 index 000000000..2350a526b --- /dev/null +++ b/sandbox/dotnet/src/Dropbox.SignSandbox.Test/SignatureRequestTests.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using Xunit; +using Dropbox.Sign; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Dropbox.SignSandbox.Test +{ + public class TestHelper + { + public static JObject GetJsonContents(string fileName) + { + using (var r = new StreamReader( $"./../../../../../{fileName}")) + { + dynamic json = JsonConvert.DeserializeObject(r.ReadToEnd()); + Assert.NotNull(json); + + return json; + } + } + + public static JObject GetConfig() + { + dynamic configCustom = GetJsonContents("src/Dropbox.SignSandbox.Test/.config.json"); + dynamic configDist = GetJsonContents("src/Dropbox.SignSandbox.Test/.config.dist.json"); + + var mergeSettings = new JsonMergeSettings + { + MergeArrayHandling = MergeArrayHandling.Union + }; + + configDist.Merge(configCustom, mergeSettings); + + return configDist; + } + } + + public class SignatureRequestTests + { + [Fact] + public void SendTest() + { + dynamic config_merged = TestHelper.GetConfig(); + + var config = new Sign.Client.Configuration(); + config.Username = config_merged["API_KEY"]; + config.BasePath = config_merged["BASE_URL"]; + + var signatureRequestApi = new Sign.Api.SignatureRequestApi(config); + + var data = TestHelper.GetJsonContents("test_fixtures/SignatureRequestSendRequest.json"); + + var sendRequest = Sign.Model.SignatureRequestSendRequest.Init(data.ToString()); + + sendRequest.Files = new List { + new FileStream( + "./../../../../../test_fixtures/pdf-sample.pdf", + FileMode.Open, + FileAccess.Read, + FileShare.Read + ) + }; + + var sendResponse = signatureRequestApi.SignatureRequestSend(sendRequest); + + Assert.Equal( + sendRequest.FormFieldsPerDocument[0].ApiId, + sendResponse.SignatureRequest.CustomFields[0].ApiId + ); + + Assert.Equal( + sendRequest.Signers[0].EmailAddress, + sendResponse.SignatureRequest.Signatures[0].SignerEmailAddress + ); + Assert.Equal( + sendRequest.Signers[1].EmailAddress, + sendResponse.SignatureRequest.Signatures[1].SignerEmailAddress + ); + Assert.Equal( + sendRequest.Signers[2].EmailAddress, + sendResponse.SignatureRequest.Signatures[2].SignerEmailAddress + ); + + var getResponse = signatureRequestApi.SignatureRequestGet(sendResponse.SignatureRequest.SignatureRequestId); + + Assert.Equal( + sendResponse.SignatureRequest.SignatureRequestId, + getResponse.SignatureRequest.SignatureRequestId + ); + } + + [Fact] + public void CreateEmbeddedTest() + { + dynamic config_merged = TestHelper.GetConfig(); + + var config = new Sign.Client.Configuration(); + config.Username = config_merged["API_KEY"]; + config.BasePath = config_merged["BASE_URL"]; + + var signatureRequestApi = new Sign.Api.SignatureRequestApi(config); + + var data = TestHelper.GetJsonContents("test_fixtures/SignatureRequestSendRequest.json"); + data["client_id"] = config_merged["CLIENT_ID"]; + + var sendRequest = Sign.Model.SignatureRequestCreateEmbeddedRequest.Init(data.ToString()); + + sendRequest.Files = new List { + new FileStream( + "./../../../../../test_fixtures/pdf-sample.pdf", + FileMode.Open, + FileAccess.Read, + FileShare.Read + ) + }; + + var sendResponse = signatureRequestApi.SignatureRequestCreateEmbedded(sendRequest); + + Assert.Equal( + sendRequest.Signers[0].EmailAddress, + sendResponse.SignatureRequest.Signatures[0].SignerEmailAddress + ); + Assert.Equal( + sendRequest.Signers[1].EmailAddress, + sendResponse.SignatureRequest.Signatures[1].SignerEmailAddress + ); + Assert.Equal( + sendRequest.Signers[2].EmailAddress, + sendResponse.SignatureRequest.Signatures[2].SignerEmailAddress + ); + + var embeddedApi = new Sign.Api.EmbeddedApi(config); + + var getResponse = embeddedApi.EmbeddedSignUrl(sendResponse.SignatureRequest.Signatures[0].SignatureId); + + Assert.NotEmpty(getResponse.Embedded.SignUrl); + } + + [Fact] + public void SendWithoutFillErrorTest() + { + dynamic config_merged = TestHelper.GetConfig(); + + var config = new Sign.Client.Configuration(); + config.Username = config_merged["API_KEY"]; + config.BasePath = config_merged["BASE_URL"]; + + var signatureRequestApi = new Sign.Api.SignatureRequestApi(config); + + var data = TestHelper.GetJsonContents("test_fixtures/SignatureRequestSendRequest.json"); + + var sendRequest = Sign.Model.SignatureRequestSendRequest.Init(data.ToString()); + + try + { + signatureRequestApi.SignatureRequestSend(sendRequest); + Assert.True(false); + } + catch (Sign.Client.ApiException e) + { + Assert.Equal("file", e.ErrorContent.Error.ErrorPath); + } + } + } +} \ No newline at end of file diff --git a/sandbox/dotnet/src/Dropbox.SignSandbox/Dropbox.SignSandbox.csproj b/sandbox/dotnet/src/Dropbox.SignSandbox/Dropbox.SignSandbox.csproj new file mode 100644 index 000000000..00fa04608 --- /dev/null +++ b/sandbox/dotnet/src/Dropbox.SignSandbox/Dropbox.SignSandbox.csproj @@ -0,0 +1,18 @@ + + + + false + net6.0 + Dropbox.SignSandbox + Dropbox.SignSandbox + Library + Dropbox.SignSandbox + false + annotations + false + + + + + + diff --git a/sandbox/dotnet/src/Dropbox.SignSandbox/Program.cs b/sandbox/dotnet/src/Dropbox.SignSandbox/Program.cs new file mode 100644 index 000000000..ad6fb38e6 --- /dev/null +++ b/sandbox/dotnet/src/Dropbox.SignSandbox/Program.cs @@ -0,0 +1,39 @@ +using System; + +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.SignSandbox +{ + public class Example + { + public static void Main() + { + var config = new Configuration(); + // Configure HTTP basic authorization: api_key + config.Username = "YOUR_API_KEY"; + + // or, configure Bearer (JWT) authorization: oauth2 + // config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new AccountApi(config); + + var data = new AccountCreateRequest( + emailAddress: "newuser@dropboxsign.com" + ); + + try + { + var result = apiInstance.AccountCreate(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); + } + } + } +} \ No newline at end of file diff --git a/sandbox/dotnet/test_fixtures/SignatureRequestCreateEmbeddedRequest.json b/sandbox/dotnet/test_fixtures/SignatureRequestCreateEmbeddedRequest.json new file mode 100644 index 000000000..f9bd157f8 --- /dev/null +++ b/sandbox/dotnet/test_fixtures/SignatureRequestCreateEmbeddedRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "MM / DD / YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/dotnet/test_fixtures/SignatureRequestSendRequest.json b/sandbox/dotnet/test_fixtures/SignatureRequestSendRequest.json new file mode 100644 index 000000000..9560ddd52 --- /dev/null +++ b/sandbox/dotnet/test_fixtures/SignatureRequestSendRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "DD - MM - YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/dotnet/pdf-sample.pdf b/sandbox/dotnet/test_fixtures/pdf-sample.pdf similarity index 100% rename from sandbox/dotnet/pdf-sample.pdf rename to sandbox/dotnet/test_fixtures/pdf-sample.pdf diff --git a/sandbox/java-v1/pom.xml b/sandbox/java-v1/pom.xml index ad069e1de..326905ec6 100644 --- a/sandbox/java-v1/pom.xml +++ b/sandbox/java-v1/pom.xml @@ -22,6 +22,18 @@ system ${pom.basedir}/artifacts/dropbox-sign.jar + + junit + junit + 4.13.1 + test + + + junit + junit + 4.13.1 + test + diff --git a/sandbox/java-v1/src/test/com/dropbox/sign_sandbox/.config.dist.json b/sandbox/java-v1/src/test/com/dropbox/sign_sandbox/.config.dist.json new file mode 100644 index 000000000..601c6a5f9 --- /dev/null +++ b/sandbox/java-v1/src/test/com/dropbox/sign_sandbox/.config.dist.json @@ -0,0 +1,6 @@ +{ + "BASE_URL": "https://api.hellosign.com/v3", + "API_KEY": "", + "CLIENT_ID": "", + "USE_XDEBUG": 0 +} diff --git a/sandbox/java-v1/src/test/com/dropbox/sign_sandbox/.gitignore b/sandbox/java-v1/src/test/com/dropbox/sign_sandbox/.gitignore new file mode 100644 index 000000000..a9b8cc8b8 --- /dev/null +++ b/sandbox/java-v1/src/test/com/dropbox/sign_sandbox/.gitignore @@ -0,0 +1 @@ +.config.json diff --git a/sandbox/java-v1/src/test/com/dropbox/sign_sandbox/SignatureRequestTest.java b/sandbox/java-v1/src/test/com/dropbox/sign_sandbox/SignatureRequestTest.java new file mode 100644 index 000000000..d0df6afe9 --- /dev/null +++ b/sandbox/java-v1/src/test/com/dropbox/sign_sandbox/SignatureRequestTest.java @@ -0,0 +1,148 @@ +package com.dropbox.sign_sandbox; + +import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.JSON; +import com.dropbox.sign.api.EmbeddedApi; +import com.dropbox.sign.api.SignatureRequestApi; +import com.dropbox.sign.model.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectReader; +import org.junit.Assert; +import org.junit.Test; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class SignatureRequestTest { + public static JsonNode getConfig() throws Exception { + ObjectMapper objectMapper = JSON.getDefault().getMapper(); + + JsonNode configCustom = objectMapper.readTree(Files.newInputStream( + Paths.get("src/test/com/dropbox/sign_sandbox/.config.json") + )); + JsonNode configDist = objectMapper.readTree(Files.newInputStream( + Paths.get("src/test/com/dropbox/sign_sandbox/.config.dist.json") + )); + + ObjectReader updater = objectMapper.readerForUpdating(configDist); + + return updater.readValue(configCustom); + } + + public static JsonNode getJsonContents(String filename) throws Exception { + ObjectMapper objectMapper = JSON.getDefault().getMapper(); + return objectMapper.readTree(Files.newInputStream( + Paths.get("test_fixtures/" + filename) + )); + } + + @Test + public void testSend() throws Exception { + JsonNode config = getConfig(); + + ApiClient apiClient = Configuration.getDefaultApiClient() + .setApiKey(config.findPath("API_KEY").textValue()) + .setBasePath(config.findPath("BASE_URL").textValue()); + + SignatureRequestApi signatureRequestApi = new SignatureRequestApi(apiClient); + + JsonNode data = getJsonContents("SignatureRequestSendRequest.json"); + + SignatureRequestSendRequest sendRequest = SignatureRequestSendRequest.init(data.toString()); + sendRequest.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); + + SignatureRequestGetResponse sendResponse = signatureRequestApi.signatureRequestSend(sendRequest); + + Assert.assertEquals( + sendRequest.getFormFieldsPerDocument().get(0).getApiId(), + sendResponse.getSignatureRequest().getCustomFields().get(0).getApiId() + ); + + Assert.assertEquals( + sendRequest.getSigners().get(0).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(0).getSignerEmailAddress() + ); + Assert.assertEquals( + sendRequest.getSigners().get(1).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(1).getSignerEmailAddress() + ); + Assert.assertEquals( + sendRequest.getSigners().get(2).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(2).getSignerEmailAddress() + ); + + SignatureRequestGetResponse getResponse = signatureRequestApi.signatureRequestGet( + sendResponse.getSignatureRequest().getSignatureRequestId() + ); + + Assert.assertEquals( + sendResponse.getSignatureRequest().getSignatureRequestId(), + getResponse.getSignatureRequest().getSignatureRequestId() + ); + } + + @Test + public void testCreateEmbedded() throws Exception { + JsonNode config = getConfig(); + + ApiClient apiClient = Configuration.getDefaultApiClient() + .setApiKey(config.findPath("API_KEY").textValue()) + .setBasePath(config.findPath("BASE_URL").textValue()); + + SignatureRequestApi signatureRequestApi = new SignatureRequestApi(apiClient); + + JsonNode data = getJsonContents("SignatureRequestCreateEmbeddedRequest.json"); + + SignatureRequestCreateEmbeddedRequest sendRequest = SignatureRequestCreateEmbeddedRequest.init(data.toString()); + sendRequest.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); + sendRequest.clientId(config.findPath("CLIENT_ID").textValue()); + + SignatureRequestGetResponse sendResponse = signatureRequestApi.signatureRequestCreateEmbedded(sendRequest); + + Assert.assertEquals( + sendRequest.getSigners().get(0).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(0).getSignerEmailAddress() + ); + Assert.assertEquals( + sendRequest.getSigners().get(1).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(1).getSignerEmailAddress() + ); + Assert.assertEquals( + sendRequest.getSigners().get(2).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(2).getSignerEmailAddress() + ); + + EmbeddedApi embeddedApi = new EmbeddedApi(apiClient); + + EmbeddedSignUrlResponse getResponse = embeddedApi.embeddedSignUrl( + sendResponse.getSignatureRequest().getSignatures().get(0).getSignatureId() + ); + + Assert.assertNotNull(getResponse.getEmbedded().getSignUrl()); + } + + @Test + public void testSendWithoutFileError() throws Exception { + JsonNode config = getConfig(); + + ApiClient apiClient = Configuration.getDefaultApiClient() + .setApiKey(config.findPath("API_KEY").textValue()) + .setBasePath(config.findPath("BASE_URL").textValue()); + + SignatureRequestApi signatureRequestApi = new SignatureRequestApi(apiClient); + + JsonNode data = getJsonContents("SignatureRequestSendRequest.json"); + SignatureRequestSendRequest sendRequest = SignatureRequestSendRequest.init(data.toString()); + + try { + signatureRequestApi.signatureRequestSend(sendRequest); + Assert.fail(); + } catch (ApiException e) { + Assert.assertEquals("file", e.getErrorResponse().getError().getErrorPath()); + } + } +} diff --git a/sandbox/java-v1/test_fixtures/SignatureRequestCreateEmbeddedRequest.json b/sandbox/java-v1/test_fixtures/SignatureRequestCreateEmbeddedRequest.json new file mode 100644 index 000000000..f9bd157f8 --- /dev/null +++ b/sandbox/java-v1/test_fixtures/SignatureRequestCreateEmbeddedRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "MM / DD / YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/java-v1/test_fixtures/SignatureRequestSendRequest.json b/sandbox/java-v1/test_fixtures/SignatureRequestSendRequest.json new file mode 100644 index 000000000..9560ddd52 --- /dev/null +++ b/sandbox/java-v1/test_fixtures/SignatureRequestSendRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "DD - MM - YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/java-v1/pdf-sample.pdf b/sandbox/java-v1/test_fixtures/pdf-sample.pdf similarity index 100% rename from sandbox/java-v1/pdf-sample.pdf rename to sandbox/java-v1/test_fixtures/pdf-sample.pdf diff --git a/sandbox/java-v2/pom.xml b/sandbox/java-v2/pom.xml index 3b22283fb..67f2456ad 100644 --- a/sandbox/java-v2/pom.xml +++ b/sandbox/java-v2/pom.xml @@ -22,6 +22,12 @@ system ${pom.basedir}/artifacts/dropbox-sign.jar + + junit + junit + 4.13.1 + test + diff --git a/sandbox/java-v2/src/test/com/dropbox/sign_sandbox/.config.dist.json b/sandbox/java-v2/src/test/com/dropbox/sign_sandbox/.config.dist.json new file mode 100644 index 000000000..601c6a5f9 --- /dev/null +++ b/sandbox/java-v2/src/test/com/dropbox/sign_sandbox/.config.dist.json @@ -0,0 +1,6 @@ +{ + "BASE_URL": "https://api.hellosign.com/v3", + "API_KEY": "", + "CLIENT_ID": "", + "USE_XDEBUG": 0 +} diff --git a/sandbox/java-v2/src/test/com/dropbox/sign_sandbox/.gitignore b/sandbox/java-v2/src/test/com/dropbox/sign_sandbox/.gitignore new file mode 100644 index 000000000..a9b8cc8b8 --- /dev/null +++ b/sandbox/java-v2/src/test/com/dropbox/sign_sandbox/.gitignore @@ -0,0 +1 @@ +.config.json diff --git a/sandbox/java-v2/src/test/com/dropbox/sign_sandbox/SignatureRequestTest.java b/sandbox/java-v2/src/test/com/dropbox/sign_sandbox/SignatureRequestTest.java new file mode 100644 index 000000000..d0df6afe9 --- /dev/null +++ b/sandbox/java-v2/src/test/com/dropbox/sign_sandbox/SignatureRequestTest.java @@ -0,0 +1,148 @@ +package com.dropbox.sign_sandbox; + +import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.Configuration; +import com.dropbox.sign.JSON; +import com.dropbox.sign.api.EmbeddedApi; +import com.dropbox.sign.api.SignatureRequestApi; +import com.dropbox.sign.model.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectReader; +import org.junit.Assert; +import org.junit.Test; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class SignatureRequestTest { + public static JsonNode getConfig() throws Exception { + ObjectMapper objectMapper = JSON.getDefault().getMapper(); + + JsonNode configCustom = objectMapper.readTree(Files.newInputStream( + Paths.get("src/test/com/dropbox/sign_sandbox/.config.json") + )); + JsonNode configDist = objectMapper.readTree(Files.newInputStream( + Paths.get("src/test/com/dropbox/sign_sandbox/.config.dist.json") + )); + + ObjectReader updater = objectMapper.readerForUpdating(configDist); + + return updater.readValue(configCustom); + } + + public static JsonNode getJsonContents(String filename) throws Exception { + ObjectMapper objectMapper = JSON.getDefault().getMapper(); + return objectMapper.readTree(Files.newInputStream( + Paths.get("test_fixtures/" + filename) + )); + } + + @Test + public void testSend() throws Exception { + JsonNode config = getConfig(); + + ApiClient apiClient = Configuration.getDefaultApiClient() + .setApiKey(config.findPath("API_KEY").textValue()) + .setBasePath(config.findPath("BASE_URL").textValue()); + + SignatureRequestApi signatureRequestApi = new SignatureRequestApi(apiClient); + + JsonNode data = getJsonContents("SignatureRequestSendRequest.json"); + + SignatureRequestSendRequest sendRequest = SignatureRequestSendRequest.init(data.toString()); + sendRequest.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); + + SignatureRequestGetResponse sendResponse = signatureRequestApi.signatureRequestSend(sendRequest); + + Assert.assertEquals( + sendRequest.getFormFieldsPerDocument().get(0).getApiId(), + sendResponse.getSignatureRequest().getCustomFields().get(0).getApiId() + ); + + Assert.assertEquals( + sendRequest.getSigners().get(0).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(0).getSignerEmailAddress() + ); + Assert.assertEquals( + sendRequest.getSigners().get(1).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(1).getSignerEmailAddress() + ); + Assert.assertEquals( + sendRequest.getSigners().get(2).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(2).getSignerEmailAddress() + ); + + SignatureRequestGetResponse getResponse = signatureRequestApi.signatureRequestGet( + sendResponse.getSignatureRequest().getSignatureRequestId() + ); + + Assert.assertEquals( + sendResponse.getSignatureRequest().getSignatureRequestId(), + getResponse.getSignatureRequest().getSignatureRequestId() + ); + } + + @Test + public void testCreateEmbedded() throws Exception { + JsonNode config = getConfig(); + + ApiClient apiClient = Configuration.getDefaultApiClient() + .setApiKey(config.findPath("API_KEY").textValue()) + .setBasePath(config.findPath("BASE_URL").textValue()); + + SignatureRequestApi signatureRequestApi = new SignatureRequestApi(apiClient); + + JsonNode data = getJsonContents("SignatureRequestCreateEmbeddedRequest.json"); + + SignatureRequestCreateEmbeddedRequest sendRequest = SignatureRequestCreateEmbeddedRequest.init(data.toString()); + sendRequest.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); + sendRequest.clientId(config.findPath("CLIENT_ID").textValue()); + + SignatureRequestGetResponse sendResponse = signatureRequestApi.signatureRequestCreateEmbedded(sendRequest); + + Assert.assertEquals( + sendRequest.getSigners().get(0).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(0).getSignerEmailAddress() + ); + Assert.assertEquals( + sendRequest.getSigners().get(1).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(1).getSignerEmailAddress() + ); + Assert.assertEquals( + sendRequest.getSigners().get(2).getEmailAddress(), + sendResponse.getSignatureRequest().getSignatures().get(2).getSignerEmailAddress() + ); + + EmbeddedApi embeddedApi = new EmbeddedApi(apiClient); + + EmbeddedSignUrlResponse getResponse = embeddedApi.embeddedSignUrl( + sendResponse.getSignatureRequest().getSignatures().get(0).getSignatureId() + ); + + Assert.assertNotNull(getResponse.getEmbedded().getSignUrl()); + } + + @Test + public void testSendWithoutFileError() throws Exception { + JsonNode config = getConfig(); + + ApiClient apiClient = Configuration.getDefaultApiClient() + .setApiKey(config.findPath("API_KEY").textValue()) + .setBasePath(config.findPath("BASE_URL").textValue()); + + SignatureRequestApi signatureRequestApi = new SignatureRequestApi(apiClient); + + JsonNode data = getJsonContents("SignatureRequestSendRequest.json"); + SignatureRequestSendRequest sendRequest = SignatureRequestSendRequest.init(data.toString()); + + try { + signatureRequestApi.signatureRequestSend(sendRequest); + Assert.fail(); + } catch (ApiException e) { + Assert.assertEquals("file", e.getErrorResponse().getError().getErrorPath()); + } + } +} diff --git a/sandbox/java-v2/test_fixtures/SignatureRequestCreateEmbeddedRequest.json b/sandbox/java-v2/test_fixtures/SignatureRequestCreateEmbeddedRequest.json new file mode 100644 index 000000000..f9bd157f8 --- /dev/null +++ b/sandbox/java-v2/test_fixtures/SignatureRequestCreateEmbeddedRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "MM / DD / YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/java-v2/test_fixtures/SignatureRequestSendRequest.json b/sandbox/java-v2/test_fixtures/SignatureRequestSendRequest.json new file mode 100644 index 000000000..9560ddd52 --- /dev/null +++ b/sandbox/java-v2/test_fixtures/SignatureRequestSendRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "DD - MM - YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/java-v2/pdf-sample.pdf b/sandbox/java-v2/test_fixtures/pdf-sample.pdf similarity index 100% rename from sandbox/java-v2/pdf-sample.pdf rename to sandbox/java-v2/test_fixtures/pdf-sample.pdf diff --git a/sandbox/node/package.json b/sandbox/node/package.json index a982f5fae..8506e51c3 100644 --- a/sandbox/node/package.json +++ b/sandbox/node/package.json @@ -8,10 +8,14 @@ }, "dependencies": { "@dropbox/sign": "file:./artifacts/dropbox-sign-sdk.tgz", + "@types/jest": "^29.5.7", "@types/node": "^20.8.10", + "jest": "^29.7.0", + "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^4.3.0" + "typescript": "^4.0 || ^5.0" }, + "type": "module", "author": "", "license": "ISC" } diff --git a/sandbox/node/test_fixtures/SignatureRequestCreateEmbeddedRequest.json b/sandbox/node/test_fixtures/SignatureRequestCreateEmbeddedRequest.json new file mode 100644 index 000000000..f9bd157f8 --- /dev/null +++ b/sandbox/node/test_fixtures/SignatureRequestCreateEmbeddedRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "MM / DD / YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/node/test_fixtures/SignatureRequestSendRequest.json b/sandbox/node/test_fixtures/SignatureRequestSendRequest.json new file mode 100644 index 000000000..9560ddd52 --- /dev/null +++ b/sandbox/node/test_fixtures/SignatureRequestSendRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "DD - MM - YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/node/pdf-sample.pdf b/sandbox/node/test_fixtures/pdf-sample.pdf similarity index 100% rename from sandbox/node/pdf-sample.pdf rename to sandbox/node/test_fixtures/pdf-sample.pdf diff --git a/sandbox/node/tests/.config.dist.json b/sandbox/node/tests/.config.dist.json new file mode 100644 index 000000000..601c6a5f9 --- /dev/null +++ b/sandbox/node/tests/.config.dist.json @@ -0,0 +1,6 @@ +{ + "BASE_URL": "https://api.hellosign.com/v3", + "API_KEY": "", + "CLIENT_ID": "", + "USE_XDEBUG": 0 +} diff --git a/sandbox/node/tests/.gitignore b/sandbox/node/tests/.gitignore new file mode 100644 index 000000000..a9b8cc8b8 --- /dev/null +++ b/sandbox/node/tests/.gitignore @@ -0,0 +1 @@ +.config.json diff --git a/sandbox/node/tests/signatureRequest.test.ts b/sandbox/node/tests/signatureRequest.test.ts new file mode 100644 index 000000000..73579a528 --- /dev/null +++ b/sandbox/node/tests/signatureRequest.test.ts @@ -0,0 +1,140 @@ +import "jest"; +import * as DropboxSign from "@dropbox/sign"; +import * as fs from "fs"; + +describe("signatureRequest", () => { + let config: { + BASE_URL: string, + API_KEY: string, + CLIENT_ID: string, + USE_XDEBUG: boolean, + }; + + let headers = {}; + + beforeEach(() => { + const config_custom = require("./.config.json"); + const config_dist = require("./.config.dist.json"); + config = { ...config_dist, ...config_custom }; + + if (config["USE_XDEBUG"]) { + headers = { + "Cookie": "XDEBUG_SESSION=xdebug", + }; + } + }); + + test("testSend", () => { + const signature_request_api = new DropboxSign.SignatureRequestApi(); + signature_request_api.username = config.API_KEY; + signature_request_api.basePath = config.BASE_URL; + signature_request_api.defaultHeaders = headers; + + const data: Partial = require( + "./../test_fixtures/SignatureRequestSendRequest.json", + ); + data["files"] = [fs.createReadStream(__dirname + "/../test_fixtures/pdf-sample.pdf")]; + + const send_request = DropboxSign.SignatureRequestSendRequest.init(data); + + return signature_request_api.signatureRequestSend( + send_request, + ).then(send_response => { + const signature_request = send_response.body.signatureRequest; + + expect(send_request.formFieldsPerDocument![0].apiId) + .toBe(signature_request.customFields![0].apiId); + + expect(send_request.signers![0].emailAddress) + .toBe(signature_request.signatures![0].signerEmailAddress); + expect(send_request.signers![1].emailAddress) + .toBe(signature_request.signatures![1].signerEmailAddress); + expect(send_request.signers![2].emailAddress) + .toBe(signature_request.signatures![2].signerEmailAddress); + + return signature_request_api.signatureRequestGet( + signature_request.signatureRequestId!, + ).then(get_response => { + expect(signature_request.signatureRequestId) + .toBe(get_response.body.signatureRequest.signatureRequestId); + }).catch(error => { + throw new Error(`Should not have thrown: ${error.body}`); + }); + }).catch(error => { + throw new Error(`Should not have thrown: ${error.body}`); + }); + }); + + test("testCreateEmbedded", () => { + const signature_request_api = new DropboxSign.SignatureRequestApi(); + signature_request_api.username = config.API_KEY; + signature_request_api.basePath = config.BASE_URL; + signature_request_api.defaultHeaders = headers; + + const data: Partial = require( + "./../test_fixtures/SignatureRequestCreateEmbeddedRequest.json" + ); + data["files"] = [fs.createReadStream(__dirname + "/../test_fixtures/pdf-sample.pdf")]; + data["clientId"] = config.CLIENT_ID; + + const send_request = DropboxSign.SignatureRequestCreateEmbeddedRequest.init(data); + + return signature_request_api.signatureRequestCreateEmbedded( + send_request, + ).then(send_response => { + const signature_request = send_response.body.signatureRequest; + + expect(send_request.signers![0].emailAddress) + .toBe(signature_request.signatures![0].signerEmailAddress); + expect(send_request.signers![1].emailAddress) + .toBe(signature_request.signatures![1].signerEmailAddress); + expect(send_request.signers![2].emailAddress) + .toBe(signature_request.signatures![2].signerEmailAddress); + + const embedded_api = new DropboxSign.EmbeddedApi(); + embedded_api.username = config.API_KEY; + embedded_api.basePath = config.BASE_URL; + embedded_api.defaultHeaders = headers; + + return embedded_api.embeddedSignUrl( + signature_request.signatures![0].signatureId!, + ).then(get_response => { + expect(get_response.body.embedded.signUrl).toBeTruthy(); + }).catch(error => { + throw new Error(`Should not have thrown: ${error.body}`); + }); + }).catch(error => { + throw new Error(`Should not have thrown: ${error.body}`); + }); + }); + + test.concurrent("testSendWithoutFileError", async () => { + const config_custom = require("./.config.json"); + const config_dist = require("./.config.dist.json"); + config = { ...config_dist, ...config_custom }; + let headers = {}; + + if (config["USE_XDEBUG"]) { + headers = { + "Cookie": "XDEBUG_SESSION=xdebug", + }; + } + + const signature_request_api = new DropboxSign.SignatureRequestApi(); + signature_request_api.username = config.API_KEY; + signature_request_api.basePath = config.BASE_URL; + signature_request_api.defaultHeaders = headers; + + const data: Partial = require( + "./../test_fixtures/SignatureRequestSendRequest.json", + ); + + const request = DropboxSign.SignatureRequestSendRequest.init(data); + + return signature_request_api.signatureRequestSend(request).then(response => { + expect(response).toBeFalsy(); + }).catch((error: DropboxSign.HttpError) => { + expect(error.body.error.errorPath).toEqual("file"); + }); + }); +}); diff --git a/sandbox/php/composer.json b/sandbox/php/composer.json index 0bbf9e28e..ab722a292 100644 --- a/sandbox/php/composer.json +++ b/sandbox/php/composer.json @@ -2,11 +2,15 @@ "name": "dropbox/sign-sandbox", "autoload": { "psr-4": { - "Dropbox\\Sign\\Sandbox\\": "src/" + "Dropbox\\SignSandbox\\Tests\\": "test" } }, "require": { - "dropbox/sign": "*" + "dropbox/sign": "*", + "ext-json": "*" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 || ^9.0" }, "repositories": [ { diff --git a/sandbox/php/test/.config.dist.json b/sandbox/php/test/.config.dist.json new file mode 100644 index 000000000..601c6a5f9 --- /dev/null +++ b/sandbox/php/test/.config.dist.json @@ -0,0 +1,6 @@ +{ + "BASE_URL": "https://api.hellosign.com/v3", + "API_KEY": "", + "CLIENT_ID": "", + "USE_XDEBUG": 0 +} diff --git a/sandbox/php/test/.gitignore b/sandbox/php/test/.gitignore new file mode 100644 index 000000000..a9b8cc8b8 --- /dev/null +++ b/sandbox/php/test/.gitignore @@ -0,0 +1 @@ +.config.json diff --git a/sandbox/php/test/SignatureRequestTest.php b/sandbox/php/test/SignatureRequestTest.php new file mode 100644 index 000000000..052808b36 --- /dev/null +++ b/sandbox/php/test/SignatureRequestTest.php @@ -0,0 +1,151 @@ +client_id = $config['CLIENT_ID']; + + $this->config = new Sign\Configuration(); + $this->config->setUsername($config['API_KEY']); + $this->config->setHost($config['BASE_URL']); + + if ($config['USE_XDEBUG']) { + $cookies = CookieJar::fromArray( + ['XDEBUG_SESSION' => 'xdebug'], + parse_url($config['BASE_URL'], PHP_URL_HOST), + ); + + $this->config->setOptions(['cookies' => $cookies]); + } + } + + public function testSend(): void + { + $signature_request_api = new Sign\Api\SignatureRequestApi($this->config); + + $data = json_decode( + file_get_contents(self::FIXTURES_DIR . '/SignatureRequestSendRequest.json'), + true, + ); + $file = new SplFileObject(self::FIXTURES_DIR . '/pdf-sample.pdf'); + $data['files'] = [$file]; + + $send_request = Sign\Model\SignatureRequestSendRequest::init($data); + + $send_response = $signature_request_api->signatureRequestSend($send_request); + + $this->assertEquals( + $send_request->getFormFieldsPerDocument()[0]->getApiId(), + $send_response->getSignatureRequest()->getCustomFields()[0]->getApiId(), + ); + + $this->assertEquals( + $send_request->getSigners()[0]->getEmailAddress(), + $send_response->getSignatureRequest()->getSignatures()[0]->getSignerEmailAddress(), + ); + $this->assertEquals( + $send_request->getSigners()[1]->getEmailAddress(), + $send_response->getSignatureRequest()->getSignatures()[1]->getSignerEmailAddress(), + ); + $this->assertEquals( + $send_request->getSigners()[2]->getEmailAddress(), + $send_response->getSignatureRequest()->getSignatures()[2]->getSignerEmailAddress(), + ); + + $get_response = $signature_request_api->signatureRequestGet( + $send_response->getSignatureRequest()->getSignatureRequestId(), + ); + + $this->assertSame( + $send_response->getSignatureRequest()->getSignatureRequestId(), + $get_response->getSignatureRequest()->getSignatureRequestId(), + ); + } + + public function testCreateEmbedded(): void + { + $signature_request_api = new Sign\Api\SignatureRequestApi($this->config); + + $data = json_decode( + file_get_contents(self::FIXTURES_DIR . '/SignatureRequestCreateEmbeddedRequest.json'), + true, + ); + $file = new SplFileObject(self::FIXTURES_DIR . '/pdf-sample.pdf'); + $data['files'] = [$file]; + $data['client_id'] = $this->client_id; + + $send_request = Sign\Model\SignatureRequestCreateEmbeddedRequest::init($data); + + $send_response = $signature_request_api->signatureRequestCreateEmbedded($send_request); + + $this->assertEquals( + $send_request->getSigners()[0]->getEmailAddress(), + $send_response->getSignatureRequest()->getSignatures()[0]->getSignerEmailAddress(), + ); + $this->assertEquals( + $send_request->getSigners()[1]->getEmailAddress(), + $send_response->getSignatureRequest()->getSignatures()[1]->getSignerEmailAddress(), + ); + $this->assertEquals( + $send_request->getSigners()[2]->getEmailAddress(), + $send_response->getSignatureRequest()->getSignatures()[2]->getSignerEmailAddress(), + ); + + $embedded_api = new Sign\Api\EmbeddedApi($this->config); + + $get_response = $embedded_api->embeddedSignUrl( + $send_response->getSignatureRequest()->getSignatures()[0]->getSignatureId(), + ); + + $this->assertNotEmpty($get_response->getEmbedded()->getSignUrl()); + } + + public function testSendWithoutFileError(): void + { + $signature_request_api = new Sign\Api\SignatureRequestApi($this->config); + + $data = json_decode( + file_get_contents(self::FIXTURES_DIR . '/SignatureRequestSendRequest.json'), + true, + ); + + $request = Sign\Model\SignatureRequestSendRequest::init($data); + + try { + $response = $signature_request_api->signatureRequestSend($request); + + $this->fail('Should have thrown: ' . print_r($response, true)); + } catch (Sign\ApiException $e) { + $error = $e->getResponseObject(); + + $this->assertEquals('file', $error->getError()->getErrorPath()); + } + } +} diff --git a/sandbox/php/test_fixtures/SignatureRequestCreateEmbeddedRequest.json b/sandbox/php/test_fixtures/SignatureRequestCreateEmbeddedRequest.json new file mode 100644 index 000000000..f9bd157f8 --- /dev/null +++ b/sandbox/php/test_fixtures/SignatureRequestCreateEmbeddedRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "MM / DD / YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/php/test_fixtures/SignatureRequestSendRequest.json b/sandbox/php/test_fixtures/SignatureRequestSendRequest.json new file mode 100644 index 000000000..9560ddd52 --- /dev/null +++ b/sandbox/php/test_fixtures/SignatureRequestSendRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "DD - MM - YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/php/pdf-sample.pdf b/sandbox/php/test_fixtures/pdf-sample.pdf similarity index 100% rename from sandbox/php/pdf-sample.pdf rename to sandbox/php/test_fixtures/pdf-sample.pdf diff --git a/sandbox/python/test_fixtures/SignatureRequestCreateEmbeddedRequest.json b/sandbox/python/test_fixtures/SignatureRequestCreateEmbeddedRequest.json new file mode 100644 index 000000000..f9bd157f8 --- /dev/null +++ b/sandbox/python/test_fixtures/SignatureRequestCreateEmbeddedRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "MM / DD / YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/python/test_fixtures/SignatureRequestSendRequest.json b/sandbox/python/test_fixtures/SignatureRequestSendRequest.json new file mode 100644 index 000000000..9560ddd52 --- /dev/null +++ b/sandbox/python/test_fixtures/SignatureRequestSendRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "DD - MM - YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/python/pdf-sample.pdf b/sandbox/python/test_fixtures/pdf-sample.pdf similarity index 100% rename from sandbox/python/pdf-sample.pdf rename to sandbox/python/test_fixtures/pdf-sample.pdf diff --git a/sandbox/python/tests/.config.dist.json b/sandbox/python/tests/.config.dist.json new file mode 100644 index 000000000..601c6a5f9 --- /dev/null +++ b/sandbox/python/tests/.config.dist.json @@ -0,0 +1,6 @@ +{ + "BASE_URL": "https://api.hellosign.com/v3", + "API_KEY": "", + "CLIENT_ID": "", + "USE_XDEBUG": 0 +} diff --git a/sandbox/python/tests/.gitignore b/sandbox/python/tests/.gitignore new file mode 100644 index 000000000..a9b8cc8b8 --- /dev/null +++ b/sandbox/python/tests/.gitignore @@ -0,0 +1 @@ +.config.json diff --git a/sandbox/python/tests/test_signature_request.py b/sandbox/python/tests/test_signature_request.py new file mode 100644 index 000000000..93bdf203c --- /dev/null +++ b/sandbox/python/tests/test_signature_request.py @@ -0,0 +1,124 @@ +import json +import os +import unittest + +from dropbox_sign import ApiClient, Configuration, apis, models, ApiException + + +class TestSignatureRequest(unittest.TestCase): + def setUp(self): + self.base_path = os.path.dirname(os.path.abspath(__file__)) + "/.." + self.config_merged = self.get_config() + + self.configuration = Configuration( + username=self.config_merged["API_KEY"], + host=self.config_merged["BASE_URL"], + ) + + def get_config(self): + file = open(f'{self.base_path}/tests/.config.dist.json', 'r') + config_dist = json.load(file) + file.close() + + file = open(f'{self.base_path}/tests/.config.json', 'r') + config_custom = json.load(file) + file.close() + + config_dist.update(config_custom) + + return config_dist + + def test_send(self): + api_client = ApiClient(self.configuration) + signature_request_api = apis.SignatureRequestApi(api_client) + + file = open(f'{self.base_path}/test_fixtures/SignatureRequestSendRequest.json', 'r') + data = json.load(file) + file.close() + + send_request = models.SignatureRequestSendRequest.init(data) + send_request.files = [open(f'{self.base_path}/test_fixtures/pdf-sample.pdf', 'rb')] + + send_response = signature_request_api.signature_request_send(send_request) + + self.assertEqual( + send_request.form_fields_per_document[0].api_id, + send_response.signature_request.custom_fields[0].api_id, + ) + + self.assertEqual( + send_request.signers[0].email_address, + send_response.signature_request.signatures[0].signer_email_address, + ) + self.assertEqual( + send_request.signers[1].email_address, + send_response.signature_request.signatures[1].signer_email_address, + ) + self.assertEqual( + send_request.signers[2].email_address, + send_response.signature_request.signatures[2].signer_email_address, + ) + + get_response = signature_request_api.signature_request_get( + send_response.signature_request.signature_request_id, + ) + + self.assertEqual( + send_response.signature_request.signature_request_id, + get_response.signature_request.signature_request_id, + ) + + def test_create_embedded(self): + api_client = ApiClient(self.configuration) + signature_request_api = apis.SignatureRequestApi(api_client) + + file = open(f'{self.base_path}/test_fixtures/SignatureRequestCreateEmbeddedRequest.json', 'r') + data = json.load(file) + data["client_id"] = self.config_merged["CLIENT_ID"] + file.close() + + send_request = models.SignatureRequestCreateEmbeddedRequest.init(data) + send_request.files = [open(f'{self.base_path}/test_fixtures/pdf-sample.pdf', 'rb')] + + send_response = signature_request_api.signature_request_create_embedded(send_request) + + self.assertEqual( + send_request.signers[0].email_address, + send_response.signature_request.signatures[0].signer_email_address, + ) + self.assertEqual( + send_request.signers[1].email_address, + send_response.signature_request.signatures[1].signer_email_address, + ) + self.assertEqual( + send_request.signers[2].email_address, + send_response.signature_request.signatures[2].signer_email_address, + ) + + embedded_api = apis.EmbeddedApi(api_client) + + get_response = embedded_api.embedded_sign_url( + send_response.signature_request.signatures[0].signature_id + ) + + self.assertNotEquals("", get_response.embedded.sign_url) + + def test_send_without_file_error(self): + api_client = ApiClient(self.configuration) + signature_request_api = apis.SignatureRequestApi(api_client) + + file = open(f'{self.base_path}/test_fixtures/SignatureRequestSendRequest.json', 'r') + data = json.load(file) + file.close() + + send_request = models.SignatureRequestSendRequest.init(data) + + try: + signature_request_api.signature_request_send(send_request) + self.assertFalse(True) + except ApiException as e: + self.assertEqual("file", e.data.error.error_path) + + +if __name__ == '__main__': + unittest.main() diff --git a/sandbox/ruby/Gemfile b/sandbox/ruby/Gemfile index b4e4d20a4..fa76ed89f 100644 --- a/sandbox/ruby/Gemfile +++ b/sandbox/ruby/Gemfile @@ -2,3 +2,7 @@ source 'https://rubygems.org' gem 'dropbox-sign', path: "../../sdks/ruby" + +group :development, :test do + gem 'json_spec', '~> 1.1.5' +end diff --git a/sandbox/ruby/spec/.config.dist.json b/sandbox/ruby/spec/.config.dist.json new file mode 100644 index 000000000..601c6a5f9 --- /dev/null +++ b/sandbox/ruby/spec/.config.dist.json @@ -0,0 +1,6 @@ +{ + "BASE_URL": "https://api.hellosign.com/v3", + "API_KEY": "", + "CLIENT_ID": "", + "USE_XDEBUG": 0 +} diff --git a/sandbox/ruby/spec/.gitignore b/sandbox/ruby/spec/.gitignore new file mode 100644 index 000000000..a9b8cc8b8 --- /dev/null +++ b/sandbox/ruby/spec/.gitignore @@ -0,0 +1 @@ +.config.json diff --git a/sandbox/ruby/spec/signature_request_spec.rb b/sandbox/ruby/spec/signature_request_spec.rb new file mode 100644 index 000000000..d598cf164 --- /dev/null +++ b/sandbox/ruby/spec/signature_request_spec.rb @@ -0,0 +1,133 @@ +require "spec_helper" +require "dropbox-sign" + +# This test suite is intended solely as a stopgap while we setup automated +# internal tests from github actions. +# +# For now it requires running manually +describe "SignatureRequestSpec" do + config_custom = JSON.parse(File.read(__dir__ + "/.config.json"), :symbolize_names => false) + config_dist = JSON.parse(File.read(__dir__ + "/.config.dist.json"), :symbolize_names => false) + config_merged = config_dist.merge(config_custom) + opts = {} + + if config_merged["USE_XDEBUG"] + opts[:header_params] = {"Cookie" => "XDEBUG_SESSION=xdebug"} + end + + Dropbox::Sign.configure do |config| + config.username = config_merged["API_KEY"] + config.host = config_merged["BASE_URL"] + end + + it "testSend" do + signature_request_api = Dropbox::Sign::SignatureRequestApi.new + + data = JSON.parse( + File.read(__dir__ + "/../test_fixtures/SignatureRequestSendRequest.json"), + :symbolize_names => true, + ) + + send_request = Dropbox::Sign::SignatureRequestSendRequest.init(data) + send_request.files = [File.new(__dir__ + "/../test_fixtures/pdf-sample.pdf", "r")] + + begin + send_response = signature_request_api.signature_request_send(send_request, opts) + rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" + exit + end + + signature_request = send_response.signature_request + + expect(signature_request.custom_fields[0].api_id) + .to eq(send_request.form_fields_per_document[0].api_id) + + expect(signature_request.signatures[0].signer_email_address) + .to eq(send_request.signers[0].email_address) + expect(signature_request.signatures[1].signer_email_address) + .to eq(send_request.signers[1].email_address) + expect(signature_request.signatures[2].signer_email_address) + .to eq(send_request.signers[2].email_address) + + begin + get_response = signature_request_api.signature_request_get( + signature_request.signature_request_id, + opts, + ) + rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" + exit + end + + expect(signature_request.signature_request_id) + .to eq(get_response.signature_request.signature_request_id) + end + + it "testCreateEmbedded" do + signature_request_api = Dropbox::Sign::SignatureRequestApi.new + + data = JSON.parse( + File.read(__dir__ + "/../test_fixtures/SignatureRequestCreateEmbeddedRequest.json"), + :symbolize_names => true, + ) + + send_request = Dropbox::Sign::SignatureRequestCreateEmbeddedRequest.init(data) + send_request.files = [File.new(__dir__ + "/../test_fixtures/pdf-sample.pdf", "r")] + send_request.client_id = config_merged["CLIENT_ID"] + + begin + send_response = signature_request_api.signature_request_create_embedded( + send_request, + opts, + ) + rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" + exit + end + + signature_request = send_response.signature_request + + expect(signature_request.signatures[0].signer_email_address) + .to eq(send_request.signers[0].email_address) + expect(signature_request.signatures[1].signer_email_address) + .to eq(send_request.signers[1].email_address) + expect(signature_request.signatures[2].signer_email_address) + .to eq(send_request.signers[2].email_address) + + embedded_api = Dropbox::Sign::EmbeddedApi.new + + begin + get_response = embedded_api.embedded_sign_url( + signature_request.signatures[0].signature_id, + opts, + ) + + expect(get_response.embedded.sign_url).to be_truthy + rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" + exit + end + end + + it "testSendWithoutFileError" do + signature_request_api = Dropbox::Sign::SignatureRequestApi.new + + data = JSON.parse( + File.read(__dir__ + "/../test_fixtures/SignatureRequestSendRequest.json"), + :symbolize_names => true, + ) + + send_request = Dropbox::Sign::SignatureRequestSendRequest.init(data) + + begin + send_response = signature_request_api.signature_request_send(send_request, opts) + + puts "Should have thrown: #{send_response}" + exit + rescue Dropbox::Sign::ApiError => e + expect(e.response_body.error.error_path) + .to eq("file") + end + end +end diff --git a/sandbox/ruby/spec/spec_helper.rb b/sandbox/ruby/spec/spec_helper.rb new file mode 100644 index 000000000..a365de3db --- /dev/null +++ b/sandbox/ruby/spec/spec_helper.rb @@ -0,0 +1,111 @@ +=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 + +# load the gem +require 'dropbox-sign' + +# The following was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end diff --git a/sandbox/ruby/test_fixtures/SignatureRequestCreateEmbeddedRequest.json b/sandbox/ruby/test_fixtures/SignatureRequestCreateEmbeddedRequest.json new file mode 100644 index 000000000..f9bd157f8 --- /dev/null +++ b/sandbox/ruby/test_fixtures/SignatureRequestCreateEmbeddedRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "MM / DD / YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you have any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/ruby/test_fixtures/SignatureRequestSendRequest.json b/sandbox/ruby/test_fixtures/SignatureRequestSendRequest.json new file mode 100644 index 000000000..9560ddd52 --- /dev/null +++ b/sandbox/ruby/test_fixtures/SignatureRequestSendRequest.json @@ -0,0 +1,163 @@ +{ + "allow_decline": true, + "allow_reassign": true, + "attachments": [ + { + "name": "Attachment1", + "signer_index": 1, + "instructions": "Upload your Driver's License", + "required": true + } + ], + "cc_email_addresses": [ + "lawyer1@example.com", + "lawyer2@example.com" + ], + "field_options": { + "date_format": "DD - MM - YYYY" + }, + "form_field_groups": [ + { + "group_id": "radio_group_1", + "group_label": "Radio Group 1", + "requirement": "require_0-1" + } + ], + "form_field_rules": [ + { + "id": "rule_1", + "trigger_operator": "AND", + "triggers": [ + { + "id": "api_id_1", + "operator": "is", + "value": "foo" + } + ], + "actions": [ + { + "field_id": "api_id_2", + "hidden": true, + "type": "change-field-visibility" + } + ] + } + ], + "form_fields_per_document": [ + { + "document_index": 0, + "api_id": "api_id_1", + "name": "field_1", + "type": "text", + "x": 0, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": "0", + "page": 1, + "font_family": "roboto", + "font_size": 11 + }, + { + "document_index": 0, + "api_id": "api_id_2", + "name": "field_2", + "type": "text", + "x": 300, + "y": 0, + "width": 120, + "height": 30, + "required": true, + "signer": 0, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_3", + "name": "field_3", + "type": "dropdown", + "options": [ + "Option 1", + "Option 2", + "Option 3" + ], + "x": 0, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": 1, + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_4", + "name": "field_4", + "type": "text", + "x": 300, + "y": 200, + "width": 120, + "height": 30, + "required": true, + "signer": "1", + "page": 1, + "font_size": 12 + }, + { + "document_index": 0, + "api_id": "api_id_5", + "name": "field_5", + "type": "radio", + "group": "radio_group_1", + "is_checked": true, + "x": 0, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + }, + { + "document_index": 0, + "api_id": "api_id_6", + "name": "field_6", + "type": "radio", + "group": "radio_group_1", + "is_checked": false, + "x": 300, + "y": 400, + "width": 100, + "height": 16, + "required": false, + "signer": "2", + "page": 1 + } + ], + "message": "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.", + "metadata": { + "custom_id": 1234, + "custom_text": "NDA #9" + }, + "signers": [ + { + "email_address": "s1@example.com", + "name": "Signer 1", + "order": 0 + }, + { + "email_address": "s2@example.com", + "name": "Signer 2", + "order": 1 + }, + { + "email_address": "s3@example.com", + "name": "Signer 3", + "order": 2 + } + ], + "test_mode": true +} diff --git a/sandbox/ruby/pdf-sample.pdf b/sandbox/ruby/test_fixtures/pdf-sample.pdf similarity index 100% rename from sandbox/ruby/pdf-sample.pdf rename to sandbox/ruby/test_fixtures/pdf-sample.pdf diff --git a/sdks/dotnet/.gitignore b/sdks/dotnet/.gitignore index 0a5d07c58..747f85cf3 100644 --- a/sdks/dotnet/.gitignore +++ b/sdks/dotnet/.gitignore @@ -27,6 +27,7 @@ x86/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ +#[Bb]in/ [Oo]bj/ [Ll]og/ [Ll]ogs/ @@ -361,5 +362,5 @@ MigrationBackup/ FodyWeavers.xsd vendor - +api .openapi-generator diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index 19444f601..e3507dbe3 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -23,8 +23,9 @@ directory that corresponds to the file you want updated. This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 3.0.0 -- SDK version: 1.5-dev -- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen +- SDK version: 1.6-dev +- Generator version: 7.8.0 +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen ### Building @@ -42,18 +43,18 @@ Run the following and everything is done for you: to the OAS file and/or the mustache template files _will be lost_ when you run this command. - + ## Frameworks supported - + ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 108.0.1 or later -- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.1 or later -- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.9.0 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later - [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later - + ## Installation & Usage ### NuGet Package Manager @@ -74,9 +75,11 @@ webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; c.Proxy = webProxy; ``` - + + ## Getting Started + ```csharp using System; @@ -117,7 +120,8 @@ public class Example ``` - + + ## Documentation for API Endpoints All URIs are relative to *https://api.hellosign.com/v3* @@ -137,6 +141,13 @@ 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 +*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 +*FaxLineApi* | [**FaxLineDelete**](docs/FaxLineApi.md#faxlinedelete) | **DELETE** /fax_line | Delete Fax Line +*FaxLineApi* | [**FaxLineGet**](docs/FaxLineApi.md#faxlineget) | **GET** /fax_line | Get Fax Line +*FaxLineApi* | [**FaxLineList**](docs/FaxLineApi.md#faxlinelist) | **GET** /fax_line/list | List Fax Lines +*FaxLineApi* | [**FaxLineRemoveUser**](docs/FaxLineApi.md#faxlineremoveuser) | **PUT** /fax_line/remove_user | Remove Fax Line Access *OAuthApi* | [**OauthTokenGenerate**](docs/OAuthApi.md#oauthtokengenerate) | **POST** /oauth/token | OAuth Token Generate *OAuthApi* | [**OauthTokenRefresh**](docs/OAuthApi.md#oauthtokenrefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh *ReportApi* | [**ReportCreate**](docs/ReportApi.md#reportcreate) | **POST** /report/create | Create Report @@ -183,7 +194,7 @@ Class | Method | HTTP request | Description *UnclaimedDraftApi* | [**UnclaimedDraftEditAndResend**](docs/UnclaimedDraftApi.md#unclaimeddrafteditandresend) | **POST** /unclaimed_draft/edit_and_resend/{signature_request_id} | Edit and Resend Unclaimed Draft - + ## Documentation for Models - [Model.AccountCreateRequest](docs/AccountCreateRequest.md) @@ -220,6 +231,17 @@ Class | Method | HTTP request | Description - [Model.EventCallbackRequest](docs/EventCallbackRequest.md) - [Model.EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [Model.EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [Model.FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) + - [Model.FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) + - [Model.FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) + - [Model.FaxLineAreaCodeGetResponse](docs/FaxLineAreaCodeGetResponse.md) + - [Model.FaxLineAreaCodeGetStateEnum](docs/FaxLineAreaCodeGetStateEnum.md) + - [Model.FaxLineCreateRequest](docs/FaxLineCreateRequest.md) + - [Model.FaxLineDeleteRequest](docs/FaxLineDeleteRequest.md) + - [Model.FaxLineListResponse](docs/FaxLineListResponse.md) + - [Model.FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) + - [Model.FaxLineResponse](docs/FaxLineResponse.md) + - [Model.FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [Model.FileResponse](docs/FileResponse.md) - [Model.FileResponseDataUri](docs/FileResponseDataUri.md) - [Model.ListInfoResponse](docs/ListInfoResponse.md) @@ -360,15 +382,17 @@ Class | Method | HTTP request | Description - [Model.WarningResponse](docs/WarningResponse.md) - + ## Documentation for Authorization - + +Authentication schemes defined for the API: + ### api_key - **Type**: HTTP basic authentication - + ### oauth2 - **Type**: Bearer Authentication diff --git a/sdks/dotnet/VERSION b/sdks/dotnet/VERSION index 6f3dd2f48..78ca9a102 100644 --- a/sdks/dotnet/VERSION +++ b/sdks/dotnet/VERSION @@ -1 +1 @@ -1.5-dev +1.6-dev diff --git a/sdks/dotnet/docs/AccountApi.md b/sdks/dotnet/docs/AccountApi.md index 017c8e525..897f4d2ab 100644 --- a/sdks/dotnet/docs/AccountApi.md +++ b/sdks/dotnet/docs/AccountApi.md @@ -9,7 +9,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**AccountUpdate**](AccountApi.md#accountupdate) | **PUT** /account | Update Account | | [**AccountVerify**](AccountApi.md#accountverify) | **POST** /account/verify | Verify Account | - + # **AccountCreate** > AccountCreateResponse AccountCreate (AccountCreateRequest accountCreateRequest) @@ -106,7 +106,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **AccountGet** > AccountGetResponse AccountGet (string? accountId = null, string? emailAddress = null) @@ -200,7 +200,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **AccountUpdate** > AccountGetResponse AccountUpdate (AccountUpdateRequest accountUpdateRequest) @@ -297,7 +297,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **AccountVerify** > AccountVerifyResponse AccountVerify (AccountVerifyRequest accountVerifyRequest) diff --git a/sdks/dotnet/docs/AccountCreateRequest.md b/sdks/dotnet/docs/AccountCreateRequest.md index ce037d797..4e1279c88 100644 --- a/sdks/dotnet/docs/AccountCreateRequest.md +++ b/sdks/dotnet/docs/AccountCreateRequest.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EmailAddress** | **string** | The email address which will be associated with the new Account. | -**ClientId** | **string** | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | [optional] -**ClientSecret** | **string** | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | [optional] -**Locale** | **string** | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | [optional] +**EmailAddress** | **string** | The email address which will be associated with the new Account. | **ClientId** | **string** | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | [optional] **ClientSecret** | **string** | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | [optional] **Locale** | **string** | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | [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/AccountCreateResponse.md b/sdks/dotnet/docs/AccountCreateResponse.md index 873ccaf8a..b7a73e614 100644 --- a/sdks/dotnet/docs/AccountCreateResponse.md +++ b/sdks/dotnet/docs/AccountCreateResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Account** | [**AccountResponse**](AccountResponse.md) | | [optional] -**OauthData** | [**OAuthTokenResponse**](OAuthTokenResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Account** | [**AccountResponse**](AccountResponse.md) | | **OauthData** | [**OAuthTokenResponse**](OAuthTokenResponse.md) | | [optional] **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/AccountGetResponse.md b/sdks/dotnet/docs/AccountGetResponse.md index ed624a254..1cca9a309 100644 --- a/sdks/dotnet/docs/AccountGetResponse.md +++ b/sdks/dotnet/docs/AccountGetResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Account** | [**AccountResponse**](AccountResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Account** | [**AccountResponse**](AccountResponse.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/AccountResponse.md b/sdks/dotnet/docs/AccountResponse.md index b26ddb8c6..2f9672466 100644 --- a/sdks/dotnet/docs/AccountResponse.md +++ b/sdks/dotnet/docs/AccountResponse.md @@ -4,17 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The ID of the Account | [optional] -**EmailAddress** | **string** | The email address associated with the Account. | [optional] -**IsLocked** | **bool** | Returns `true` if the user has been locked out of their account by a team admin. | [optional] -**IsPaidHs** | **bool** | Returns `true` if the user has a paid Dropbox Sign account. | [optional] -**IsPaidHf** | **bool** | Returns `true` if the user has a paid HelloFax account. | [optional] -**Quotas** | [**AccountResponseQuotas**](AccountResponseQuotas.md) | | [optional] -**CallbackUrl** | **string** | The URL that Dropbox Sign events will `POST` to. | [optional] -**RoleCode** | **string** | The membership role for the team. | [optional] -**TeamId** | **string** | The id of the team account belongs to. | [optional] -**Locale** | **string** | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | [optional] -**Usage** | [**AccountResponseUsage**](AccountResponseUsage.md) | | [optional] +**AccountId** | **string** | The ID of the Account | [optional] **EmailAddress** | **string** | The email address associated with the Account. | [optional] **IsLocked** | **bool** | Returns `true` if the user has been locked out of their account by a team admin. | [optional] **IsPaidHs** | **bool** | Returns `true` if the user has a paid Dropbox Sign account. | [optional] **IsPaidHf** | **bool** | Returns `true` if the user has a paid HelloFax account. | [optional] **Quotas** | [**AccountResponseQuotas**](AccountResponseQuotas.md) | | [optional] **CallbackUrl** | **string** | The URL that Dropbox Sign events will `POST` to. | [optional] **RoleCode** | **string** | The membership role for the team. | [optional] **TeamId** | **string** | The id of the team account belongs to. | [optional] **Locale** | **string** | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | [optional] **Usage** | [**AccountResponseUsage**](AccountResponseUsage.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/AccountResponseQuotas.md b/sdks/dotnet/docs/AccountResponseQuotas.md index fae9d2397..2e12ea8cb 100644 --- a/sdks/dotnet/docs/AccountResponseQuotas.md +++ b/sdks/dotnet/docs/AccountResponseQuotas.md @@ -5,12 +5,7 @@ Details concerning remaining monthly quotas. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ApiSignatureRequestsLeft** | **int?** | API signature requests remaining. | [optional] -**DocumentsLeft** | **int?** | Signature requests remaining. | [optional] -**TemplatesTotal** | **int?** | Total API templates allowed. | [optional] -**TemplatesLeft** | **int?** | API templates remaining. | [optional] -**SmsVerificationsLeft** | **int?** | SMS verifications remaining. | [optional] -**NumFaxPagesLeft** | **int?** | Number of fax pages left | [optional] +**ApiSignatureRequestsLeft** | **int?** | API signature requests remaining. | [optional] **DocumentsLeft** | **int?** | Signature requests remaining. | [optional] **TemplatesTotal** | **int?** | Total API templates allowed. | [optional] **TemplatesLeft** | **int?** | API templates remaining. | [optional] **SmsVerificationsLeft** | **int?** | SMS verifications remaining. | [optional] **NumFaxPagesLeft** | **int?** | Number of fax pages left | [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/AccountUpdateRequest.md b/sdks/dotnet/docs/AccountUpdateRequest.md index 5ff6c6927..32ff20817 100644 --- a/sdks/dotnet/docs/AccountUpdateRequest.md +++ b/sdks/dotnet/docs/AccountUpdateRequest.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The ID of the Account | [optional] -**CallbackUrl** | **string** | The URL that Dropbox Sign should POST events to. | [optional] -**Locale** | **string** | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | [optional] +**AccountId** | **string** | The ID of the Account | [optional] **CallbackUrl** | **string** | The URL that Dropbox Sign should POST events to. | [optional] **Locale** | **string** | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | [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/AccountVerifyResponse.md b/sdks/dotnet/docs/AccountVerifyResponse.md index 070df33af..3337b0cdf 100644 --- a/sdks/dotnet/docs/AccountVerifyResponse.md +++ b/sdks/dotnet/docs/AccountVerifyResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Account** | [**AccountVerifyResponseAccount**](AccountVerifyResponseAccount.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Account** | [**AccountVerifyResponseAccount**](AccountVerifyResponseAccount.md) | | [optional] **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/ApiAppApi.md b/sdks/dotnet/docs/ApiAppApi.md index d395eb750..e587a69d8 100644 --- a/sdks/dotnet/docs/ApiAppApi.md +++ b/sdks/dotnet/docs/ApiAppApi.md @@ -10,7 +10,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**ApiAppList**](ApiAppApi.md#apiapplist) | **GET** /api_app/list | List API Apps | | [**ApiAppUpdate**](ApiAppApi.md#apiappupdate) | **PUT** /api_app/{client_id} | Update API App | - + # **ApiAppCreate** > ApiAppGetResponse ApiAppCreate (ApiAppCreateRequest apiAppCreateRequest) @@ -130,7 +130,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **ApiAppDelete** > void ApiAppDelete (string clientId) @@ -222,7 +222,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **ApiAppGet** > ApiAppGetResponse ApiAppGet (string clientId) @@ -317,7 +317,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **ApiAppList** > ApiAppListResponse ApiAppList (int? page = null, int? pageSize = null) @@ -414,7 +414,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **ApiAppUpdate** > ApiAppGetResponse ApiAppUpdate (string clientId, ApiAppUpdateRequest apiAppUpdateRequest) diff --git a/sdks/dotnet/docs/ApiAppCreateRequest.md b/sdks/dotnet/docs/ApiAppCreateRequest.md index 7585b735c..00307e783 100644 --- a/sdks/dotnet/docs/ApiAppCreateRequest.md +++ b/sdks/dotnet/docs/ApiAppCreateRequest.md @@ -4,13 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Domains** | **List<string>** | The domain names the ApiApp will be associated with. | -**Name** | **string** | The name you want to assign to the ApiApp. | -**CallbackUrl** | **string** | The URL at which the ApiApp should receive event callbacks. | [optional] -**CustomLogoFile** | **System.IO.Stream** | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | [optional] -**Oauth** | [**SubOAuth**](SubOAuth.md) | | [optional] -**Options** | [**SubOptions**](SubOptions.md) | | [optional] -**WhiteLabelingOptions** | [**SubWhiteLabelingOptions**](SubWhiteLabelingOptions.md) | | [optional] +**Domains** | **List<string>** | The domain names the ApiApp will be associated with. | **Name** | **string** | The name you want to assign to the ApiApp. | **CallbackUrl** | **string** | The URL at which the ApiApp should receive event callbacks. | [optional] **CustomLogoFile** | **System.IO.Stream** | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | [optional] **Oauth** | [**SubOAuth**](SubOAuth.md) | | [optional] **Options** | [**SubOptions**](SubOptions.md) | | [optional] **WhiteLabelingOptions** | [**SubWhiteLabelingOptions**](SubWhiteLabelingOptions.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/ApiAppGetResponse.md b/sdks/dotnet/docs/ApiAppGetResponse.md index 95a2b8b40..9677b8922 100644 --- a/sdks/dotnet/docs/ApiAppGetResponse.md +++ b/sdks/dotnet/docs/ApiAppGetResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ApiApp** | [**ApiAppResponse**](ApiAppResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**ApiApp** | [**ApiAppResponse**](ApiAppResponse.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/ApiAppListResponse.md b/sdks/dotnet/docs/ApiAppListResponse.md index 041a0c9cf..c53c3e482 100644 --- a/sdks/dotnet/docs/ApiAppListResponse.md +++ b/sdks/dotnet/docs/ApiAppListResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ApiApps** | [**List<ApiAppResponse>**](ApiAppResponse.md) | Contains information about API Apps. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**ApiApps** | [**List<ApiAppResponse>**](ApiAppResponse.md) | Contains information about API Apps. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.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/ApiAppResponse.md b/sdks/dotnet/docs/ApiAppResponse.md index 011ca12ec..f27ff0659 100644 --- a/sdks/dotnet/docs/ApiAppResponse.md +++ b/sdks/dotnet/docs/ApiAppResponse.md @@ -5,16 +5,7 @@ Contains information about an API App. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CallbackUrl** | **string** | The app's callback URL (for events) | [optional] -**ClientId** | **string** | The app's client id | [optional] -**CreatedAt** | **int** | The time that the app was created | [optional] -**Domains** | **List<string>** | The domain name(s) associated with the app | [optional] -**Name** | **string** | The name of the app | [optional] -**IsApproved** | **bool** | Boolean to indicate if the app has been approved | [optional] -**Oauth** | [**ApiAppResponseOAuth**](ApiAppResponseOAuth.md) | | [optional] -**Options** | [**ApiAppResponseOptions**](ApiAppResponseOptions.md) | | [optional] -**OwnerAccount** | [**ApiAppResponseOwnerAccount**](ApiAppResponseOwnerAccount.md) | | [optional] -**WhiteLabelingOptions** | [**ApiAppResponseWhiteLabelingOptions**](ApiAppResponseWhiteLabelingOptions.md) | | [optional] +**CallbackUrl** | **string** | The app's callback URL (for events) | [optional] **ClientId** | **string** | The app's client id | [optional] **CreatedAt** | **int** | The time that the app was created | [optional] **Domains** | **List<string>** | The domain name(s) associated with the app | [optional] **Name** | **string** | The name of the app | [optional] **IsApproved** | **bool** | Boolean to indicate if the app has been approved | [optional] **Oauth** | [**ApiAppResponseOAuth**](ApiAppResponseOAuth.md) | | [optional] **Options** | [**ApiAppResponseOptions**](ApiAppResponseOptions.md) | | [optional] **OwnerAccount** | [**ApiAppResponseOwnerAccount**](ApiAppResponseOwnerAccount.md) | | [optional] **WhiteLabelingOptions** | [**ApiAppResponseWhiteLabelingOptions**](ApiAppResponseWhiteLabelingOptions.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/ApiAppResponseOAuth.md b/sdks/dotnet/docs/ApiAppResponseOAuth.md index b8cdfff9a..cffe8900f 100644 --- a/sdks/dotnet/docs/ApiAppResponseOAuth.md +++ b/sdks/dotnet/docs/ApiAppResponseOAuth.md @@ -5,10 +5,7 @@ An object describing the app's OAuth properties, or null if OAuth is not configu Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CallbackUrl** | **string** | The app's OAuth callback URL. | [optional] -**Secret** | **string** | The app's OAuth secret, or null if the app does not belong to user. | [optional] -**Scopes** | **List<string>** | Array of OAuth scopes used by the app. | [optional] -**ChargesUsers** | **bool** | Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. | [optional] +**CallbackUrl** | **string** | The app's OAuth callback URL. | [optional] **Secret** | **string** | The app's OAuth secret, or null if the app does not belong to user. | [optional] **Scopes** | **List<string>** | Array of OAuth scopes used by the app. | [optional] **ChargesUsers** | **bool** | Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. | [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/ApiAppResponseOwnerAccount.md b/sdks/dotnet/docs/ApiAppResponseOwnerAccount.md index 396b83ec6..eee4afc3e 100644 --- a/sdks/dotnet/docs/ApiAppResponseOwnerAccount.md +++ b/sdks/dotnet/docs/ApiAppResponseOwnerAccount.md @@ -5,8 +5,7 @@ An object describing the app's owner Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The owner account's ID | [optional] -**EmailAddress** | **string** | The owner account's email address | [optional] +**AccountId** | **string** | The owner account's ID | [optional] **EmailAddress** | **string** | The owner account's email address | [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/ApiAppResponseWhiteLabelingOptions.md b/sdks/dotnet/docs/ApiAppResponseWhiteLabelingOptions.md index 8d0221907..3f3eb34a3 100644 --- a/sdks/dotnet/docs/ApiAppResponseWhiteLabelingOptions.md +++ b/sdks/dotnet/docs/ApiAppResponseWhiteLabelingOptions.md @@ -5,20 +5,7 @@ An object with options to customize the app's signer page Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**HeaderBackgroundColor** | **string** | | [optional] -**LegalVersion** | **string** | | [optional] -**LinkColor** | **string** | | [optional] -**PageBackgroundColor** | **string** | | [optional] -**PrimaryButtonColor** | **string** | | [optional] -**PrimaryButtonColorHover** | **string** | | [optional] -**PrimaryButtonTextColor** | **string** | | [optional] -**PrimaryButtonTextColorHover** | **string** | | [optional] -**SecondaryButtonColor** | **string** | | [optional] -**SecondaryButtonColorHover** | **string** | | [optional] -**SecondaryButtonTextColor** | **string** | | [optional] -**SecondaryButtonTextColorHover** | **string** | | [optional] -**TextColor1** | **string** | | [optional] -**TextColor2** | **string** | | [optional] +**HeaderBackgroundColor** | **string** | | [optional] **LegalVersion** | **string** | | [optional] **LinkColor** | **string** | | [optional] **PageBackgroundColor** | **string** | | [optional] **PrimaryButtonColor** | **string** | | [optional] **PrimaryButtonColorHover** | **string** | | [optional] **PrimaryButtonTextColor** | **string** | | [optional] **PrimaryButtonTextColorHover** | **string** | | [optional] **SecondaryButtonColor** | **string** | | [optional] **SecondaryButtonColorHover** | **string** | | [optional] **SecondaryButtonTextColor** | **string** | | [optional] **SecondaryButtonTextColorHover** | **string** | | [optional] **TextColor1** | **string** | | [optional] **TextColor2** | **string** | | [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/ApiAppUpdateRequest.md b/sdks/dotnet/docs/ApiAppUpdateRequest.md index a68925567..cd4888a9a 100644 --- a/sdks/dotnet/docs/ApiAppUpdateRequest.md +++ b/sdks/dotnet/docs/ApiAppUpdateRequest.md @@ -4,13 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CallbackUrl** | **string** | The URL at which the API App should receive event callbacks. | [optional] -**CustomLogoFile** | **System.IO.Stream** | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | [optional] -**Domains** | **List<string>** | The domain names the ApiApp will be associated with. | [optional] -**Name** | **string** | The name you want to assign to the ApiApp. | [optional] -**Oauth** | [**SubOAuth**](SubOAuth.md) | | [optional] -**Options** | [**SubOptions**](SubOptions.md) | | [optional] -**WhiteLabelingOptions** | [**SubWhiteLabelingOptions**](SubWhiteLabelingOptions.md) | | [optional] +**CallbackUrl** | **string** | The URL at which the API App should receive event callbacks. | [optional] **CustomLogoFile** | **System.IO.Stream** | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | [optional] **Domains** | **List<string>** | The domain names the ApiApp will be associated with. | [optional] **Name** | **string** | The name you want to assign to the ApiApp. | [optional] **Oauth** | [**SubOAuth**](SubOAuth.md) | | [optional] **Options** | [**SubOptions**](SubOptions.md) | | [optional] **WhiteLabelingOptions** | [**SubWhiteLabelingOptions**](SubWhiteLabelingOptions.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/BulkSendJobApi.md b/sdks/dotnet/docs/BulkSendJobApi.md index 25e2c7979..050257d63 100644 --- a/sdks/dotnet/docs/BulkSendJobApi.md +++ b/sdks/dotnet/docs/BulkSendJobApi.md @@ -7,7 +7,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**BulkSendJobGet**](BulkSendJobApi.md#bulksendjobget) | **GET** /bulk_send_job/{bulk_send_job_id} | Get Bulk Send Job | | [**BulkSendJobList**](BulkSendJobApi.md#bulksendjoblist) | **GET** /bulk_send_job/list | List Bulk Send Jobs | - + # **BulkSendJobGet** > BulkSendJobGetResponse BulkSendJobGet (string bulkSendJobId, int? page = null, int? pageSize = null) @@ -105,7 +105,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **BulkSendJobList** > BulkSendJobListResponse BulkSendJobList (int? page = null, int? pageSize = null) diff --git a/sdks/dotnet/docs/BulkSendJobGetResponse.md b/sdks/dotnet/docs/BulkSendJobGetResponse.md index 8f229a100..9d23309a8 100644 --- a/sdks/dotnet/docs/BulkSendJobGetResponse.md +++ b/sdks/dotnet/docs/BulkSendJobGetResponse.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BulkSendJob** | [**BulkSendJobResponse**](BulkSendJobResponse.md) | | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**SignatureRequests** | [**List<BulkSendJobGetResponseSignatureRequests>**](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**BulkSendJob** | [**BulkSendJobResponse**](BulkSendJobResponse.md) | | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **SignatureRequests** | [**List<BulkSendJobGetResponseSignatureRequests>**](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | **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/BulkSendJobGetResponseSignatureRequests.md b/sdks/dotnet/docs/BulkSendJobGetResponseSignatureRequests.md index 012dd7018..779fdaf8c 100644 --- a/sdks/dotnet/docs/BulkSendJobGetResponseSignatureRequests.md +++ b/sdks/dotnet/docs/BulkSendJobGetResponseSignatureRequests.md @@ -4,31 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TestMode** | **bool?** | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [optional] [default to false] -**SignatureRequestId** | **string** | The id of the SignatureRequest. | [optional] -**RequesterEmailAddress** | **string** | The email address of the initiator of the SignatureRequest. | [optional] -**Title** | **string** | The title the specified Account uses for the SignatureRequest. | [optional] -**OriginalTitle** | **string** | Default Label for account. | [optional] -**Subject** | **string** | The subject in the email that was initially sent to the signers. | [optional] -**Message** | **string** | The custom message in the email that was initially sent to the signers. | [optional] -**Metadata** | **Object** | The metadata attached to the signature request. | [optional] -**CreatedAt** | **int** | Time the signature request was created. | [optional] -**ExpiresAt** | **int** | The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] -**IsComplete** | **bool** | Whether or not the SignatureRequest has been fully executed by all signers. | [optional] -**IsDeclined** | **bool** | Whether or not the SignatureRequest has been declined by a signer. | [optional] -**HasError** | **bool** | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | [optional] -**FilesUrl** | **string** | The URL where a copy of the request's documents can be downloaded. | [optional] -**SigningUrl** | **string** | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | [optional] -**DetailsUrl** | **string** | The URL where the requester and the signers can view the current status of the SignatureRequest. | [optional] -**CcEmailAddresses** | **List<string>** | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | [optional] -**SigningRedirectUrl** | **string** | The URL you want the signer redirected to after they successfully sign. | [optional] -**FinalCopyUri** | **string** | The path where the completed document can be downloaded | [optional] -**TemplateIds** | **List<string>** | Templates IDs used in this SignatureRequest (if any). | [optional] -**CustomFields** | [**List<SignatureRequestResponseCustomFieldBase>**](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | [optional] -**Attachments** | [**List<SignatureRequestResponseAttachment>**](SignatureRequestResponseAttachment.md) | Signer attachments. | [optional] -**ResponseData** | [**List<SignatureRequestResponseDataBase>**](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | [optional] -**Signatures** | [**List<SignatureRequestResponseSignatures>**](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | [optional] -**BulkSendJobId** | **string** | The id of the BulkSendJob. | [optional] +**TestMode** | **bool?** | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [optional] [default to false]**SignatureRequestId** | **string** | The id of the SignatureRequest. | [optional] **RequesterEmailAddress** | **string** | The email address of the initiator of the SignatureRequest. | [optional] **Title** | **string** | The title the specified Account uses for the SignatureRequest. | [optional] **OriginalTitle** | **string** | Default Label for account. | [optional] **Subject** | **string** | The subject in the email that was initially sent to the signers. | [optional] **Message** | **string** | The custom message in the email that was initially sent to the signers. | [optional] **Metadata** | **Object** | The metadata attached to the signature request. | [optional] **CreatedAt** | **int** | Time the signature request was created. | [optional] **ExpiresAt** | **int** | The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] **IsComplete** | **bool** | Whether or not the SignatureRequest has been fully executed by all signers. | [optional] **IsDeclined** | **bool** | Whether or not the SignatureRequest has been declined by a signer. | [optional] **HasError** | **bool** | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | [optional] **FilesUrl** | **string** | The URL where a copy of the request's documents can be downloaded. | [optional] **SigningUrl** | **string** | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | [optional] **DetailsUrl** | **string** | The URL where the requester and the signers can view the current status of the SignatureRequest. | [optional] **CcEmailAddresses** | **List<string>** | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | [optional] **SigningRedirectUrl** | **string** | The URL you want the signer redirected to after they successfully sign. | [optional] **FinalCopyUri** | **string** | The path where the completed document can be downloaded | [optional] **TemplateIds** | **List<string>** | Templates IDs used in this SignatureRequest (if any). | [optional] **CustomFields** | [**List<SignatureRequestResponseCustomFieldBase>**](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | [optional] **Attachments** | [**List<SignatureRequestResponseAttachment>**](SignatureRequestResponseAttachment.md) | Signer attachments. | [optional] **ResponseData** | [**List<SignatureRequestResponseDataBase>**](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | [optional] **Signatures** | [**List<SignatureRequestResponseSignatures>**](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | [optional] **BulkSendJobId** | **string** | The id of the BulkSendJob. | [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/BulkSendJobListResponse.md b/sdks/dotnet/docs/BulkSendJobListResponse.md index 1ecc64a8a..0c353ddd0 100644 --- a/sdks/dotnet/docs/BulkSendJobListResponse.md +++ b/sdks/dotnet/docs/BulkSendJobListResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BulkSendJobs** | [**List<BulkSendJobResponse>**](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**BulkSendJobs** | [**List<BulkSendJobResponse>**](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.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/BulkSendJobResponse.md b/sdks/dotnet/docs/BulkSendJobResponse.md index 02eff3580..6a9e580db 100644 --- a/sdks/dotnet/docs/BulkSendJobResponse.md +++ b/sdks/dotnet/docs/BulkSendJobResponse.md @@ -5,10 +5,7 @@ Contains information about the BulkSendJob such as when it was created and how m Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BulkSendJobId** | **string** | The id of the BulkSendJob. | [optional] -**Total** | **int** | The total amount of Signature Requests queued for sending. | [optional] -**IsCreator** | **bool** | True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. | [optional] -**CreatedAt** | **int** | Time that the BulkSendJob was created. | [optional] +**BulkSendJobId** | **string** | The id of the BulkSendJob. | [optional] **Total** | **int** | The total amount of Signature Requests queued for sending. | [optional] **IsCreator** | **bool** | True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. | [optional] **CreatedAt** | **int** | Time that the BulkSendJob was created. | [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/BulkSendJobSendResponse.md b/sdks/dotnet/docs/BulkSendJobSendResponse.md index dda084aa0..1649dc405 100644 --- a/sdks/dotnet/docs/BulkSendJobSendResponse.md +++ b/sdks/dotnet/docs/BulkSendJobSendResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BulkSendJob** | [**BulkSendJobResponse**](BulkSendJobResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**BulkSendJob** | [**BulkSendJobResponse**](BulkSendJobResponse.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/EmbeddedApi.md b/sdks/dotnet/docs/EmbeddedApi.md index 9906560d1..39c38b4c2 100644 --- a/sdks/dotnet/docs/EmbeddedApi.md +++ b/sdks/dotnet/docs/EmbeddedApi.md @@ -7,7 +7,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**EmbeddedEditUrl**](EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | | [**EmbeddedSignUrl**](EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | - + # **EmbeddedEditUrl** > EmbeddedEditUrlResponse EmbeddedEditUrl (string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) @@ -109,7 +109,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **EmbeddedSignUrl** > EmbeddedSignUrlResponse EmbeddedSignUrl (string signatureId) diff --git a/sdks/dotnet/docs/EmbeddedEditUrlRequest.md b/sdks/dotnet/docs/EmbeddedEditUrlRequest.md index 8ebd95468..43b4c3e10 100644 --- a/sdks/dotnet/docs/EmbeddedEditUrlRequest.md +++ b/sdks/dotnet/docs/EmbeddedEditUrlRequest.md @@ -4,16 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AllowEditCcs** | **bool** | This allows the requester to enable/disable to add or change CC roles when editing the template. | [optional] [default to false] -**CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. | [optional] -**EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] -**ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false] -**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false] -**MergeFields** | [**List<SubMergeField>**](SubMergeField.md) | Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template.

Remove all merge fields on the template by passing an empty array `[]`. | [optional] -**PreviewOnly** | **bool** | This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor).

**NOTE:** This parameter overwrites `show_preview=true` (if set). | [optional] [default to false] -**ShowPreview** | **bool** | This allows the requester to enable the editor/preview experience. | [optional] [default to false] -**ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true] -**TestMode** | **bool** | Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. | [optional] [default to false] +**AllowEditCcs** | **bool** | This allows the requester to enable/disable to add or change CC roles when editing the template. | [optional] [default to false]**CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. | [optional] **EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] **ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false]**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false]**MergeFields** | [**List<SubMergeField>**](SubMergeField.md) | Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template.

Remove all merge fields on the template by passing an empty array `[]`. | [optional] **PreviewOnly** | **bool** | This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor).

**NOTE:** This parameter overwrites `show_preview=true` (if set). | [optional] [default to false]**ShowPreview** | **bool** | This allows the requester to enable the editor/preview experience. | [optional] [default to false]**ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true]**TestMode** | **bool** | Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/EmbeddedEditUrlResponse.md b/sdks/dotnet/docs/EmbeddedEditUrlResponse.md index c133ac342..d2c1d5fae 100644 --- a/sdks/dotnet/docs/EmbeddedEditUrlResponse.md +++ b/sdks/dotnet/docs/EmbeddedEditUrlResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Embedded** | [**EmbeddedEditUrlResponseEmbedded**](EmbeddedEditUrlResponseEmbedded.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Embedded** | [**EmbeddedEditUrlResponseEmbedded**](EmbeddedEditUrlResponseEmbedded.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/EmbeddedEditUrlResponseEmbedded.md b/sdks/dotnet/docs/EmbeddedEditUrlResponseEmbedded.md index 92c333624..7750157e9 100644 --- a/sdks/dotnet/docs/EmbeddedEditUrlResponseEmbedded.md +++ b/sdks/dotnet/docs/EmbeddedEditUrlResponseEmbedded.md @@ -5,8 +5,7 @@ An embedded template object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EditUrl** | **string** | A template url that can be opened in an iFrame. | [optional] -**ExpiresAt** | **int** | The specific time that the the `edit_url` link expires, in epoch. | [optional] +**EditUrl** | **string** | A template url that can be opened in an iFrame. | [optional] **ExpiresAt** | **int** | The specific time that the the `edit_url` link expires, in epoch. | [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/EmbeddedSignUrlResponse.md b/sdks/dotnet/docs/EmbeddedSignUrlResponse.md index 95e267361..2bd6732b3 100644 --- a/sdks/dotnet/docs/EmbeddedSignUrlResponse.md +++ b/sdks/dotnet/docs/EmbeddedSignUrlResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Embedded** | [**EmbeddedSignUrlResponseEmbedded**](EmbeddedSignUrlResponseEmbedded.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Embedded** | [**EmbeddedSignUrlResponseEmbedded**](EmbeddedSignUrlResponseEmbedded.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/EmbeddedSignUrlResponseEmbedded.md b/sdks/dotnet/docs/EmbeddedSignUrlResponseEmbedded.md index 1da5d6bf6..319edfa14 100644 --- a/sdks/dotnet/docs/EmbeddedSignUrlResponseEmbedded.md +++ b/sdks/dotnet/docs/EmbeddedSignUrlResponseEmbedded.md @@ -5,8 +5,7 @@ An object that contains necessary information to set up embedded signing. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignUrl** | **string** | A signature url that can be opened in an iFrame. | [optional] -**ExpiresAt** | **int** | The specific time that the the `sign_url` link expires, in epoch. | [optional] +**SignUrl** | **string** | A signature url that can be opened in an iFrame. | [optional] **ExpiresAt** | **int** | The specific time that the the `sign_url` link expires, in epoch. | [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/ErrorResponseError.md b/sdks/dotnet/docs/ErrorResponseError.md index 387d68298..13dacc1bf 100644 --- a/sdks/dotnet/docs/ErrorResponseError.md +++ b/sdks/dotnet/docs/ErrorResponseError.md @@ -5,9 +5,7 @@ Contains information about an error that occurred. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ErrorMsg** | **string** | Message describing an error. | -**ErrorName** | **string** | Name of the error. | -**ErrorPath** | **string** | Path at which an error occurred. | [optional] +**ErrorMsg** | **string** | Message describing an error. | **ErrorName** | **string** | Name of the error. | **ErrorPath** | **string** | Path at which an error occurred. | [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/EventCallbackRequest.md b/sdks/dotnet/docs/EventCallbackRequest.md index 8f1e5d7f8..2ff935c42 100644 --- a/sdks/dotnet/docs/EventCallbackRequest.md +++ b/sdks/dotnet/docs/EventCallbackRequest.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Event** | [**EventCallbackRequestEvent**](EventCallbackRequestEvent.md) | | -**Account** | [**AccountResponse**](AccountResponse.md) | | [optional] -**SignatureRequest** | [**SignatureRequestResponse**](SignatureRequestResponse.md) | | [optional] -**Template** | [**TemplateResponse**](TemplateResponse.md) | | [optional] +**Event** | [**EventCallbackRequestEvent**](EventCallbackRequestEvent.md) | | **Account** | [**AccountResponse**](AccountResponse.md) | | [optional] **SignatureRequest** | [**SignatureRequestResponse**](SignatureRequestResponse.md) | | [optional] **Template** | [**TemplateResponse**](TemplateResponse.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/EventCallbackRequestEvent.md b/sdks/dotnet/docs/EventCallbackRequestEvent.md index 98884f129..ca1780ac9 100644 --- a/sdks/dotnet/docs/EventCallbackRequestEvent.md +++ b/sdks/dotnet/docs/EventCallbackRequestEvent.md @@ -5,10 +5,7 @@ Basic information about the event that occurred. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EventTime** | **string** | Time the event was created (using Unix time). | -**EventType** | **string** | Type of callback event that was triggered. | -**EventHash** | **string** | Generated hash used to verify source of event data. | -**EventMetadata** | [**EventCallbackRequestEventMetadata**](EventCallbackRequestEventMetadata.md) | | [optional] +**EventTime** | **string** | Time the event was created (using Unix time). | **EventType** | **string** | Type of callback event that was triggered. | **EventHash** | **string** | Generated hash used to verify source of event data. | **EventMetadata** | [**EventCallbackRequestEventMetadata**](EventCallbackRequestEventMetadata.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/EventCallbackRequestEventMetadata.md b/sdks/dotnet/docs/EventCallbackRequestEventMetadata.md index 65ad87405..cf78a668c 100644 --- a/sdks/dotnet/docs/EventCallbackRequestEventMetadata.md +++ b/sdks/dotnet/docs/EventCallbackRequestEventMetadata.md @@ -5,10 +5,7 @@ Specific metadata about the event. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**RelatedSignatureId** | **string** | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | [optional] -**ReportedForAccountId** | **string** | Account ID the event was reported for. | [optional] -**ReportedForAppId** | **string** | App ID the event was reported for. | [optional] -**EventMessage** | **string** | Message about a declined or failed (due to error) signature flow. | [optional] +**RelatedSignatureId** | **string** | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | [optional] **ReportedForAccountId** | **string** | Account ID the event was reported for. | [optional] **ReportedForAppId** | **string** | App ID the event was reported for. | [optional] **EventMessage** | **string** | Message about a declined or failed (due to error) signature flow. | [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/FaxLineAddUserRequest.md b/sdks/dotnet/docs/FaxLineAddUserRequest.md new file mode 100644 index 000000000..f89c0deef --- /dev/null +++ b/sdks/dotnet/docs/FaxLineAddUserRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineAddUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Number** | **string** | The Fax Line number. | **AccountId** | **string** | Account ID | [optional] **EmailAddress** | **string** | Email address | [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/FaxLineApi.md b/sdks/dotnet/docs/FaxLineApi.md new file mode 100644 index 000000000..4fd57baf5 --- /dev/null +++ b/sdks/dotnet/docs/FaxLineApi.md @@ -0,0 +1,665 @@ +# Dropbox.Sign.Api.FaxLineApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FaxLineAddUser**](FaxLineApi.md#faxlineadduser) | **PUT** /fax_line/add_user | Add Fax Line User | +| [**FaxLineAreaCodeGet**](FaxLineApi.md#faxlineareacodeget) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes | +| [**FaxLineCreate**](FaxLineApi.md#faxlinecreate) | **POST** /fax_line/create | Purchase Fax Line | +| [**FaxLineDelete**](FaxLineApi.md#faxlinedelete) | **DELETE** /fax_line | Delete Fax Line | +| [**FaxLineGet**](FaxLineApi.md#faxlineget) | **GET** /fax_line | Get Fax Line | +| [**FaxLineList**](FaxLineApi.md#faxlinelist) | **GET** /fax_line/list | List Fax Lines | +| [**FaxLineRemoveUser**](FaxLineApi.md#faxlineremoveuser) | **PUT** /fax_line/remove_user | Remove Fax Line Access | + + +# **FaxLineAddUser** +> FaxLineResponse FaxLineAddUser (FaxLineAddUserRequest faxLineAddUserRequest) + +Add Fax Line User + +Grants a user access to the specified Fax Line. + +### 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 faxLineApi = new FaxLineApi(config); + + var data = new FaxLineAddUserRequest( + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com" + ); + + try + { + var result = faxLineApi.FaxLineAddUser(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 FaxLineAddUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Add Fax Line User + ApiResponse response = apiInstance.FaxLineAddUserWithHttpInfo(faxLineAddUserRequest); + 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 FaxLineApi.FaxLineAddUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxLineAddUserRequest** | [**FaxLineAddUserRequest**](FaxLineAddUserRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FaxLineAreaCodeGet** +> FaxLineAreaCodeGetResponse FaxLineAreaCodeGet (string country, string? state = null, string? province = null, string? city = null) + +Get Available Fax Line Area Codes + +Returns a response with the area codes available for a given state/provice and city. + +### 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 faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineAreaCodeGet("US", "CA"); + 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 FaxLineAreaCodeGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Available Fax Line Area Codes + ApiResponse response = apiInstance.FaxLineAreaCodeGetWithHttpInfo(country, state, province, city); + 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 FaxLineApi.FaxLineAreaCodeGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **country** | **string** | Filter area codes by country. | | +| **state** | **string?** | Filter area codes by state. | [optional] | +| **province** | **string?** | Filter area codes by province. | [optional] | +| **city** | **string?** | Filter area codes by city. | [optional] | + +### Return type + +[**FaxLineAreaCodeGetResponse**](FaxLineAreaCodeGetResponse.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) + + +# **FaxLineCreate** +> FaxLineResponse FaxLineCreate (FaxLineCreateRequest faxLineCreateRequest) + +Purchase Fax Line + +Purchases a new Fax Line. + +### 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 faxLineApi = new FaxLineApi(config); + + var data = new FaxLineCreateRequest( + areaCode: 209, + country: "US" + ); + + try + { + var result = faxLineApi.FaxLineCreate(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 FaxLineCreateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Purchase Fax Line + ApiResponse response = apiInstance.FaxLineCreateWithHttpInfo(faxLineCreateRequest); + 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 FaxLineApi.FaxLineCreateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxLineCreateRequest** | [**FaxLineCreateRequest**](FaxLineCreateRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FaxLineDelete** +> void FaxLineDelete (FaxLineDeleteRequest faxLineDeleteRequest) + +Delete Fax Line + +Deletes the specified Fax Line from the subscription. + +### 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 faxLineApi = new FaxLineApi(config); + + var data = new FaxLineDeleteRequest( + number: "[FAX_NUMBER]", + ); + + try + { + faxLineApi.FaxLineDelete(data); + } + 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 FaxLineDeleteWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete Fax Line + apiInstance.FaxLineDeleteWithHttpInfo(faxLineDeleteRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxLineApi.FaxLineDeleteWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxLineDeleteRequest** | [**FaxLineDeleteRequest**](FaxLineDeleteRequest.md) | | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FaxLineGet** +> FaxLineResponse FaxLineGet (string number) + +Get Fax Line + +Returns the properties and settings of a Fax Line. + +### 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 faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineGet("[FAX_NUMBER]"); + 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 FaxLineGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Fax Line + ApiResponse response = apiInstance.FaxLineGetWithHttpInfo(number); + 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 FaxLineApi.FaxLineGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **number** | **string** | The Fax Line number. | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.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) + + +# **FaxLineList** +> FaxLineListResponse FaxLineList (string? accountId = null, int? page = null, int? pageSize = null, bool? showTeamLines = null) + +List Fax Lines + +Returns the properties and settings of multiple Fax Lines. + +### 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 faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineList(); + 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 FaxLineListWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List Fax Lines + ApiResponse response = apiInstance.FaxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + 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 FaxLineApi.FaxLineListWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string?** | Account ID | [optional] | +| **page** | **int?** | Page | [optional] [default to 1] | +| **pageSize** | **int?** | Page size | [optional] [default to 20] | +| **showTeamLines** | **bool?** | Show team lines | [optional] | + +### Return type + +[**FaxLineListResponse**](FaxLineListResponse.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) + + +# **FaxLineRemoveUser** +> FaxLineResponse FaxLineRemoveUser (FaxLineRemoveUserRequest faxLineRemoveUserRequest) + +Remove Fax Line Access + +Removes a user's access to the specified Fax Line. + +### 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 faxLineApi = new FaxLineApi(config); + + var data = new FaxLineRemoveUserRequest( + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com" + ); + + try + { + var result = faxLineApi.FaxLineRemoveUser(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 FaxLineRemoveUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Remove Fax Line Access + ApiResponse response = apiInstance.FaxLineRemoveUserWithHttpInfo(faxLineRemoveUserRequest); + 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 FaxLineApi.FaxLineRemoveUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxLineRemoveUserRequest** | [**FaxLineRemoveUserRequest**](FaxLineRemoveUserRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/FaxLineAreaCodeGetCountryEnum.md b/sdks/dotnet/docs/FaxLineAreaCodeGetCountryEnum.md new file mode 100644 index 000000000..1bb3e0419 --- /dev/null +++ b/sdks/dotnet/docs/FaxLineAreaCodeGetCountryEnum.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineAreaCodeGetCountryEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[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/FaxLineAreaCodeGetProvinceEnum.md b/sdks/dotnet/docs/FaxLineAreaCodeGetProvinceEnum.md new file mode 100644 index 000000000..7b06480c2 --- /dev/null +++ b/sdks/dotnet/docs/FaxLineAreaCodeGetProvinceEnum.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineAreaCodeGetProvinceEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[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/FaxLineAreaCodeGetResponse.md b/sdks/dotnet/docs/FaxLineAreaCodeGetResponse.md new file mode 100644 index 000000000..91d4723aa --- /dev/null +++ b/sdks/dotnet/docs/FaxLineAreaCodeGetResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineAreaCodeGetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AreaCodes** | **List<int>** | | + +[[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/FaxLineAreaCodeGetStateEnum.md b/sdks/dotnet/docs/FaxLineAreaCodeGetStateEnum.md new file mode 100644 index 000000000..9519cbc73 --- /dev/null +++ b/sdks/dotnet/docs/FaxLineAreaCodeGetStateEnum.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineAreaCodeGetStateEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[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/FaxLineCreateRequest.md b/sdks/dotnet/docs/FaxLineCreateRequest.md new file mode 100644 index 000000000..21d3ffc88 --- /dev/null +++ b/sdks/dotnet/docs/FaxLineCreateRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineCreateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AreaCode** | **int** | Area code | **Country** | **string** | Country | **City** | **string** | City | [optional] **AccountId** | **string** | Account ID | [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/FaxLineDeleteRequest.md b/sdks/dotnet/docs/FaxLineDeleteRequest.md new file mode 100644 index 000000000..673880d28 --- /dev/null +++ b/sdks/dotnet/docs/FaxLineDeleteRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineDeleteRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Number** | **string** | The Fax Line number. | + +[[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/FaxLineListResponse.md b/sdks/dotnet/docs/FaxLineListResponse.md new file mode 100644 index 000000000..95a4918bb --- /dev/null +++ b/sdks/dotnet/docs/FaxLineListResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **FaxLines** | [**List<FaxLineResponseFaxLine>**](FaxLineResponseFaxLine.md) | | **Warnings** | [**WarningResponse**](WarningResponse.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/FaxLineRemoveUserRequest.md b/sdks/dotnet/docs/FaxLineRemoveUserRequest.md new file mode 100644 index 000000000..0d73414a7 --- /dev/null +++ b/sdks/dotnet/docs/FaxLineRemoveUserRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineRemoveUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Number** | **string** | The Fax Line number. | **AccountId** | **string** | Account ID | [optional] **EmailAddress** | **string** | Email address | [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/FaxLineResponse.md b/sdks/dotnet/docs/FaxLineResponse.md new file mode 100644 index 000000000..101ad06fa --- /dev/null +++ b/sdks/dotnet/docs/FaxLineResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FaxLine** | [**FaxLineResponseFaxLine**](FaxLineResponseFaxLine.md) | | **Warnings** | [**WarningResponse**](WarningResponse.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/FaxLineResponseFaxLine.md b/sdks/dotnet/docs/FaxLineResponseFaxLine.md new file mode 100644 index 000000000..672e73d56 --- /dev/null +++ b/sdks/dotnet/docs/FaxLineResponseFaxLine.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineResponseFaxLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Number** | **string** | Number | [optional] **CreatedAt** | **int** | Created at | [optional] **UpdatedAt** | **int** | Updated at | [optional] **Accounts** | [**List<AccountResponse>**](AccountResponse.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/dotnet/docs/FileResponse.md b/sdks/dotnet/docs/FileResponse.md index 313709654..8ce1da078 100644 --- a/sdks/dotnet/docs/FileResponse.md +++ b/sdks/dotnet/docs/FileResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FileUrl** | **string** | URL to the file. | [optional] -**ExpiresAt** | **int** | When the link expires. | [optional] +**FileUrl** | **string** | URL to the file. | **ExpiresAt** | **int** | When the link expires. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/FileResponseDataUri.md b/sdks/dotnet/docs/FileResponseDataUri.md index 927cb34b7..784c396f4 100644 --- a/sdks/dotnet/docs/FileResponseDataUri.md +++ b/sdks/dotnet/docs/FileResponseDataUri.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DataUri** | **string** | File as base64 encoded string. | [optional] +**DataUri** | **string** | File as base64 encoded string. | [[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/ListInfoResponse.md b/sdks/dotnet/docs/ListInfoResponse.md index cd1983fe1..59b6e3a67 100644 --- a/sdks/dotnet/docs/ListInfoResponse.md +++ b/sdks/dotnet/docs/ListInfoResponse.md @@ -5,10 +5,7 @@ Contains pagination information about the data returned. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NumPages** | **int** | Total number of pages available. | [optional] -**NumResults** | **int?** | Total number of objects available. | [optional] -**Page** | **int** | Number of the page being returned. | [optional] -**PageSize** | **int** | Objects returned per page. | [optional] +**NumPages** | **int** | Total number of pages available. | [optional] **NumResults** | **int?** | Total number of objects available. | [optional] **Page** | **int** | Number of the page being returned. | [optional] **PageSize** | **int** | Objects returned per page. | [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/OAuthApi.md b/sdks/dotnet/docs/OAuthApi.md index bde8c1a75..5af912344 100644 --- a/sdks/dotnet/docs/OAuthApi.md +++ b/sdks/dotnet/docs/OAuthApi.md @@ -7,7 +7,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**OauthTokenGenerate**](OAuthApi.md#oauthtokengenerate) | **POST** /oauth/token | OAuth Token Generate | | [**OauthTokenRefresh**](OAuthApi.md#oauthtokenrefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh | - + # **OauthTokenGenerate** > OAuthTokenResponse OauthTokenGenerate (OAuthTokenGenerateRequest oAuthTokenGenerateRequest) @@ -102,7 +102,7 @@ No authorization required [[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) - + # **OauthTokenRefresh** > OAuthTokenResponse OauthTokenRefresh (OAuthTokenRefreshRequest oAuthTokenRefreshRequest) diff --git a/sdks/dotnet/docs/OAuthTokenGenerateRequest.md b/sdks/dotnet/docs/OAuthTokenGenerateRequest.md index 0513db70b..04b69bc13 100644 --- a/sdks/dotnet/docs/OAuthTokenGenerateRequest.md +++ b/sdks/dotnet/docs/OAuthTokenGenerateRequest.md @@ -4,11 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | The client id of the app requesting authorization. | -**ClientSecret** | **string** | The secret token of your app. | -**Code** | **string** | The code passed to your callback when the user granted access. | -**GrantType** | **string** | When generating a new token use `authorization_code`. | [default to "authorization_code"] -**State** | **string** | Same as the state you specified earlier. | +**ClientId** | **string** | The client id of the app requesting authorization. | **ClientSecret** | **string** | The secret token of your app. | **Code** | **string** | The code passed to your callback when the user granted access. | **GrantType** | **string** | When generating a new token use `authorization_code`. | [default to "authorization_code"]**State** | **string** | Same as the state you specified earlier. | [[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/OAuthTokenRefreshRequest.md b/sdks/dotnet/docs/OAuthTokenRefreshRequest.md index 02ff11835..c9866d3bf 100644 --- a/sdks/dotnet/docs/OAuthTokenRefreshRequest.md +++ b/sdks/dotnet/docs/OAuthTokenRefreshRequest.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**GrantType** | **string** | When refreshing an existing token use `refresh_token`. | [default to "refresh_token"] -**RefreshToken** | **string** | The token provided when you got the expired access token. | +**GrantType** | **string** | When refreshing an existing token use `refresh_token`. | [default to "refresh_token"]**RefreshToken** | **string** | The token provided when you got the expired access token. | [[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/OAuthTokenResponse.md b/sdks/dotnet/docs/OAuthTokenResponse.md index ea11e011f..52a050158 100644 --- a/sdks/dotnet/docs/OAuthTokenResponse.md +++ b/sdks/dotnet/docs/OAuthTokenResponse.md @@ -4,11 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccessToken** | **string** | | [optional] -**TokenType** | **string** | | [optional] -**RefreshToken** | **string** | | [optional] -**ExpiresIn** | **int** | Number of seconds until the `access_token` expires. Uses epoch time. | [optional] -**State** | **string** | | [optional] +**AccessToken** | **string** | | [optional] **TokenType** | **string** | | [optional] **RefreshToken** | **string** | | [optional] **ExpiresIn** | **int** | Number of seconds until the `access_token` expires. Uses epoch time. | [optional] **State** | **string** | | [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/ReportApi.md b/sdks/dotnet/docs/ReportApi.md index 7069375dd..9ea98796f 100644 --- a/sdks/dotnet/docs/ReportApi.md +++ b/sdks/dotnet/docs/ReportApi.md @@ -6,7 +6,7 @@ All URIs are relative to *https://api.hellosign.com/v3* |--------|--------------|-------------| | [**ReportCreate**](ReportApi.md#reportcreate) | **POST** /report/create | Create Report | - + # **ReportCreate** > ReportCreateResponse ReportCreate (ReportCreateRequest reportCreateRequest) diff --git a/sdks/dotnet/docs/ReportCreateRequest.md b/sdks/dotnet/docs/ReportCreateRequest.md index d1c813dd6..4b025274b 100644 --- a/sdks/dotnet/docs/ReportCreateRequest.md +++ b/sdks/dotnet/docs/ReportCreateRequest.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EndDate** | **string** | The (inclusive) end date for the report data in `MM/DD/YYYY` format. | -**ReportType** | **List<string>** | The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | -**StartDate** | **string** | The (inclusive) start date for the report data in `MM/DD/YYYY` format. | +**EndDate** | **string** | The (inclusive) end date for the report data in `MM/DD/YYYY` format. | **ReportType** | **List<ReportCreateRequest.ReportTypeEnum>** | The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | **StartDate** | **string** | The (inclusive) start date for the report data in `MM/DD/YYYY` format. | [[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/ReportCreateResponse.md b/sdks/dotnet/docs/ReportCreateResponse.md index 18102c623..a6416fe7a 100644 --- a/sdks/dotnet/docs/ReportCreateResponse.md +++ b/sdks/dotnet/docs/ReportCreateResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Report** | [**ReportResponse**](ReportResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Report** | [**ReportResponse**](ReportResponse.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/ReportResponse.md b/sdks/dotnet/docs/ReportResponse.md index fd15b485f..9f6aec6c6 100644 --- a/sdks/dotnet/docs/ReportResponse.md +++ b/sdks/dotnet/docs/ReportResponse.md @@ -5,10 +5,7 @@ Contains information about the report request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Success** | **string** | A message indicating the requested operation's success | [optional] -**StartDate** | **string** | The (inclusive) start date for the report data in MM/DD/YYYY format. | [optional] -**EndDate** | **string** | The (inclusive) end date for the report data in MM/DD/YYYY format. | [optional] -**ReportType** | **List<string>** | The type(s) of the report you are requesting. Allowed values are "user_activity" and "document_status". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | [optional] +**Success** | **string** | A message indicating the requested operation's success | [optional] **StartDate** | **string** | The (inclusive) start date for the report data in MM/DD/YYYY format. | [optional] **EndDate** | **string** | The (inclusive) end date for the report data in MM/DD/YYYY format. | [optional] **ReportType** | **List<ReportResponse.ReportTypeEnum>** | The type(s) of the report you are requesting. Allowed values are "user_activity" and "document_status". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | [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/SignatureRequestApi.md b/sdks/dotnet/docs/SignatureRequestApi.md index 60f6e1b2c..c411d0c01 100644 --- a/sdks/dotnet/docs/SignatureRequestApi.md +++ b/sdks/dotnet/docs/SignatureRequestApi.md @@ -21,7 +21,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**SignatureRequestSendWithTemplate**](SignatureRequestApi.md#signaturerequestsendwithtemplate) | **POST** /signature_request/send_with_template | Send with Template | | [**SignatureRequestUpdate**](SignatureRequestApi.md#signaturerequestupdate) | **POST** /signature_request/update/{signature_request_id} | Update Signature Request | - + # **SignatureRequestBulkCreateEmbeddedWithTemplate** > BulkSendJobSendResponse SignatureRequestBulkCreateEmbeddedWithTemplate (SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest) @@ -164,7 +164,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestBulkSendWithTemplate** > BulkSendJobSendResponse SignatureRequestBulkSendWithTemplate (SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) @@ -306,7 +306,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestCancel** > void SignatureRequestCancel (string signatureRequestId) @@ -398,7 +398,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestCreateEmbedded** > SignatureRequestGetResponse SignatureRequestCreateEmbedded (SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) @@ -533,7 +533,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestCreateEmbeddedWithTemplate** > SignatureRequestGetResponse SignatureRequestCreateEmbeddedWithTemplate (SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) @@ -649,7 +649,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestFiles** > System.IO.Stream SignatureRequestFiles (string signatureRequestId, string? fileType = null) @@ -749,7 +749,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestFilesAsDataUri** > FileResponseDataUri SignatureRequestFilesAsDataUri (string signatureRequestId) @@ -844,7 +844,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestFilesAsFileUrl** > FileResponse SignatureRequestFilesAsFileUrl (string signatureRequestId, int? forceDownload = null) @@ -940,7 +940,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestGet** > SignatureRequestGetResponse SignatureRequestGet (string signatureRequestId) @@ -1035,7 +1035,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestList** > SignatureRequestListResponse SignatureRequestList (string? accountId = null, int? page = null, int? pageSize = null, string? query = null) @@ -1133,7 +1133,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestReleaseHold** > SignatureRequestGetResponse SignatureRequestReleaseHold (string signatureRequestId) @@ -1228,7 +1228,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestRemind** > SignatureRequestGetResponse SignatureRequestRemind (string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) @@ -1328,7 +1328,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestRemove** > void SignatureRequestRemove (string signatureRequestId) @@ -1419,7 +1419,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestSend** > SignatureRequestGetResponse SignatureRequestSend (SignatureRequestSendRequest signatureRequestSendRequest) @@ -1565,7 +1565,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestSendWithTemplate** > SignatureRequestGetResponse SignatureRequestSendWithTemplate (SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) @@ -1695,7 +1695,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **SignatureRequestUpdate** > SignatureRequestGetResponse SignatureRequestUpdate (string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) diff --git a/sdks/dotnet/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/dotnet/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index 7feccc873..002d9501a 100644 --- a/sdks/dotnet/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/dotnet/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -4,19 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | -**ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | -**SignerFile** | **System.IO.Stream** | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | [optional] -**SignerList** | [**List<SubBulkSignerList>**](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | [optional] -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] -**CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **SignerFile** | **System.IO.Stream** | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | [optional] **SignerList** | [**List<SubBulkSignerList>**](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/dotnet/docs/SignatureRequestBulkSendWithTemplateRequest.md index 8eb63a7a1..8e108215e 100644 --- a/sdks/dotnet/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/dotnet/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -4,19 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | -**SignerFile** | **System.IO.Stream** | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | [optional] -**SignerList** | [**List<SubBulkSignerList>**](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | [optional] -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] -**ClientId** | **string** | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | [optional] -**CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **SignerFile** | **System.IO.Stream** | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | [optional] **SignerList** | [**List<SubBulkSignerList>**](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **ClientId** | **string** | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SignatureRequestCreateEmbeddedRequest.md b/sdks/dotnet/docs/SignatureRequestCreateEmbeddedRequest.md index 20d996cfe..babeb4eb2 100644 --- a/sdks/dotnet/docs/SignatureRequestCreateEmbeddedRequest.md +++ b/sdks/dotnet/docs/SignatureRequestCreateEmbeddedRequest.md @@ -4,30 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

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

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

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

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

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

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

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

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

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false] -**ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] +**ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SignatureRequestGetResponse.md b/sdks/dotnet/docs/SignatureRequestGetResponse.md index 6f985fcab..b43aebe70 100644 --- a/sdks/dotnet/docs/SignatureRequestGetResponse.md +++ b/sdks/dotnet/docs/SignatureRequestGetResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignatureRequest** | [**SignatureRequestResponse**](SignatureRequestResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**SignatureRequest** | [**SignatureRequestResponse**](SignatureRequestResponse.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/SignatureRequestListResponse.md b/sdks/dotnet/docs/SignatureRequestListResponse.md index 41c1429b0..d3cda99bc 100644 --- a/sdks/dotnet/docs/SignatureRequestListResponse.md +++ b/sdks/dotnet/docs/SignatureRequestListResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignatureRequests** | [**List<SignatureRequestResponse>**](SignatureRequestResponse.md) | Contains information about signature requests. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**SignatureRequests** | [**List<SignatureRequestResponse>**](SignatureRequestResponse.md) | Contains information about signature requests. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.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/SignatureRequestRemindRequest.md b/sdks/dotnet/docs/SignatureRequestRemindRequest.md index 60f2bfa92..45ab25c37 100644 --- a/sdks/dotnet/docs/SignatureRequestRemindRequest.md +++ b/sdks/dotnet/docs/SignatureRequestRemindRequest.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EmailAddress** | **string** | The email address of the signer to send a reminder to. | -**Name** | **string** | The name of the signer to send a reminder to. Include if two or more signers share an email address. | [optional] +**EmailAddress** | **string** | The email address of the signer to send a reminder to. | **Name** | **string** | The name of the signer to send a reminder to. Include if two or more signers share an email address. | [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/SignatureRequestResponse.md b/sdks/dotnet/docs/SignatureRequestResponse.md index 3a36fd4ea..a21e1fde2 100644 --- a/sdks/dotnet/docs/SignatureRequestResponse.md +++ b/sdks/dotnet/docs/SignatureRequestResponse.md @@ -5,31 +5,7 @@ Contains information about a signature request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TestMode** | **bool?** | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [optional] [default to false] -**SignatureRequestId** | **string** | The id of the SignatureRequest. | [optional] -**RequesterEmailAddress** | **string** | The email address of the initiator of the SignatureRequest. | [optional] -**Title** | **string** | The title the specified Account uses for the SignatureRequest. | [optional] -**OriginalTitle** | **string** | Default Label for account. | [optional] -**Subject** | **string** | The subject in the email that was initially sent to the signers. | [optional] -**Message** | **string** | The custom message in the email that was initially sent to the signers. | [optional] -**Metadata** | **Object** | The metadata attached to the signature request. | [optional] -**CreatedAt** | **int** | Time the signature request was created. | [optional] -**ExpiresAt** | **int** | The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] -**IsComplete** | **bool** | Whether or not the SignatureRequest has been fully executed by all signers. | [optional] -**IsDeclined** | **bool** | Whether or not the SignatureRequest has been declined by a signer. | [optional] -**HasError** | **bool** | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | [optional] -**FilesUrl** | **string** | The URL where a copy of the request's documents can be downloaded. | [optional] -**SigningUrl** | **string** | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | [optional] -**DetailsUrl** | **string** | The URL where the requester and the signers can view the current status of the SignatureRequest. | [optional] -**CcEmailAddresses** | **List<string>** | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | [optional] -**SigningRedirectUrl** | **string** | The URL you want the signer redirected to after they successfully sign. | [optional] -**FinalCopyUri** | **string** | The path where the completed document can be downloaded | [optional] -**TemplateIds** | **List<string>** | Templates IDs used in this SignatureRequest (if any). | [optional] -**CustomFields** | [**List<SignatureRequestResponseCustomFieldBase>**](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | [optional] -**Attachments** | [**List<SignatureRequestResponseAttachment>**](SignatureRequestResponseAttachment.md) | Signer attachments. | [optional] -**ResponseData** | [**List<SignatureRequestResponseDataBase>**](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | [optional] -**Signatures** | [**List<SignatureRequestResponseSignatures>**](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | [optional] -**BulkSendJobId** | **string** | The ID of the Bulk Send job which sent the signature request, if applicable. | [optional] +**TestMode** | **bool?** | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [optional] [default to false]**SignatureRequestId** | **string** | The id of the SignatureRequest. | [optional] **RequesterEmailAddress** | **string** | The email address of the initiator of the SignatureRequest. | [optional] **Title** | **string** | The title the specified Account uses for the SignatureRequest. | [optional] **OriginalTitle** | **string** | Default Label for account. | [optional] **Subject** | **string** | The subject in the email that was initially sent to the signers. | [optional] **Message** | **string** | The custom message in the email that was initially sent to the signers. | [optional] **Metadata** | **Object** | The metadata attached to the signature request. | [optional] **CreatedAt** | **int** | Time the signature request was created. | [optional] **ExpiresAt** | **int** | The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] **IsComplete** | **bool** | Whether or not the SignatureRequest has been fully executed by all signers. | [optional] **IsDeclined** | **bool** | Whether or not the SignatureRequest has been declined by a signer. | [optional] **HasError** | **bool** | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | [optional] **FilesUrl** | **string** | The URL where a copy of the request's documents can be downloaded. | [optional] **SigningUrl** | **string** | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | [optional] **DetailsUrl** | **string** | The URL where the requester and the signers can view the current status of the SignatureRequest. | [optional] **CcEmailAddresses** | **List<string>** | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | [optional] **SigningRedirectUrl** | **string** | The URL you want the signer redirected to after they successfully sign. | [optional] **FinalCopyUri** | **string** | The path where the completed document can be downloaded | [optional] **TemplateIds** | **List<string>** | Templates IDs used in this SignatureRequest (if any). | [optional] **CustomFields** | [**List<SignatureRequestResponseCustomFieldBase>**](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | [optional] **Attachments** | [**List<SignatureRequestResponseAttachment>**](SignatureRequestResponseAttachment.md) | Signer attachments. | [optional] **ResponseData** | [**List<SignatureRequestResponseDataBase>**](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | [optional] **Signatures** | [**List<SignatureRequestResponseSignatures>**](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | [optional] **BulkSendJobId** | **string** | The ID of the Bulk Send job which sent the signature request, if applicable. | [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/SignatureRequestResponseAttachment.md b/sdks/dotnet/docs/SignatureRequestResponseAttachment.md index 0d488c9d0..cf0956931 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseAttachment.md +++ b/sdks/dotnet/docs/SignatureRequestResponseAttachment.md @@ -5,12 +5,7 @@ Signer attachments. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | The unique ID for this attachment. | -**Signer** | **string** | The Signer this attachment is assigned to. | -**Name** | **string** | The name of this attachment. | -**Required** | **bool** | A boolean value denoting if this attachment is required. | -**Instructions** | **string** | Instructions for Signer. | [optional] -**UploadedAt** | **int?** | Timestamp when attachment was uploaded by Signer. | [optional] +**Id** | **string** | The unique ID for this attachment. | **Signer** | **string** | The Signer this attachment is assigned to. | **Name** | **string** | The name of this attachment. | **Required** | **bool** | A boolean value denoting if this attachment is required. | **Instructions** | **string** | Instructions for Signer. | [optional] **UploadedAt** | **int?** | Timestamp when attachment was uploaded by Signer. | [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/SignatureRequestResponseCustomFieldBase.md b/sdks/dotnet/docs/SignatureRequestResponseCustomFieldBase.md index cb0615917..02072d8aa 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseCustomFieldBase.md +++ b/sdks/dotnet/docs/SignatureRequestResponseCustomFieldBase.md @@ -5,11 +5,7 @@ An array of Custom Field objects containing the name and type of each custom fie Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | -**Name** | **string** | The name of the Custom Field. | -**Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**ApiId** | **string** | The unique ID for this field. | [optional] -**Editor** | **string** | The name of the Role that is able to edit this field. | [optional] +**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | **Name** | **string** | The name of the Custom Field. | **Required** | **bool** | A boolean value denoting if this field is required. | [optional] **ApiId** | **string** | The unique ID for this field. | [optional] **Editor** | **string** | The name of the Role that is able to edit this field. | [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/SignatureRequestResponseCustomFieldCheckbox.md b/sdks/dotnet/docs/SignatureRequestResponseCustomFieldCheckbox.md index 7ec0fea91..42a1a3004 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseCustomFieldCheckbox.md +++ b/sdks/dotnet/docs/SignatureRequestResponseCustomFieldCheckbox.md @@ -9,8 +9,7 @@ Name | Type | Description | Notes **Required** | **bool** | A boolean value denoting if this field is required. | [optional] **ApiId** | **string** | The unique ID for this field. | [optional] **Editor** | **string** | The name of the Role that is able to edit this field. | [optional] -**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "checkbox"] -**Value** | **bool** | A true/false for checkbox fields | [optional] +**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "checkbox"]**Value** | **bool** | A true/false for checkbox fields | [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/SignatureRequestResponseCustomFieldText.md b/sdks/dotnet/docs/SignatureRequestResponseCustomFieldText.md index 505b9ed03..c3c9ca8af 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseCustomFieldText.md +++ b/sdks/dotnet/docs/SignatureRequestResponseCustomFieldText.md @@ -9,8 +9,7 @@ Name | Type | Description | Notes **Required** | **bool** | A boolean value denoting if this field is required. | [optional] **ApiId** | **string** | The unique ID for this field. | [optional] **Editor** | **string** | The name of the Role that is able to edit this field. | [optional] -**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "text"] -**Value** | **string** | A text string for text fields | [optional] +**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "text"]**Value** | **string** | A text string for text fields | [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/SignatureRequestResponseCustomFieldTypeEnum.md b/sdks/dotnet/docs/SignatureRequestResponseCustomFieldTypeEnum.md index fdc354563..d425f40d9 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseCustomFieldTypeEnum.md +++ b/sdks/dotnet/docs/SignatureRequestResponseCustomFieldTypeEnum.md @@ -5,5 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[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/SignatureRequestResponseDataBase.md b/sdks/dotnet/docs/SignatureRequestResponseDataBase.md index 8adfadbba..63c965df9 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataBase.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataBase.md @@ -5,11 +5,7 @@ An array of form field objects containing the name, value, and type of each text Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ApiId** | **string** | The unique ID for this field. | [optional] -**SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] -**Name** | **string** | The name of the form field. | [optional] -**Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | | [optional] +**ApiId** | **string** | The unique ID for this field. | [optional] **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] **Type** | **string** | | [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/SignatureRequestResponseDataTypeEnum.md b/sdks/dotnet/docs/SignatureRequestResponseDataTypeEnum.md index f0c37a9cc..493db1e4b 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataTypeEnum.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataTypeEnum.md @@ -5,5 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[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/SignatureRequestResponseDataValueCheckbox.md b/sdks/dotnet/docs/SignatureRequestResponseDataValueCheckbox.md index 416604440..57d02ae42 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataValueCheckbox.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataValueCheckbox.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A yes/no checkbox | [optional] [default to "checkbox"] -**Value** | **bool** | The value of the form field. | [optional] +**Type** | **string** | A yes/no checkbox | [optional] [default to "checkbox"]**Value** | **bool** | The value of the form field. | [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/SignatureRequestResponseDataValueCheckboxMerge.md b/sdks/dotnet/docs/SignatureRequestResponseDataValueCheckboxMerge.md index bad93e460..7e96757d7 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataValueCheckboxMerge.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataValueCheckboxMerge.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A checkbox field that has default value set by the api | [optional] [default to "checkbox-merge"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | A checkbox field that has default value set by the api | [optional] [default to "checkbox-merge"]**Value** | **string** | The value of the form field. | [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/SignatureRequestResponseDataValueDateSigned.md b/sdks/dotnet/docs/SignatureRequestResponseDataValueDateSigned.md index bb083824c..3bc2e553e 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataValueDateSigned.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataValueDateSigned.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A date | [optional] [default to "date_signed"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | A date | [optional] [default to "date_signed"]**Value** | **string** | The value of the form field. | [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/SignatureRequestResponseDataValueDropdown.md b/sdks/dotnet/docs/SignatureRequestResponseDataValueDropdown.md index bfcdf07a1..13473c22d 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataValueDropdown.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataValueDropdown.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | An input field for dropdowns | [optional] [default to "dropdown"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | An input field for dropdowns | [optional] [default to "dropdown"]**Value** | **string** | The value of the form field. | [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/SignatureRequestResponseDataValueInitials.md b/sdks/dotnet/docs/SignatureRequestResponseDataValueInitials.md index 389f1394d..fcd9ab1f8 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataValueInitials.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataValueInitials.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | An input field for initials | [optional] [default to "initials"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | An input field for initials | [optional] [default to "initials"]**Value** | **string** | The value of the form field. | [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/SignatureRequestResponseDataValueRadio.md b/sdks/dotnet/docs/SignatureRequestResponseDataValueRadio.md index 3dc569348..ccc7520e2 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataValueRadio.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataValueRadio.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | An input field for radios | [optional] [default to "radio"] -**Value** | **bool** | The value of the form field. | [optional] +**Type** | **string** | An input field for radios | [optional] [default to "radio"]**Value** | **bool** | The value of the form field. | [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/SignatureRequestResponseDataValueSignature.md b/sdks/dotnet/docs/SignatureRequestResponseDataValueSignature.md index 8ea7c7cb6..2ee12dce2 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataValueSignature.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataValueSignature.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A signature input field | [optional] [default to "signature"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | A signature input field | [optional] [default to "signature"]**Value** | **string** | The value of the form field. | [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/SignatureRequestResponseDataValueText.md b/sdks/dotnet/docs/SignatureRequestResponseDataValueText.md index e8c2438d7..14e685ea2 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataValueText.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataValueText.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A text input field | [optional] [default to "text"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | A text input field | [optional] [default to "text"]**Value** | **string** | The value of the form field. | [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/SignatureRequestResponseDataValueTextMerge.md b/sdks/dotnet/docs/SignatureRequestResponseDataValueTextMerge.md index d41148eef..2c8ab326b 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseDataValueTextMerge.md +++ b/sdks/dotnet/docs/SignatureRequestResponseDataValueTextMerge.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A text field that has default text set by the api | [optional] [default to "text-merge"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | A text field that has default text set by the api | [optional] [default to "text-merge"]**Value** | **string** | The value of the form field. | [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/SignatureRequestResponseSignatures.md b/sdks/dotnet/docs/SignatureRequestResponseSignatures.md index 484840e24..0956244ab 100644 --- a/sdks/dotnet/docs/SignatureRequestResponseSignatures.md +++ b/sdks/dotnet/docs/SignatureRequestResponseSignatures.md @@ -5,25 +5,7 @@ An array of signature objects, 1 for each signer. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignatureId** | **string** | Signature identifier. | [optional] -**SignerGroupGuid** | **string** | Signer Group GUID | [optional] -**SignerEmailAddress** | **string** | The email address of the signer. | [optional] -**SignerName** | **string** | The name of the signer. | [optional] -**SignerRole** | **string** | The role of the signer. | [optional] -**Order** | **int?** | If signer order is assigned this is the 0-based index for this signer. | [optional] -**StatusCode** | **string** | The current status of the signature. eg: awaiting_signature, signed, declined. | [optional] -**DeclineReason** | **string** | The reason provided by the signer for declining the request. | [optional] -**SignedAt** | **int?** | Time that the document was signed or null. | [optional] -**LastViewedAt** | **int?** | The time that the document was last viewed by this signer or null. | [optional] -**LastRemindedAt** | **int?** | The time the last reminder email was sent to the signer or null. | [optional] -**HasPin** | **bool** | Boolean to indicate whether this signature requires a PIN to access. | [optional] -**HasSmsAuth** | **bool?** | Boolean to indicate whether this signature has SMS authentication enabled. | [optional] -**HasSmsDelivery** | **bool?** | Boolean to indicate whether this signature has SMS delivery enabled. | [optional] -**SmsPhoneNumber** | **string** | The SMS phone number used for authentication or signature request delivery. | [optional] -**ReassignedBy** | **string** | Email address of original signer who reassigned to this signer. | [optional] -**ReassignmentReason** | **string** | Reason provided by original signer who reassigned to this signer. | [optional] -**ReassignedFrom** | **string** | Previous signature identifier. | [optional] -**Error** | **string** | Error message pertaining to this signer, or null. | [optional] +**SignatureId** | **string** | Signature identifier. | [optional] **SignerGroupGuid** | **string** | Signer Group GUID | [optional] **SignerEmailAddress** | **string** | The email address of the signer. | [optional] **SignerName** | **string** | The name of the signer. | [optional] **SignerRole** | **string** | The role of the signer. | [optional] **Order** | **int?** | If signer order is assigned this is the 0-based index for this signer. | [optional] **StatusCode** | **string** | The current status of the signature. eg: awaiting_signature, signed, declined. | [optional] **DeclineReason** | **string** | The reason provided by the signer for declining the request. | [optional] **SignedAt** | **int?** | Time that the document was signed or null. | [optional] **LastViewedAt** | **int?** | The time that the document was last viewed by this signer or null. | [optional] **LastRemindedAt** | **int?** | The time the last reminder email was sent to the signer or null. | [optional] **HasPin** | **bool** | Boolean to indicate whether this signature requires a PIN to access. | [optional] **HasSmsAuth** | **bool?** | Boolean to indicate whether this signature has SMS authentication enabled. | [optional] **HasSmsDelivery** | **bool?** | Boolean to indicate whether this signature has SMS delivery enabled. | [optional] **SmsPhoneNumber** | **string** | The SMS phone number used for authentication or signature request delivery. | [optional] **ReassignedBy** | **string** | Email address of original signer who reassigned to this signer. | [optional] **ReassignmentReason** | **string** | Reason provided by original signer who reassigned to this signer. | [optional] **ReassignedFrom** | **string** | Previous signature identifier. | [optional] **Error** | **string** | Error message pertaining to this signer, or null. | [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/SignatureRequestSendRequest.md b/sdks/dotnet/docs/SignatureRequestSendRequest.md index 545f97661..000c7adec 100644 --- a/sdks/dotnet/docs/SignatureRequestSendRequest.md +++ b/sdks/dotnet/docs/SignatureRequestSendRequest.md @@ -4,32 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

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

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

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

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

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

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

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

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] -**UseTextTags** | **bool** | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [optional] [default to false] -**ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] +**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

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

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

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

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

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

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

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

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

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

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

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **ClientId** | **string** | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] [[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/SignatureRequestUpdateRequest.md b/sdks/dotnet/docs/SignatureRequestUpdateRequest.md index 7aa6991ec..9f19a93f9 100644 --- a/sdks/dotnet/docs/SignatureRequestUpdateRequest.md +++ b/sdks/dotnet/docs/SignatureRequestUpdateRequest.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignatureId** | **string** | The signature ID for the recipient. | -**EmailAddress** | **string** | The new email address for the recipient.

This will generate a new `signature_id` value.

**NOTE:** Optional if `name` is provided. | [optional] -**Name** | **string** | The new name for the recipient.

**NOTE:** Optional if `email_address` is provided. | [optional] -**ExpiresAt** | **int?** | The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] +**SignatureId** | **string** | The signature ID for the recipient. | **EmailAddress** | **string** | The new email address for the recipient.

This will generate a new `signature_id` value.

**NOTE:** Optional if `name` is provided. | [optional] **Name** | **string** | The new name for the recipient.

**NOTE:** Optional if `email_address` is provided. | [optional] **ExpiresAt** | **int?** | The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SubAttachment.md b/sdks/dotnet/docs/SubAttachment.md index 80d4f5c84..55eb99ae5 100644 --- a/sdks/dotnet/docs/SubAttachment.md +++ b/sdks/dotnet/docs/SubAttachment.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of attachment. | -**SignerIndex** | **int** | The signer's index in the `signers` parameter (0-based indexing).

**NOTE:** Only one signer can be assigned per attachment. | -**Instructions** | **string** | The instructions for uploading the attachment. | [optional] -**Required** | **bool** | Determines if the attachment must be uploaded. | [optional] [default to false] +**Name** | **string** | The name of attachment. | **SignerIndex** | **int** | The signer's index in the `signers` parameter (0-based indexing).

**NOTE:** Only one signer can be assigned per attachment. | **Instructions** | **string** | The instructions for uploading the attachment. | [optional] **Required** | **bool** | Determines if the attachment must be uploaded. | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SubBulkSignerList.md b/sdks/dotnet/docs/SubBulkSignerList.md index 69b43a931..c256792ff 100644 --- a/sdks/dotnet/docs/SubBulkSignerList.md +++ b/sdks/dotnet/docs/SubBulkSignerList.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CustomFields** | [**List<SubBulkSignerListCustomField>**](SubBulkSignerListCustomField.md) | An array of custom field values. | [optional] -**Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document.

Currently only templates with a single role are supported. All signers must have the same `role` value. | [optional] +**CustomFields** | [**List<SubBulkSignerListCustomField>**](SubBulkSignerListCustomField.md) | An array of custom field values. | [optional] **Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document.

Currently only templates with a single role are supported. All signers must have the same `role` value. | [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/SubBulkSignerListCustomField.md b/sdks/dotnet/docs/SubBulkSignerListCustomField.md index 1646ba42e..da30ceb6d 100644 --- a/sdks/dotnet/docs/SubBulkSignerListCustomField.md +++ b/sdks/dotnet/docs/SubBulkSignerListCustomField.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the custom field. Must be the field's `name` or `api_id`. | -**Value** | **string** | The value of the custom field. | +**Name** | **string** | The name of the custom field. Must be the field's `name` or `api_id`. | **Value** | **string** | The value of the custom field. | [[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/SubCC.md b/sdks/dotnet/docs/SubCC.md index bfe6bc5a2..098eee573 100644 --- a/sdks/dotnet/docs/SubCC.md +++ b/sdks/dotnet/docs/SubCC.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Role** | **string** | Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. | -**EmailAddress** | **string** | The email address of the CC recipient. | +**Role** | **string** | Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. | **EmailAddress** | **string** | The email address of the CC recipient. | [[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/SubCustomField.md b/sdks/dotnet/docs/SubCustomField.md index 27ee651d8..0ef9221a6 100644 --- a/sdks/dotnet/docs/SubCustomField.md +++ b/sdks/dotnet/docs/SubCustomField.md @@ -5,10 +5,7 @@ When used together with merge fields, `custom_fields` allows users to add pre-fi Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. | -**Editor** | **string** | Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`.

**NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. | [optional] -**Required** | **bool** | Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. | [optional] [default to false] -**Value** | **string** | The string that resolves (aka "pre-fills") to the merge field on the final document(s) used for signing. | [optional] +**Name** | **string** | The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. | **Editor** | **string** | Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`.

**NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. | [optional] **Required** | **bool** | Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. | [optional] [default to false]**Value** | **string** | The string that resolves (aka "pre-fills") to the merge field on the final document(s) used for signing. | [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/SubEditorOptions.md b/sdks/dotnet/docs/SubEditorOptions.md index b1bca0ab6..e0b22f171 100644 --- a/sdks/dotnet/docs/SubEditorOptions.md +++ b/sdks/dotnet/docs/SubEditorOptions.md @@ -5,8 +5,7 @@ This allows the requester to specify editor options when a preparing a document Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AllowEditSigners** | **bool** | Allows requesters to edit the list of signers | [optional] [default to false] -**AllowEditDocuments** | **bool** | Allows requesters to edit documents, including delete and add | [optional] [default to false] +**AllowEditSigners** | **bool** | Allows requesters to edit the list of signers | [optional] [default to false]**AllowEditDocuments** | **bool** | Allows requesters to edit documents, including delete and add | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SubFormFieldGroup.md b/sdks/dotnet/docs/SubFormFieldGroup.md index 82a52fe4a..7928371c4 100644 --- a/sdks/dotnet/docs/SubFormFieldGroup.md +++ b/sdks/dotnet/docs/SubFormFieldGroup.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**GroupId** | **string** | ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. | -**GroupLabel** | **string** | Name of the group | -**Requirement** | **string** | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | +**GroupId** | **string** | ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. | **GroupLabel** | **string** | Name of the group | **Requirement** | **string** | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | [[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/SubFormFieldRule.md b/sdks/dotnet/docs/SubFormFieldRule.md index 219166a22..e83476289 100644 --- a/sdks/dotnet/docs/SubFormFieldRule.md +++ b/sdks/dotnet/docs/SubFormFieldRule.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | Must be unique across all defined rules. | -**TriggerOperator** | **string** | Currently only `AND` is supported. Support for `OR` is being worked on. | [default to "AND"] -**Triggers** | [**List<SubFormFieldRuleTrigger>**](SubFormFieldRuleTrigger.md) | An array of trigger definitions, the "if this" part of "**if this**, then that". Currently only a single trigger per rule is allowed. | -**Actions** | [**List<SubFormFieldRuleAction>**](SubFormFieldRuleAction.md) | An array of action definitions, the "then that" part of "if this, **then that**". Any number of actions may be attached to a single rule. | +**Id** | **string** | Must be unique across all defined rules. | **TriggerOperator** | **string** | Currently only `AND` is supported. Support for `OR` is being worked on. | [default to "AND"]**Triggers** | [**List<SubFormFieldRuleTrigger>**](SubFormFieldRuleTrigger.md) | An array of trigger definitions, the "if this" part of "**if this**, then that". Currently only a single trigger per rule is allowed. | **Actions** | [**List<SubFormFieldRuleAction>**](SubFormFieldRuleAction.md) | An array of action definitions, the "then that" part of "if this, **then that**". Any number of actions may be attached to a single rule. | [[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/SubFormFieldRuleAction.md b/sdks/dotnet/docs/SubFormFieldRuleAction.md index 83e89ce82..96028d9a7 100644 --- a/sdks/dotnet/docs/SubFormFieldRuleAction.md +++ b/sdks/dotnet/docs/SubFormFieldRuleAction.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Hidden** | **bool** | `true` to hide the target field when rule is satisfied, otherwise `false`. | -**Type** | **string** | | -**FieldId** | **string** | **field_id** or **group_id** is required, but not both.

Must reference the `api_id` of an existing field defined within `form_fields_per_document`.

Cannot use with `group_id`. Trigger and action fields must belong to the same signer. | [optional] -**GroupId** | **string** | **group_id** or **field_id** is required, but not both.

Must reference the ID of an existing group defined within `form_field_groups`.

Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer. | [optional] +**Hidden** | **bool** | `true` to hide the target field when rule is satisfied, otherwise `false`. | **Type** | **string** | | **FieldId** | **string** | **field_id** or **group_id** is required, but not both.

Must reference the `api_id` of an existing field defined within `form_fields_per_document`.

Cannot use with `group_id`. Trigger and action fields must belong to the same signer. | [optional] **GroupId** | **string** | **group_id** or **field_id** is required, but not both.

Must reference the ID of an existing group defined within `form_field_groups`.

Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer. | [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/SubFormFieldRuleTrigger.md b/sdks/dotnet/docs/SubFormFieldRuleTrigger.md index e2ee20398..e6b829e6a 100644 --- a/sdks/dotnet/docs/SubFormFieldRuleTrigger.md +++ b/sdks/dotnet/docs/SubFormFieldRuleTrigger.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. | -**Operator** | **string** | Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value | -**Value** | **string** | **value** or **values** is required, but not both.

The value to match against **operator**.

- When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match`

Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` | [optional] -**Values** | **List<string>** | **values** or **value** is required, but not both.

The values to match against **operator** when it is one of the following:

- `any` - `none` | [optional] +**Id** | **string** | Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. | **Operator** | **string** | Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value | **Value** | **string** | **value** or **values** is required, but not both.

The value to match against **operator**.

- When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match`

Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` | [optional] **Values** | **List<string>** | **values** or **value** is required, but not both.

The values to match against **operator** when it is one of the following:

- `any` - `none` | [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/SubFormFieldsPerDocumentBase.md b/sdks/dotnet/docs/SubFormFieldsPerDocumentBase.md index cadb43e8b..e684c8b85 100644 --- a/sdks/dotnet/docs/SubFormFieldsPerDocumentBase.md +++ b/sdks/dotnet/docs/SubFormFieldsPerDocumentBase.md @@ -5,17 +5,7 @@ The fields that should appear on the document, expressed as an array of objects. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DocumentIndex** | **int** | Represents the integer index of the `file` or `file_url` document the field should be attached to. | -**ApiId** | **string** | An identifier for the field that is unique across all documents in the request. | -**Height** | **int** | Size of the field in pixels. | -**Required** | **bool** | Whether this field is required. | -**Signer** | **string** | Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field.

**NOTE:** To set the value of the field as the preparer you must set this to `me_now`

**NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. | -**Type** | **string** | | -**Width** | **int** | Size of the field in pixels. | -**X** | **int** | Location coordinates of the field in pixels. | -**Y** | **int** | Location coordinates of the field in pixels. | -**Name** | **string** | Display name for the field. | [optional] -**Page** | **int?** | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | [optional] +**DocumentIndex** | **int** | Represents the integer index of the `file` or `file_url` document the field should be attached to. | **ApiId** | **string** | An identifier for the field that is unique across all documents in the request. | **Height** | **int** | Size of the field in pixels. | **Required** | **bool** | Whether this field is required. | **Signer** | **string** | Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field.

**NOTE:** To set the value of the field as the preparer you must set this to `me_now`

**NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. | **Type** | **string** | | **Width** | **int** | Size of the field in pixels. | **X** | **int** | Location coordinates of the field in pixels. | **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **Page** | **int?** | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | [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/SubFormFieldsPerDocumentCheckbox.md b/sdks/dotnet/docs/SubFormFieldsPerDocumentCheckbox.md index 2befe9216..3e099fb3d 100644 --- a/sdks/dotnet/docs/SubFormFieldsPerDocumentCheckbox.md +++ b/sdks/dotnet/docs/SubFormFieldsPerDocumentCheckbox.md @@ -15,9 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **Page** | **int?** | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | [optional] -**Type** | **string** | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | [default to "checkbox"] -**IsChecked** | **bool** | `true` for checking the checkbox field by default, otherwise `false`. | -**Group** | **string** | String referencing group defined in `form_field_groups` parameter. | [optional] +**Type** | **string** | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | [default to "checkbox"]**IsChecked** | **bool** | `true` for checking the checkbox field by default, otherwise `false`. | **Group** | **string** | String referencing group defined in `form_field_groups` parameter. | [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/SubFormFieldsPerDocumentDateSigned.md b/sdks/dotnet/docs/SubFormFieldsPerDocumentDateSigned.md index 3a9f886bb..1e7bf6477 100644 --- a/sdks/dotnet/docs/SubFormFieldsPerDocumentDateSigned.md +++ b/sdks/dotnet/docs/SubFormFieldsPerDocumentDateSigned.md @@ -15,9 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **Page** | **int?** | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | [optional] -**Type** | **string** | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | [default to "date_signed"] -**FontFamily** | **string** | Font family for the field. | [optional] -**FontSize** | **int** | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [optional] [default to 12] +**Type** | **string** | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | [default to "date_signed"]**FontFamily** | **string** | Font family for the field. | [optional] **FontSize** | **int** | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [optional] [default to 12] [[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/SubFormFieldsPerDocumentDropdown.md b/sdks/dotnet/docs/SubFormFieldsPerDocumentDropdown.md index 4e4016292..d23c8c62c 100644 --- a/sdks/dotnet/docs/SubFormFieldsPerDocumentDropdown.md +++ b/sdks/dotnet/docs/SubFormFieldsPerDocumentDropdown.md @@ -15,11 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **Page** | **int?** | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | [optional] -**Type** | **string** | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | [default to "dropdown"] -**Options** | **List<string>** | Array of string values representing dropdown values. | -**Content** | **string** | Selected value in `options` array. Value must exist in array. | [optional] -**FontFamily** | **string** | Font family for the field. | [optional] -**FontSize** | **int** | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [optional] [default to 12] +**Type** | **string** | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | [default to "dropdown"]**Options** | **List<string>** | Array of string values representing dropdown values. | **Content** | **string** | Selected value in `options` array. Value must exist in array. | [optional] **FontFamily** | **string** | Font family for the field. | [optional] **FontSize** | **int** | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [optional] [default to 12] [[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/SubFormFieldsPerDocumentFontEnum.md b/sdks/dotnet/docs/SubFormFieldsPerDocumentFontEnum.md index d47a6bf1c..e9298334d 100644 --- a/sdks/dotnet/docs/SubFormFieldsPerDocumentFontEnum.md +++ b/sdks/dotnet/docs/SubFormFieldsPerDocumentFontEnum.md @@ -5,5 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[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/SubFormFieldsPerDocumentHyperlink.md b/sdks/dotnet/docs/SubFormFieldsPerDocumentHyperlink.md index 6b3845fd5..aea6fa4e5 100644 --- a/sdks/dotnet/docs/SubFormFieldsPerDocumentHyperlink.md +++ b/sdks/dotnet/docs/SubFormFieldsPerDocumentHyperlink.md @@ -15,11 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **Page** | **int?** | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | [optional] -**Type** | **string** | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | [default to "hyperlink"] -**Content** | **string** | Link Text. | -**ContentUrl** | **string** | Link URL. | -**FontFamily** | **string** | Font family for the field. | [optional] -**FontSize** | **int** | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [optional] [default to 12] +**Type** | **string** | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | [default to "hyperlink"]**Content** | **string** | Link Text. | **ContentUrl** | **string** | Link URL. | **FontFamily** | **string** | Font family for the field. | [optional] **FontSize** | **int** | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [optional] [default to 12] [[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/SubFormFieldsPerDocumentRadio.md b/sdks/dotnet/docs/SubFormFieldsPerDocumentRadio.md index 3340d568d..d8b4ec7d1 100644 --- a/sdks/dotnet/docs/SubFormFieldsPerDocumentRadio.md +++ b/sdks/dotnet/docs/SubFormFieldsPerDocumentRadio.md @@ -15,9 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **Page** | **int?** | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | [optional] -**Type** | **string** | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | [default to "radio"] -**Group** | **string** | String referencing group defined in `form_field_groups` parameter. | -**IsChecked** | **bool** | `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. | +**Type** | **string** | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | [default to "radio"]**Group** | **string** | String referencing group defined in `form_field_groups` parameter. | **IsChecked** | **bool** | `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. | [[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/SubFormFieldsPerDocumentText.md b/sdks/dotnet/docs/SubFormFieldsPerDocumentText.md index b40010ee1..c025afe54 100644 --- a/sdks/dotnet/docs/SubFormFieldsPerDocumentText.md +++ b/sdks/dotnet/docs/SubFormFieldsPerDocumentText.md @@ -15,17 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **Page** | **int?** | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | [optional] -**Type** | **string** | A text input field. Use the `SubFormFieldsPerDocumentText` class. | [default to "text"] -**Placeholder** | **string** | Placeholder value for text field. | [optional] -**AutoFillType** | **string** | Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. | [optional] -**LinkId** | **string** | Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. | [optional] -**Masked** | **bool** | Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`. | [optional] -**ValidationType** | **string** | Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.

**NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value. | [optional] -**ValidationCustomRegex** | **string** | | [optional] -**ValidationCustomRegexFormatLabel** | **string** | | [optional] -**Content** | **string** | Content of a `me_now` text field | [optional] -**FontFamily** | **string** | Font family for the field. | [optional] -**FontSize** | **int** | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [optional] [default to 12] +**Type** | **string** | A text input field. Use the `SubFormFieldsPerDocumentText` class. | [default to "text"]**Placeholder** | **string** | Placeholder value for text field. | [optional] **AutoFillType** | **string** | Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. | [optional] **LinkId** | **string** | Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. | [optional] **Masked** | **bool** | Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`. | [optional] **ValidationType** | **string** | Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.

**NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value. | [optional] **ValidationCustomRegex** | **string** | | [optional] **ValidationCustomRegexFormatLabel** | **string** | | [optional] **Content** | **string** | Content of a `me_now` text field | [optional] **FontFamily** | **string** | Font family for the field. | [optional] **FontSize** | **int** | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [optional] [default to 12] [[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/SubFormFieldsPerDocumentTextMerge.md b/sdks/dotnet/docs/SubFormFieldsPerDocumentTextMerge.md index 861141674..20fd61464 100644 --- a/sdks/dotnet/docs/SubFormFieldsPerDocumentTextMerge.md +++ b/sdks/dotnet/docs/SubFormFieldsPerDocumentTextMerge.md @@ -15,9 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **Page** | **int?** | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | [optional] -**Type** | **string** | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | [default to "text-merge"] -**FontFamily** | **string** | Font family for the field. | [optional] -**FontSize** | **int** | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [optional] [default to 12] +**Type** | **string** | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | [default to "text-merge"]**FontFamily** | **string** | Font family for the field. | [optional] **FontSize** | **int** | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [optional] [default to 12] [[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/SubFormFieldsPerDocumentTypeEnum.md b/sdks/dotnet/docs/SubFormFieldsPerDocumentTypeEnum.md index b9660651e..73d875e74 100644 --- a/sdks/dotnet/docs/SubFormFieldsPerDocumentTypeEnum.md +++ b/sdks/dotnet/docs/SubFormFieldsPerDocumentTypeEnum.md @@ -5,5 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[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/SubMergeField.md b/sdks/dotnet/docs/SubMergeField.md index 76911af53..d87cc9044 100644 --- a/sdks/dotnet/docs/SubMergeField.md +++ b/sdks/dotnet/docs/SubMergeField.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the merge field. Must be unique. | -**Type** | **string** | The type of merge field. | +**Name** | **string** | The name of the merge field. Must be unique. | **Type** | **string** | The type of merge field. | [[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/SubOAuth.md b/sdks/dotnet/docs/SubOAuth.md index db5dc0abe..6c5bf7d33 100644 --- a/sdks/dotnet/docs/SubOAuth.md +++ b/sdks/dotnet/docs/SubOAuth.md @@ -5,8 +5,7 @@ OAuth related parameters. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CallbackUrl** | **string** | The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) | [optional] -**Scopes** | **List<string>** | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | [optional] +**CallbackUrl** | **string** | The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) | [optional] **Scopes** | **List<SubOAuth.ScopesEnum>** | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | [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/SubSignatureRequestGroupedSigners.md b/sdks/dotnet/docs/SubSignatureRequestGroupedSigners.md index 8ae84f74c..b37cae03b 100644 --- a/sdks/dotnet/docs/SubSignatureRequestGroupedSigners.md +++ b/sdks/dotnet/docs/SubSignatureRequestGroupedSigners.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Group** | **string** | The name of the group. | -**Signers** | [**List<SubSignatureRequestSigner>**](SubSignatureRequestSigner.md) | Signers belonging to this Group.

**NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. | -**Order** | **int?** | The order the group is required to sign in. Use this instead of Signer-level `order`. | [optional] +**Group** | **string** | The name of the group. | **Signers** | [**List<SubSignatureRequestSigner>**](SubSignatureRequestSigner.md) | Signers belonging to this Group.

**NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. | **Order** | **int?** | The order the group is required to sign in. Use this instead of Signer-level `order`. | [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/SubSignatureRequestSigner.md b/sdks/dotnet/docs/SubSignatureRequestSigner.md index a13065734..4357879ce 100644 --- a/sdks/dotnet/docs/SubSignatureRequestSigner.md +++ b/sdks/dotnet/docs/SubSignatureRequestSigner.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the signer. | -**EmailAddress** | **string** | The email address of the signer. | -**Order** | **int?** | The order the signer is required to sign in. | [optional] -**Pin** | **string** | The 4- to 12-character access code that will secure this signer's signature page. | [optional] -**SmsPhoneNumber** | **string** | An E.164 formatted phone number.

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. | [optional] -**SmsPhoneNumberType** | **string** | Specifies the feature used with the `sms_phone_number`. Default `authentication`.

If `authentication`, signer is sent a verification code via SMS that is required to access the document.

If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). | [optional] +**Name** | **string** | The name of the signer. | **EmailAddress** | **string** | The email address of the signer. | **Order** | **int?** | The order the signer is required to sign in. | [optional] **Pin** | **string** | The 4- to 12-character access code that will secure this signer's signature page. | [optional] **SmsPhoneNumber** | **string** | An E.164 formatted phone number.

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. | [optional] **SmsPhoneNumberType** | **string** | Specifies the feature used with the `sms_phone_number`. Default `authentication`.

If `authentication`, signer is sent a verification code via SMS that is required to access the document.

If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). | [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/SubSignatureRequestTemplateSigner.md b/sdks/dotnet/docs/SubSignatureRequestTemplateSigner.md index 4a304067a..5789681fb 100644 --- a/sdks/dotnet/docs/SubSignatureRequestTemplateSigner.md +++ b/sdks/dotnet/docs/SubSignatureRequestTemplateSigner.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Role** | **string** | Must match an existing role in chosen Template(s). It's case-sensitive. | -**Name** | **string** | The name of the signer. | -**EmailAddress** | **string** | The email address of the signer. | -**Pin** | **string** | The 4- to 12-character access code that will secure this signer's signature page. | [optional] -**SmsPhoneNumber** | **string** | An E.164 formatted phone number.

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. | [optional] -**SmsPhoneNumberType** | **string** | Specifies the feature used with the `sms_phone_number`. Default `authentication`.

If `authentication`, signer is sent a verification code via SMS that is required to access the document.

If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). | [optional] +**Role** | **string** | Must match an existing role in chosen Template(s). It's case-sensitive. | **Name** | **string** | The name of the signer. | **EmailAddress** | **string** | The email address of the signer. | **Pin** | **string** | The 4- to 12-character access code that will secure this signer's signature page. | [optional] **SmsPhoneNumber** | **string** | An E.164 formatted phone number.

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. | [optional] **SmsPhoneNumberType** | **string** | Specifies the feature used with the `sms_phone_number`. Default `authentication`.

If `authentication`, signer is sent a verification code via SMS that is required to access the document.

If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). | [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/SubSigningOptions.md b/sdks/dotnet/docs/SubSigningOptions.md index c0ec40eff..a65674196 100644 --- a/sdks/dotnet/docs/SubSigningOptions.md +++ b/sdks/dotnet/docs/SubSigningOptions.md @@ -5,11 +5,7 @@ This allows the requester to specify the types allowed for creating a signature. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DefaultType** | **string** | The default type shown (limited to the listed types) | -**Draw** | **bool** | Allows drawing the signature | [optional] [default to false] -**Phone** | **bool** | Allows using a smartphone to email the signature | [optional] [default to false] -**Type** | **bool** | Allows typing the signature | [optional] [default to false] -**Upload** | **bool** | Allows uploading the signature | [optional] [default to false] +**DefaultType** | **string** | The default type shown (limited to the listed types) | **Draw** | **bool** | Allows drawing the signature | [optional] [default to false]**Phone** | **bool** | Allows using a smartphone to email the signature | [optional] [default to false]**Type** | **bool** | Allows typing the signature | [optional] [default to false]**Upload** | **bool** | Allows uploading the signature | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/SubTeamResponse.md b/sdks/dotnet/docs/SubTeamResponse.md index ebdb96c12..b2c09e6c7 100644 --- a/sdks/dotnet/docs/SubTeamResponse.md +++ b/sdks/dotnet/docs/SubTeamResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TeamId** | **string** | The id of a team | [optional] -**Name** | **string** | The name of a team | [optional] +**TeamId** | **string** | The id of a team | [optional] **Name** | **string** | The name of a team | [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/SubTemplateRole.md b/sdks/dotnet/docs/SubTemplateRole.md index ece06e4d5..ecf59c54c 100644 --- a/sdks/dotnet/docs/SubTemplateRole.md +++ b/sdks/dotnet/docs/SubTemplateRole.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The role name of the signer that will be displayed when the template is used to create a signature request. | [optional] -**Order** | **int?** | The order in which this signer role is required to sign. | [optional] +**Name** | **string** | The role name of the signer that will be displayed when the template is used to create a signature request. | [optional] **Order** | **int?** | The order in which this signer role is required to sign. | [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/SubUnclaimedDraftSigner.md b/sdks/dotnet/docs/SubUnclaimedDraftSigner.md index 4a7ca39dc..46bdfda3b 100644 --- a/sdks/dotnet/docs/SubUnclaimedDraftSigner.md +++ b/sdks/dotnet/docs/SubUnclaimedDraftSigner.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EmailAddress** | **string** | The email address of the signer. | -**Name** | **string** | The name of the signer. | -**Order** | **int?** | The order the signer is required to sign in. | [optional] +**EmailAddress** | **string** | The email address of the signer. | **Name** | **string** | The name of the signer. | **Order** | **int?** | The order the signer is required to sign in. | [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/SubUnclaimedDraftTemplateSigner.md b/sdks/dotnet/docs/SubUnclaimedDraftTemplateSigner.md index 79f09789e..43be64a68 100644 --- a/sdks/dotnet/docs/SubUnclaimedDraftTemplateSigner.md +++ b/sdks/dotnet/docs/SubUnclaimedDraftTemplateSigner.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Role** | **string** | Must match an existing role in chosen Template(s). | -**Name** | **string** | The name of the signer filling the role of `role`. | -**EmailAddress** | **string** | The email address of the signer filling the role of `role`. | +**Role** | **string** | Must match an existing role in chosen Template(s). | **Name** | **string** | The name of the signer filling the role of `role`. | **EmailAddress** | **string** | The email address of the signer filling the role of `role`. | [[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/SubWhiteLabelingOptions.md b/sdks/dotnet/docs/SubWhiteLabelingOptions.md index 295d243ad..930a345f5 100644 --- a/sdks/dotnet/docs/SubWhiteLabelingOptions.md +++ b/sdks/dotnet/docs/SubWhiteLabelingOptions.md @@ -5,21 +5,7 @@ An array of elements and values serialized to a string, to be used to customize Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**HeaderBackgroundColor** | **string** | | [optional] [default to "#1A1A1A"] -**LegalVersion** | **string** | | [optional] [default to LegalVersionEnum.Terms1] -**LinkColor** | **string** | | [optional] [default to "#00B3E6"] -**PageBackgroundColor** | **string** | | [optional] [default to "#F7F8F9"] -**PrimaryButtonColor** | **string** | | [optional] [default to "#00B3E6"] -**PrimaryButtonColorHover** | **string** | | [optional] [default to "#00B3E6"] -**PrimaryButtonTextColor** | **string** | | [optional] [default to "#FFFFFF"] -**PrimaryButtonTextColorHover** | **string** | | [optional] [default to "#FFFFFF"] -**SecondaryButtonColor** | **string** | | [optional] [default to "#FFFFFF"] -**SecondaryButtonColorHover** | **string** | | [optional] [default to "#FFFFFF"] -**SecondaryButtonTextColor** | **string** | | [optional] [default to "#00B3E6"] -**SecondaryButtonTextColorHover** | **string** | | [optional] [default to "#00B3E6"] -**TextColor1** | **string** | | [optional] [default to "#808080"] -**TextColor2** | **string** | | [optional] [default to "#FFFFFF"] -**ResetToDefault** | **bool** | Resets white labeling options to defaults. Only useful when updating an API App. | [optional] +**HeaderBackgroundColor** | **string** | | [optional] [default to "#1A1A1A"]**LegalVersion** | **string** | | [optional] [default to LegalVersionEnum.Terms1]**LinkColor** | **string** | | [optional] [default to "#00B3E6"]**PageBackgroundColor** | **string** | | [optional] [default to "#F7F8F9"]**PrimaryButtonColor** | **string** | | [optional] [default to "#00B3E6"]**PrimaryButtonColorHover** | **string** | | [optional] [default to "#00B3E6"]**PrimaryButtonTextColor** | **string** | | [optional] [default to "#FFFFFF"]**PrimaryButtonTextColorHover** | **string** | | [optional] [default to "#FFFFFF"]**SecondaryButtonColor** | **string** | | [optional] [default to "#FFFFFF"]**SecondaryButtonColorHover** | **string** | | [optional] [default to "#FFFFFF"]**SecondaryButtonTextColor** | **string** | | [optional] [default to "#00B3E6"]**SecondaryButtonTextColorHover** | **string** | | [optional] [default to "#00B3E6"]**TextColor1** | **string** | | [optional] [default to "#808080"]**TextColor2** | **string** | | [optional] [default to "#FFFFFF"]**ResetToDefault** | **bool** | Resets white labeling options to defaults. Only useful when updating an API App. | [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/TeamAddMemberRequest.md b/sdks/dotnet/docs/TeamAddMemberRequest.md index 89478f0f0..878edbb50 100644 --- a/sdks/dotnet/docs/TeamAddMemberRequest.md +++ b/sdks/dotnet/docs/TeamAddMemberRequest.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | `account_id` or `email_address` is required. If both are provided, the account id prevails.

Account id of the user to invite to your Team. | [optional] -**EmailAddress** | **string** | `account_id` or `email_address` is required, If both are provided, the account id prevails.

Email address of the user to invite to your Team. | [optional] -**Role** | **string** | A role member will take in a new Team.

**NOTE:** This parameter is used only if `team_id` is provided. | [optional] +**AccountId** | **string** | `account_id` or `email_address` is required. If both are provided, the account id prevails.

Account id of the user to invite to your Team. | [optional] **EmailAddress** | **string** | `account_id` or `email_address` is required, If both are provided, the account id prevails.

Email address of the user to invite to your Team. | [optional] **Role** | **string** | A role member will take in a new Team.

**NOTE:** This parameter is used only if `team_id` is provided. | [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/TeamApi.md b/sdks/dotnet/docs/TeamApi.md index 90d89f025..64d8dd554 100644 --- a/sdks/dotnet/docs/TeamApi.md +++ b/sdks/dotnet/docs/TeamApi.md @@ -15,7 +15,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**TeamSubTeams**](TeamApi.md#teamsubteams) | **GET** /team/sub_teams/{team_id} | List Sub Teams | | [**TeamUpdate**](TeamApi.md#teamupdate) | **PUT** /team | Update Team | - + # **TeamAddMember** > TeamGetResponse TeamAddMember (TeamAddMemberRequest teamAddMemberRequest, string? teamId = null) @@ -113,7 +113,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TeamCreate** > TeamGetResponse TeamCreate (TeamCreateRequest teamCreateRequest) @@ -210,7 +210,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TeamDelete** > void TeamDelete () @@ -295,7 +295,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TeamGet** > TeamGetResponse TeamGet () @@ -384,7 +384,7 @@ This endpoint does not need any parameter. [[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) - + # **TeamInfo** > TeamGetInfoResponse TeamInfo (string? teamId = null) @@ -477,7 +477,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TeamInvites** > TeamInvitesResponse TeamInvites (string? emailAddress = null) @@ -571,7 +571,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TeamMembers** > TeamMembersResponse TeamMembers (string teamId, int? page = null, int? pageSize = null) @@ -667,7 +667,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TeamRemoveMember** > TeamGetResponse TeamRemoveMember (TeamRemoveMemberRequest teamRemoveMemberRequest) @@ -765,7 +765,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TeamSubTeams** > TeamSubTeamsResponse TeamSubTeams (string teamId, int? page = null, int? pageSize = null) @@ -861,7 +861,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TeamUpdate** > TeamGetResponse TeamUpdate (TeamUpdateRequest teamUpdateRequest) diff --git a/sdks/dotnet/docs/TeamGetInfoResponse.md b/sdks/dotnet/docs/TeamGetInfoResponse.md index bacc7995c..b0f876e55 100644 --- a/sdks/dotnet/docs/TeamGetInfoResponse.md +++ b/sdks/dotnet/docs/TeamGetInfoResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Team** | [**TeamInfoResponse**](TeamInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Team** | [**TeamInfoResponse**](TeamInfoResponse.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/TeamGetResponse.md b/sdks/dotnet/docs/TeamGetResponse.md index 45046b1e1..a3a82936a 100644 --- a/sdks/dotnet/docs/TeamGetResponse.md +++ b/sdks/dotnet/docs/TeamGetResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Team** | [**TeamResponse**](TeamResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Team** | [**TeamResponse**](TeamResponse.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/TeamInfoResponse.md b/sdks/dotnet/docs/TeamInfoResponse.md index ac3a4e8fc..8f487d8bf 100644 --- a/sdks/dotnet/docs/TeamInfoResponse.md +++ b/sdks/dotnet/docs/TeamInfoResponse.md @@ -4,11 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TeamId** | **string** | The id of a team | [optional] -**TeamParent** | [**TeamParentResponse**](TeamParentResponse.md) | | [optional] -**Name** | **string** | The name of a team | [optional] -**NumMembers** | **int** | Number of members within a team | [optional] -**NumSubTeams** | **int** | Number of sub teams within a team | [optional] +**TeamId** | **string** | The id of a team | [optional] **TeamParent** | [**TeamParentResponse**](TeamParentResponse.md) | | [optional] **Name** | **string** | The name of a team | [optional] **NumMembers** | **int** | Number of members within a team | [optional] **NumSubTeams** | **int** | Number of sub teams within a team | [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/TeamInviteResponse.md b/sdks/dotnet/docs/TeamInviteResponse.md index 125800019..ed0e48ba2 100644 --- a/sdks/dotnet/docs/TeamInviteResponse.md +++ b/sdks/dotnet/docs/TeamInviteResponse.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EmailAddress** | **string** | Email address of the user invited to this team. | [optional] -**TeamId** | **string** | Id of the team. | [optional] -**Role** | **string** | Role of the user invited to this team. | [optional] -**SentAt** | **int** | Timestamp when the invitation was sent. | [optional] -**RedeemedAt** | **int** | Timestamp when the invitation was redeemed. | [optional] -**ExpiresAt** | **int** | Timestamp when the invitation is expiring. | [optional] +**EmailAddress** | **string** | Email address of the user invited to this team. | [optional] **TeamId** | **string** | Id of the team. | [optional] **Role** | **string** | Role of the user invited to this team. | [optional] **SentAt** | **int** | Timestamp when the invitation was sent. | [optional] **RedeemedAt** | **int** | Timestamp when the invitation was redeemed. | [optional] **ExpiresAt** | **int** | Timestamp when the invitation is expiring. | [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/TeamInvitesResponse.md b/sdks/dotnet/docs/TeamInvitesResponse.md index ffc82c408..393ff7113 100644 --- a/sdks/dotnet/docs/TeamInvitesResponse.md +++ b/sdks/dotnet/docs/TeamInvitesResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TeamInvites** | [**List<TeamInviteResponse>**](TeamInviteResponse.md) | Contains a list of team invites and their roles. | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] +**TeamInvites** | [**List<TeamInviteResponse>**](TeamInviteResponse.md) | Contains a list of team invites and their roles. | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/TeamMemberResponse.md b/sdks/dotnet/docs/TeamMemberResponse.md index dde526641..d8f0e5d00 100644 --- a/sdks/dotnet/docs/TeamMemberResponse.md +++ b/sdks/dotnet/docs/TeamMemberResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | Account id of the team member. | [optional] -**EmailAddress** | **string** | Email address of the team member. | [optional] -**Role** | **string** | The specific role a member has on the team. | [optional] +**AccountId** | **string** | Account id of the team member. | [optional] **EmailAddress** | **string** | Email address of the team member. | [optional] **Role** | **string** | The specific role a member has on the team. | [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/TeamMembersResponse.md b/sdks/dotnet/docs/TeamMembersResponse.md index fd51ffe8e..654933542 100644 --- a/sdks/dotnet/docs/TeamMembersResponse.md +++ b/sdks/dotnet/docs/TeamMembersResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TeamMembers** | [**List<TeamMemberResponse>**](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] +**TeamMembers** | [**List<TeamMemberResponse>**](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/TeamParentResponse.md b/sdks/dotnet/docs/TeamParentResponse.md index 56bd35be7..6db34d85e 100644 --- a/sdks/dotnet/docs/TeamParentResponse.md +++ b/sdks/dotnet/docs/TeamParentResponse.md @@ -5,8 +5,7 @@ Information about the parent team if a team has one, set to `null` otherwise. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TeamId** | **string** | The id of a team | [optional] -**Name** | **string** | The name of a team | [optional] +**TeamId** | **string** | The id of a team | [optional] **Name** | **string** | The name of a team | [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/TeamRemoveMemberRequest.md b/sdks/dotnet/docs/TeamRemoveMemberRequest.md index bc227b9fd..475caf0b9 100644 --- a/sdks/dotnet/docs/TeamRemoveMemberRequest.md +++ b/sdks/dotnet/docs/TeamRemoveMemberRequest.md @@ -4,11 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Account id to remove from your Team. | [optional] -**EmailAddress** | **string** | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Email address of the Account to remove from your Team. | [optional] -**NewOwnerEmailAddress** | **string** | The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account.

**NOTE:** Only available for Enterprise plans. | [optional] -**NewTeamId** | **string** | Id of the new Team. | [optional] -**NewRole** | **string** | A new role member will take in a new Team.

**NOTE:** This parameter is used only if `new_team_id` is provided. | [optional] +**AccountId** | **string** | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Account id to remove from your Team. | [optional] **EmailAddress** | **string** | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Email address of the Account to remove from your Team. | [optional] **NewOwnerEmailAddress** | **string** | The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account.

**NOTE:** Only available for Enterprise plans. | [optional] **NewTeamId** | **string** | Id of the new Team. | [optional] **NewRole** | **string** | A new role member will take in a new Team.

**NOTE:** This parameter is used only if `new_team_id` is provided. | [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/TeamResponse.md b/sdks/dotnet/docs/TeamResponse.md index e8a14f5b6..977696c0a 100644 --- a/sdks/dotnet/docs/TeamResponse.md +++ b/sdks/dotnet/docs/TeamResponse.md @@ -5,10 +5,7 @@ Contains information about your team and its members Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of your Team | [optional] -**Accounts** | [**List<AccountResponse>**](AccountResponse.md) | | [optional] -**InvitedAccounts** | [**List<AccountResponse>**](AccountResponse.md) | A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. | [optional] -**InvitedEmails** | **List<string>** | A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. | [optional] +**Name** | **string** | The name of your Team | [optional] **Accounts** | [**List<AccountResponse>**](AccountResponse.md) | | [optional] **InvitedAccounts** | [**List<AccountResponse>**](AccountResponse.md) | A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. | [optional] **InvitedEmails** | **List<string>** | A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. | [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/TeamSubTeamsResponse.md b/sdks/dotnet/docs/TeamSubTeamsResponse.md index 41faf831a..f25e02688 100644 --- a/sdks/dotnet/docs/TeamSubTeamsResponse.md +++ b/sdks/dotnet/docs/TeamSubTeamsResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SubTeams** | [**List<SubTeamResponse>**](SubTeamResponse.md) | Contains a list with sub teams. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] +**SubTeams** | [**List<SubTeamResponse>**](SubTeamResponse.md) | Contains a list with sub teams. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/TemplateAddUserRequest.md b/sdks/dotnet/docs/TemplateAddUserRequest.md index 059dc1ea0..8fd19bc62 100644 --- a/sdks/dotnet/docs/TemplateAddUserRequest.md +++ b/sdks/dotnet/docs/TemplateAddUserRequest.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The id of the Account to give access to the Template.
**NOTE:** The account id prevails if email address is also provided. | [optional] -**EmailAddress** | **string** | The email address of the Account to give access to the Template.
**NOTE:** The account id prevails if it is also provided. | [optional] -**SkipNotification** | **bool** | If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. | [optional] [default to false] +**AccountId** | **string** | The id of the Account to give access to the Template.
**NOTE:** The account id prevails if email address is also provided. | [optional] **EmailAddress** | **string** | The email address of the Account to give access to the Template.
**NOTE:** The account id prevails if it is also provided. | [optional] **SkipNotification** | **bool** | If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/TemplateApi.md b/sdks/dotnet/docs/TemplateApi.md index 60384f66a..2f6cf986c 100644 --- a/sdks/dotnet/docs/TemplateApi.md +++ b/sdks/dotnet/docs/TemplateApi.md @@ -16,7 +16,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**TemplateRemoveUser**](TemplateApi.md#templateremoveuser) | **POST** /template/remove_user/{template_id} | Remove User from Template | | [**TemplateUpdateFiles**](TemplateApi.md#templateupdatefiles) | **POST** /template/update_files/{template_id} | Update Template Files | - + # **TemplateAddUser** > TemplateGetResponse TemplateAddUser (string templateId, TemplateAddUserRequest templateAddUserRequest) @@ -116,7 +116,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TemplateCreate** > TemplateCreateResponse TemplateCreate (TemplateCreateRequest templateCreateRequest) @@ -256,7 +256,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TemplateCreateEmbeddedDraft** > TemplateCreateEmbeddedDraftResponse TemplateCreateEmbeddedDraft (TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) @@ -396,7 +396,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TemplateDelete** > void TemplateDelete (string templateId) @@ -487,7 +487,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TemplateFiles** > System.IO.Stream TemplateFiles (string templateId, string? fileType = null) @@ -587,7 +587,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TemplateFilesAsDataUri** > FileResponseDataUri TemplateFilesAsDataUri (string templateId) @@ -682,7 +682,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TemplateFilesAsFileUrl** > FileResponse TemplateFilesAsFileUrl (string templateId, int? forceDownload = null) @@ -778,7 +778,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TemplateGet** > TemplateGetResponse TemplateGet (string templateId) @@ -873,7 +873,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TemplateList** > TemplateListResponse TemplateList (string? accountId = null, int? page = null, int? pageSize = null, string? query = null) @@ -971,7 +971,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TemplateRemoveUser** > TemplateGetResponse TemplateRemoveUser (string templateId, TemplateRemoveUserRequest templateRemoveUserRequest) @@ -1071,7 +1071,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **TemplateUpdateFiles** > TemplateUpdateFilesResponse TemplateUpdateFiles (string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) diff --git a/sdks/dotnet/docs/TemplateCreateEmbeddedDraftRequest.md b/sdks/dotnet/docs/TemplateCreateEmbeddedDraftRequest.md index 0ce33cb02..299d6feef 100644 --- a/sdks/dotnet/docs/TemplateCreateEmbeddedDraftRequest.md +++ b/sdks/dotnet/docs/TemplateCreateEmbeddedDraftRequest.md @@ -4,31 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. | -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. | [optional] [default to true] -**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [optional] [default to false] -**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] -**CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request | [optional] -**EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] -**FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] -**ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false] -**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false] -**FormFieldGroups** | [**List<SubFormFieldGroup>**](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | [optional] -**FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] -**FormFieldsPerDocument** | [**List<SubFormFieldsPerDocumentBase>**](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | [optional] -**MergeFields** | [**List<SubMergeField>**](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | [optional] -**Message** | **string** | The default template email message. | [optional] -**Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] -**ShowPreview** | **bool** | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | [optional] [default to false] -**ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true] -**SignerRoles** | [**List<SubTemplateRole>**](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | [optional] -**SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false] -**Subject** | **string** | The template title (alias). | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] -**UsePreexistingFields** | **bool** | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [optional] [default to false] +**ClientId** | **string** | Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. | **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. | [optional] [default to true]**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [optional] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request | [optional] **EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false]**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false]**FormFieldGroups** | [**List<SubFormFieldGroup>**](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **FormFieldsPerDocument** | [**List<SubFormFieldsPerDocumentBase>**](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | [optional] **MergeFields** | [**List<SubMergeField>**](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | [optional] **Message** | **string** | The default template email message. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **ShowPreview** | **bool** | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | [optional] [default to false]**ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true]**SignerRoles** | [**List<SubTemplateRole>**](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | [optional] **SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false]**Subject** | **string** | The template title (alias). | [optional] **TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **UsePreexistingFields** | **bool** | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/TemplateCreateEmbeddedDraftResponse.md b/sdks/dotnet/docs/TemplateCreateEmbeddedDraftResponse.md index cf5a67512..b3a03c05a 100644 --- a/sdks/dotnet/docs/TemplateCreateEmbeddedDraftResponse.md +++ b/sdks/dotnet/docs/TemplateCreateEmbeddedDraftResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Template** | [**TemplateCreateEmbeddedDraftResponseTemplate**](TemplateCreateEmbeddedDraftResponseTemplate.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Template** | [**TemplateCreateEmbeddedDraftResponseTemplate**](TemplateCreateEmbeddedDraftResponseTemplate.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/TemplateCreateEmbeddedDraftResponseTemplate.md b/sdks/dotnet/docs/TemplateCreateEmbeddedDraftResponseTemplate.md index 0e1309198..d23893dd3 100644 --- a/sdks/dotnet/docs/TemplateCreateEmbeddedDraftResponseTemplate.md +++ b/sdks/dotnet/docs/TemplateCreateEmbeddedDraftResponseTemplate.md @@ -5,10 +5,7 @@ Template object with parameters: `template_id`, `edit_url`, `expires_at`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateId** | **string** | The id of the Template. | [optional] -**EditUrl** | **string** | Link to edit the template. | [optional] -**ExpiresAt** | **int** | When the link expires. | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**TemplateId** | **string** | The id of the Template. | [optional] **EditUrl** | **string** | Link to edit the template. | [optional] **ExpiresAt** | **int** | When the link expires. | [optional] **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/TemplateCreateRequest.md b/sdks/dotnet/docs/TemplateCreateRequest.md index a0e986083..9a80d0c9a 100644 --- a/sdks/dotnet/docs/TemplateCreateRequest.md +++ b/sdks/dotnet/docs/TemplateCreateRequest.md @@ -4,24 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FormFieldsPerDocument** | [**List<SubFormFieldsPerDocumentBase>**](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | -**SignerRoles** | [**List<SubTemplateRole>**](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [optional] [default to false] -**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] -**CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request | [optional] -**ClientId** | **string** | Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. | [optional] -**FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] -**FormFieldGroups** | [**List<SubFormFieldGroup>**](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | [optional] -**FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] -**MergeFields** | [**List<SubMergeField>**](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | [optional] -**Message** | **string** | The default template email message. | [optional] -**Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] -**Subject** | **string** | The template title (alias). | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] -**UsePreexistingFields** | **bool** | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [optional] [default to false] +**FormFieldsPerDocument** | [**List<SubFormFieldsPerDocumentBase>**](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | **SignerRoles** | [**List<SubTemplateRole>**](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [optional] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request | [optional] **ClientId** | **string** | Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **FormFieldGroups** | [**List<SubFormFieldGroup>**](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **MergeFields** | [**List<SubMergeField>**](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | [optional] **Message** | **string** | The default template email message. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **Subject** | **string** | The template title (alias). | [optional] **TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **UsePreexistingFields** | **bool** | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/TemplateCreateResponse.md b/sdks/dotnet/docs/TemplateCreateResponse.md index cbd87a781..75bab14de 100644 --- a/sdks/dotnet/docs/TemplateCreateResponse.md +++ b/sdks/dotnet/docs/TemplateCreateResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Template** | [**TemplateCreateResponseTemplate**](TemplateCreateResponseTemplate.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Template** | [**TemplateCreateResponseTemplate**](TemplateCreateResponseTemplate.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/TemplateEditResponse.md b/sdks/dotnet/docs/TemplateEditResponse.md index 723cdfce4..830c7a9ed 100644 --- a/sdks/dotnet/docs/TemplateEditResponse.md +++ b/sdks/dotnet/docs/TemplateEditResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateId** | **string** | The id of the Template. | [optional] +**TemplateId** | **string** | The id of the Template. | [[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/TemplateGetResponse.md b/sdks/dotnet/docs/TemplateGetResponse.md index ee781ceb5..7a301e17d 100644 --- a/sdks/dotnet/docs/TemplateGetResponse.md +++ b/sdks/dotnet/docs/TemplateGetResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Template** | [**TemplateResponse**](TemplateResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Template** | [**TemplateResponse**](TemplateResponse.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/TemplateListResponse.md b/sdks/dotnet/docs/TemplateListResponse.md index b5bb9aa96..7bb37dc6b 100644 --- a/sdks/dotnet/docs/TemplateListResponse.md +++ b/sdks/dotnet/docs/TemplateListResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Templates** | [**List<TemplateResponse>**](TemplateResponse.md) | List of templates that the API caller has access to. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Templates** | [**List<TemplateResponse>**](TemplateResponse.md) | List of templates that the API caller has access to. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.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/TemplateRemoveUserRequest.md b/sdks/dotnet/docs/TemplateRemoveUserRequest.md index 1e2280fbc..98922e5b7 100644 --- a/sdks/dotnet/docs/TemplateRemoveUserRequest.md +++ b/sdks/dotnet/docs/TemplateRemoveUserRequest.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | [optional] -**EmailAddress** | **string** | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | [optional] +**AccountId** | **string** | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | [optional] **EmailAddress** | **string** | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | [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/TemplateResponse.md b/sdks/dotnet/docs/TemplateResponse.md index f25de6a77..ce17e3777 100644 --- a/sdks/dotnet/docs/TemplateResponse.md +++ b/sdks/dotnet/docs/TemplateResponse.md @@ -5,21 +5,7 @@ Contains information about the templates you and your team have created. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateId** | **string** | The id of the Template. | [optional] -**Title** | **string** | The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | [optional] -**Message** | **string** | The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | [optional] -**UpdatedAt** | **int** | Time the template was last updated. | [optional] -**IsEmbedded** | **bool?** | `true` if this template was created using an embedded flow, `false` if it was created on our website. | [optional] -**IsCreator** | **bool?** | `true` if you are the owner of this template, `false` if it's been shared with you by a team member. | [optional] -**CanEdit** | **bool?** | Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). | [optional] -**IsLocked** | **bool?** | Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. | [optional] -**Metadata** | **Object** | The metadata attached to the template. | [optional] -**SignerRoles** | [**List<TemplateResponseSignerRole>**](TemplateResponseSignerRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | [optional] -**CcRoles** | [**List<TemplateResponseCCRole>**](TemplateResponseCCRole.md) | An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. | [optional] -**Documents** | [**List<TemplateResponseDocument>**](TemplateResponseDocument.md) | An array describing each document associated with this Template. Includes form field data for each document. | [optional] -**CustomFields** | [**List<TemplateResponseDocumentCustomFieldBase>**](TemplateResponseDocumentCustomFieldBase.md) | Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | [optional] -**NamedFormFields** | [**List<TemplateResponseDocumentFormFieldBase>**](TemplateResponseDocumentFormFieldBase.md) | Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | [optional] -**Accounts** | [**List<TemplateResponseAccount>**](TemplateResponseAccount.md) | An array of the Accounts that can use this Template. | [optional] +**TemplateId** | **string** | The id of the Template. | [optional] **Title** | **string** | The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | [optional] **Message** | **string** | The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | [optional] **UpdatedAt** | **int** | Time the template was last updated. | [optional] **IsEmbedded** | **bool?** | `true` if this template was created using an embedded flow, `false` if it was created on our website. | [optional] **IsCreator** | **bool?** | `true` if you are the owner of this template, `false` if it's been shared with you by a team member. | [optional] **CanEdit** | **bool?** | Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). | [optional] **IsLocked** | **bool?** | Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. | [optional] **Metadata** | **Object** | The metadata attached to the template. | [optional] **SignerRoles** | [**List<TemplateResponseSignerRole>**](TemplateResponseSignerRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | [optional] **CcRoles** | [**List<TemplateResponseCCRole>**](TemplateResponseCCRole.md) | An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. | [optional] **Documents** | [**List<TemplateResponseDocument>**](TemplateResponseDocument.md) | An array describing each document associated with this Template. Includes form field data for each document. | [optional] **CustomFields** | [**List<TemplateResponseDocumentCustomFieldBase>**](TemplateResponseDocumentCustomFieldBase.md) | Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | [optional] **NamedFormFields** | [**List<TemplateResponseDocumentFormFieldBase>**](TemplateResponseDocumentFormFieldBase.md) | Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | [optional] **Accounts** | [**List<TemplateResponseAccount>**](TemplateResponseAccount.md) | An array of the Accounts that can use this Template. | [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/TemplateResponseAccount.md b/sdks/dotnet/docs/TemplateResponseAccount.md index 8713247ee..b69b4ebaa 100644 --- a/sdks/dotnet/docs/TemplateResponseAccount.md +++ b/sdks/dotnet/docs/TemplateResponseAccount.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The id of the Account. | [optional] -**EmailAddress** | **string** | The email address associated with the Account. | [optional] -**IsLocked** | **bool** | Returns `true` if the user has been locked out of their account by a team admin. | [optional] -**IsPaidHs** | **bool** | Returns `true` if the user has a paid Dropbox Sign account. | [optional] -**IsPaidHf** | **bool** | Returns `true` if the user has a paid HelloFax account. | [optional] -**Quotas** | [**TemplateResponseAccountQuota**](TemplateResponseAccountQuota.md) | | [optional] +**AccountId** | **string** | The id of the Account. | [optional] **EmailAddress** | **string** | The email address associated with the Account. | [optional] **IsLocked** | **bool** | Returns `true` if the user has been locked out of their account by a team admin. | [optional] **IsPaidHs** | **bool** | Returns `true` if the user has a paid Dropbox Sign account. | [optional] **IsPaidHf** | **bool** | Returns `true` if the user has a paid HelloFax account. | [optional] **Quotas** | [**TemplateResponseAccountQuota**](TemplateResponseAccountQuota.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/TemplateResponseAccountQuota.md b/sdks/dotnet/docs/TemplateResponseAccountQuota.md index c57a271f1..5051dc54f 100644 --- a/sdks/dotnet/docs/TemplateResponseAccountQuota.md +++ b/sdks/dotnet/docs/TemplateResponseAccountQuota.md @@ -5,10 +5,7 @@ An array of the designated CC roles that must be specified when sending a Signat Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplatesLeft** | **int** | API templates remaining. | [optional] -**ApiSignatureRequestsLeft** | **int** | API signature requests remaining. | [optional] -**DocumentsLeft** | **int** | Signature requests remaining. | [optional] -**SmsVerificationsLeft** | **int** | SMS verifications remaining. | [optional] +**TemplatesLeft** | **int** | API templates remaining. | [optional] **ApiSignatureRequestsLeft** | **int** | API signature requests remaining. | [optional] **DocumentsLeft** | **int** | Signature requests remaining. | [optional] **SmsVerificationsLeft** | **int** | SMS verifications remaining. | [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/TemplateResponseDocument.md b/sdks/dotnet/docs/TemplateResponseDocument.md index 09b0716a6..6847d7b3c 100644 --- a/sdks/dotnet/docs/TemplateResponseDocument.md +++ b/sdks/dotnet/docs/TemplateResponseDocument.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | Name of the associated file. | [optional] -**Index** | **int** | Document ordering, the lowest index is displayed first and the highest last (0-based indexing). | [optional] -**FieldGroups** | [**List<TemplateResponseDocumentFieldGroup>**](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | [optional] -**FormFields** | [**List<TemplateResponseDocumentFormFieldBase>**](TemplateResponseDocumentFormFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | [optional] -**CustomFields** | [**List<TemplateResponseDocumentCustomFieldBase>**](TemplateResponseDocumentCustomFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | [optional] -**StaticFields** | [**List<TemplateResponseDocumentStaticFieldBase>**](TemplateResponseDocumentStaticFieldBase.md) | An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. | [optional] +**Name** | **string** | Name of the associated file. | [optional] **Index** | **int** | Document ordering, the lowest index is displayed first and the highest last (0-based indexing). | [optional] **FieldGroups** | [**List<TemplateResponseDocumentFieldGroup>**](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | [optional] **FormFields** | [**List<TemplateResponseDocumentFormFieldBase>**](TemplateResponseDocumentFormFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | [optional] **CustomFields** | [**List<TemplateResponseDocumentCustomFieldBase>**](TemplateResponseDocumentCustomFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | [optional] **StaticFields** | [**List<TemplateResponseDocumentStaticFieldBase>**](TemplateResponseDocumentStaticFieldBase.md) | An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. | [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/TemplateResponseDocumentCustomFieldBase.md b/sdks/dotnet/docs/TemplateResponseDocumentCustomFieldBase.md index 6aba80b59..9f349a7ab 100644 --- a/sdks/dotnet/docs/TemplateResponseDocumentCustomFieldBase.md +++ b/sdks/dotnet/docs/TemplateResponseDocumentCustomFieldBase.md @@ -5,16 +5,7 @@ An array of Form Field objects containing the name and type of each named field. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | -**ApiId** | **string** | The unique ID for this field. | [optional] -**Name** | **string** | The name of the Custom Field. | [optional] -**Signer** | **string** | The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). | [optional] -**X** | **int** | The horizontal offset in pixels for this form field. | [optional] -**Y** | **int** | The vertical offset in pixels for this form field. | [optional] -**Width** | **int** | The width in pixels of this form field. | [optional] -**Height** | **int** | The height in pixels of this form field. | [optional] -**Required** | **bool** | Boolean showing whether or not this field is required. | [optional] -**Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null`. | [optional] +**Type** | **string** | | **ApiId** | **string** | The unique ID for this field. | [optional] **Name** | **string** | The name of the Custom Field. | [optional] **Signer** | **string** | The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). | [optional] **X** | **int** | The horizontal offset in pixels for this form field. | [optional] **Y** | **int** | The vertical offset in pixels for this form field. | [optional] **Width** | **int** | The width in pixels of this form field. | [optional] **Height** | **int** | The height in pixels of this form field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null`. | [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/TemplateResponseDocumentCustomFieldText.md b/sdks/dotnet/docs/TemplateResponseDocumentCustomFieldText.md index 4a63e9dd3..8db16365b 100644 --- a/sdks/dotnet/docs/TemplateResponseDocumentCustomFieldText.md +++ b/sdks/dotnet/docs/TemplateResponseDocumentCustomFieldText.md @@ -14,11 +14,7 @@ Name | Type | Description | Notes **Height** | **int** | The height in pixels of this form field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null`. | [optional] -**Type** | **string** | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to "text"] -**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] -**IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] -**OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] -**FontFamily** | **string** | Font family used in this form field's text. | [optional] +**Type** | **string** | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to "text"]**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] **IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] **OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] **FontFamily** | **string** | Font family used in this form field's text. | [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/TemplateResponseDocumentFieldGroup.md b/sdks/dotnet/docs/TemplateResponseDocumentFieldGroup.md index a1e7f000d..0dfac711c 100644 --- a/sdks/dotnet/docs/TemplateResponseDocumentFieldGroup.md +++ b/sdks/dotnet/docs/TemplateResponseDocumentFieldGroup.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the form field group. | [optional] -**Rule** | [**TemplateResponseDocumentFieldGroupRule**](TemplateResponseDocumentFieldGroupRule.md) | | [optional] +**Name** | **string** | The name of the form field group. | [optional] **Rule** | [**TemplateResponseDocumentFieldGroupRule**](TemplateResponseDocumentFieldGroupRule.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/TemplateResponseDocumentFieldGroupRule.md b/sdks/dotnet/docs/TemplateResponseDocumentFieldGroupRule.md index 0a92e924b..44dd2eb4a 100644 --- a/sdks/dotnet/docs/TemplateResponseDocumentFieldGroupRule.md +++ b/sdks/dotnet/docs/TemplateResponseDocumentFieldGroupRule.md @@ -5,8 +5,7 @@ The rule used to validate checkboxes in the form field group. See [checkbox fiel Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Requirement** | **string** | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | [optional] -**GroupLabel** | **string** | Name of the group | [optional] +**Requirement** | **string** | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | [optional] **GroupLabel** | **string** | Name of the group | [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/TemplateResponseDocumentFormFieldBase.md b/sdks/dotnet/docs/TemplateResponseDocumentFormFieldBase.md index 74429bf89..0e941c7ec 100644 --- a/sdks/dotnet/docs/TemplateResponseDocumentFormFieldBase.md +++ b/sdks/dotnet/docs/TemplateResponseDocumentFormFieldBase.md @@ -5,16 +5,7 @@ An array of Form Field objects containing the name and type of each named field. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | -**ApiId** | **string** | A unique id for the form field. | [optional] -**Name** | **string** | The name of the form field. | [optional] -**Signer** | **string** | The signer of the Form Field. | [optional] -**X** | **int** | The horizontal offset in pixels for this form field. | [optional] -**Y** | **int** | The vertical offset in pixels for this form field. | [optional] -**Width** | **int** | The width in pixels of this form field. | [optional] -**Height** | **int** | The height in pixels of this form field. | [optional] -**Required** | **bool** | Boolean showing whether or not this field is required. | [optional] -**Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | [optional] +**Type** | **string** | | **ApiId** | **string** | A unique id for the form field. | [optional] **Name** | **string** | The name of the form field. | [optional] **Signer** | **string** | The signer of the Form Field. | [optional] **X** | **int** | The horizontal offset in pixels for this form field. | [optional] **Y** | **int** | The vertical offset in pixels for this form field. | [optional] **Width** | **int** | The width in pixels of this form field. | [optional] **Height** | **int** | The height in pixels of this form field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | [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/TemplateResponseDocumentFormFieldHyperlink.md b/sdks/dotnet/docs/TemplateResponseDocumentFormFieldHyperlink.md index 125ba1d60..c5dc34e1f 100644 --- a/sdks/dotnet/docs/TemplateResponseDocumentFormFieldHyperlink.md +++ b/sdks/dotnet/docs/TemplateResponseDocumentFormFieldHyperlink.md @@ -14,11 +14,7 @@ Name | Type | Description | Notes **Height** | **int** | The height in pixels of this form field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | [optional] -**Type** | **string** | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "hyperlink"] -**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] -**IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] -**OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] -**FontFamily** | **string** | Font family used in this form field's text. | [optional] +**Type** | **string** | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "hyperlink"]**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] **IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] **OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] **FontFamily** | **string** | Font family used in this form field's text. | [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/TemplateResponseDocumentFormFieldText.md b/sdks/dotnet/docs/TemplateResponseDocumentFormFieldText.md index cc0c064b2..9bcc4780e 100644 --- a/sdks/dotnet/docs/TemplateResponseDocumentFormFieldText.md +++ b/sdks/dotnet/docs/TemplateResponseDocumentFormFieldText.md @@ -14,12 +14,7 @@ Name | Type | Description | Notes **Height** | **int** | The height in pixels of this form field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | [optional] -**Type** | **string** | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "text"] -**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] -**IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] -**OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] -**FontFamily** | **string** | Font family used in this form field's text. | [optional] -**ValidationType** | **string** | Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. | [optional] +**Type** | **string** | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "text"]**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] **IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] **OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] **FontFamily** | **string** | Font family used in this form field's text. | [optional] **ValidationType** | **string** | Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. | [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/TemplateResponseDocumentStaticFieldBase.md b/sdks/dotnet/docs/TemplateResponseDocumentStaticFieldBase.md index 4af001900..b147460c8 100644 --- a/sdks/dotnet/docs/TemplateResponseDocumentStaticFieldBase.md +++ b/sdks/dotnet/docs/TemplateResponseDocumentStaticFieldBase.md @@ -5,16 +5,7 @@ An array describing static overlay fields. **NOTE:** Only available for certain Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | -**ApiId** | **string** | A unique id for the static field. | [optional] -**Name** | **string** | The name of the static field. | [optional] -**Signer** | **string** | The signer of the Static Field. | [optional] [default to "me_now"] -**X** | **int** | The horizontal offset in pixels for this static field. | [optional] -**Y** | **int** | The vertical offset in pixels for this static field. | [optional] -**Width** | **int** | The width in pixels of this static field. | [optional] -**Height** | **int** | The height in pixels of this static field. | [optional] -**Required** | **bool** | Boolean showing whether or not this field is required. | [optional] -**Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null`. | [optional] +**Type** | **string** | | **ApiId** | **string** | A unique id for the static field. | [optional] **Name** | **string** | The name of the static field. | [optional] **Signer** | **string** | The signer of the Static Field. | [optional] [default to "me_now"]**X** | **int** | The horizontal offset in pixels for this static field. | [optional] **Y** | **int** | The vertical offset in pixels for this static field. | [optional] **Width** | **int** | The width in pixels of this static field. | [optional] **Height** | **int** | The height in pixels of this static field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null`. | [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/TemplateResponseFieldAvgTextLength.md b/sdks/dotnet/docs/TemplateResponseFieldAvgTextLength.md index 7909e61bb..a2773f068 100644 --- a/sdks/dotnet/docs/TemplateResponseFieldAvgTextLength.md +++ b/sdks/dotnet/docs/TemplateResponseFieldAvgTextLength.md @@ -5,8 +5,7 @@ Average text length in this field. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NumLines** | **int** | Number of lines. | [optional] -**NumCharsPerLine** | **int** | Number of characters per line. | [optional] +**NumLines** | **int** | Number of lines. | [optional] **NumCharsPerLine** | **int** | Number of characters per line. | [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/TemplateResponseSignerRole.md b/sdks/dotnet/docs/TemplateResponseSignerRole.md index 20be54cd8..ddead2a48 100644 --- a/sdks/dotnet/docs/TemplateResponseSignerRole.md +++ b/sdks/dotnet/docs/TemplateResponseSignerRole.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the Role. | [optional] -**Order** | **int** | If signer order is assigned this is the 0-based index for this role. | [optional] +**Name** | **string** | The name of the Role. | [optional] **Order** | **int** | If signer order is assigned this is the 0-based index for this role. | [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/TemplateUpdateFilesRequest.md b/sdks/dotnet/docs/TemplateUpdateFilesRequest.md index 77529c03e..ddaaac690 100644 --- a/sdks/dotnet/docs/TemplateUpdateFilesRequest.md +++ b/sdks/dotnet/docs/TemplateUpdateFilesRequest.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app you're using to update this template. | [optional] -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to use for the template.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**Message** | **string** | The new default template email message. | [optional] -**Subject** | **string** | The new default template email subject. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] +**ClientId** | **string** | Client id of the app you're using to update this template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to use for the template.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **Message** | **string** | The new default template email message. | [optional] **Subject** | **string** | The new default template email subject. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/TemplateUpdateFilesResponse.md b/sdks/dotnet/docs/TemplateUpdateFilesResponse.md index 5bd4210ef..8ff710ea7 100644 --- a/sdks/dotnet/docs/TemplateUpdateFilesResponse.md +++ b/sdks/dotnet/docs/TemplateUpdateFilesResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Template** | [**TemplateUpdateFilesResponseTemplate**](TemplateUpdateFilesResponseTemplate.md) | | [optional] +**Template** | [**TemplateUpdateFilesResponseTemplate**](TemplateUpdateFilesResponseTemplate.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/TemplateUpdateFilesResponseTemplate.md b/sdks/dotnet/docs/TemplateUpdateFilesResponseTemplate.md index 34756c32f..390961e68 100644 --- a/sdks/dotnet/docs/TemplateUpdateFilesResponseTemplate.md +++ b/sdks/dotnet/docs/TemplateUpdateFilesResponseTemplate.md @@ -5,8 +5,7 @@ Contains template id Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateId** | **string** | The id of the Template. | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**TemplateId** | **string** | The id of the Template. | [optional] **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/UnclaimedDraftApi.md b/sdks/dotnet/docs/UnclaimedDraftApi.md index 458e5d313..7d5a0e145 100644 --- a/sdks/dotnet/docs/UnclaimedDraftApi.md +++ b/sdks/dotnet/docs/UnclaimedDraftApi.md @@ -9,7 +9,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**UnclaimedDraftCreateEmbeddedWithTemplate**](UnclaimedDraftApi.md#unclaimeddraftcreateembeddedwithtemplate) | **POST** /unclaimed_draft/create_embedded_with_template | Create Embedded Unclaimed Draft with Template | | [**UnclaimedDraftEditAndResend**](UnclaimedDraftApi.md#unclaimeddrafteditandresend) | **POST** /unclaimed_draft/edit_and_resend/{signature_request_id} | Edit and Resend Unclaimed Draft | - + # **UnclaimedDraftCreate** > UnclaimedDraftCreateResponse UnclaimedDraftCreate (UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) @@ -155,7 +155,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **UnclaimedDraftCreateEmbedded** > UnclaimedDraftCreateResponse UnclaimedDraftCreateEmbedded (UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) @@ -265,7 +265,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **UnclaimedDraftCreateEmbeddedWithTemplate** > UnclaimedDraftCreateResponse UnclaimedDraftCreateEmbeddedWithTemplate (UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest) @@ -378,7 +378,7 @@ catch (ApiException e) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - + # **UnclaimedDraftEditAndResend** > UnclaimedDraftCreateResponse UnclaimedDraftEditAndResend (string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) diff --git a/sdks/dotnet/docs/UnclaimedDraftCreateEmbeddedRequest.md b/sdks/dotnet/docs/UnclaimedDraftCreateEmbeddedRequest.md index 0da15d2d5..d3bc89c77 100644 --- a/sdks/dotnet/docs/UnclaimedDraftCreateEmbeddedRequest.md +++ b/sdks/dotnet/docs/UnclaimedDraftCreateEmbeddedRequest.md @@ -4,42 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | -**RequesterEmailAddress** | **string** | The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. | -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [optional] [default to true] -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

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

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

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

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | [optional] -**HideTextTags** | **bool** | Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. | [optional] [default to false] -**HoldRequest** | **bool** | The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. | [optional] [default to false] -**IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [optional] [default to false] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] -**RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] -**ShowPreview** | **bool** | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | [optional] -**ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true] -**Signers** | [**List<SubUnclaimedDraftSigner>**](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Type** | **string** | The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. | [optional] [default to TypeEnum.RequestSignature] -**UsePreexistingFields** | **bool** | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [optional] [default to false] -**UseTextTags** | **bool** | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [optional] [default to false] -**PopulateAutoFillFields** | **bool** | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false] -**ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | [optional] +**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | **RequesterEmailAddress** | **string** | The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. | **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [optional] [default to true]**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

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

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

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

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | [optional] **HideTextTags** | **bool** | Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. | [optional] [default to false]**HoldRequest** | **bool** | The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. | [optional] [default to false]**IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] **ShowPreview** | **bool** | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | [optional] **ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true]**Signers** | [**List<SubUnclaimedDraftSigner>**](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false]**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Type** | **string** | The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. | [optional] [default to TypeEnum.RequestSignature]**UsePreexistingFields** | **bool** | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [optional] [default to false]**UseTextTags** | **bool** | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [optional] [default to false]**PopulateAutoFillFields** | **bool** | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false]**ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | [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/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md b/sdks/dotnet/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md index 1dc85f621..d5b69549f 100644 --- a/sdks/dotnet/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +++ b/sdks/dotnet/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md @@ -4,36 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | -**RequesterEmailAddress** | **string** | The email address of the user that should be designated as the requester of this draft. | -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [optional] [default to false] -**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] -**CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] -**EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] -**FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] -**Files** | **List<System.IO.Stream>** | Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | [optional] -**FileUrls** | **List<string>** | Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | [optional] -**ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false] -**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false] -**HoldRequest** | **bool** | The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. | [optional] [default to false] -**IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [optional] [default to false] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] -**PreviewOnly** | **bool** | This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor).

- `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience.

**NOTE:** This parameter overwrites `show_preview=1` (if set). | [optional] [default to false] -**RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] -**ShowPreview** | **bool** | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | [optional] [default to false] -**ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true] -**Signers** | [**List<SubUnclaimedDraftTemplateSigner>**](SubUnclaimedDraftTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] -**PopulateAutoFillFields** | **bool** | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false] -**AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [optional] [default to false] +**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | **RequesterEmailAddress** | **string** | The email address of the user that should be designated as the requester of this draft. | **TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**AllowReassign** | **bool** | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | [optional] **FileUrls** | **List<string>** | Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | [optional] **ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false]**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false]**HoldRequest** | **bool** | The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. | [optional] [default to false]**IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **PreviewOnly** | **bool** | This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor).

- `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience.

**NOTE:** This parameter overwrites `show_preview=1` (if set). | [optional] [default to false]**RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] **ShowPreview** | **bool** | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | [optional] [default to false]**ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true]**Signers** | [**List<SubUnclaimedDraftTemplateSigner>**](SubUnclaimedDraftTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false]**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **PopulateAutoFillFields** | **bool** | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [optional] [default to false]**AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/UnclaimedDraftCreateRequest.md b/sdks/dotnet/docs/UnclaimedDraftCreateRequest.md index 71ef91fc0..462e91456 100644 --- a/sdks/dotnet/docs/UnclaimedDraftCreateRequest.md +++ b/sdks/dotnet/docs/UnclaimedDraftCreateRequest.md @@ -4,30 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. | -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] -**CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] -**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | [optional] -**CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

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

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | [optional] -**HideTextTags** | **bool** | Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. | [optional] [default to false] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] -**ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true] -**Signers** | [**List<SubUnclaimedDraftSigner>**](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**UsePreexistingFields** | **bool** | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [optional] [default to false] -**UseTextTags** | **bool** | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [optional] [default to false] -**ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | [optional] +**Type** | **string** | The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. | **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] **ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

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

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | [optional] **HideTextTags** | **bool** | Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, Object>** | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | [optional] **ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true]**Signers** | [**List<SubUnclaimedDraftSigner>**](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**UsePreexistingFields** | **bool** | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [optional] [default to false]**UseTextTags** | **bool** | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [optional] [default to false]**ExpiresAt** | **int?** | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | [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/UnclaimedDraftCreateResponse.md b/sdks/dotnet/docs/UnclaimedDraftCreateResponse.md index 32584814d..97a8f57d0 100644 --- a/sdks/dotnet/docs/UnclaimedDraftCreateResponse.md +++ b/sdks/dotnet/docs/UnclaimedDraftCreateResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**UnclaimedDraft** | [**UnclaimedDraftResponse**](UnclaimedDraftResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**UnclaimedDraft** | [**UnclaimedDraftResponse**](UnclaimedDraftResponse.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/UnclaimedDraftEditAndResendRequest.md b/sdks/dotnet/docs/UnclaimedDraftEditAndResendRequest.md index 80051e3ab..330a064f4 100644 --- a/sdks/dotnet/docs/UnclaimedDraftEditAndResendRequest.md +++ b/sdks/dotnet/docs/UnclaimedDraftEditAndResendRequest.md @@ -4,14 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | -**EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] -**IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. | [optional] -**RequesterEmailAddress** | **string** | The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used. | [optional] -**RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] -**ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] +**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | **EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] **IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. | [optional] **RequesterEmailAddress** | **string** | The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used. | [optional] **RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] **ShowProgressStepper** | **bool** | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [optional] [default to true]**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/dotnet/docs/UnclaimedDraftResponse.md b/sdks/dotnet/docs/UnclaimedDraftResponse.md index d9fe7da4c..f301ff7b9 100644 --- a/sdks/dotnet/docs/UnclaimedDraftResponse.md +++ b/sdks/dotnet/docs/UnclaimedDraftResponse.md @@ -5,12 +5,7 @@ A group of documents that a user can take ownership of via the claim URL. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignatureRequestId** | **string** | The ID of the signature request that is represented by this UnclaimedDraft. | [optional] -**ClaimUrl** | **string** | The URL to be used to claim this UnclaimedDraft. | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). | [optional] -**ExpiresAt** | **int?** | When the link expires. | [optional] -**TestMode** | **bool** | Whether this is a test draft. Signature requests made from test drafts have no legal value. | [optional] +**SignatureRequestId** | **string** | The ID of the signature request that is represented by this UnclaimedDraft. | [optional] **ClaimUrl** | **string** | The URL to be used to claim this UnclaimedDraft. | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). | [optional] **ExpiresAt** | **int?** | When the link expires. | [optional] **TestMode** | **bool** | Whether this is a test draft. Signature requests made from test drafts have no legal value. | [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/WarningResponse.md b/sdks/dotnet/docs/WarningResponse.md index e5466e0cf..f44da160e 100644 --- a/sdks/dotnet/docs/WarningResponse.md +++ b/sdks/dotnet/docs/WarningResponse.md @@ -5,8 +5,7 @@ A list of warnings. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**WarningMsg** | **string** | Warning message | -**WarningName** | **string** | Warning name | +**WarningMsg** | **string** | Warning message | **WarningName** | **string** | Warning name | [[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/openapi-config.yaml b/sdks/dotnet/openapi-config.yaml index b8a7b6d7a..ec94ff7bc 100644 --- a/sdks/dotnet/openapi-config.yaml +++ b/sdks/dotnet/openapi-config.yaml @@ -1,16 +1,19 @@ -generatorName: csharp-netcore +generatorName: csharp additionalProperties: - clientPackage: Dropbox.Sign.Api + clientPackage: Client packageName: Dropbox.Sign packageAuthors: Dropbox Sign API Team packageCompany: Dropbox Sign API Team + packageCopyright: Dropbox 2024 packageDescription: Client library for using the Dropbox Sign API - packageVersion: 1.5-dev + packageVersion: 1.6-dev packageTitle: Dropbox Sign .Net SDK sortModelPropertiesByRequiredFlag: true optionalEmitDefaultValues: true targetFramework: net6.0 packageGuid: "{F8C8232D-7020-4603-8E04-18D060AE530B}" + legacyDiscriminatorBehavior: true + useCustomTemplateCode: true files: EventCallbackHelper.cs: templateType: SupportingFiles diff --git a/sdks/dotnet/run-build b/sdks/dotnet/run-build index 01f458f5d..d928df3e1 100755 --- a/sdks/dotnet/run-build +++ b/sdks/dotnet/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/522a5df24ab2424dcd6e4e28393000045e3ea39e/modules/openapi-generator/src/main/resources/csharp-netcore +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/csharp set -e @@ -9,7 +9,7 @@ WORKING_DIR="/app/dotnet" docker run --rm \ -v "${DIR}/:/local" \ - openapitools/openapi-generator-cli:v6.0.0 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ @@ -48,3 +48,4 @@ printf "Running tests ...\n" bash "${DIR}/bin/dotnet" dotnet test src/Dropbox.Sign.Test/ printf "Success!\n" + diff --git a/sdks/dotnet/src/Dropbox.Sign.Test/Api/ApiAppApiTests.cs b/sdks/dotnet/src/Dropbox.Sign.Test/Api/ApiAppApiTests.cs index e9a3e6333..a20533479 100644 --- a/sdks/dotnet/src/Dropbox.Sign.Test/Api/ApiAppApiTests.cs +++ b/sdks/dotnet/src/Dropbox.Sign.Test/Api/ApiAppApiTests.cs @@ -43,7 +43,7 @@ public void ApiAppGetTest() TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson()); } - [Fact(Skip="DELETE /api_app/{client_id} skipped")] + [Fact(Skip = "DELETE /api_app/{client_id} skipped")] public void ApiAppDeleteTest() { } @@ -83,39 +83,5 @@ public void ApiAppUpdateTest() TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson()); } - - [Fact] - public void ValuesJsonifiedTest() - { - var oauth = new SubOAuth( - callbackUrl: "https://oauth-callback.test", - scopes: new List() {SubOAuth.ScopesEnum.TemplateAccess} - ); - - var customLogoFile = TestHelper.GetFile("pdf-sample.pdf"); - - var obj = new ApiAppCreateRequest( - name: "My name is", - callbackUrl: "https://awesome.test", - domains: new List() {"domain1.com", "domain2.com"}, - oauth: oauth, - customLogoFile: customLogoFile - ); - - var responseData = TestHelper.GetJsonContents(nameof(ApiAppGetResponse)); - - var responseObj = ApiAppGetResponse.Init(responseData.ToString()); - - var api = MockRestClientHelper.CreateApiExpectContentContains(responseObj, - HttpStatusCode.Accepted, - "application/json", - "[\"domain1.com\",\"domain2.com\"]", - "My name is", - "{\"scopes\":[\"template_access\"],\"callback_url\":\"https://oauth-callback.test\"}" - ); - var response = api.ApiAppCreate(obj); - - TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson()); - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj b/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj index 67bb7610b..50c2bf70c 100644 --- a/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj +++ b/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/sdks/dotnet/src/Dropbox.Sign.Test/MockRestClientHelper.cs b/sdks/dotnet/src/Dropbox.Sign.Test/MockRestClientHelper.cs index 61431969a..5e9ed0285 100644 --- a/sdks/dotnet/src/Dropbox.Sign.Test/MockRestClientHelper.cs +++ b/sdks/dotnet/src/Dropbox.Sign.Test/MockRestClientHelper.cs @@ -1,13 +1,19 @@ using System; +using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.Net.Http; +using System.Text.RegularExpressions; using Dropbox.Sign.Client; +using Dropbox.Sign.Model; using RestSharp; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Serialization; +using RestSharp.Serializers; using RichardSzalay.MockHttp; +using FileIO = System.IO.File; namespace Dropbox.Sign.Test { @@ -76,11 +82,158 @@ private static T CreateApiInternal(MockHttpMessageHandler handler) ConfigureMessageHandler = _ => handler, BaseUrl = new Uri("https://api.hellosign.com") }; - var mockRestClient = new RestClient(options); + var mockRestClient = new RestClient(options, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, GlobalConfiguration.Instance)) + ); + Configuration config = new Configuration(); config.Username = "YOUR_API_KEY"; var client = new ApiClient(config.BasePath, mockRestClient); return (T)Activator.CreateInstance(typeof(T), client, client, config); } + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + private static JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + } + + // see ApiClient::CustomJsonCodec + internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer + { + private readonly IReadableConfiguration _configuration; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); + + public T Deserialize(RestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(RestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + FileIO.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public ISerializer Serializer => this; + public IDeserializer Deserializer => this; + + public string[] AcceptedContentTypes => ContentType.JsonAccept; + + public SupportsContentType SupportsContentType => contentType => + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + + public ContentType ContentType { get; set; } = ContentType.Json; + + public DataFormat DataFormat => DataFormat.Json; } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/AccountApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/AccountApi.cs index 0b1d311ce..0e70ee233 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/AccountApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/AccountApi.cs @@ -141,7 +141,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountCreateResponse - System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Account @@ -154,7 +154,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountCreateResponse) - System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Account /// @@ -167,7 +167,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - System.Threading.Tasks.Task AccountGetAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountGetAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Account @@ -181,7 +181,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Account /// @@ -193,7 +193,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Account @@ -206,7 +206,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Verify Account /// @@ -218,7 +218,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountVerifyResponse - System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Verify Account @@ -231,7 +231,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountVerifyResponse) - System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -411,6 +411,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -449,7 +450,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountCreateResponse - public async System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountCreateWithHttpInfoAsync(accountCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -463,7 +464,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountCreateResponse) - public async System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'accountCreateRequest' is set if (accountCreateRequest == null) @@ -503,6 +504,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -588,6 +590,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "email_address", emailAddress)); } + localVarRequestOptions.Operation = "AccountApi.AccountGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -627,7 +630,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - public async System.Threading.Tasks.Task AccountGetAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountGetAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountGetWithHttpInfoAsync(accountId, emailAddress, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -642,14 +645,13 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - public async System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default(string?), string? emailAddress = default(string?), 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 @@ -676,6 +678,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "email_address", emailAddress)); } + localVarRequestOptions.Operation = "AccountApi.AccountGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -766,6 +769,7 @@ public Dropbox.Sign.Client.ApiResponse AccountUpdateWithHttp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountUpdate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -804,7 +808,7 @@ public Dropbox.Sign.Client.ApiResponse AccountUpdateWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - public async System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountUpdateWithHttpInfoAsync(accountUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -818,7 +822,7 @@ public Dropbox.Sign.Client.ApiResponse AccountUpdateWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - public async System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'accountUpdateRequest' is set if (accountUpdateRequest == null) @@ -858,6 +862,7 @@ public Dropbox.Sign.Client.ApiResponse AccountUpdateWithHttp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountUpdate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -948,6 +953,7 @@ public Dropbox.Sign.Client.ApiResponse AccountVerifyWithH localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountVerify"; localVarRequestOptions.OperationIndex = operationIndex; @@ -986,7 +992,7 @@ public Dropbox.Sign.Client.ApiResponse AccountVerifyWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountVerifyResponse - public async System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountVerifyWithHttpInfoAsync(accountVerifyRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1000,7 +1006,7 @@ public Dropbox.Sign.Client.ApiResponse AccountVerifyWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountVerifyResponse) - public async System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'accountVerifyRequest' is set if (accountVerifyRequest == null) @@ -1040,6 +1046,7 @@ public Dropbox.Sign.Client.ApiResponse AccountVerifyWithH localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountVerify"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/ApiAppApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/ApiAppApi.cs index 4213670e7..d5ff4381b 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/ApiAppApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/ApiAppApi.cs @@ -166,7 +166,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create API App @@ -179,7 +179,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete API App /// @@ -191,7 +191,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete API App @@ -204,7 +204,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get API App /// @@ -216,7 +216,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get API App @@ -229,7 +229,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List API Apps /// @@ -242,7 +242,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppListResponse - System.Threading.Tasks.Task ApiAppListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List API Apps @@ -256,7 +256,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppListResponse) - System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update API App /// @@ -269,7 +269,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update API App @@ -283,7 +283,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -463,6 +463,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppCreateWithHttpIn localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "ApiAppApi.ApiAppCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -501,7 +502,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppCreateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - public async System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppCreateWithHttpInfoAsync(apiAppCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -515,7 +516,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppCreateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - public async System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'apiAppCreateRequest' is set if (apiAppCreateRequest == null) @@ -555,6 +556,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppCreateWithHttpIn localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "ApiAppApi.ApiAppCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -636,6 +638,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -674,7 +677,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await ApiAppDeleteWithHttpInfoAsync(clientId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -687,7 +690,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'clientId' is set if (clientId == null) @@ -700,7 +703,6 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -720,6 +722,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -802,6 +805,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -840,7 +844,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - public async System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppGetWithHttpInfoAsync(clientId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -854,7 +858,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - public async System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'clientId' is set if (clientId == null) @@ -867,7 +871,6 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -887,6 +890,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -972,6 +976,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "ApiAppApi.ApiAppList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1011,7 +1016,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppListResponse - public async System.Threading.Tasks.Task ApiAppListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppListAsync(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 ApiAppListWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1026,14 +1031,13 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppListResponse) - public async System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(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 @@ -1060,6 +1064,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "ApiAppApi.ApiAppList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1159,6 +1164,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppUpdateWithHttpIn } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppUpdate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1198,7 +1204,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppUpdateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - public async System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppUpdateWithHttpInfoAsync(clientId, apiAppUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1213,7 +1219,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppUpdateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - public async System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'clientId' is set if (clientId == null) @@ -1260,6 +1266,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppUpdateWithHttpIn } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppUpdate"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/BulkSendJobApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/BulkSendJobApi.cs index f550e80bb..25915628e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/BulkSendJobApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/BulkSendJobApi.cs @@ -101,7 +101,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobGetResponse - System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Bulk Send Job @@ -116,7 +116,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobGetResponse) - System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Bulk Send Jobs /// @@ -129,7 +129,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobListResponse - System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Bulk Send Jobs @@ -143,7 +143,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobListResponse) - System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -327,6 +327,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "BulkSendJobApi.BulkSendJobGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -367,7 +368,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobGetResponse - public async System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, 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 BulkSendJobGetWithHttpInfoAsync(bulkSendJobId, page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -383,7 +384,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobGetResponse) - public async System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'bulkSendJobId' is set if (bulkSendJobId == null) @@ -396,7 +397,6 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -424,6 +424,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "BulkSendJobApi.BulkSendJobGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -509,6 +510,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "BulkSendJobApi.BulkSendJobList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -548,7 +550,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobListResponse - public async System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task BulkSendJobListAsync(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 BulkSendJobListWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -563,14 +565,13 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobListResponse) - public async System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(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 @@ -597,6 +598,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "BulkSendJobApi.BulkSendJobList"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/EmbeddedApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/EmbeddedApi.cs index da3f9e0a6..32115b268 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/EmbeddedApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/EmbeddedApi.cs @@ -96,7 +96,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedEditUrlResponse - System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Embedded Template Edit URL @@ -110,7 +110,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedEditUrlResponse) - System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Embedded Sign URL /// @@ -122,7 +122,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedSignUrlResponse - System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Embedded Sign URL @@ -135,7 +135,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedSignUrlResponse) - System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -324,6 +324,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedEditUrlW } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "EmbeddedApi.EmbeddedEditUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -363,7 +364,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedEditUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedEditUrlResponse - public async System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await EmbeddedEditUrlWithHttpInfoAsync(templateId, embeddedEditUrlRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -378,7 +379,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedEditUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedEditUrlResponse) - public async System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -425,6 +426,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedEditUrlW } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "EmbeddedApi.EmbeddedEditUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -507,6 +509,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW } localVarRequestOptions.PathParameters.Add("signature_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureId)); // path parameter + localVarRequestOptions.Operation = "EmbeddedApi.EmbeddedSignUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -545,7 +548,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedSignUrlResponse - public async System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await EmbeddedSignUrlWithHttpInfoAsync(signatureId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -559,7 +562,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedSignUrlResponse) - public async System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureId' is set if (signatureId == null) @@ -572,7 +575,6 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -592,6 +594,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW } localVarRequestOptions.PathParameters.Add("signature_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureId)); // path parameter + localVarRequestOptions.Operation = "EmbeddedApi.EmbeddedSignUrl"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/FaxLineApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/FaxLineApi.cs new file mode 100644 index 000000000..edb0eb516 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Api/FaxLineApi.cs @@ -0,0 +1,1740 @@ +/* + * 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 IFaxLineApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Add Fax Line User + /// + /// + /// Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + FaxLineResponse FaxLineAddUser(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0); + + /// + /// Add Fax Line User + /// + /// + /// Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + ApiResponse FaxLineAddUserWithHttpInfo(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0); + /// + /// Get Available Fax Line Area Codes + /// + /// + /// Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// FaxLineAreaCodeGetResponse + FaxLineAreaCodeGetResponse FaxLineAreaCodeGet(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0); + + /// + /// Get Available Fax Line Area Codes + /// + /// + /// Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// ApiResponse of FaxLineAreaCodeGetResponse + ApiResponse FaxLineAreaCodeGetWithHttpInfo(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0); + /// + /// Purchase Fax Line + /// + /// + /// Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + FaxLineResponse FaxLineCreate(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0); + + /// + /// Purchase Fax Line + /// + /// + /// Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + ApiResponse FaxLineCreateWithHttpInfo(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0); + /// + /// Delete Fax Line + /// + /// + /// Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// + void FaxLineDelete(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0); + + /// + /// Delete Fax Line + /// + /// + /// Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse FaxLineDeleteWithHttpInfo(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0); + /// + /// Get Fax Line + /// + /// + /// Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// FaxLineResponse + FaxLineResponse FaxLineGet(string number, int operationIndex = 0); + + /// + /// Get Fax Line + /// + /// + /// Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + ApiResponse FaxLineGetWithHttpInfo(string number, int operationIndex = 0); + /// + /// List Fax Lines + /// + /// + /// Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// FaxLineListResponse + FaxLineListResponse FaxLineList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0); + + /// + /// List Fax Lines + /// + /// + /// Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// ApiResponse of FaxLineListResponse + ApiResponse FaxLineListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0); + /// + /// Remove Fax Line Access + /// + /// + /// Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + FaxLineResponse FaxLineRemoveUser(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0); + + /// + /// Remove Fax Line Access + /// + /// + /// Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + ApiResponse FaxLineRemoveUserWithHttpInfo(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFaxLineApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Add Fax Line User + /// + /// + /// Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + System.Threading.Tasks.Task FaxLineAddUserAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Add Fax Line User + /// + /// + /// Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + System.Threading.Tasks.Task> FaxLineAddUserWithHttpInfoAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get Available Fax Line Area Codes + /// + /// + /// Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineAreaCodeGetResponse + System.Threading.Tasks.Task FaxLineAreaCodeGetAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get Available Fax Line Area Codes + /// + /// + /// Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineAreaCodeGetResponse) + System.Threading.Tasks.Task> FaxLineAreaCodeGetWithHttpInfoAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Purchase Fax Line + /// + /// + /// Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + System.Threading.Tasks.Task FaxLineCreateAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Purchase Fax Line + /// + /// + /// Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + System.Threading.Tasks.Task> FaxLineCreateWithHttpInfoAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Delete Fax Line + /// + /// + /// Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task FaxLineDeleteAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Delete Fax Line + /// + /// + /// Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> FaxLineDeleteWithHttpInfoAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get Fax Line + /// + /// + /// Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + System.Threading.Tasks.Task FaxLineGetAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get Fax Line + /// + /// + /// Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + System.Threading.Tasks.Task> FaxLineGetWithHttpInfoAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// List Fax Lines + /// + /// + /// Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineListResponse + System.Threading.Tasks.Task FaxLineListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// List Fax Lines + /// + /// + /// Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineListResponse) + System.Threading.Tasks.Task> FaxLineListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Remove Fax Line Access + /// + /// + /// Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + System.Threading.Tasks.Task FaxLineRemoveUserAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Remove Fax Line Access + /// + /// + /// Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + System.Threading.Tasks.Task> FaxLineRemoveUserWithHttpInfoAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, 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 IFaxLineApi : IFaxLineApiSync, IFaxLineApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FaxLineApi : IFaxLineApi + { + private Dropbox.Sign.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public FaxLineApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public FaxLineApi(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 FaxLineApi(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 FaxLineApi(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; } + } + + /// + /// Add Fax Line User Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + public FaxLineResponse FaxLineAddUser(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineAddUserWithHttpInfo(faxLineAddUserRequest); + return localVarResponse.Data; + } + + /// + /// Add Fax Line User Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpInfo(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0) + { + // verify the required parameter 'faxLineAddUserRequest' is set + if (faxLineAddUserRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineAddUserRequest' when calling FaxLineApi->FaxLineAddUser"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineAddUserRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineAddUserRequest; + } + + // 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 = "FaxLineApi.FaxLineAddUser"; + 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.Put("/fax_line/add_user", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineAddUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Add Fax Line User Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + public async System.Threading.Tasks.Task FaxLineAddUserAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineAddUserWithHttpInfoAsync(faxLineAddUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Add Fax Line User Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + public async System.Threading.Tasks.Task> FaxLineAddUserWithHttpInfoAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxLineAddUserRequest' is set + if (faxLineAddUserRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineAddUserRequest' when calling FaxLineApi->FaxLineAddUser"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineAddUserRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineAddUserRequest; + } + + // 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 = "FaxLineApi.FaxLineAddUser"; + 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.PutAsync("/fax_line/add_user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineAddUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// FaxLineAreaCodeGetResponse + public FaxLineAreaCodeGetResponse FaxLineAreaCodeGet(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineAreaCodeGetWithHttpInfo(country, state, province, city); + return localVarResponse.Data; + } + + /// + /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// ApiResponse of FaxLineAreaCodeGetResponse + public Dropbox.Sign.Client.ApiResponse FaxLineAreaCodeGetWithHttpInfo(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0) + { + // verify the required parameter 'country' is set + if (country == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'country' when calling FaxLineApi->FaxLineAreaCodeGet"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "country", country)); + if (state != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "state", state)); + } + if (province != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "province", province)); + } + if (city != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "city", city)); + } + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineAreaCodeGet"; + 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_line/area_codes", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineAreaCodeGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineAreaCodeGetResponse + public async System.Threading.Tasks.Task FaxLineAreaCodeGetAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineAreaCodeGetWithHttpInfoAsync(country, state, province, city, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineAreaCodeGetResponse) + public async System.Threading.Tasks.Task> FaxLineAreaCodeGetWithHttpInfoAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'country' is set + if (country == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'country' when calling FaxLineApi->FaxLineAreaCodeGet"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "country", country)); + if (state != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "state", state)); + } + if (province != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "province", province)); + } + if (city != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "city", city)); + } + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineAreaCodeGet"; + 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_line/area_codes", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineAreaCodeGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Purchase Fax Line Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + public FaxLineResponse FaxLineCreate(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineCreateWithHttpInfo(faxLineCreateRequest); + return localVarResponse.Data; + } + + /// + /// Purchase Fax Line Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + public Dropbox.Sign.Client.ApiResponse FaxLineCreateWithHttpInfo(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0) + { + // verify the required parameter 'faxLineCreateRequest' is set + if (faxLineCreateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineCreateRequest' when calling FaxLineApi->FaxLineCreate"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineCreateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineCreateRequest; + } + + // 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 = "FaxLineApi.FaxLineCreate"; + 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_line/create", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Purchase Fax Line Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + public async System.Threading.Tasks.Task FaxLineCreateAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineCreateWithHttpInfoAsync(faxLineCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Purchase Fax Line Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + public async System.Threading.Tasks.Task> FaxLineCreateWithHttpInfoAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxLineCreateRequest' is set + if (faxLineCreateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineCreateRequest' when calling FaxLineApi->FaxLineCreate"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineCreateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineCreateRequest; + } + + // 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 = "FaxLineApi.FaxLineCreate"; + 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_line/create", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Fax Line Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// + public void FaxLineDelete(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0) + { + FaxLineDeleteWithHttpInfo(faxLineDeleteRequest); + } + + /// + /// Delete Fax Line Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Dropbox.Sign.Client.ApiResponse FaxLineDeleteWithHttpInfo(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0) + { + // verify the required parameter 'faxLineDeleteRequest' is set + if (faxLineDeleteRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineDeleteRequest' when calling FaxLineApi->FaxLineDelete"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineDeleteRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineDeleteRequest; + } + + // 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 = "FaxLineApi.FaxLineDelete"; + 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_line", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineDelete", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Fax Line Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task FaxLineDeleteAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await FaxLineDeleteWithHttpInfoAsync(faxLineDeleteRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete Fax Line Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> FaxLineDeleteWithHttpInfoAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxLineDeleteRequest' is set + if (faxLineDeleteRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineDeleteRequest' when calling FaxLineApi->FaxLineDelete"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineDeleteRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineDeleteRequest; + } + + // 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 = "FaxLineApi.FaxLineDelete"; + 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_line", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineDelete", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Fax Line Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// FaxLineResponse + public FaxLineResponse FaxLineGet(string number, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineGetWithHttpInfo(number); + return localVarResponse.Data; + } + + /// + /// Get Fax Line Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(string number, int operationIndex = 0) + { + // verify the required parameter 'number' is set + if (number == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'number' when calling FaxLineApi->FaxLineGet"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "number", number)); + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineGet"; + 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_line", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Fax Line Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + public async System.Threading.Tasks.Task FaxLineGetAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineGetWithHttpInfoAsync(number, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Fax Line Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + public async System.Threading.Tasks.Task> FaxLineGetWithHttpInfoAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'number' is set + if (number == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'number' when calling FaxLineApi->FaxLineGet"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "number", number)); + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineGet"; + 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_line", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Fax Lines Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// FaxLineListResponse + public FaxLineListResponse FaxLineList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + return localVarResponse.Data; + } + + /// + /// List Fax Lines Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// ApiResponse of FaxLineListResponse + public Dropbox.Sign.Client.ApiResponse FaxLineListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), 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 (accountId != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "account_id", accountId)); + } + 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)); + } + if (showTeamLines != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "show_team_lines", showTeamLines)); + } + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineList"; + 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_line/list", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineList", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Fax Lines Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineListResponse + public async System.Threading.Tasks.Task FaxLineListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineListWithHttpInfoAsync(accountId, page, pageSize, showTeamLines, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List Fax Lines Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineListResponse) + public async System.Threading.Tasks.Task> FaxLineListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), 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 (accountId != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "account_id", accountId)); + } + 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)); + } + if (showTeamLines != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "show_team_lines", showTeamLines)); + } + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineList"; + 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_line/list", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineList", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + public FaxLineResponse FaxLineRemoveUser(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineRemoveUserWithHttpInfo(faxLineRemoveUserRequest); + return localVarResponse.Data; + } + + /// + /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + public Dropbox.Sign.Client.ApiResponse FaxLineRemoveUserWithHttpInfo(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0) + { + // verify the required parameter 'faxLineRemoveUserRequest' is set + if (faxLineRemoveUserRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineRemoveUserRequest' when calling FaxLineApi->FaxLineRemoveUser"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineRemoveUserRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineRemoveUserRequest; + } + + // 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 = "FaxLineApi.FaxLineRemoveUser"; + 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.Put("/fax_line/remove_user", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineRemoveUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + public async System.Threading.Tasks.Task FaxLineRemoveUserAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineRemoveUserWithHttpInfoAsync(faxLineRemoveUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + public async System.Threading.Tasks.Task> FaxLineRemoveUserWithHttpInfoAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxLineRemoveUserRequest' is set + if (faxLineRemoveUserRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineRemoveUserRequest' when calling FaxLineApi->FaxLineRemoveUser"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineRemoveUserRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineRemoveUserRequest; + } + + // 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 = "FaxLineApi.FaxLineRemoveUser"; + 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.PutAsync("/fax_line/remove_user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineRemoveUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/OAuthApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/OAuthApi.cs index 78d47c5df..563c0a500 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/OAuthApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/OAuthApi.cs @@ -93,7 +93,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// OAuth Token Generate @@ -106,7 +106,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// OAuth Token Refresh /// @@ -118,7 +118,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// OAuth Token Refresh @@ -131,7 +131,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -311,6 +311,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenGenerateWit localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "OAuthApi.OauthTokenGenerate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -337,7 +338,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenGenerateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - public async System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await OauthTokenGenerateWithHttpInfoAsync(oAuthTokenGenerateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -351,7 +352,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenGenerateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - public async System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'oAuthTokenGenerateRequest' is set if (oAuthTokenGenerateRequest == null) @@ -391,6 +392,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenGenerateWit localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "OAuthApi.OauthTokenGenerate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -469,6 +471,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenRefreshWith localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "OAuthApi.OauthTokenRefresh"; localVarRequestOptions.OperationIndex = operationIndex; @@ -495,7 +498,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenRefreshWith /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - public async System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await OauthTokenRefreshWithHttpInfoAsync(oAuthTokenRefreshRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -509,7 +512,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenRefreshWith /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - public async System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'oAuthTokenRefreshRequest' is set if (oAuthTokenRefreshRequest == null) @@ -549,6 +552,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenRefreshWith localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "OAuthApi.OauthTokenRefresh"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/ReportApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/ReportApi.cs index 8f8a81b9c..a3e26932a 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/ReportApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/ReportApi.cs @@ -70,7 +70,7 @@ public interface IReportApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ReportCreateResponse - System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Report @@ -83,7 +83,7 @@ public interface IReportApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ReportCreateResponse) - System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -263,6 +263,7 @@ public Dropbox.Sign.Client.ApiResponse ReportCreateWithHtt localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "ReportApi.ReportCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -295,7 +296,7 @@ public Dropbox.Sign.Client.ApiResponse ReportCreateWithHtt /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ReportCreateResponse - public async System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ReportCreateWithHttpInfoAsync(reportCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -309,7 +310,7 @@ public Dropbox.Sign.Client.ApiResponse ReportCreateWithHtt /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ReportCreateResponse) - public async System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'reportCreateRequest' is set if (reportCreateRequest == null) @@ -349,6 +350,7 @@ public Dropbox.Sign.Client.ApiResponse ReportCreateWithHtt localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "ReportApi.ReportCreate"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs index 1ccec7fcd..0669f9132 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs @@ -429,7 +429,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Embedded Bulk Send with Template @@ -442,7 +442,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Bulk Send with Template /// @@ -454,7 +454,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Bulk Send with Template @@ -467,7 +467,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Cancel Incomplete Signature Request /// @@ -479,7 +479,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Cancel Incomplete Signature Request @@ -492,7 +492,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Signature Request /// @@ -504,7 +504,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Signature Request @@ -517,7 +517,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Signature Request with Template /// @@ -529,7 +529,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Signature Request with Template @@ -542,7 +542,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files /// @@ -555,7 +555,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files @@ -569,7 +569,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files as Data Uri /// @@ -581,7 +581,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files as Data Uri @@ -594,7 +594,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files as File Url /// @@ -607,7 +607,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files as File Url @@ -621,7 +621,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Signature Request /// @@ -633,7 +633,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Signature Request @@ -646,7 +646,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Signature Requests /// @@ -661,7 +661,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestListResponse - System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Signature Requests @@ -677,7 +677,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestListResponse) - System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Release On-Hold Signature Request /// @@ -689,7 +689,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Release On-Hold Signature Request @@ -702,7 +702,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send Request Reminder /// @@ -715,7 +715,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send Request Reminder @@ -729,7 +729,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove Signature Request Access /// @@ -741,7 +741,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove Signature Request Access @@ -754,7 +754,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send Signature Request /// @@ -766,7 +766,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send Signature Request @@ -779,7 +779,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send with Template /// @@ -791,7 +791,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send with Template @@ -804,7 +804,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Signature Request /// @@ -817,7 +817,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Signature Request @@ -831,7 +831,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -1011,6 +1011,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestBulkCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1043,7 +1044,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - public async System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(signatureRequestBulkCreateEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1057,7 +1058,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - public async System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' is set if (signatureRequestBulkCreateEmbeddedWithTemplateRequest == null) @@ -1097,6 +1098,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestBulkCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1181,6 +1183,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestBulkSendWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1219,7 +1222,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - public async System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(signatureRequestBulkSendWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1233,7 +1236,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - public async System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestBulkSendWithTemplateRequest' is set if (signatureRequestBulkSendWithTemplateRequest == null) @@ -1273,6 +1276,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestBulkSendWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1354,6 +1358,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCancel"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1392,7 +1397,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await SignatureRequestCancelWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -1405,7 +1410,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -1418,7 +1423,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1438,6 +1442,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCancel"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1528,6 +1533,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCreateEmbedded"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1566,7 +1572,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestCreateEmbeddedWithHttpInfoAsync(signatureRequestCreateEmbeddedRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1580,7 +1586,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestCreateEmbeddedRequest' is set if (signatureRequestCreateEmbeddedRequest == null) @@ -1620,6 +1626,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCreateEmbedded"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1710,6 +1717,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1748,7 +1756,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(signatureRequestCreateEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1762,7 +1770,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' is set if (signatureRequestCreateEmbeddedWithTemplateRequest == null) @@ -1802,6 +1810,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1892,6 +1901,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "file_type", fileType)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFiles"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1931,7 +1941,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - public async System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestFilesWithHttpInfoAsync(signatureRequestId, fileType, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1946,7 +1956,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - public async System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -1959,7 +1969,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1985,6 +1994,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "file_type", fileType)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFiles"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2067,6 +2077,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFilesAsDataUri"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2105,7 +2116,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - public async System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestFilesAsDataUriWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2119,7 +2130,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - public async System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2132,7 +2143,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2152,6 +2162,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFilesAsDataUri"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2240,6 +2251,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "force_download", forceDownload)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFilesAsFileUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2279,7 +2291,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - public async System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestFilesAsFileUrlWithHttpInfoAsync(signatureRequestId, forceDownload, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2294,7 +2306,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - public async System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2307,7 +2319,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2331,6 +2342,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "force_download", forceDownload)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFilesAsFileUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2413,6 +2425,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2451,7 +2464,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestGetWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2465,7 +2478,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2478,7 +2491,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2498,6 +2510,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2595,6 +2608,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2636,7 +2650,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestListResponse - public async System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestListWithHttpInfoAsync(accountId, page, pageSize, query, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2653,14 +2667,13 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestListResponse) - public async System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), 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 @@ -2695,6 +2708,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2777,6 +2791,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestReleaseHold"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2815,7 +2830,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestReleaseHoldWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2829,7 +2844,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2842,7 +2857,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2862,6 +2876,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestReleaseHold"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2961,6 +2976,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestRemind"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3000,7 +3016,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestRemindWithHttpInfoAsync(signatureRequestId, signatureRequestRemindRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3015,7 +3031,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3062,6 +3078,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestRemind"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3143,6 +3160,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestRemove"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3175,7 +3193,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await SignatureRequestRemoveWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -3188,7 +3206,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3201,7 +3219,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -3221,6 +3238,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestRemove"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3305,6 +3323,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestSend"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3343,7 +3362,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestSendWithHttpInfoAsync(signatureRequestSendRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3357,7 +3376,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestSendRequest' is set if (signatureRequestSendRequest == null) @@ -3397,6 +3416,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestSend"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3487,6 +3507,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestSendWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3525,7 +3546,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestSendWithTemplateWithHttpInfoAsync(signatureRequestSendWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3539,7 +3560,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestSendWithTemplateRequest' is set if (signatureRequestSendWithTemplateRequest == null) @@ -3579,6 +3600,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestSendWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3678,6 +3700,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestUpdate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3717,7 +3740,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestUpdateWithHttpInfoAsync(signatureRequestId, signatureRequestUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3732,7 +3755,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3779,6 +3802,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestUpdate"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/TeamApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/TeamApi.cs index 13b22c003..8fd6f3b1c 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/TeamApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/TeamApi.cs @@ -284,7 +284,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Add User to Team @@ -298,7 +298,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Team /// @@ -310,7 +310,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Team @@ -323,7 +323,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete Team /// @@ -334,7 +334,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete Team @@ -346,7 +346,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Team /// @@ -357,7 +357,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Team @@ -369,7 +369,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Team Info /// @@ -381,7 +381,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetInfoResponse - System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Team Info @@ -394,7 +394,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetInfoResponse) - System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Team Invites /// @@ -406,7 +406,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamInvitesResponse - System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Team Invites @@ -419,7 +419,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamInvitesResponse) - System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Team Members /// @@ -433,7 +433,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamMembersResponse - System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Team Members @@ -448,7 +448,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamMembersResponse) - System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove User from Team /// @@ -460,7 +460,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove User from Team @@ -473,7 +473,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Sub Teams /// @@ -487,7 +487,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamSubTeamsResponse - System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Sub Teams @@ -502,7 +502,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamSubTeamsResponse) - System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Team /// @@ -514,7 +514,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Team @@ -527,7 +527,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -713,6 +713,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "team_id", teamId)); } + localVarRequestOptions.Operation = "TeamApi.TeamAddMember"; localVarRequestOptions.OperationIndex = operationIndex; @@ -752,7 +753,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamAddMemberWithHttpInfoAsync(teamAddMemberRequest, teamId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -767,7 +768,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamAddMemberRequest' is set if (teamAddMemberRequest == null) @@ -811,6 +812,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "team_id", teamId)); } + localVarRequestOptions.Operation = "TeamApi.TeamAddMember"; localVarRequestOptions.OperationIndex = operationIndex; @@ -901,6 +903,7 @@ public Dropbox.Sign.Client.ApiResponse TeamCreateWithHttpInfo(T localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -939,7 +942,7 @@ public Dropbox.Sign.Client.ApiResponse TeamCreateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamCreateWithHttpInfoAsync(teamCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -953,7 +956,7 @@ public Dropbox.Sign.Client.ApiResponse TeamCreateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamCreateRequest' is set if (teamCreateRequest == null) @@ -993,6 +996,7 @@ public Dropbox.Sign.Client.ApiResponse TeamCreateWithHttpInfo(T localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1065,6 +1069,7 @@ public Dropbox.Sign.Client.ApiResponse TeamDeleteWithHttpInfo(int operat localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1102,7 +1107,7 @@ public Dropbox.Sign.Client.ApiResponse TeamDeleteWithHttpInfo(int operat /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await TeamDeleteWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); } @@ -1114,14 +1119,13 @@ public Dropbox.Sign.Client.ApiResponse TeamDeleteWithHttpInfo(int operat /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(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 @@ -1140,6 +1144,7 @@ public Dropbox.Sign.Client.ApiResponse TeamDeleteWithHttpInfo(int operat localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1213,6 +1218,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1250,7 +1256,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1263,14 +1269,13 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(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 @@ -1289,6 +1294,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1368,6 +1374,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "team_id", teamId)); } + localVarRequestOptions.Operation = "TeamApi.TeamInfo"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1406,7 +1413,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetInfoResponse - public async System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamInfoWithHttpInfoAsync(teamId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1420,14 +1427,13 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetInfoResponse) - public async System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default(string?), 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 @@ -1450,6 +1456,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "team_id", teamId)); } + localVarRequestOptions.Operation = "TeamApi.TeamInfo"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1529,6 +1536,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "email_address", emailAddress)); } + localVarRequestOptions.Operation = "TeamApi.TeamInvites"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1567,7 +1575,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamInvitesResponse - public async System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamInvitesWithHttpInfoAsync(emailAddress, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1581,14 +1589,13 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamInvitesResponse) - public async System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default(string?), 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 @@ -1611,6 +1618,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "email_address", emailAddress)); } + localVarRequestOptions.Operation = "TeamApi.TeamInvites"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1705,6 +1713,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "TeamApi.TeamMembers"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1745,7 +1754,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamMembersResponse - public async System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamMembersAsync(string teamId, 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 TeamMembersWithHttpInfoAsync(teamId, page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1761,7 +1770,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamMembersResponse) - public async System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamId' is set if (teamId == null) @@ -1774,7 +1783,6 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1802,6 +1810,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "TeamApi.TeamMembers"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1892,6 +1901,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamRemoveMember"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1930,7 +1940,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamRemoveMemberWithHttpInfoAsync(teamRemoveMemberRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1944,7 +1954,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamRemoveMemberRequest' is set if (teamRemoveMemberRequest == null) @@ -1984,6 +1994,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamRemoveMember"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2078,6 +2089,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "TeamApi.TeamSubTeams"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2118,7 +2130,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamSubTeamsResponse - public async System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, 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 TeamSubTeamsWithHttpInfoAsync(teamId, page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2134,7 +2146,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamSubTeamsResponse) - public async System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamId' is set if (teamId == null) @@ -2147,7 +2159,6 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2175,6 +2186,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "TeamApi.TeamSubTeams"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2265,6 +2277,7 @@ public Dropbox.Sign.Client.ApiResponse TeamUpdateWithHttpInfo(T localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamUpdate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2303,7 +2316,7 @@ public Dropbox.Sign.Client.ApiResponse TeamUpdateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamUpdateWithHttpInfoAsync(teamUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2317,7 +2330,7 @@ public Dropbox.Sign.Client.ApiResponse TeamUpdateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamUpdateRequest' is set if (teamUpdateRequest == null) @@ -2357,6 +2370,7 @@ public Dropbox.Sign.Client.ApiResponse TeamUpdateWithHttpInfo(T localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamUpdate"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs index 103e31143..01bb32262 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs @@ -317,7 +317,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Add User to Template @@ -331,7 +331,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Template /// @@ -343,7 +343,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateResponse - System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Template @@ -356,7 +356,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateResponse) - System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Template Draft /// @@ -368,7 +368,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateEmbeddedDraftResponse - System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Template Draft @@ -381,7 +381,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateEmbeddedDraftResponse) - System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete Template /// @@ -393,7 +393,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete Template @@ -406,7 +406,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files /// @@ -419,7 +419,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files @@ -433,7 +433,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files as Data Uri /// @@ -445,7 +445,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files as Data Uri @@ -458,7 +458,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files as File Url /// @@ -471,7 +471,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files as File Url @@ -485,7 +485,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template /// @@ -497,7 +497,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template @@ -510,7 +510,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Templates /// @@ -525,7 +525,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateListResponse - System.Threading.Tasks.Task TemplateListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Templates @@ -541,7 +541,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateListResponse) - System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove User from Template /// @@ -554,7 +554,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove User from Template @@ -568,7 +568,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Template Files /// @@ -581,7 +581,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateUpdateFilesResponse - System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Template Files @@ -595,7 +595,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateUpdateFilesResponse) - System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -784,6 +784,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateAddUserWithH } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateAddUser"; localVarRequestOptions.OperationIndex = operationIndex; @@ -823,7 +824,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateAddUserWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - public async System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateAddUserWithHttpInfoAsync(templateId, templateAddUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -838,7 +839,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateAddUserWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - public async System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -885,6 +886,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateAddUserWithH } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateAddUser"; localVarRequestOptions.OperationIndex = operationIndex; @@ -975,6 +977,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateCreateWit localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TemplateApi.TemplateCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1013,7 +1016,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateCreateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateResponse - public async System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateCreateWithHttpInfoAsync(templateCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1027,7 +1030,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateCreateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateResponse) - public async System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateCreateRequest' is set if (templateCreateRequest == null) @@ -1067,6 +1070,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateCreateWit localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TemplateApi.TemplateCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1157,6 +1161,7 @@ public Dropbox.Sign.Client.ApiResponse Temp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TemplateApi.TemplateCreateEmbeddedDraft"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1195,7 +1200,7 @@ public Dropbox.Sign.Client.ApiResponse Temp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateEmbeddedDraftResponse - public async System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateCreateEmbeddedDraftWithHttpInfoAsync(templateCreateEmbeddedDraftRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1209,7 +1214,7 @@ public Dropbox.Sign.Client.ApiResponse Temp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateEmbeddedDraftResponse) - public async System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateCreateEmbeddedDraftRequest' is set if (templateCreateEmbeddedDraftRequest == null) @@ -1249,6 +1254,7 @@ public Dropbox.Sign.Client.ApiResponse Temp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TemplateApi.TemplateCreateEmbeddedDraft"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1330,6 +1336,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1368,7 +1375,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await TemplateDeleteWithHttpInfoAsync(templateId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -1381,7 +1388,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1394,7 +1401,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1414,6 +1420,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1504,6 +1511,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "file_type", fileType)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateFiles"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1543,7 +1551,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - public async System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateFilesWithHttpInfoAsync(templateId, fileType, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1558,7 +1566,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - public async System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1571,7 +1579,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1597,6 +1604,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "file_type", fileType)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateFiles"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1679,6 +1687,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateFilesAsDataUri"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1717,7 +1726,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - public async System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateFilesAsDataUriWithHttpInfoAsync(templateId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1731,7 +1740,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - public async System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1744,7 +1753,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1764,6 +1772,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateFilesAsDataUri"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1852,6 +1861,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "force_download", forceDownload)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateFilesAsFileUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1891,7 +1901,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - public async System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateFilesAsFileUrlWithHttpInfoAsync(templateId, forceDownload, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1906,7 +1916,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - public async System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1919,7 +1929,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1943,6 +1952,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "force_download", forceDownload)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateFilesAsFileUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2025,6 +2035,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2063,7 +2074,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - public async System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateGetWithHttpInfoAsync(templateId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2077,7 +2088,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - public async System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -2090,7 +2101,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2110,6 +2120,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2207,6 +2218,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2248,7 +2260,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateListResponse - public async System.Threading.Tasks.Task TemplateListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateListWithHttpInfoAsync(accountId, page, pageSize, query, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2265,14 +2277,13 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateListResponse) - public async System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), 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 @@ -2307,6 +2318,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2406,6 +2418,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateRemoveUser"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2445,7 +2458,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - public async System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateRemoveUserWithHttpInfoAsync(templateId, templateRemoveUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2460,7 +2473,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - public async System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -2507,6 +2520,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateRemoveUser"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2606,6 +2620,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateUpda } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateUpdateFiles"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2645,7 +2660,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateUpda /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateUpdateFilesResponse - public async System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateUpdateFilesWithHttpInfoAsync(templateId, templateUpdateFilesRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2660,7 +2675,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateUpda /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateUpdateFilesResponse) - public async System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -2707,6 +2722,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateUpda } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateUpdateFiles"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs index c42910389..6e23e47ef 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs @@ -141,7 +141,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Unclaimed Draft @@ -154,7 +154,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Unclaimed Draft /// @@ -166,7 +166,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Unclaimed Draft @@ -179,7 +179,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Unclaimed Draft with Template /// @@ -191,7 +191,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Unclaimed Draft with Template @@ -204,7 +204,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Edit and Resend Unclaimed Draft /// @@ -217,7 +217,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Edit and Resend Unclaimed Draft @@ -231,7 +231,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -411,6 +411,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -449,7 +450,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftCreateWithHttpInfoAsync(unclaimedDraftCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -463,7 +464,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'unclaimedDraftCreateRequest' is set if (unclaimedDraftCreateRequest == null) @@ -503,6 +504,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -593,6 +595,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreateEmbedded"; localVarRequestOptions.OperationIndex = operationIndex; @@ -631,7 +634,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(unclaimedDraftCreateEmbeddedRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -645,7 +648,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'unclaimedDraftCreateEmbeddedRequest' is set if (unclaimedDraftCreateEmbeddedRequest == null) @@ -685,6 +688,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreateEmbedded"; localVarRequestOptions.OperationIndex = operationIndex; @@ -775,6 +779,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -813,7 +818,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(unclaimedDraftCreateEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -827,7 +832,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' is set if (unclaimedDraftCreateEmbeddedWithTemplateRequest == null) @@ -867,6 +872,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -966,6 +972,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftEditAndResend"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1005,7 +1012,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftEditAndResendWithHttpInfoAsync(signatureRequestId, unclaimedDraftEditAndResendRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1020,7 +1027,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -1067,6 +1074,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftEditAndResend"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/src/Dropbox.Sign/Client/ApiClient.cs b/sdks/dotnet/src/Dropbox.Sign/Client/ApiClient.cs index c64b27de0..2e1fe9212 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Client/ApiClient.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Client/ApiClient.cs @@ -23,13 +23,14 @@ using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; +using Dropbox.Sign.Model; namespace Dropbox.Sign.Client { @@ -39,7 +40,6 @@ namespace Dropbox.Sign.Client internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer { private readonly IReadableConfiguration _configuration; - private static readonly string _contentType = "application/json"; private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. @@ -71,10 +71,10 @@ public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfi /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Dropbox.Sign.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Dropbox.Sign.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -119,7 +119,7 @@ internal object Deserialize(RestResponse response, Type type) if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -130,7 +130,7 @@ internal object Deserialize(RestResponse response, Type type) if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -152,17 +152,13 @@ internal object Deserialize(RestResponse response, Type type) public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.Serializers.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => - contentType.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || - contentType.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public string ContentType - { - get { return _contentType; } - set { throw new InvalidOperationException("Not allowed to set content type."); } - } + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -176,8 +172,7 @@ public partial class ApiClient : ISynchronousClient, IAsynchronousClient private readonly RestClient _restClient; - - /// + /// /// Specifies the settings on a object. /// These settings can be adjusted to accommodate custom serialization rules. /// @@ -212,7 +207,7 @@ public partial class ApiClient : ISynchronousClient, IAsynchronousClient /// public ApiClient() { - _baseUrl = Dropbox.Sign.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -284,14 +279,14 @@ private RestSharpMethod Method(HttpMethod method) /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -399,7 +394,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -409,6 +404,13 @@ private RestRequest NewRequest( return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -453,199 +455,178 @@ private ApiResponse ToApiResponse(RestResponse response) return transformed; } - private ApiResponse Exec(RestRequest req, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + RestClient client = _restClient; if (client == null) { - client = new RestClient(clientOptions); + client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)) + ); } - client.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)); + using (client) + { + InterceptRequest(request); - InterceptRequest(req); + RestResponse response = await getResponse(client); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { - Request = req, - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(req); - } - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Dropbox.Sign.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - try + try + { + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } + } + else if (typeof(T).Name == "Stream") // for binary response { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)(object)new MemoryStream(response.RawBytes); } - catch (Exception ex) + else if (typeof(T).Name == "Byte[]") // for byte response { - throw ex.InnerException != null ? ex.InnerException : ex; + response.Data = (T)(object)response.RawBytes; + } + else if (typeof(T).Name == "String") // for string response + { + response.Data = (T)(object)response.Content; } - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - else if (typeof(T).Name == "String") // for string response - { - response.Data = (T)(object)response.Content; - } - InterceptResponse(req, response); + InterceptResponse(request, response); - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (response.Cookies != null && response.Cookies.Count > 0) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } } + return result; } - return result; } - private async Task> ExecAsync(RestRequest req, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent - }; - - RestClient client = new RestClient(clientOptions) - .UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)); - - InterceptRequest(req); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + return client.Deserialize(policyResult.Result); + } + else { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + return new RestResponse(request) { - Request = req, ErrorException = policyResult.FinalException }; } - else + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => { - response = await client.ExecuteAsync(req, cancellationToken).ConfigureAwait(false); - } + var cookies = new CookieContainer(); - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Dropbox.Sign.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; + }; + + Func>> getResponse = (client) => { - response.Data = (T)(object)response.RawBytes; - } + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return Task.FromResult(DeserializeRestResponseFromPolicy(client, request, policyResult)); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; - InterceptResponse(req, response); + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => { - result.ErrorText = response.ErrorMessage; - } + //no extra options + }; - if (response.Cookies != null && response.Cookies.Count > 0) + Func>> getResponse = async (client) => { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration); } #region IAsynchronousClient @@ -658,7 +639,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -673,7 +654,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -688,7 +669,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -703,7 +684,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -718,7 +699,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -733,7 +714,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -748,7 +729,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/sdks/dotnet/src/Dropbox.Sign/Client/ClientUtils.cs b/sdks/dotnet/src/Dropbox.Sign/Client/ClientUtils.cs index 2916c1dc3..645421e58 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Client/ClientUtils.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Client/ClientUtils.cs @@ -15,9 +15,9 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Runtime.Serialization; using Newtonsoft.Json; using Dropbox.Sign.Model; @@ -105,8 +105,12 @@ public static string ParameterToString(object obj, IReadableConfiguration config return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); @@ -130,7 +134,7 @@ public static string Serialize(object obj) /// Encoded string. public static string Base64Encode(string text) { - return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); } /// @@ -293,7 +297,7 @@ public static void SetFormData(RequestOptions requestOptions, List item.Value.ToString() ); - continue; + continue; } if (item.Value is Enum) diff --git a/sdks/dotnet/src/Dropbox.Sign/Client/Configuration.cs b/sdks/dotnet/src/Dropbox.Sign/Client/Configuration.cs index b1e4a868f..307b45ac3 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Client/Configuration.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Client/Configuration.cs @@ -18,11 +18,11 @@ using System.Reflection; using System.Security.Cryptography.X509Certificates; using System.Text; -using Newtonsoft.Json; using System.Net.Http; +using System.Net.Security; +using Newtonsoft.Json; using Dropbox.Sign.Model; - namespace Dropbox.Sign.Client { /// @@ -36,7 +36,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "1.5-dev"; + public const string Version = "1.6-dev"; /// /// Identifier for ISO 8601 DateTime Format @@ -79,6 +79,8 @@ public class Configuration : IReadableConfiguration /// private string _basePath; + private bool _useDefaultCredentials = false; + /// /// Gets or sets the API key based on the authentication name. /// This is the key and value comprising the "secret" for accessing an API. @@ -114,11 +116,11 @@ public class Configuration : IReadableConfiguration /// /// Initializes a new instance of the class /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration() { Proxy = null; - UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.5-dev/csharp"); + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.6-dev/csharp"); BasePath = "https://api.hellosign.com/v3"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -167,7 +169,7 @@ public Configuration() /// /// Initializes a new instance of the class /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration( IDictionary defaultHeaders, IDictionary apiKey, @@ -208,11 +210,21 @@ public Configuration( /// /// Gets or sets the base path for API access. /// - public virtual string BasePath { + public virtual string BasePath + { get { return _basePath; } set { _basePath = value; } } + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + /// /// Gets or sets the default header. /// @@ -477,7 +489,7 @@ public string GetOperationServerUrl(string operation, int index) /// The operation server URL. public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) { - if (OperationServers.TryGetValue(operation, out var operationServer)) + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) { return GetServerUrl(operationServer, index, inputVariables); } @@ -536,6 +548,11 @@ private string GetServerUrl(IList> servers, return url; } + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } #endregion Properties @@ -550,7 +567,7 @@ public static string ToDebugReport() report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; report += " Version of the API: 3.0.0\n"; - report += " SDK Package Version: 1.5-dev\n"; + report += " SDK Package Version: 1.6-dev\n"; return report; } @@ -612,6 +629,8 @@ public static IReadableConfiguration MergeConfigurations(IReadableConfiguration TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, }; return config; } diff --git a/sdks/dotnet/src/Dropbox.Sign/Client/IAsynchronousClient.cs b/sdks/dotnet/src/Dropbox.Sign/Client/IAsynchronousClient.cs index 6d1c11df9..66e347c5b 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Client/IAsynchronousClient.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Client/IAsynchronousClient.cs @@ -30,7 +30,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -41,7 +41,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -52,7 +52,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -63,7 +63,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -74,7 +74,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -85,7 +85,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -96,6 +96,6 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Client/IReadableConfiguration.cs b/sdks/dotnet/src/Dropbox.Sign/Client/IReadableConfiguration.cs index 09535915b..a4e493e1c 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Client/IReadableConfiguration.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Client/IReadableConfiguration.cs @@ -12,6 +12,7 @@ using System; using System.Collections.Generic; using System.Net; +using System.Net.Security; using System.Security.Cryptography.X509Certificates; namespace Dropbox.Sign.Client @@ -100,6 +101,11 @@ public interface IReadableConfiguration /// Password. string Password { get; } + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + /// /// Get the servers associated with the operation. /// @@ -126,5 +132,11 @@ public interface IReadableConfiguration /// /// X509 Certificate collection. X509CertificateCollection ClientCertificates { get; } + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Client/RequestOptions.cs b/sdks/dotnet/src/Dropbox.Sign/Client/RequestOptions.cs index f1839c959..54db7aae6 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Client/RequestOptions.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Client/RequestOptions.cs @@ -34,7 +34,7 @@ public class RequestOptions public Multimap QueryParameters { get; set; } /// - /// Header parameters to be applied to to the request. + /// Header parameters to be applied to the request. /// Keys may have 1 or more values associated. /// public Multimap HeaderParameters { get; set; } diff --git a/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj b/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj index ccb83267d..3ed07d49e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj +++ b/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj @@ -10,21 +10,26 @@ Dropbox Sign API Team Dropbox Sign .Net SDK Client library for using the Dropbox Sign API + Dropbox 2024 Dropbox.Sign - 1.5-dev + 1.6-dev bin\$(Configuration)\$(TargetFramework)\Dropbox.Sign.xml https://github.com/hellosign/dropbox-sign-dotnet.git git Minor update annotations + false - - - - - + + + + + + + + diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AbstractOpenAPISchema.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AbstractOpenAPISchema.cs index f0eb45d54..76b51744a 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AbstractOpenAPISchema.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AbstractOpenAPISchema.cs @@ -10,9 +10,9 @@ using System; -using System.Collections.Generic; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using System.Collections.Generic; namespace Dropbox.Sign.Model { diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AccountCreateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AccountCreateRequest.cs index f2448610e..c8569fb00 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AccountCreateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AccountCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountCreateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -81,28 +81,28 @@ public static AccountCreateRequest Init(string jsonData) /// The email address which will be associated with the new Account. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) /// /// Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) /// /// Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) [DataMember(Name = "client_secret", EmitDefaultValue = true)] public string ClientSecret { get; set; } - + /// /// The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. /// /// The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. [DataMember(Name = "locale", EmitDefaultValue = true)] public string Locale { get; set; } - + /// /// Returns the string presentation of the object /// @@ -201,6 +201,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -231,16 +240,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AccountCreateResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AccountCreateResponse.cs index 0da9d72f8..498d367da 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AccountCreateResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AccountCreateResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountCreateResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountCreateResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountCreateResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,12 +41,17 @@ protected AccountCreateResponse() { } /// /// Initializes a new instance of the class. /// - /// account. + /// account (required). /// oauthData. /// A list of warnings.. public AccountCreateResponse(AccountResponse account = default(AccountResponse), OAuthTokenResponse oauthData = default(OAuthTokenResponse), List warnings = default(List)) { + // to ensure "account" is required (not null) + if (account == null) + { + throw new ArgumentNullException("account is a required property for AccountCreateResponse and cannot be null"); + } this.Account = account; this.OauthData = oauthData; this.Warnings = warnings; @@ -71,22 +76,22 @@ public static AccountCreateResponse Init(string jsonData) /// /// Gets or Sets Account /// - [DataMember(Name = "account", EmitDefaultValue = true)] + [DataMember(Name = "account", IsRequired = true, EmitDefaultValue = true)] public AccountResponse Account { get; set; } - + /// /// Gets or Sets OauthData /// [DataMember(Name = "oauth_data", EmitDefaultValue = true)] public OAuthTokenResponse OauthData { 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 /// @@ -176,6 +181,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -200,16 +214,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AccountGetResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AccountGetResponse.cs index b98e61706..4e5c2f16e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AccountGetResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AccountGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected AccountGetResponse() { } /// /// Initializes a new instance of the class. /// - /// account. + /// account (required). /// A list of warnings.. public AccountGetResponse(AccountResponse account = default(AccountResponse), List warnings = default(List)) { + // to ensure "account" is required (not null) + if (account == null) + { + throw new ArgumentNullException("account is a required property for AccountGetResponse and cannot be null"); + } this.Account = account; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static AccountGetResponse Init(string jsonData) /// /// Gets or Sets Account /// - [DataMember(Name = "account", EmitDefaultValue = true)] + [DataMember(Name = "account", IsRequired = true, EmitDefaultValue = true)] public AccountResponse Account { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponse.cs index e5b102f62..39bd9bf14 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -90,75 +90,75 @@ public static AccountResponse Init(string jsonData) /// The ID of the Account [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The email address associated with the Account. /// /// The email address associated with the Account. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns `true` if the user has been locked out of their account by a team admin. /// /// Returns `true` if the user has been locked out of their account by a team admin. [DataMember(Name = "is_locked", EmitDefaultValue = true)] public bool IsLocked { get; set; } - + /// /// Returns `true` if the user has a paid Dropbox Sign account. /// /// Returns `true` if the user has a paid Dropbox Sign account. [DataMember(Name = "is_paid_hs", EmitDefaultValue = true)] public bool IsPaidHs { get; set; } - + /// /// Returns `true` if the user has a paid HelloFax account. /// /// Returns `true` if the user has a paid HelloFax account. [DataMember(Name = "is_paid_hf", EmitDefaultValue = true)] public bool IsPaidHf { get; set; } - + /// /// Gets or Sets Quotas /// [DataMember(Name = "quotas", EmitDefaultValue = true)] public AccountResponseQuotas Quotas { get; set; } - + /// /// The URL that Dropbox Sign events will `POST` to. /// /// The URL that Dropbox Sign events will `POST` to. [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// The membership role for the team. /// /// The membership role for the team. [DataMember(Name = "role_code", EmitDefaultValue = true)] public string RoleCode { get; set; } - + /// /// The id of the team account belongs to. /// /// The id of the team account belongs to. [DataMember(Name = "team_id", EmitDefaultValue = true)] public string TeamId { get; set; } - + /// /// The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. /// /// The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. [DataMember(Name = "locale", EmitDefaultValue = true)] public string Locale { get; set; } - + /// /// Gets or Sets Usage /// [DataMember(Name = "usage", EmitDefaultValue = true)] public AccountResponseUsage Usage { get; set; } - + /// /// Returns the string presentation of the object /// @@ -315,6 +315,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -387,16 +396,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponseQuotas.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponseQuotas.cs index bf46598c7..28a16d5d4 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponseQuotas.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponseQuotas.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountResponseQuotas")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountResponseQuotas : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountResponseQuotas : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,42 +80,42 @@ public static AccountResponseQuotas Init(string jsonData) /// API signature requests remaining. [DataMember(Name = "api_signature_requests_left", EmitDefaultValue = true)] public int? ApiSignatureRequestsLeft { get; set; } - + /// /// Signature requests remaining. /// /// Signature requests remaining. [DataMember(Name = "documents_left", EmitDefaultValue = true)] public int? DocumentsLeft { get; set; } - + /// /// Total API templates allowed. /// /// Total API templates allowed. [DataMember(Name = "templates_total", EmitDefaultValue = true)] public int? TemplatesTotal { get; set; } - + /// /// API templates remaining. /// /// API templates remaining. [DataMember(Name = "templates_left", EmitDefaultValue = true)] public int? TemplatesLeft { get; set; } - + /// /// SMS verifications remaining. /// /// SMS verifications remaining. [DataMember(Name = "sms_verifications_left", EmitDefaultValue = true)] public int? SmsVerificationsLeft { get; set; } - + /// /// Number of fax pages left /// /// Number of fax pages left [DataMember(Name = "num_fax_pages_left", EmitDefaultValue = true)] public int? NumFaxPagesLeft { get; set; } - + /// /// Returns the string presentation of the object /// @@ -234,6 +234,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -276,16 +285,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponseUsage.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponseUsage.cs index 2a72141a5..068f2a7c0 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponseUsage.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AccountResponseUsage.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountResponseUsage")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountResponseUsage : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountResponseUsage : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static AccountResponseUsage Init(string jsonData) /// Number of fax pages sent [DataMember(Name = "fax_pages_sent", EmitDefaultValue = true)] public int? FaxPagesSent { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +139,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -151,16 +160,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AccountUpdateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AccountUpdateRequest.cs index 2048e3256..e0ce0ef85 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AccountUpdateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AccountUpdateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountUpdateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountUpdateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountUpdateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -74,21 +74,21 @@ public static AccountUpdateRequest Init(string jsonData) /// The ID of the Account [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The URL that Dropbox Sign should POST events to. /// /// The URL that Dropbox Sign should POST events to. [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. /// /// The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. [DataMember(Name = "locale", EmitDefaultValue = true)] public string Locale { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,6 +177,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -201,16 +210,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyRequest.cs index 13de31874..b13781a36 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountVerifyRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountVerifyRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountVerifyRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -75,7 +75,7 @@ public static AccountVerifyRequest Init(string jsonData) /// Email address to run the verification for. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -144,6 +144,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -156,16 +165,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyResponse.cs index f4c97511b..f8b0b8e27 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountVerifyResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountVerifyResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountVerifyResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -71,14 +71,14 @@ public static AccountVerifyResponse Init(string jsonData) /// [DataMember(Name = "account", EmitDefaultValue = true)] public AccountVerifyResponseAccount Account { 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 /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyResponseAccount.cs b/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyResponseAccount.cs index 39edf9b0f..8d56b2327 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyResponseAccount.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/AccountVerifyResponseAccount.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountVerifyResponseAccount")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountVerifyResponseAccount : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountVerifyResponseAccount : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static AccountVerifyResponseAccount Init(string jsonData) /// The email address associated with the Account. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +139,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -151,16 +160,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppCreateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppCreateRequest.cs index ca0b7982b..535fc8078 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppCreateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppCreateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -92,46 +92,46 @@ public static ApiAppCreateRequest Init(string jsonData) /// The domain names the ApiApp will be associated with. [DataMember(Name = "domains", IsRequired = true, EmitDefaultValue = true)] public List Domains { get; set; } - + /// /// The name you want to assign to the ApiApp. /// /// The name you want to assign to the ApiApp. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The URL at which the ApiApp should receive event callbacks. /// /// The URL at which the ApiApp should receive event callbacks. [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) /// /// An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) [DataMember(Name = "custom_logo_file", EmitDefaultValue = true)] public System.IO.Stream CustomLogoFile { get; set; } - + /// /// Gets or Sets Oauth /// [DataMember(Name = "oauth", EmitDefaultValue = true)] public SubOAuth Oauth { get; set; } - + /// /// Gets or Sets Options /// [DataMember(Name = "options", EmitDefaultValue = true)] public SubOptions Options { get; set; } - + /// /// Gets or Sets WhiteLabelingOptions /// [DataMember(Name = "white_labeling_options", EmitDefaultValue = true)] public SubWhiteLabelingOptions WhiteLabelingOptions { get; set; } - + /// /// Returns the string presentation of the object /// @@ -261,6 +261,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -309,16 +318,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppGetResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppGetResponse.cs index 6fd9e3f1e..5bc614d3d 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppGetResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected ApiAppGetResponse() { } /// /// Initializes a new instance of the class. /// - /// apiApp. + /// apiApp (required). /// A list of warnings.. public ApiAppGetResponse(ApiAppResponse apiApp = default(ApiAppResponse), List warnings = default(List)) { + // to ensure "apiApp" is required (not null) + if (apiApp == null) + { + throw new ArgumentNullException("apiApp is a required property for ApiAppGetResponse and cannot be null"); + } this.ApiApp = apiApp; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static ApiAppGetResponse Init(string jsonData) /// /// Gets or Sets ApiApp /// - [DataMember(Name = "api_app", EmitDefaultValue = true)] + [DataMember(Name = "api_app", IsRequired = true, EmitDefaultValue = true)] public ApiAppResponse ApiApp { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppListResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppListResponse.cs index c43833af7..26e2b2843 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppListResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppListResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppListResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppListResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppListResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected ApiAppListResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains information about API Apps.. - /// listInfo. + /// Contains information about API Apps. (required). + /// listInfo (required). /// A list of warnings.. public ApiAppListResponse(List apiApps = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "apiApps" is required (not null) + if (apiApps == null) + { + throw new ArgumentNullException("apiApps is a required property for ApiAppListResponse and cannot be null"); + } this.ApiApps = apiApps; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for ApiAppListResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,22 +82,22 @@ public static ApiAppListResponse Init(string jsonData) /// Contains information about API Apps. /// /// Contains information about API Apps. - [DataMember(Name = "api_apps", EmitDefaultValue = true)] + [DataMember(Name = "api_apps", IsRequired = true, EmitDefaultValue = true)] public List ApiApps { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { 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 /// @@ -178,6 +188,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -202,16 +221,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponse.cs index fb4b75275..e377917e4 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -88,66 +88,66 @@ public static ApiAppResponse Init(string jsonData) /// The app's callback URL (for events) [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// The app's client id /// /// The app's client id [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// The time that the app was created /// /// The time that the app was created [DataMember(Name = "created_at", EmitDefaultValue = true)] public int CreatedAt { get; set; } - + /// /// The domain name(s) associated with the app /// /// The domain name(s) associated with the app [DataMember(Name = "domains", EmitDefaultValue = true)] public List Domains { get; set; } - + /// /// The name of the app /// /// The name of the app [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Boolean to indicate if the app has been approved /// /// Boolean to indicate if the app has been approved [DataMember(Name = "is_approved", EmitDefaultValue = true)] public bool IsApproved { get; set; } - + /// /// Gets or Sets Oauth /// [DataMember(Name = "oauth", EmitDefaultValue = true)] public ApiAppResponseOAuth Oauth { get; set; } - + /// /// Gets or Sets Options /// [DataMember(Name = "options", EmitDefaultValue = true)] public ApiAppResponseOptions Options { get; set; } - + /// /// Gets or Sets OwnerAccount /// [DataMember(Name = "owner_account", EmitDefaultValue = true)] public ApiAppResponseOwnerAccount OwnerAccount { get; set; } - + /// /// Gets or Sets WhiteLabelingOptions /// [DataMember(Name = "white_labeling_options", EmitDefaultValue = true)] public ApiAppResponseWhiteLabelingOptions WhiteLabelingOptions { get; set; } - + /// /// Returns the string presentation of the object /// @@ -299,6 +299,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -365,16 +374,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOAuth.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOAuth.cs index 91bbff9d4..d1b7c4914 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOAuth.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOAuth.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppResponseOAuth")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppResponseOAuth : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppResponseOAuth : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,28 +76,28 @@ public static ApiAppResponseOAuth Init(string jsonData) /// The app's OAuth callback URL. [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// The app's OAuth secret, or null if the app does not belong to user. /// /// The app's OAuth secret, or null if the app does not belong to user. [DataMember(Name = "secret", EmitDefaultValue = true)] public string Secret { get; set; } - + /// /// Array of OAuth scopes used by the app. /// /// Array of OAuth scopes used by the app. [DataMember(Name = "scopes", EmitDefaultValue = true)] public List Scopes { get; set; } - + /// /// Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. /// /// Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. [DataMember(Name = "charges_users", EmitDefaultValue = true)] public bool ChargesUsers { get; set; } - + /// /// Returns the string presentation of the object /// @@ -193,6 +193,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -223,16 +232,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOptions.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOptions.cs index 948ef419b..55e16f2f0 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOptions.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppResponseOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppResponseOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppResponseOptions : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static ApiAppResponseOptions Init(string jsonData) /// Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document [DataMember(Name = "can_insert_everywhere", EmitDefaultValue = true)] public bool CanInsertEverywhere { get; set; } - + /// /// Returns the string presentation of the object /// @@ -135,6 +135,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -147,16 +156,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOwnerAccount.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOwnerAccount.cs index 0ee2ac652..8a57baef8 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOwnerAccount.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseOwnerAccount.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppResponseOwnerAccount")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppResponseOwnerAccount : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppResponseOwnerAccount : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static ApiAppResponseOwnerAccount Init(string jsonData) /// The owner account's ID [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The owner account's email address /// /// The owner account's email address [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseWhiteLabelingOptions.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseWhiteLabelingOptions.cs index 5dc24b9ec..602754bd3 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseWhiteLabelingOptions.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppResponseWhiteLabelingOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppResponseWhiteLabelingOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppResponseWhiteLabelingOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppResponseWhiteLabelingOptions : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -95,85 +95,85 @@ public static ApiAppResponseWhiteLabelingOptions Init(string jsonData) /// [DataMember(Name = "header_background_color", EmitDefaultValue = true)] public string HeaderBackgroundColor { get; set; } - + /// /// Gets or Sets LegalVersion /// [DataMember(Name = "legal_version", EmitDefaultValue = true)] public string LegalVersion { get; set; } - + /// /// Gets or Sets LinkColor /// [DataMember(Name = "link_color", EmitDefaultValue = true)] public string LinkColor { get; set; } - + /// /// Gets or Sets PageBackgroundColor /// [DataMember(Name = "page_background_color", EmitDefaultValue = true)] public string PageBackgroundColor { get; set; } - + /// /// Gets or Sets PrimaryButtonColor /// [DataMember(Name = "primary_button_color", EmitDefaultValue = true)] public string PrimaryButtonColor { get; set; } - + /// /// Gets or Sets PrimaryButtonColorHover /// [DataMember(Name = "primary_button_color_hover", EmitDefaultValue = true)] public string PrimaryButtonColorHover { get; set; } - + /// /// Gets or Sets PrimaryButtonTextColor /// [DataMember(Name = "primary_button_text_color", EmitDefaultValue = true)] public string PrimaryButtonTextColor { get; set; } - + /// /// Gets or Sets PrimaryButtonTextColorHover /// [DataMember(Name = "primary_button_text_color_hover", EmitDefaultValue = true)] public string PrimaryButtonTextColorHover { get; set; } - + /// /// Gets or Sets SecondaryButtonColor /// [DataMember(Name = "secondary_button_color", EmitDefaultValue = true)] public string SecondaryButtonColor { get; set; } - + /// /// Gets or Sets SecondaryButtonColorHover /// [DataMember(Name = "secondary_button_color_hover", EmitDefaultValue = true)] public string SecondaryButtonColorHover { get; set; } - + /// /// Gets or Sets SecondaryButtonTextColor /// [DataMember(Name = "secondary_button_text_color", EmitDefaultValue = true)] public string SecondaryButtonTextColor { get; set; } - + /// /// Gets or Sets SecondaryButtonTextColorHover /// [DataMember(Name = "secondary_button_text_color_hover", EmitDefaultValue = true)] public string SecondaryButtonTextColorHover { get; set; } - + /// /// Gets or Sets TextColor1 /// [DataMember(Name = "text_color1", EmitDefaultValue = true)] public string TextColor1 { get; set; } - + /// /// Gets or Sets TextColor2 /// [DataMember(Name = "text_color2", EmitDefaultValue = true)] public string TextColor2 { get; set; } - + /// /// Returns the string presentation of the object /// @@ -372,6 +372,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -462,16 +471,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppUpdateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppUpdateRequest.cs index 9570c834d..68faf3529 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppUpdateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ApiAppUpdateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppUpdateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppUpdateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppUpdateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -82,46 +82,46 @@ public static ApiAppUpdateRequest Init(string jsonData) /// The URL at which the API App should receive event callbacks. [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) /// /// An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) [DataMember(Name = "custom_logo_file", EmitDefaultValue = true)] public System.IO.Stream CustomLogoFile { get; set; } - + /// /// The domain names the ApiApp will be associated with. /// /// The domain names the ApiApp will be associated with. [DataMember(Name = "domains", EmitDefaultValue = true)] public List Domains { get; set; } - + /// /// The name you want to assign to the ApiApp. /// /// The name you want to assign to the ApiApp. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Gets or Sets Oauth /// [DataMember(Name = "oauth", EmitDefaultValue = true)] public SubOAuth Oauth { get; set; } - + /// /// Gets or Sets Options /// [DataMember(Name = "options", EmitDefaultValue = true)] public SubOptions Options { get; set; } - + /// /// Gets or Sets WhiteLabelingOptions /// [DataMember(Name = "white_labeling_options", EmitDefaultValue = true)] public SubWhiteLabelingOptions WhiteLabelingOptions { get; set; } - + /// /// Returns the string presentation of the object /// @@ -251,6 +251,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -299,16 +308,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobGetResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobGetResponse.cs index 947c7cffb..80a6c5598 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobGetResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "BulkSendJobGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class BulkSendJobGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class BulkSendJobGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,15 +41,30 @@ protected BulkSendJobGetResponse() { } /// /// Initializes a new instance of the class. /// - /// bulkSendJob. - /// listInfo. - /// Contains information about the Signature Requests sent in bulk.. + /// bulkSendJob (required). + /// listInfo (required). + /// Contains information about the Signature Requests sent in bulk. (required). /// A list of warnings.. public BulkSendJobGetResponse(BulkSendJobResponse bulkSendJob = default(BulkSendJobResponse), ListInfoResponse listInfo = default(ListInfoResponse), List signatureRequests = default(List), List warnings = default(List)) { + // to ensure "bulkSendJob" is required (not null) + if (bulkSendJob == null) + { + throw new ArgumentNullException("bulkSendJob is a required property for BulkSendJobGetResponse and cannot be null"); + } this.BulkSendJob = bulkSendJob; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for BulkSendJobGetResponse and cannot be null"); + } this.ListInfo = listInfo; + // to ensure "signatureRequests" is required (not null) + if (signatureRequests == null) + { + throw new ArgumentNullException("signatureRequests is a required property for BulkSendJobGetResponse and cannot be null"); + } this.SignatureRequests = signatureRequests; this.Warnings = warnings; } @@ -73,29 +88,29 @@ public static BulkSendJobGetResponse Init(string jsonData) /// /// Gets or Sets BulkSendJob /// - [DataMember(Name = "bulk_send_job", EmitDefaultValue = true)] + [DataMember(Name = "bulk_send_job", IsRequired = true, EmitDefaultValue = true)] public BulkSendJobResponse BulkSendJob { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { get; set; } - + /// /// Contains information about the Signature Requests sent in bulk. /// /// Contains information about the Signature Requests sent in bulk. - [DataMember(Name = "signature_requests", EmitDefaultValue = true)] + [DataMember(Name = "signature_requests", IsRequired = true, EmitDefaultValue = true)] public List SignatureRequests { 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 /// @@ -196,6 +211,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -226,16 +250,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobGetResponseSignatureRequests.cs b/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobGetResponseSignatureRequests.cs index c1a68e6f5..ba7ff61ee 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobGetResponseSignatureRequests.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobGetResponseSignatureRequests.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "BulkSendJobGetResponseSignatureRequests")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class BulkSendJobGetResponseSignatureRequests : IOpenApiTyped, IEquatable, IValidatableObject + public partial class BulkSendJobGetResponseSignatureRequests : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -119,175 +119,175 @@ public static BulkSendJobGetResponseSignatureRequests Init(string jsonData) /// Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool? TestMode { get; set; } - + /// /// The id of the SignatureRequest. /// /// The id of the SignatureRequest. [DataMember(Name = "signature_request_id", EmitDefaultValue = true)] public string SignatureRequestId { get; set; } - + /// /// The email address of the initiator of the SignatureRequest. /// /// The email address of the initiator of the SignatureRequest. [DataMember(Name = "requester_email_address", EmitDefaultValue = true)] public string RequesterEmailAddress { get; set; } - + /// /// The title the specified Account uses for the SignatureRequest. /// /// The title the specified Account uses for the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Default Label for account. /// /// Default Label for account. [DataMember(Name = "original_title", EmitDefaultValue = true)] public string OriginalTitle { get; set; } - + /// /// The subject in the email that was initially sent to the signers. /// /// The subject in the email that was initially sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// The custom message in the email that was initially sent to the signers. /// /// The custom message in the email that was initially sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// The metadata attached to the signature request. /// /// The metadata attached to the signature request. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Object Metadata { get; set; } - + /// /// Time the signature request was created. /// /// Time the signature request was created. [DataMember(Name = "created_at", EmitDefaultValue = true)] public int CreatedAt { get; set; } - + /// /// The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. /// /// The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Whether or not the SignatureRequest has been fully executed by all signers. /// /// Whether or not the SignatureRequest has been fully executed by all signers. [DataMember(Name = "is_complete", EmitDefaultValue = true)] public bool IsComplete { get; set; } - + /// /// Whether or not the SignatureRequest has been declined by a signer. /// /// Whether or not the SignatureRequest has been declined by a signer. [DataMember(Name = "is_declined", EmitDefaultValue = true)] public bool IsDeclined { get; set; } - + /// /// Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). /// /// Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). [DataMember(Name = "has_error", EmitDefaultValue = true)] public bool HasError { get; set; } - + /// /// The URL where a copy of the request's documents can be downloaded. /// /// The URL where a copy of the request's documents can be downloaded. [DataMember(Name = "files_url", EmitDefaultValue = true)] public string FilesUrl { get; set; } - + /// /// The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. /// /// The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. [DataMember(Name = "signing_url", EmitDefaultValue = true)] public string SigningUrl { get; set; } - + /// /// The URL where the requester and the signers can view the current status of the SignatureRequest. /// /// The URL where the requester and the signers can view the current status of the SignatureRequest. [DataMember(Name = "details_url", EmitDefaultValue = true)] public string DetailsUrl { get; set; } - + /// /// A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. /// /// A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// The URL you want the signer redirected to after they successfully sign. /// /// The URL you want the signer redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The path where the completed document can be downloaded /// /// The path where the completed document can be downloaded [DataMember(Name = "final_copy_uri", EmitDefaultValue = true)] public string FinalCopyUri { get; set; } - + /// /// Templates IDs used in this SignatureRequest (if any). /// /// Templates IDs used in this SignatureRequest (if any). [DataMember(Name = "template_ids", EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` /// /// An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Signer attachments. /// /// Signer attachments. [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. /// /// An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. [DataMember(Name = "response_data", EmitDefaultValue = true)] public List ResponseData { get; set; } - + /// /// An array of signature objects, 1 for each signer. /// /// An array of signature objects, 1 for each signer. [DataMember(Name = "signatures", EmitDefaultValue = true)] public List Signatures { get; set; } - + /// /// The id of the BulkSendJob. /// /// The id of the BulkSendJob. [DataMember(Name = "bulk_send_job_id", EmitDefaultValue = true)] public string BulkSendJobId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -582,6 +582,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -738,16 +747,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobListResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobListResponse.cs index 4840c1be5..51dff2ab5 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobListResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobListResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "BulkSendJobListResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class BulkSendJobListResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class BulkSendJobListResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected BulkSendJobListResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains a list of BulkSendJobs that the API caller has access to.. - /// listInfo. + /// Contains a list of BulkSendJobs that the API caller has access to. (required). + /// listInfo (required). /// A list of warnings.. public BulkSendJobListResponse(List bulkSendJobs = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "bulkSendJobs" is required (not null) + if (bulkSendJobs == null) + { + throw new ArgumentNullException("bulkSendJobs is a required property for BulkSendJobListResponse and cannot be null"); + } this.BulkSendJobs = bulkSendJobs; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for BulkSendJobListResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,22 +82,22 @@ public static BulkSendJobListResponse Init(string jsonData) /// Contains a list of BulkSendJobs that the API caller has access to. /// /// Contains a list of BulkSendJobs that the API caller has access to. - [DataMember(Name = "bulk_send_jobs", EmitDefaultValue = true)] + [DataMember(Name = "bulk_send_jobs", IsRequired = true, EmitDefaultValue = true)] public List BulkSendJobs { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { 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 /// @@ -178,6 +188,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -202,16 +221,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobResponse.cs index 42d178e29..a471d6652 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "BulkSendJobResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class BulkSendJobResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class BulkSendJobResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,28 +76,28 @@ public static BulkSendJobResponse Init(string jsonData) /// The id of the BulkSendJob. [DataMember(Name = "bulk_send_job_id", EmitDefaultValue = true)] public string BulkSendJobId { get; set; } - + /// /// The total amount of Signature Requests queued for sending. /// /// The total amount of Signature Requests queued for sending. [DataMember(Name = "total", EmitDefaultValue = true)] public int Total { get; set; } - + /// /// True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. /// /// True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. [DataMember(Name = "is_creator", EmitDefaultValue = true)] public bool IsCreator { get; set; } - + /// /// Time that the BulkSendJob was created. /// /// Time that the BulkSendJob was created. [DataMember(Name = "created_at", EmitDefaultValue = true)] public int CreatedAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -184,6 +184,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -214,16 +223,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobSendResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobSendResponse.cs index 8cb4ec3ed..ff2af8680 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobSendResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/BulkSendJobSendResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "BulkSendJobSendResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class BulkSendJobSendResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class BulkSendJobSendResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected BulkSendJobSendResponse() { } /// /// Initializes a new instance of the class. /// - /// bulkSendJob. + /// bulkSendJob (required). /// A list of warnings.. public BulkSendJobSendResponse(BulkSendJobResponse bulkSendJob = default(BulkSendJobResponse), List warnings = default(List)) { + // to ensure "bulkSendJob" is required (not null) + if (bulkSendJob == null) + { + throw new ArgumentNullException("bulkSendJob is a required property for BulkSendJobSendResponse and cannot be null"); + } this.BulkSendJob = bulkSendJob; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static BulkSendJobSendResponse Init(string jsonData) /// /// Gets or Sets BulkSendJob /// - [DataMember(Name = "bulk_send_job", EmitDefaultValue = true)] + [DataMember(Name = "bulk_send_job", IsRequired = true, EmitDefaultValue = true)] public BulkSendJobResponse BulkSendJob { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlRequest.cs index 755134783..a8af5ce42 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EmbeddedEditUrlRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EmbeddedEditUrlRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EmbeddedEditUrlRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -88,69 +88,69 @@ public static EmbeddedEditUrlRequest Init(string jsonData) /// This allows the requester to enable/disable to add or change CC roles when editing the template. [DataMember(Name = "allow_edit_ccs", EmitDefaultValue = true)] public bool AllowEditCcs { get; set; } - + /// /// The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. /// /// The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. [DataMember(Name = "cc_roles", EmitDefaultValue = true)] public List CcRoles { get; set; } - + /// /// Gets or Sets EditorOptions /// [DataMember(Name = "editor_options", EmitDefaultValue = true)] public SubEditorOptions EditorOptions { get; set; } - + /// /// Provide users the ability to review/edit the template signer roles. /// /// Provide users the ability to review/edit the template signer roles. [DataMember(Name = "force_signer_roles", EmitDefaultValue = true)] public bool ForceSignerRoles { get; set; } - + /// /// Provide users the ability to review/edit the template subject and message. /// /// Provide users the ability to review/edit the template subject and message. [DataMember(Name = "force_subject_message", EmitDefaultValue = true)] public bool ForceSubjectMessage { get; set; } - + /// /// Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`. /// /// Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`. [DataMember(Name = "merge_fields", EmitDefaultValue = true)] public List MergeFields { get; set; } - + /// /// This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set). /// /// This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set). [DataMember(Name = "preview_only", EmitDefaultValue = true)] public bool PreviewOnly { get; set; } - + /// /// This allows the requester to enable the editor/preview experience. /// /// This allows the requester to enable the editor/preview experience. [DataMember(Name = "show_preview", EmitDefaultValue = true)] public bool ShowPreview { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. /// /// Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// Returns the string presentation of the object /// @@ -283,6 +283,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -349,16 +358,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlResponse.cs index 6e9da6fc9..27ff9ffe8 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EmbeddedEditUrlResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EmbeddedEditUrlResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EmbeddedEditUrlResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected EmbeddedEditUrlResponse() { } /// /// Initializes a new instance of the class. /// - /// embedded. + /// embedded (required). /// A list of warnings.. public EmbeddedEditUrlResponse(EmbeddedEditUrlResponseEmbedded embedded = default(EmbeddedEditUrlResponseEmbedded), List warnings = default(List)) { + // to ensure "embedded" is required (not null) + if (embedded == null) + { + throw new ArgumentNullException("embedded is a required property for EmbeddedEditUrlResponse and cannot be null"); + } this.Embedded = embedded; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static EmbeddedEditUrlResponse Init(string jsonData) /// /// Gets or Sets Embedded /// - [DataMember(Name = "embedded", EmitDefaultValue = true)] + [DataMember(Name = "embedded", IsRequired = true, EmitDefaultValue = true)] public EmbeddedEditUrlResponseEmbedded Embedded { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlResponseEmbedded.cs b/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlResponseEmbedded.cs index 1f961bb91..39d86c9da 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlResponseEmbedded.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedEditUrlResponseEmbedded.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EmbeddedEditUrlResponseEmbedded")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EmbeddedEditUrlResponseEmbedded : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EmbeddedEditUrlResponseEmbedded : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static EmbeddedEditUrlResponseEmbedded Init(string jsonData) /// A template url that can be opened in an iFrame. [DataMember(Name = "edit_url", EmitDefaultValue = true)] public string EditUrl { get; set; } - + /// /// The specific time that the the `edit_url` link expires, in epoch. /// /// The specific time that the the `edit_url` link expires, in epoch. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -154,6 +154,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -172,16 +181,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedSignUrlResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedSignUrlResponse.cs index 554b2d2f3..6e7f347c5 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedSignUrlResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedSignUrlResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EmbeddedSignUrlResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EmbeddedSignUrlResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EmbeddedSignUrlResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected EmbeddedSignUrlResponse() { } /// /// Initializes a new instance of the class. /// - /// embedded. + /// embedded (required). /// A list of warnings.. public EmbeddedSignUrlResponse(EmbeddedSignUrlResponseEmbedded embedded = default(EmbeddedSignUrlResponseEmbedded), List warnings = default(List)) { + // to ensure "embedded" is required (not null) + if (embedded == null) + { + throw new ArgumentNullException("embedded is a required property for EmbeddedSignUrlResponse and cannot be null"); + } this.Embedded = embedded; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static EmbeddedSignUrlResponse Init(string jsonData) /// /// Gets or Sets Embedded /// - [DataMember(Name = "embedded", EmitDefaultValue = true)] + [DataMember(Name = "embedded", IsRequired = true, EmitDefaultValue = true)] public EmbeddedSignUrlResponseEmbedded Embedded { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedSignUrlResponseEmbedded.cs b/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedSignUrlResponseEmbedded.cs index 6d67035d5..ae0834e72 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedSignUrlResponseEmbedded.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/EmbeddedSignUrlResponseEmbedded.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EmbeddedSignUrlResponseEmbedded")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EmbeddedSignUrlResponseEmbedded : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EmbeddedSignUrlResponseEmbedded : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static EmbeddedSignUrlResponseEmbedded Init(string jsonData) /// A signature url that can be opened in an iFrame. [DataMember(Name = "sign_url", EmitDefaultValue = true)] public string SignUrl { get; set; } - + /// /// The specific time that the the `sign_url` link expires, in epoch. /// /// The specific time that the the `sign_url` link expires, in epoch. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -154,6 +154,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -172,16 +181,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ErrorResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ErrorResponse.cs index 3f52837a3..7a89dff0b 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ErrorResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ErrorResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ErrorResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ErrorResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ErrorResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -74,7 +74,7 @@ public static ErrorResponse Init(string jsonData) /// [DataMember(Name = "error", IsRequired = true, EmitDefaultValue = true)] public ErrorResponseError Error { get; set; } - + /// /// Returns the string presentation of the object /// @@ -143,6 +143,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -155,16 +164,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ErrorResponseError.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ErrorResponseError.cs index b7ec7a6b1..15c9f7aa4 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ErrorResponseError.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ErrorResponseError.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ErrorResponseError")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ErrorResponseError : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ErrorResponseError : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -84,21 +84,21 @@ public static ErrorResponseError Init(string jsonData) /// Message describing an error. [DataMember(Name = "error_msg", IsRequired = true, EmitDefaultValue = true)] public string ErrorMsg { get; set; } - + /// /// Name of the error. /// /// Name of the error. [DataMember(Name = "error_name", IsRequired = true, EmitDefaultValue = true)] public string ErrorName { get; set; } - + /// /// Path at which an error occurred. /// /// Path at which an error occurred. [DataMember(Name = "error_path", EmitDefaultValue = true)] public string ErrorPath { get; set; } - + /// /// Returns the string presentation of the object /// @@ -187,6 +187,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -211,16 +220,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequest.cs index d8b074418..dbe451c40 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EventCallbackRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EventCallbackRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EventCallbackRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,19 +41,19 @@ protected EventCallbackRequest() { } /// /// Initializes a new instance of the class. /// - /// _event (required). + /// varEvent (required). /// account. /// signatureRequest. /// template. - public EventCallbackRequest(EventCallbackRequestEvent _event = default(EventCallbackRequestEvent), AccountResponse account = default(AccountResponse), SignatureRequestResponse signatureRequest = default(SignatureRequestResponse), TemplateResponse template = default(TemplateResponse)) + public EventCallbackRequest(EventCallbackRequestEvent varEvent = default(EventCallbackRequestEvent), AccountResponse account = default(AccountResponse), SignatureRequestResponse signatureRequest = default(SignatureRequestResponse), TemplateResponse template = default(TemplateResponse)) { - // to ensure "_event" is required (not null) - if (_event == null) + // to ensure "varEvent" is required (not null) + if (varEvent == null) { - throw new ArgumentNullException("_event is a required property for EventCallbackRequest and cannot be null"); + throw new ArgumentNullException("varEvent is a required property for EventCallbackRequest and cannot be null"); } - this.Event = _event; + this.Event = varEvent; this.Account = account; this.SignatureRequest = signatureRequest; this.Template = template; @@ -80,25 +80,25 @@ public static EventCallbackRequest Init(string jsonData) /// [DataMember(Name = "event", IsRequired = true, EmitDefaultValue = true)] public EventCallbackRequestEvent Event { get; set; } - + /// /// Gets or Sets Account /// [DataMember(Name = "account", EmitDefaultValue = true)] public AccountResponse Account { get; set; } - + /// /// Gets or Sets SignatureRequest /// [DataMember(Name = "signature_request", EmitDefaultValue = true)] public SignatureRequestResponse SignatureRequest { get; set; } - + /// /// Gets or Sets Template /// [DataMember(Name = "template", EmitDefaultValue = true)] public TemplateResponse Template { get; set; } - + /// /// Returns the string presentation of the object /// @@ -197,6 +197,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -227,16 +236,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequestEvent.cs b/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequestEvent.cs index 9513fffcb..3058970cb 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequestEvent.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequestEvent.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EventCallbackRequestEvent")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EventCallbackRequestEvent : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EventCallbackRequestEvent : IEquatable, IValidatableObject { /// /// Type of callback event that was triggered. @@ -177,7 +177,6 @@ public enum EventTypeEnum /// [EnumMember(Value = "signature_request_signer_removed")] SignatureRequestSignerRemoved = 23 - } @@ -240,20 +239,20 @@ public static EventCallbackRequestEvent Init(string jsonData) /// Time the event was created (using Unix time). [DataMember(Name = "event_time", IsRequired = true, EmitDefaultValue = true)] public string EventTime { get; set; } - + /// /// Generated hash used to verify source of event data. /// /// Generated hash used to verify source of event data. [DataMember(Name = "event_hash", IsRequired = true, EmitDefaultValue = true)] public string EventHash { get; set; } - + /// /// Gets or Sets EventMetadata /// [DataMember(Name = "event_metadata", EmitDefaultValue = true)] public EventCallbackRequestEventMetadata EventMetadata { get; set; } - + /// /// Returns the string presentation of the object /// @@ -348,6 +347,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -378,16 +386,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequestEventMetadata.cs b/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequestEventMetadata.cs index 5b0aaf582..f3993c49e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequestEventMetadata.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/EventCallbackRequestEventMetadata.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EventCallbackRequestEventMetadata")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EventCallbackRequestEventMetadata : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EventCallbackRequestEventMetadata : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,28 +76,28 @@ public static EventCallbackRequestEventMetadata Init(string jsonData) /// Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. [DataMember(Name = "related_signature_id", EmitDefaultValue = true)] public string RelatedSignatureId { get; set; } - + /// /// Account ID the event was reported for. /// /// Account ID the event was reported for. [DataMember(Name = "reported_for_account_id", EmitDefaultValue = true)] public string ReportedForAccountId { get; set; } - + /// /// App ID the event was reported for. /// /// App ID the event was reported for. [DataMember(Name = "reported_for_app_id", EmitDefaultValue = true)] public string ReportedForAppId { get; set; } - + /// /// Message about a declined or failed (due to error) signature flow. /// /// Message about a declined or failed (due to error) signature flow. [DataMember(Name = "event_message", EmitDefaultValue = true)] public string EventMessage { get; set; } - + /// /// Returns the string presentation of the object /// @@ -196,6 +196,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -226,16 +235,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLine.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLine.cs new file mode 100644 index 000000000..8ded1b15c --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLine.cs @@ -0,0 +1,241 @@ +/* + * 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 +{ + /// + /// FaxLine + /// + [DataContract(Name = "FaxLine")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLine : IOpenApiTyped, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLine() { } + /// + /// Initializes a new instance of the class. + /// + /// Number. + /// Created at. + /// Updated at. + /// accounts. + public FaxLine(string number = default(string), string createdAt = default(string), string updatedAt = default(string), List accounts = default(List)) + { + + this.Number = number; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.Accounts = accounts; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLine Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLine"); + } + + return obj; + } + + /// + /// Number + /// + /// Number + [DataMember(Name = "number", EmitDefaultValue = true)] + public string Number { get; set; } + + /// + /// Created at + /// + /// Created at + [DataMember(Name = "created_at", EmitDefaultValue = true)] + public string CreatedAt { get; set; } + + /// + /// Updated at + /// + /// Updated at + [DataMember(Name = "updated_at", EmitDefaultValue = true)] + public string UpdatedAt { get; set; } + + /// + /// Gets or Sets Accounts + /// + [DataMember(Name = "accounts", EmitDefaultValue = true)] + public List Accounts { 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 FaxLine {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); + sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n"); + sb.Append(" Accounts: ").Append(Accounts).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 FaxLine); + } + + /// + /// Returns true if FaxLine instances are equal + /// + /// Instance of FaxLine to be compared + /// Boolean + public bool Equals(FaxLine input) + { + if (input == null) + { + return false; + } + return + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.CreatedAt == input.CreatedAt || + (this.CreatedAt != null && + this.CreatedAt.Equals(input.CreatedAt)) + ) && + ( + this.UpdatedAt == input.UpdatedAt || + (this.UpdatedAt != null && + this.UpdatedAt.Equals(input.UpdatedAt)) + ) && + ( + this.Accounts == input.Accounts || + this.Accounts != null && + input.Accounts != null && + this.Accounts.SequenceEqual(input.Accounts) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + if (this.CreatedAt != null) + { + hashCode = (hashCode * 59) + this.CreatedAt.GetHashCode(); + } + if (this.UpdatedAt != null) + { + hashCode = (hashCode * 59) + this.UpdatedAt.GetHashCode(); + } + if (this.Accounts != null) + { + hashCode = (hashCode * 59) + this.Accounts.GetHashCode(); + } + return hashCode; + } + } + + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "number", + Property = "Number", + Type = "string", + Value = Number, + }); + types.Add(new OpenApiType(){ + Name = "created_at", + Property = "CreatedAt", + Type = "string", + Value = CreatedAt, + }); + types.Add(new OpenApiType(){ + Name = "updated_at", + Property = "UpdatedAt", + Type = "string", + Value = UpdatedAt, + }); + types.Add(new OpenApiType(){ + Name = "accounts", + Property = "Accounts", + Type = "List", + Value = Accounts, + }); + + return types; + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs new file mode 100644 index 000000000..564561bc4 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs @@ -0,0 +1,221 @@ +/* + * 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 +{ + /// + /// FaxLineAddUserRequest + /// + [DataContract(Name = "FaxLineAddUserRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineAddUserRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineAddUserRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The Fax Line number. (required). + /// Account ID. + /// Email address. + public FaxLineAddUserRequest(string number = default(string), string accountId = default(string), string emailAddress = default(string)) + { + + // to ensure "number" is required (not null) + if (number == null) + { + throw new ArgumentNullException("number is a required property for FaxLineAddUserRequest and cannot be null"); + } + this.Number = number; + this.AccountId = accountId; + this.EmailAddress = emailAddress; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineAddUserRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineAddUserRequest"); + } + + return obj; + } + + /// + /// The Fax Line number. + /// + /// The Fax Line number. + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] + public string Number { get; set; } + + /// + /// Account ID + /// + /// Account ID + /// ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + [DataMember(Name = "account_id", EmitDefaultValue = true)] + public string AccountId { get; set; } + + /// + /// Email address + /// + /// Email address + [DataMember(Name = "email_address", EmitDefaultValue = true)] + public string EmailAddress { 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 FaxLineAddUserRequest {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" AccountId: ").Append(AccountId).Append("\n"); + sb.Append(" EmailAddress: ").Append(EmailAddress).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 FaxLineAddUserRequest); + } + + /// + /// Returns true if FaxLineAddUserRequest instances are equal + /// + /// Instance of FaxLineAddUserRequest to be compared + /// Boolean + public bool Equals(FaxLineAddUserRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.AccountId == input.AccountId || + (this.AccountId != null && + this.AccountId.Equals(input.AccountId)) + ) && + ( + this.EmailAddress == input.EmailAddress || + (this.EmailAddress != null && + this.EmailAddress.Equals(input.EmailAddress)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + if (this.AccountId != null) + { + hashCode = (hashCode * 59) + this.AccountId.GetHashCode(); + } + if (this.EmailAddress != null) + { + hashCode = (hashCode * 59) + this.EmailAddress.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 = "number", + Property = "Number", + Type = "string", + Value = Number, + }); + types.Add(new OpenApiType(){ + Name = "account_id", + Property = "AccountId", + Type = "string", + Value = AccountId, + }); + types.Add(new OpenApiType(){ + Name = "email_address", + Property = "EmailAddress", + Type = "string", + Value = EmailAddress, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetCountryEnum.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetCountryEnum.cs new file mode 100644 index 000000000..bf41606e5 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetCountryEnum.cs @@ -0,0 +1,54 @@ +/* + * 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 +{ + /// + /// Defines FaxLineAreaCodeGetCountryEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FaxLineAreaCodeGetCountryEnum + { + /// + /// Enum CA for value: CA + /// + [EnumMember(Value = "CA")] + CA = 1, + + /// + /// Enum US for value: US + /// + [EnumMember(Value = "US")] + US = 2, + + /// + /// Enum UK for value: UK + /// + [EnumMember(Value = "UK")] + UK = 3 + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetProvinceEnum.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetProvinceEnum.cs new file mode 100644 index 000000000..1179ce049 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetProvinceEnum.cs @@ -0,0 +1,114 @@ +/* + * 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 +{ + /// + /// Defines FaxLineAreaCodeGetProvinceEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FaxLineAreaCodeGetProvinceEnum + { + /// + /// Enum AB for value: AB + /// + [EnumMember(Value = "AB")] + AB = 1, + + /// + /// Enum BC for value: BC + /// + [EnumMember(Value = "BC")] + BC = 2, + + /// + /// Enum MB for value: MB + /// + [EnumMember(Value = "MB")] + MB = 3, + + /// + /// Enum NB for value: NB + /// + [EnumMember(Value = "NB")] + NB = 4, + + /// + /// Enum NL for value: NL + /// + [EnumMember(Value = "NL")] + NL = 5, + + /// + /// Enum NT for value: NT + /// + [EnumMember(Value = "NT")] + NT = 6, + + /// + /// Enum NS for value: NS + /// + [EnumMember(Value = "NS")] + NS = 7, + + /// + /// Enum NU for value: NU + /// + [EnumMember(Value = "NU")] + NU = 8, + + /// + /// Enum ON for value: ON + /// + [EnumMember(Value = "ON")] + ON = 9, + + /// + /// Enum PE for value: PE + /// + [EnumMember(Value = "PE")] + PE = 10, + + /// + /// Enum QC for value: QC + /// + [EnumMember(Value = "QC")] + QC = 11, + + /// + /// Enum SK for value: SK + /// + [EnumMember(Value = "SK")] + SK = 12, + + /// + /// Enum YT for value: YT + /// + [EnumMember(Value = "YT")] + YT = 13 + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetResponse.cs new file mode 100644 index 000000000..f4224f030 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetResponse.cs @@ -0,0 +1,170 @@ +/* + * 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 +{ + /// + /// FaxLineAreaCodeGetResponse + /// + [DataContract(Name = "FaxLineAreaCodeGetResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineAreaCodeGetResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineAreaCodeGetResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// areaCodes (required). + public FaxLineAreaCodeGetResponse(List areaCodes = default(List)) + { + + // to ensure "areaCodes" is required (not null) + if (areaCodes == null) + { + throw new ArgumentNullException("areaCodes is a required property for FaxLineAreaCodeGetResponse and cannot be null"); + } + this.AreaCodes = areaCodes; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineAreaCodeGetResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineAreaCodeGetResponse"); + } + + return obj; + } + + /// + /// Gets or Sets AreaCodes + /// + [DataMember(Name = "area_codes", IsRequired = true, EmitDefaultValue = true)] + public List AreaCodes { 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 FaxLineAreaCodeGetResponse {\n"); + sb.Append(" AreaCodes: ").Append(AreaCodes).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 FaxLineAreaCodeGetResponse); + } + + /// + /// Returns true if FaxLineAreaCodeGetResponse instances are equal + /// + /// Instance of FaxLineAreaCodeGetResponse to be compared + /// Boolean + public bool Equals(FaxLineAreaCodeGetResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.AreaCodes == input.AreaCodes || + this.AreaCodes != null && + input.AreaCodes != null && + this.AreaCodes.SequenceEqual(input.AreaCodes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AreaCodes != null) + { + hashCode = (hashCode * 59) + this.AreaCodes.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 = "area_codes", + Property = "AreaCodes", + Type = "List", + Value = AreaCodes, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetStateEnum.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetStateEnum.cs new file mode 100644 index 000000000..c62661b55 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineAreaCodeGetStateEnum.cs @@ -0,0 +1,342 @@ +/* + * 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 +{ + /// + /// Defines FaxLineAreaCodeGetStateEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FaxLineAreaCodeGetStateEnum + { + /// + /// Enum AK for value: AK + /// + [EnumMember(Value = "AK")] + AK = 1, + + /// + /// Enum AL for value: AL + /// + [EnumMember(Value = "AL")] + AL = 2, + + /// + /// Enum AR for value: AR + /// + [EnumMember(Value = "AR")] + AR = 3, + + /// + /// Enum AZ for value: AZ + /// + [EnumMember(Value = "AZ")] + AZ = 4, + + /// + /// Enum CA for value: CA + /// + [EnumMember(Value = "CA")] + CA = 5, + + /// + /// Enum CO for value: CO + /// + [EnumMember(Value = "CO")] + CO = 6, + + /// + /// Enum CT for value: CT + /// + [EnumMember(Value = "CT")] + CT = 7, + + /// + /// Enum DC for value: DC + /// + [EnumMember(Value = "DC")] + DC = 8, + + /// + /// Enum DE for value: DE + /// + [EnumMember(Value = "DE")] + DE = 9, + + /// + /// Enum FL for value: FL + /// + [EnumMember(Value = "FL")] + FL = 10, + + /// + /// Enum GA for value: GA + /// + [EnumMember(Value = "GA")] + GA = 11, + + /// + /// Enum HI for value: HI + /// + [EnumMember(Value = "HI")] + HI = 12, + + /// + /// Enum IA for value: IA + /// + [EnumMember(Value = "IA")] + IA = 13, + + /// + /// Enum ID for value: ID + /// + [EnumMember(Value = "ID")] + ID = 14, + + /// + /// Enum IL for value: IL + /// + [EnumMember(Value = "IL")] + IL = 15, + + /// + /// Enum IN for value: IN + /// + [EnumMember(Value = "IN")] + IN = 16, + + /// + /// Enum KS for value: KS + /// + [EnumMember(Value = "KS")] + KS = 17, + + /// + /// Enum KY for value: KY + /// + [EnumMember(Value = "KY")] + KY = 18, + + /// + /// Enum LA for value: LA + /// + [EnumMember(Value = "LA")] + LA = 19, + + /// + /// Enum MA for value: MA + /// + [EnumMember(Value = "MA")] + MA = 20, + + /// + /// Enum MD for value: MD + /// + [EnumMember(Value = "MD")] + MD = 21, + + /// + /// Enum ME for value: ME + /// + [EnumMember(Value = "ME")] + ME = 22, + + /// + /// Enum MI for value: MI + /// + [EnumMember(Value = "MI")] + MI = 23, + + /// + /// Enum MN for value: MN + /// + [EnumMember(Value = "MN")] + MN = 24, + + /// + /// Enum MO for value: MO + /// + [EnumMember(Value = "MO")] + MO = 25, + + /// + /// Enum MS for value: MS + /// + [EnumMember(Value = "MS")] + MS = 26, + + /// + /// Enum MT for value: MT + /// + [EnumMember(Value = "MT")] + MT = 27, + + /// + /// Enum NC for value: NC + /// + [EnumMember(Value = "NC")] + NC = 28, + + /// + /// Enum ND for value: ND + /// + [EnumMember(Value = "ND")] + ND = 29, + + /// + /// Enum NE for value: NE + /// + [EnumMember(Value = "NE")] + NE = 30, + + /// + /// Enum NH for value: NH + /// + [EnumMember(Value = "NH")] + NH = 31, + + /// + /// Enum NJ for value: NJ + /// + [EnumMember(Value = "NJ")] + NJ = 32, + + /// + /// Enum NM for value: NM + /// + [EnumMember(Value = "NM")] + NM = 33, + + /// + /// Enum NV for value: NV + /// + [EnumMember(Value = "NV")] + NV = 34, + + /// + /// Enum NY for value: NY + /// + [EnumMember(Value = "NY")] + NY = 35, + + /// + /// Enum OH for value: OH + /// + [EnumMember(Value = "OH")] + OH = 36, + + /// + /// Enum OK for value: OK + /// + [EnumMember(Value = "OK")] + OK = 37, + + /// + /// Enum OR for value: OR + /// + [EnumMember(Value = "OR")] + OR = 38, + + /// + /// Enum PA for value: PA + /// + [EnumMember(Value = "PA")] + PA = 39, + + /// + /// Enum RI for value: RI + /// + [EnumMember(Value = "RI")] + RI = 40, + + /// + /// Enum SC for value: SC + /// + [EnumMember(Value = "SC")] + SC = 41, + + /// + /// Enum SD for value: SD + /// + [EnumMember(Value = "SD")] + SD = 42, + + /// + /// Enum TN for value: TN + /// + [EnumMember(Value = "TN")] + TN = 43, + + /// + /// Enum TX for value: TX + /// + [EnumMember(Value = "TX")] + TX = 44, + + /// + /// Enum UT for value: UT + /// + [EnumMember(Value = "UT")] + UT = 45, + + /// + /// Enum VA for value: VA + /// + [EnumMember(Value = "VA")] + VA = 46, + + /// + /// Enum VT for value: VT + /// + [EnumMember(Value = "VT")] + VT = 47, + + /// + /// Enum WA for value: WA + /// + [EnumMember(Value = "WA")] + WA = 48, + + /// + /// Enum WI for value: WI + /// + [EnumMember(Value = "WI")] + WI = 49, + + /// + /// Enum WV for value: WV + /// + [EnumMember(Value = "WV")] + WV = 50, + + /// + /// Enum WY for value: WY + /// + [EnumMember(Value = "WY")] + WY = 51 + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineCreateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineCreateRequest.cs new file mode 100644 index 000000000..0f7157d01 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineCreateRequest.cs @@ -0,0 +1,259 @@ +/* + * 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 +{ + /// + /// FaxLineCreateRequest + /// + [DataContract(Name = "FaxLineCreateRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineCreateRequest : IEquatable, IValidatableObject + { + /// + /// Country + /// + /// Country + [JsonConverter(typeof(StringEnumConverter))] + public enum CountryEnum + { + /// + /// Enum CA for value: CA + /// + [EnumMember(Value = "CA")] + CA = 1, + + /// + /// Enum US for value: US + /// + [EnumMember(Value = "US")] + US = 2, + + /// + /// Enum UK for value: UK + /// + [EnumMember(Value = "UK")] + UK = 3 + } + + + /// + /// Country + /// + /// Country + [DataMember(Name = "country", IsRequired = true, EmitDefaultValue = true)] + public CountryEnum Country { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineCreateRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Area code (required). + /// Country (required). + /// City. + /// Account ID. + public FaxLineCreateRequest(int areaCode = default(int), CountryEnum country = default(CountryEnum), string city = default(string), string accountId = default(string)) + { + + this.AreaCode = areaCode; + this.Country = country; + this.City = city; + this.AccountId = accountId; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineCreateRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineCreateRequest"); + } + + return obj; + } + + /// + /// Area code + /// + /// Area code + [DataMember(Name = "area_code", IsRequired = true, EmitDefaultValue = true)] + public int AreaCode { get; set; } + + /// + /// City + /// + /// City + [DataMember(Name = "city", EmitDefaultValue = true)] + public string City { get; set; } + + /// + /// Account ID + /// + /// Account ID + /// ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + [DataMember(Name = "account_id", EmitDefaultValue = true)] + public string AccountId { 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 FaxLineCreateRequest {\n"); + sb.Append(" AreaCode: ").Append(AreaCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" City: ").Append(City).Append("\n"); + sb.Append(" AccountId: ").Append(AccountId).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 FaxLineCreateRequest); + } + + /// + /// Returns true if FaxLineCreateRequest instances are equal + /// + /// Instance of FaxLineCreateRequest to be compared + /// Boolean + public bool Equals(FaxLineCreateRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.AreaCode == input.AreaCode || + this.AreaCode.Equals(input.AreaCode) + ) && + ( + this.Country == input.Country || + this.Country.Equals(input.Country) + ) && + ( + this.City == input.City || + (this.City != null && + this.City.Equals(input.City)) + ) && + ( + this.AccountId == input.AccountId || + (this.AccountId != null && + this.AccountId.Equals(input.AccountId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.AreaCode.GetHashCode(); + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + if (this.City != null) + { + hashCode = (hashCode * 59) + this.City.GetHashCode(); + } + if (this.AccountId != null) + { + hashCode = (hashCode * 59) + this.AccountId.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 = "area_code", + Property = "AreaCode", + Type = "int", + Value = AreaCode, + }); + types.Add(new OpenApiType(){ + Name = "country", + Property = "Country", + Type = "string", + Value = Country, + }); + types.Add(new OpenApiType(){ + Name = "city", + Property = "City", + Type = "string", + Value = City, + }); + types.Add(new OpenApiType(){ + Name = "account_id", + Property = "AccountId", + Type = "string", + Value = AccountId, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs new file mode 100644 index 000000000..b806f2171 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs @@ -0,0 +1,170 @@ +/* + * 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 +{ + /// + /// FaxLineDeleteRequest + /// + [DataContract(Name = "FaxLineDeleteRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineDeleteRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineDeleteRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The Fax Line number. (required). + public FaxLineDeleteRequest(string number = default(string)) + { + + // to ensure "number" is required (not null) + if (number == null) + { + throw new ArgumentNullException("number is a required property for FaxLineDeleteRequest and cannot be null"); + } + this.Number = number; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineDeleteRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineDeleteRequest"); + } + + return obj; + } + + /// + /// The Fax Line number. + /// + /// The Fax Line number. + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] + public string Number { 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 FaxLineDeleteRequest {\n"); + sb.Append(" Number: ").Append(Number).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 FaxLineDeleteRequest); + } + + /// + /// Returns true if FaxLineDeleteRequest instances are equal + /// + /// Instance of FaxLineDeleteRequest to be compared + /// Boolean + public bool Equals(FaxLineDeleteRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.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 = "number", + Property = "Number", + Type = "string", + Value = Number, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineListResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineListResponse.cs new file mode 100644 index 000000000..25bd1f713 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineListResponse.cs @@ -0,0 +1,223 @@ +/* + * 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 +{ + /// + /// FaxLineListResponse + /// + [DataContract(Name = "FaxLineListResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineListResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineListResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// listInfo (required). + /// faxLines (required). + /// warnings. + public FaxLineListResponse(ListInfoResponse listInfo = default(ListInfoResponse), List faxLines = default(List), WarningResponse warnings = default(WarningResponse)) + { + + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for FaxLineListResponse and cannot be null"); + } + this.ListInfo = listInfo; + // to ensure "faxLines" is required (not null) + if (faxLines == null) + { + throw new ArgumentNullException("faxLines is a required property for FaxLineListResponse and cannot be null"); + } + this.FaxLines = faxLines; + this.Warnings = warnings; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineListResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineListResponse"); + } + + return obj; + } + + /// + /// Gets or Sets ListInfo + /// + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] + public ListInfoResponse ListInfo { get; set; } + + /// + /// Gets or Sets FaxLines + /// + [DataMember(Name = "fax_lines", IsRequired = true, EmitDefaultValue = true)] + public List FaxLines { get; set; } + + /// + /// Gets or Sets Warnings + /// + [DataMember(Name = "warnings", EmitDefaultValue = true)] + public WarningResponse Warnings { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLineListResponse {\n"); + sb.Append(" ListInfo: ").Append(ListInfo).Append("\n"); + sb.Append(" FaxLines: ").Append(FaxLines).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 FaxLineListResponse); + } + + /// + /// Returns true if FaxLineListResponse instances are equal + /// + /// Instance of FaxLineListResponse to be compared + /// Boolean + public bool Equals(FaxLineListResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.ListInfo == input.ListInfo || + (this.ListInfo != null && + this.ListInfo.Equals(input.ListInfo)) + ) && + ( + this.FaxLines == input.FaxLines || + this.FaxLines != null && + input.FaxLines != null && + this.FaxLines.SequenceEqual(input.FaxLines) + ) && + ( + this.Warnings == input.Warnings || + (this.Warnings != null && + this.Warnings.Equals(input.Warnings)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ListInfo != null) + { + hashCode = (hashCode * 59) + this.ListInfo.GetHashCode(); + } + if (this.FaxLines != null) + { + hashCode = (hashCode * 59) + this.FaxLines.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 = "list_info", + Property = "ListInfo", + Type = "ListInfoResponse", + Value = ListInfo, + }); + types.Add(new OpenApiType(){ + Name = "fax_lines", + Property = "FaxLines", + Type = "List", + Value = FaxLines, + }); + types.Add(new OpenApiType(){ + Name = "warnings", + Property = "Warnings", + Type = "WarningResponse", + Value = Warnings, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs new file mode 100644 index 000000000..4a7b22f54 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs @@ -0,0 +1,221 @@ +/* + * 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 +{ + /// + /// FaxLineRemoveUserRequest + /// + [DataContract(Name = "FaxLineRemoveUserRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineRemoveUserRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineRemoveUserRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The Fax Line number. (required). + /// Account ID. + /// Email address. + public FaxLineRemoveUserRequest(string number = default(string), string accountId = default(string), string emailAddress = default(string)) + { + + // to ensure "number" is required (not null) + if (number == null) + { + throw new ArgumentNullException("number is a required property for FaxLineRemoveUserRequest and cannot be null"); + } + this.Number = number; + this.AccountId = accountId; + this.EmailAddress = emailAddress; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineRemoveUserRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineRemoveUserRequest"); + } + + return obj; + } + + /// + /// The Fax Line number. + /// + /// The Fax Line number. + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] + public string Number { get; set; } + + /// + /// Account ID + /// + /// Account ID + /// ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + [DataMember(Name = "account_id", EmitDefaultValue = true)] + public string AccountId { get; set; } + + /// + /// Email address + /// + /// Email address + [DataMember(Name = "email_address", EmitDefaultValue = true)] + public string EmailAddress { 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 FaxLineRemoveUserRequest {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" AccountId: ").Append(AccountId).Append("\n"); + sb.Append(" EmailAddress: ").Append(EmailAddress).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 FaxLineRemoveUserRequest); + } + + /// + /// Returns true if FaxLineRemoveUserRequest instances are equal + /// + /// Instance of FaxLineRemoveUserRequest to be compared + /// Boolean + public bool Equals(FaxLineRemoveUserRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.AccountId == input.AccountId || + (this.AccountId != null && + this.AccountId.Equals(input.AccountId)) + ) && + ( + this.EmailAddress == input.EmailAddress || + (this.EmailAddress != null && + this.EmailAddress.Equals(input.EmailAddress)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + if (this.AccountId != null) + { + hashCode = (hashCode * 59) + this.AccountId.GetHashCode(); + } + if (this.EmailAddress != null) + { + hashCode = (hashCode * 59) + this.EmailAddress.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 = "number", + Property = "Number", + Type = "string", + Value = Number, + }); + types.Add(new OpenApiType(){ + Name = "account_id", + Property = "AccountId", + Type = "string", + Value = AccountId, + }); + types.Add(new OpenApiType(){ + Name = "email_address", + Property = "EmailAddress", + Type = "string", + Value = EmailAddress, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineResponse.cs new file mode 100644 index 000000000..33442e773 --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineResponse.cs @@ -0,0 +1,193 @@ +/* + * 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 +{ + /// + /// FaxLineResponse + /// + [DataContract(Name = "FaxLineResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// faxLine (required). + /// warnings. + public FaxLineResponse(FaxLineResponseFaxLine faxLine = default(FaxLineResponseFaxLine), WarningResponse warnings = default(WarningResponse)) + { + + // to ensure "faxLine" is required (not null) + if (faxLine == null) + { + throw new ArgumentNullException("faxLine is a required property for FaxLineResponse and cannot be null"); + } + this.FaxLine = faxLine; + this.Warnings = warnings; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineResponse"); + } + + return obj; + } + + /// + /// Gets or Sets FaxLine + /// + [DataMember(Name = "fax_line", IsRequired = true, EmitDefaultValue = true)] + public FaxLineResponseFaxLine FaxLine { get; set; } + + /// + /// Gets or Sets Warnings + /// + [DataMember(Name = "warnings", EmitDefaultValue = true)] + public WarningResponse Warnings { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLineResponse {\n"); + sb.Append(" FaxLine: ").Append(FaxLine).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 FaxLineResponse); + } + + /// + /// Returns true if FaxLineResponse instances are equal + /// + /// Instance of FaxLineResponse to be compared + /// Boolean + public bool Equals(FaxLineResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.FaxLine == input.FaxLine || + (this.FaxLine != null && + this.FaxLine.Equals(input.FaxLine)) + ) && + ( + this.Warnings == input.Warnings || + (this.Warnings != null && + this.Warnings.Equals(input.Warnings)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.FaxLine != null) + { + hashCode = (hashCode * 59) + this.FaxLine.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_line", + Property = "FaxLine", + Type = "FaxLineResponseFaxLine", + Value = FaxLine, + }); + types.Add(new OpenApiType(){ + Name = "warnings", + Property = "Warnings", + Type = "WarningResponse", + Value = Warnings, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineResponseFaxLine.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineResponseFaxLine.cs new file mode 100644 index 000000000..a07bd241f --- /dev/null +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FaxLineResponseFaxLine.cs @@ -0,0 +1,232 @@ +/* + * 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 +{ + /// + /// FaxLineResponseFaxLine + /// + [DataContract(Name = "FaxLineResponseFaxLine")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineResponseFaxLine : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineResponseFaxLine() { } + /// + /// Initializes a new instance of the class. + /// + /// Number. + /// Created at. + /// Updated at. + /// accounts. + public FaxLineResponseFaxLine(string number = default(string), int createdAt = default(int), int updatedAt = default(int), List accounts = default(List)) + { + + this.Number = number; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.Accounts = accounts; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineResponseFaxLine Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineResponseFaxLine"); + } + + return obj; + } + + /// + /// Number + /// + /// Number + [DataMember(Name = "number", EmitDefaultValue = true)] + public string Number { get; set; } + + /// + /// Created at + /// + /// Created at + [DataMember(Name = "created_at", EmitDefaultValue = true)] + public int CreatedAt { get; set; } + + /// + /// Updated at + /// + /// Updated at + [DataMember(Name = "updated_at", EmitDefaultValue = true)] + public int UpdatedAt { get; set; } + + /// + /// Gets or Sets Accounts + /// + [DataMember(Name = "accounts", EmitDefaultValue = true)] + public List Accounts { 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 FaxLineResponseFaxLine {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); + sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n"); + sb.Append(" Accounts: ").Append(Accounts).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 FaxLineResponseFaxLine); + } + + /// + /// Returns true if FaxLineResponseFaxLine instances are equal + /// + /// Instance of FaxLineResponseFaxLine to be compared + /// Boolean + public bool Equals(FaxLineResponseFaxLine input) + { + if (input == null) + { + return false; + } + return + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.CreatedAt == input.CreatedAt || + this.CreatedAt.Equals(input.CreatedAt) + ) && + ( + this.UpdatedAt == input.UpdatedAt || + this.UpdatedAt.Equals(input.UpdatedAt) + ) && + ( + this.Accounts == input.Accounts || + this.Accounts != null && + input.Accounts != null && + this.Accounts.SequenceEqual(input.Accounts) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CreatedAt.GetHashCode(); + hashCode = (hashCode * 59) + this.UpdatedAt.GetHashCode(); + if (this.Accounts != null) + { + hashCode = (hashCode * 59) + this.Accounts.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 = "number", + Property = "Number", + Type = "string", + Value = Number, + }); + types.Add(new OpenApiType(){ + Name = "created_at", + Property = "CreatedAt", + Type = "int", + Value = CreatedAt, + }); + types.Add(new OpenApiType(){ + Name = "updated_at", + Property = "UpdatedAt", + Type = "int", + Value = UpdatedAt, + }); + types.Add(new OpenApiType(){ + Name = "accounts", + Property = "Accounts", + Type = "List", + Value = Accounts, + }); + + return types; + } + } + +} diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FileResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FileResponse.cs index 751b8d97b..fd5e27bea 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FileResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FileResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "FileResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class FileResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class FileResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected FileResponse() { } /// /// Initializes a new instance of the class. /// - /// URL to the file.. - /// When the link expires.. + /// URL to the file. (required). + /// When the link expires. (required). public FileResponse(string fileUrl = default(string), int expiresAt = default(int)) { + // to ensure "fileUrl" is required (not null) + if (fileUrl == null) + { + throw new ArgumentNullException("fileUrl is a required property for FileResponse and cannot be null"); + } this.FileUrl = fileUrl; this.ExpiresAt = expiresAt; } @@ -70,16 +75,16 @@ public static FileResponse Init(string jsonData) /// URL to the file. /// /// URL to the file. - [DataMember(Name = "file_url", EmitDefaultValue = true)] + [DataMember(Name = "file_url", IsRequired = true, EmitDefaultValue = true)] public string FileUrl { get; set; } - + /// /// When the link expires. /// /// When the link expires. - [DataMember(Name = "expires_at", EmitDefaultValue = true)] + [DataMember(Name = "expires_at", IsRequired = true, EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -154,6 +159,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -172,16 +186,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/FileResponseDataUri.cs b/sdks/dotnet/src/Dropbox.Sign/Model/FileResponseDataUri.cs index e0ff3b8d1..bb84d4871 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/FileResponseDataUri.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/FileResponseDataUri.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "FileResponseDataUri")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class FileResponseDataUri : IOpenApiTyped, IEquatable, IValidatableObject + public partial class FileResponseDataUri : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,10 +41,15 @@ protected FileResponseDataUri() { } /// /// Initializes a new instance of the class. /// - /// File as base64 encoded string.. + /// File as base64 encoded string. (required). public FileResponseDataUri(string dataUri = default(string)) { + // to ensure "dataUri" is required (not null) + if (dataUri == null) + { + throw new ArgumentNullException("dataUri is a required property for FileResponseDataUri and cannot be null"); + } this.DataUri = dataUri; } @@ -68,9 +73,9 @@ public static FileResponseDataUri Init(string jsonData) /// File as base64 encoded string. /// /// File as base64 encoded string. - [DataMember(Name = "data_uri", EmitDefaultValue = true)] + [DataMember(Name = "data_uri", IsRequired = true, EmitDefaultValue = true)] public string DataUri { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +144,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -151,16 +165,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ListInfoResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ListInfoResponse.cs index 04a6d62ec..47884223b 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ListInfoResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ListInfoResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ListInfoResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ListInfoResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ListInfoResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,28 +76,28 @@ public static ListInfoResponse Init(string jsonData) /// Total number of pages available. [DataMember(Name = "num_pages", EmitDefaultValue = true)] public int NumPages { get; set; } - + /// /// Total number of objects available. /// /// Total number of objects available. [DataMember(Name = "num_results", EmitDefaultValue = true)] public int? NumResults { get; set; } - + /// /// Number of the page being returned. /// /// Number of the page being returned. [DataMember(Name = "page", EmitDefaultValue = true)] public int Page { get; set; } - + /// /// Objects returned per page. /// /// Objects returned per page. [DataMember(Name = "page_size", EmitDefaultValue = true)] public int PageSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -184,6 +184,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -214,16 +223,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenGenerateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenGenerateRequest.cs index 28fae0370..8410b28b6 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenGenerateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenGenerateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "OAuthTokenGenerateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class OAuthTokenGenerateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class OAuthTokenGenerateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -46,7 +46,7 @@ protected OAuthTokenGenerateRequest() { } /// The code passed to your callback when the user granted access. (required). /// When generating a new token use `authorization_code`. (required) (default to "authorization_code"). /// Same as the state you specified earlier. (required). - public OAuthTokenGenerateRequest(string clientId = default(string), string clientSecret = default(string), string code = default(string), string grantType = "authorization_code", string state = default(string)) + public OAuthTokenGenerateRequest(string clientId = default(string), string clientSecret = default(string), string code = default(string), string grantType = @"authorization_code", string state = default(string)) { // to ensure "clientId" is required (not null) @@ -103,35 +103,35 @@ public static OAuthTokenGenerateRequest Init(string jsonData) /// The client id of the app requesting authorization. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// The secret token of your app. /// /// The secret token of your app. [DataMember(Name = "client_secret", IsRequired = true, EmitDefaultValue = true)] public string ClientSecret { get; set; } - + /// /// The code passed to your callback when the user granted access. /// /// The code passed to your callback when the user granted access. [DataMember(Name = "code", IsRequired = true, EmitDefaultValue = true)] public string Code { get; set; } - + /// /// When generating a new token use `authorization_code`. /// /// When generating a new token use `authorization_code`. [DataMember(Name = "grant_type", IsRequired = true, EmitDefaultValue = true)] public string GrantType { get; set; } - + /// /// Same as the state you specified earlier. /// /// Same as the state you specified earlier. [DataMember(Name = "state", IsRequired = true, EmitDefaultValue = true)] public string State { get; set; } - + /// /// Returns the string presentation of the object /// @@ -240,6 +240,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -276,16 +285,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenRefreshRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenRefreshRequest.cs index 335fed343..3f85000f7 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenRefreshRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenRefreshRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "OAuthTokenRefreshRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class OAuthTokenRefreshRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class OAuthTokenRefreshRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -43,7 +43,7 @@ protected OAuthTokenRefreshRequest() { } /// /// When refreshing an existing token use `refresh_token`. (required) (default to "refresh_token"). /// The token provided when you got the expired access token. (required). - public OAuthTokenRefreshRequest(string grantType = "refresh_token", string refreshToken = default(string)) + public OAuthTokenRefreshRequest(string grantType = @"refresh_token", string refreshToken = default(string)) { // to ensure "grantType" is required (not null) @@ -82,14 +82,14 @@ public static OAuthTokenRefreshRequest Init(string jsonData) /// When refreshing an existing token use `refresh_token`. [DataMember(Name = "grant_type", IsRequired = true, EmitDefaultValue = true)] public string GrantType { get; set; } - + /// /// The token provided when you got the expired access token. /// /// The token provided when you got the expired access token. [DataMember(Name = "refresh_token", IsRequired = true, EmitDefaultValue = true)] public string RefreshToken { get; set; } - + /// /// Returns the string presentation of the object /// @@ -168,6 +168,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -186,16 +195,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenResponse.cs index b61ca1d48..fe8b724a3 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/OAuthTokenResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "OAuthTokenResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class OAuthTokenResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class OAuthTokenResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -77,32 +77,32 @@ public static OAuthTokenResponse Init(string jsonData) /// [DataMember(Name = "access_token", EmitDefaultValue = true)] public string AccessToken { get; set; } - + /// /// Gets or Sets TokenType /// [DataMember(Name = "token_type", EmitDefaultValue = true)] public string TokenType { get; set; } - + /// /// Gets or Sets RefreshToken /// [DataMember(Name = "refresh_token", EmitDefaultValue = true)] public string RefreshToken { get; set; } - + /// /// Number of seconds until the `access_token` expires. Uses epoch time. /// /// Number of seconds until the `access_token` expires. Uses epoch time. [DataMember(Name = "expires_in", EmitDefaultValue = true)] public int ExpiresIn { get; set; } - + /// /// Gets or Sets State /// [DataMember(Name = "state", EmitDefaultValue = true)] public string State { get; set; } - + /// /// Returns the string presentation of the object /// @@ -207,6 +207,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -243,16 +252,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ReportCreateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ReportCreateRequest.cs index 779294972..381e9dcca 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ReportCreateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ReportCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ReportCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ReportCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ReportCreateRequest : IEquatable, IValidatableObject { /// /// Defines ReportType @@ -50,17 +50,8 @@ public enum ReportTypeEnum /// [EnumMember(Value = "document_status")] DocumentStatus = 2 - } - - - /// - /// The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). - /// - /// The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). - [DataMember(Name = "report_type", IsRequired = true, EmitDefaultValue = true)] - public List ReportType { get; set; } /// /// Initializes a new instance of the class. /// @@ -117,14 +108,21 @@ public static ReportCreateRequest Init(string jsonData) /// The (inclusive) end date for the report data in `MM/DD/YYYY` format. [DataMember(Name = "end_date", IsRequired = true, EmitDefaultValue = true)] public string EndDate { get; set; } - + + /// + /// The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). + /// + /// The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). + [DataMember(Name = "report_type", IsRequired = true, EmitDefaultValue = true)] + public List ReportType { get; set; } + /// /// The (inclusive) start date for the report data in `MM/DD/YYYY` format. /// /// The (inclusive) start date for the report data in `MM/DD/YYYY` format. [DataMember(Name = "start_date", IsRequired = true, EmitDefaultValue = true)] public string StartDate { get; set; } - + /// /// Returns the string presentation of the object /// @@ -178,6 +176,8 @@ public bool Equals(ReportCreateRequest input) ) && ( this.ReportType == input.ReportType || + this.ReportType != null && + input.ReportType != null && this.ReportType.SequenceEqual(input.ReportType) ) && ( @@ -200,7 +200,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.EndDate.GetHashCode(); } - hashCode = (hashCode * 59) + this.ReportType.GetHashCode(); + if (this.ReportType != null) + { + hashCode = (hashCode * 59) + this.ReportType.GetHashCode(); + } if (this.StartDate != null) { hashCode = (hashCode * 59) + this.StartDate.GetHashCode(); @@ -209,6 +212,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -221,7 +233,7 @@ public List GetOpenApiTypes() types.Add(new OpenApiType(){ Name = "report_type", Property = "ReportType", - Type = "List", + Type = "List", Value = ReportType, }); types.Add(new OpenApiType(){ @@ -233,16 +245,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ReportCreateResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ReportCreateResponse.cs index 30d81f957..4ea4c3da7 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ReportCreateResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ReportCreateResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ReportCreateResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ReportCreateResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ReportCreateResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected ReportCreateResponse() { } /// /// Initializes a new instance of the class. /// - /// report. + /// report (required). /// A list of warnings.. public ReportCreateResponse(ReportResponse report = default(ReportResponse), List warnings = default(List)) { + // to ensure "report" is required (not null) + if (report == null) + { + throw new ArgumentNullException("report is a required property for ReportCreateResponse and cannot be null"); + } this.Report = report; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static ReportCreateResponse Init(string jsonData) /// /// Gets or Sets Report /// - [DataMember(Name = "report", EmitDefaultValue = true)] + [DataMember(Name = "report", IsRequired = true, EmitDefaultValue = true)] public ReportResponse Report { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/ReportResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/ReportResponse.cs index 367e6f81f..172243e2c 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/ReportResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/ReportResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ReportResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ReportResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ReportResponse : IEquatable, IValidatableObject { /// /// Defines ReportType @@ -50,17 +50,8 @@ public enum ReportTypeEnum /// [EnumMember(Value = "document_status")] DocumentStatus = 2 - } - - - /// - /// The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). - /// - /// The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). - [DataMember(Name = "report_type", EmitDefaultValue = true)] - public List ReportType { get; set; } /// /// Initializes a new instance of the class. /// @@ -104,21 +95,28 @@ public static ReportResponse Init(string jsonData) /// A message indicating the requested operation's success [DataMember(Name = "success", EmitDefaultValue = true)] public string Success { get; set; } - + /// /// The (inclusive) start date for the report data in MM/DD/YYYY format. /// /// The (inclusive) start date for the report data in MM/DD/YYYY format. [DataMember(Name = "start_date", EmitDefaultValue = true)] public string StartDate { get; set; } - + /// /// The (inclusive) end date for the report data in MM/DD/YYYY format. /// /// The (inclusive) end date for the report data in MM/DD/YYYY format. [DataMember(Name = "end_date", EmitDefaultValue = true)] public string EndDate { get; set; } - + + /// + /// The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). + /// + /// The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). + [DataMember(Name = "report_type", EmitDefaultValue = true)] + public List ReportType { get; set; } + /// /// Returns the string presentation of the object /// @@ -183,6 +181,8 @@ public bool Equals(ReportResponse input) ) && ( this.ReportType == input.ReportType || + this.ReportType != null && + input.ReportType != null && this.ReportType.SequenceEqual(input.ReportType) ); } @@ -208,11 +208,23 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.EndDate.GetHashCode(); } - hashCode = (hashCode * 59) + this.ReportType.GetHashCode(); + if (this.ReportType != null) + { + hashCode = (hashCode * 59) + this.ReportType.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(); @@ -237,22 +249,12 @@ public List GetOpenApiTypes() types.Add(new OpenApiType(){ Name = "report_type", Property = "ReportType", - Type = "List", + Type = "List", Value = ReportType, }); return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs index 2586c6568..e5f910c7e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestBulkCreateEmbeddedWithTemplateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestBulkCreateEmbeddedWithTemplateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestBulkCreateEmbeddedWithTemplateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -104,91 +104,91 @@ public static SignatureRequestBulkCreateEmbeddedWithTemplateRequest Init(string /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// Client id of the app you're using to create this embedded signature request. Used for security purposes. /// /// Client id of the app you're using to create this embedded signature request. Used for security purposes. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` /// /// `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` [DataMember(Name = "signer_file", EmitDefaultValue = true)] public System.IO.Stream SignerFile { get; set; } - + /// /// `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. /// /// `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. [DataMember(Name = "signer_list", EmitDefaultValue = true)] public List SignerList { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Add CC email recipients. Required when a CC role exists for the Template. /// /// Add CC email recipients. Required when a CC role exists for the Template. [DataMember(Name = "ccs", EmitDefaultValue = true)] public List Ccs { get; set; } - + /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Returns the string presentation of the object /// @@ -374,6 +374,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -458,34 +485,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs index c2356a84c..81b747aef 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestBulkSendWithTemplateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestBulkSendWithTemplateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestBulkSendWithTemplateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -99,91 +99,91 @@ public static SignatureRequestBulkSendWithTemplateRequest Init(string jsonData) /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` /// /// `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` [DataMember(Name = "signer_file", EmitDefaultValue = true)] public System.IO.Stream SignerFile { get; set; } - + /// /// `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. /// /// `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. [DataMember(Name = "signer_list", EmitDefaultValue = true)] public List SignerList { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Add CC email recipients. Required when a CC role exists for the Template. /// /// Add CC email recipients. Required when a CC role exists for the Template. [DataMember(Name = "ccs", EmitDefaultValue = true)] public List Ccs { get; set; } - + /// /// The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. /// /// The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Returns the string presentation of the object /// @@ -369,6 +369,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -453,34 +480,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedRequest.cs index d2133fe6a..be87871cb 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestCreateEmbeddedRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestCreateEmbeddedRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestCreateEmbeddedRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -121,166 +121,166 @@ public static SignatureRequestCreateEmbeddedRequest Init(string jsonData) /// Client id of the app you're using to create this embedded signature request. Used for security purposes. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. /// /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. /// /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. [DataMember(Name = "grouped_signers", EmitDefaultValue = true)] public List GroupedSigners { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The email addresses that should be CCed. /// /// The email addresses that should be CCed. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` /// /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. /// /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] public bool HideTextTags { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. /// /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] public bool UseTextTags { get; set; } - + /// /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. /// /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] public bool PopulateAutoFillFields { get; set; } - + /// /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. /// /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -566,6 +566,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -716,34 +743,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs index 434dff6a9..af8b50efb 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestCreateEmbeddedWithTemplateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestCreateEmbeddedWithTemplateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestCreateEmbeddedWithTemplateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -113,104 +113,104 @@ public static SignatureRequestCreateEmbeddedWithTemplateRequest Init(string json /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// Client id of the app you're using to create this embedded signature request. Used for security purposes. /// /// Client id of the app you're using to create this embedded signature request. Used for security purposes. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Add Signers to your Templated-based Signature Request. /// /// Add Signers to your Templated-based Signature Request. [DataMember(Name = "signers", IsRequired = true, EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Add CC email recipients. Required when a CC role exists for the Template. /// /// Add CC email recipients. Required when a CC role exists for the Template. [DataMember(Name = "ccs", EmitDefaultValue = true)] public List Ccs { get; set; } - + /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. /// /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] public bool PopulateAutoFillFields { get; set; } - + /// /// Returns the string presentation of the object /// @@ -414,6 +414,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -510,34 +537,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestGetResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestGetResponse.cs index 99c5ca289..fb7c89e52 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestGetResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected SignatureRequestGetResponse() { } /// /// Initializes a new instance of the class. /// - /// signatureRequest. + /// signatureRequest (required). /// A list of warnings.. public SignatureRequestGetResponse(SignatureRequestResponse signatureRequest = default(SignatureRequestResponse), List warnings = default(List)) { + // to ensure "signatureRequest" is required (not null) + if (signatureRequest == null) + { + throw new ArgumentNullException("signatureRequest is a required property for SignatureRequestGetResponse and cannot be null"); + } this.SignatureRequest = signatureRequest; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static SignatureRequestGetResponse Init(string jsonData) /// /// Gets or Sets SignatureRequest /// - [DataMember(Name = "signature_request", EmitDefaultValue = true)] + [DataMember(Name = "signature_request", IsRequired = true, EmitDefaultValue = true)] public SignatureRequestResponse SignatureRequest { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestListResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestListResponse.cs index 6ee599bb8..c930e02f7 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestListResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestListResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestListResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestListResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestListResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected SignatureRequestListResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains information about signature requests.. - /// listInfo. + /// Contains information about signature requests. (required). + /// listInfo (required). /// A list of warnings.. public SignatureRequestListResponse(List signatureRequests = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "signatureRequests" is required (not null) + if (signatureRequests == null) + { + throw new ArgumentNullException("signatureRequests is a required property for SignatureRequestListResponse and cannot be null"); + } this.SignatureRequests = signatureRequests; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for SignatureRequestListResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,22 +82,22 @@ public static SignatureRequestListResponse Init(string jsonData) /// Contains information about signature requests. /// /// Contains information about signature requests. - [DataMember(Name = "signature_requests", EmitDefaultValue = true)] + [DataMember(Name = "signature_requests", IsRequired = true, EmitDefaultValue = true)] public List SignatureRequests { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { 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 /// @@ -178,6 +188,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -202,16 +221,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestRemindRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestRemindRequest.cs index d014fd082..186a374fe 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestRemindRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestRemindRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestRemindRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestRemindRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestRemindRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -77,14 +77,14 @@ public static SignatureRequestRemindRequest Init(string jsonData) /// The email address of the signer to send a reminder to. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The name of the signer to send a reminder to. Include if two or more signers share an email address. /// /// The name of the signer to send a reminder to. Include if two or more signers share an email address. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -163,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -181,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponse.cs index b2663d82f..4b06dc8bf 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -119,175 +119,175 @@ public static SignatureRequestResponse Init(string jsonData) /// Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool? TestMode { get; set; } - + /// /// The id of the SignatureRequest. /// /// The id of the SignatureRequest. [DataMember(Name = "signature_request_id", EmitDefaultValue = true)] public string SignatureRequestId { get; set; } - + /// /// The email address of the initiator of the SignatureRequest. /// /// The email address of the initiator of the SignatureRequest. [DataMember(Name = "requester_email_address", EmitDefaultValue = true)] public string RequesterEmailAddress { get; set; } - + /// /// The title the specified Account uses for the SignatureRequest. /// /// The title the specified Account uses for the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Default Label for account. /// /// Default Label for account. [DataMember(Name = "original_title", EmitDefaultValue = true)] public string OriginalTitle { get; set; } - + /// /// The subject in the email that was initially sent to the signers. /// /// The subject in the email that was initially sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// The custom message in the email that was initially sent to the signers. /// /// The custom message in the email that was initially sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// The metadata attached to the signature request. /// /// The metadata attached to the signature request. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Object Metadata { get; set; } - + /// /// Time the signature request was created. /// /// Time the signature request was created. [DataMember(Name = "created_at", EmitDefaultValue = true)] public int CreatedAt { get; set; } - + /// /// The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. /// /// The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Whether or not the SignatureRequest has been fully executed by all signers. /// /// Whether or not the SignatureRequest has been fully executed by all signers. [DataMember(Name = "is_complete", EmitDefaultValue = true)] public bool IsComplete { get; set; } - + /// /// Whether or not the SignatureRequest has been declined by a signer. /// /// Whether or not the SignatureRequest has been declined by a signer. [DataMember(Name = "is_declined", EmitDefaultValue = true)] public bool IsDeclined { get; set; } - + /// /// Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). /// /// Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). [DataMember(Name = "has_error", EmitDefaultValue = true)] public bool HasError { get; set; } - + /// /// The URL where a copy of the request's documents can be downloaded. /// /// The URL where a copy of the request's documents can be downloaded. [DataMember(Name = "files_url", EmitDefaultValue = true)] public string FilesUrl { get; set; } - + /// /// The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. /// /// The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. [DataMember(Name = "signing_url", EmitDefaultValue = true)] public string SigningUrl { get; set; } - + /// /// The URL where the requester and the signers can view the current status of the SignatureRequest. /// /// The URL where the requester and the signers can view the current status of the SignatureRequest. [DataMember(Name = "details_url", EmitDefaultValue = true)] public string DetailsUrl { get; set; } - + /// /// A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. /// /// A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// The URL you want the signer redirected to after they successfully sign. /// /// The URL you want the signer redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The path where the completed document can be downloaded /// /// The path where the completed document can be downloaded [DataMember(Name = "final_copy_uri", EmitDefaultValue = true)] public string FinalCopyUri { get; set; } - + /// /// Templates IDs used in this SignatureRequest (if any). /// /// Templates IDs used in this SignatureRequest (if any). [DataMember(Name = "template_ids", EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` /// /// An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Signer attachments. /// /// Signer attachments. [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. /// /// An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. [DataMember(Name = "response_data", EmitDefaultValue = true)] public List ResponseData { get; set; } - + /// /// An array of signature objects, 1 for each signer. /// /// An array of signature objects, 1 for each signer. [DataMember(Name = "signatures", EmitDefaultValue = true)] public List Signatures { get; set; } - + /// /// The ID of the Bulk Send job which sent the signature request, if applicable. /// /// The ID of the Bulk Send job which sent the signature request, if applicable. [DataMember(Name = "bulk_send_job_id", EmitDefaultValue = true)] public string BulkSendJobId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -582,6 +582,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -738,16 +747,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseAttachment.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseAttachment.cs index 4ef4e5869..9444496b0 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseAttachment.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseAttachment.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestResponseAttachment")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestResponseAttachment : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestResponseAttachment : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -47,7 +47,7 @@ protected SignatureRequestResponseAttachment() { } /// A boolean value denoting if this attachment is required. (required). /// Instructions for Signer.. /// Timestamp when attachment was uploaded by Signer.. - public SignatureRequestResponseAttachment(string id = default(string), string signer = default(string), string name = default(string), bool required = default(bool), string instructions = default(string), int? uploadedAt = default(int?)) + public SignatureRequestResponseAttachment(string id = default(string), Object signer = null, string name = default(string), bool required = default(bool), string instructions = default(string), int? uploadedAt = default(int?)) { // to ensure "id" is required (not null) @@ -61,7 +61,7 @@ protected SignatureRequestResponseAttachment() { } { throw new ArgumentNullException("signer is a required property for SignatureRequestResponseAttachment and cannot be null"); } - this.Signer = signer; + this.Signer = Convert.ToString(signer); // to ensure "name" is required (not null) if (name == null) { @@ -95,42 +95,46 @@ public static SignatureRequestResponseAttachment Init(string jsonData) /// The unique ID for this attachment. [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] public string Id { get; set; } - + /// /// The Signer this attachment is assigned to. /// /// The Signer this attachment is assigned to. [DataMember(Name = "signer", IsRequired = true, EmitDefaultValue = true)] - public string Signer { get; set; } + public object Signer { + get => this._signer; + set => this._signer = Convert.ToString(value); + } + private string _signer; /// /// The name of this attachment. /// /// The name of this attachment. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// A boolean value denoting if this attachment is required. /// /// A boolean value denoting if this attachment is required. [DataMember(Name = "required", IsRequired = true, EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// Instructions for Signer. /// /// Instructions for Signer. [DataMember(Name = "instructions", EmitDefaultValue = true)] public string Instructions { get; set; } - + /// /// Timestamp when attachment was uploaded by Signer. /// /// Timestamp when attachment was uploaded by Signer. [DataMember(Name = "uploaded_at", EmitDefaultValue = true)] public int? UploadedAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -245,6 +249,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -287,16 +300,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldBase.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldBase.cs index 80892f4b7..817d97715 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldBase.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldBase.cs @@ -32,12 +32,10 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestResponseCustomFieldBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldCheckbox), "SignatureRequestResponseCustomFieldCheckbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldText), "SignatureRequestResponseCustomFieldText")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestResponseCustomFieldBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestResponseCustomFieldBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -94,35 +92,35 @@ public static SignatureRequestResponseCustomFieldBase Init(string jsonData) /// The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The name of the Custom Field. /// /// The name of the Custom Field. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// A boolean value denoting if this field is required. /// /// A boolean value denoting if this field is required. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// The unique ID for this field. /// /// The unique ID for this field. [DataMember(Name = "api_id", EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// The name of the Role that is able to edit this field. /// /// The name of the Role that is able to edit this field. [DataMember(Name = "editor", EmitDefaultValue = true)] public string Editor { get; set; } - + /// /// Returns the string presentation of the object /// @@ -227,6 +225,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -263,26 +280,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldCheckbox.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldCheckbox.cs index 6423af7e1..719ce0608 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldCheckbox.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,9 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SignatureRequestResponseCustomFieldBase`. /// [DataContract(Name = "SignatureRequestResponseCustomFieldCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseCustomFieldCheckbox : SignatureRequestResponseCustomFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -51,7 +47,7 @@ protected SignatureRequestResponseCustomFieldCheckbox() { } /// A boolean value denoting if this field is required.. /// The unique ID for this field.. /// The name of the Role that is able to edit this field.. - public SignatureRequestResponseCustomFieldCheckbox(string type = "checkbox", bool value = default(bool), string name = default(string), bool required = default(bool), string apiId = default(string), string editor = default(string)) + public SignatureRequestResponseCustomFieldCheckbox(string type = @"checkbox", bool value = default(bool), string name = default(string), bool required = default(bool), string apiId = default(string), string editor = default(string)) { this.Name = name; this.Required = required; @@ -89,14 +85,14 @@ public static SignatureRequestResponseCustomFieldCheckbox Init(string jsonData) /// The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// A true/false for checkbox fields /// /// A true/false for checkbox fields [DataMember(Name = "value", EmitDefaultValue = true)] public bool Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -172,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "bool", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -206,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -214,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "bool", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldText.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldText.cs index 2ad1fc7a6..aea87ddb7 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldText.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,9 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SignatureRequestResponseCustomFieldBase`. /// [DataContract(Name = "SignatureRequestResponseCustomFieldText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseCustomFieldText : SignatureRequestResponseCustomFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -51,7 +47,7 @@ protected SignatureRequestResponseCustomFieldText() { } /// A boolean value denoting if this field is required.. /// The unique ID for this field.. /// The name of the Role that is able to edit this field.. - public SignatureRequestResponseCustomFieldText(string type = "text", string value = default(string), string name = default(string), bool required = default(bool), string apiId = default(string), string editor = default(string)) + public SignatureRequestResponseCustomFieldText(string type = @"text", string value = default(string), string name = default(string), bool required = default(bool), string apiId = default(string), string editor = default(string)) { this.Name = name; this.Required = required; @@ -89,14 +85,14 @@ public static SignatureRequestResponseCustomFieldText Init(string jsonData) /// The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// A text string for text fields /// /// A text string for text fields [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -176,31 +172,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -210,7 +187,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -218,6 +195,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldTypeEnum.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldTypeEnum.cs index f1de798d6..fc25c94fb 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldTypeEnum.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldTypeEnum.cs @@ -43,7 +43,6 @@ public enum SignatureRequestResponseCustomFieldTypeEnum /// [EnumMember(Value = "checkbox")] Checkbox = 2 - } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataBase.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataBase.cs index 3868f56c8..42d29460f 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataBase.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataBase.cs @@ -32,15 +32,6 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestResponseDataBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "SignatureRequestResponseDataValueCheckbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "SignatureRequestResponseDataValueCheckboxMerge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "SignatureRequestResponseDataValueDateSigned")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "SignatureRequestResponseDataValueDropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "SignatureRequestResponseDataValueInitials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "SignatureRequestResponseDataValueRadio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "SignatureRequestResponseDataValueSignature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "SignatureRequestResponseDataValueText")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "SignatureRequestResponseDataValueTextMerge")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] @@ -51,7 +42,7 @@ namespace Dropbox.Sign.Model [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestResponseDataBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestResponseDataBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -98,34 +89,34 @@ public static SignatureRequestResponseDataBase Init(string jsonData) /// The unique ID for this field. [DataMember(Name = "api_id", EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// The ID of the signature to which this response is linked. /// /// The ID of the signature to which this response is linked. [DataMember(Name = "signature_id", EmitDefaultValue = true)] public string SignatureId { get; set; } - + /// /// The name of the form field. /// /// The name of the form field. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// A boolean value denoting if this field is required. /// /// A boolean value denoting if this field is required. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// Gets or Sets Type /// [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -230,6 +221,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -266,26 +276,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataTypeEnum.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataTypeEnum.cs index a2ddda7a9..25f045437 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataTypeEnum.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataTypeEnum.cs @@ -85,7 +85,6 @@ public enum SignatureRequestResponseDataTypeEnum /// [EnumMember(Value = "checkbox-merge")] CheckboxMerge = 9 - } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckbox.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckbox.cs index 980cef3bd..25ae1ffb3 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckbox.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueCheckbox /// [DataContract(Name = "SignatureRequestResponseDataValueCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueCheckbox : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueCheckbox() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueCheckbox(string type = "checkbox", bool value = default(bool), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueCheckbox(string type = @"checkbox", bool value = default(bool), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueCheckbox Init(string jsonData) /// A yes/no checkbox [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public bool Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -175,31 +164,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "bool", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -209,7 +179,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -217,6 +187,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "bool", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckboxMerge.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckboxMerge.cs index 3638e458a..093bf2649 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckboxMerge.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckboxMerge.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueCheckboxMerge /// [DataContract(Name = "SignatureRequestResponseDataValueCheckboxMerge")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueCheckboxMerge : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueCheckboxMerge() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueCheckboxMerge(string type = "checkbox-merge", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueCheckboxMerge(string type = @"checkbox-merge", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueCheckboxMerge Init(string jsonDat /// A checkbox field that has default value set by the api [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDateSigned.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDateSigned.cs index 4fa90337f..f5f43e0da 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDateSigned.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDateSigned.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueDateSigned /// [DataContract(Name = "SignatureRequestResponseDataValueDateSigned")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueDateSigned : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueDateSigned() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueDateSigned(string type = "date_signed", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueDateSigned(string type = @"date_signed", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueDateSigned Init(string jsonData) /// A date [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDropdown.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDropdown.cs index fffeec0ea..f7be6cb9e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDropdown.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDropdown.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueDropdown /// [DataContract(Name = "SignatureRequestResponseDataValueDropdown")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueDropdown : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueDropdown() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueDropdown(string type = "dropdown", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueDropdown(string type = @"dropdown", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueDropdown Init(string jsonData) /// An input field for dropdowns [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueInitials.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueInitials.cs index 36ee66b34..dda612c27 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueInitials.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueInitials.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueInitials /// [DataContract(Name = "SignatureRequestResponseDataValueInitials")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueInitials : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueInitials() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueInitials(string type = "initials", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueInitials(string type = @"initials", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueInitials Init(string jsonData) /// An input field for initials [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueRadio.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueRadio.cs index a147981b9..953335197 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueRadio.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueRadio.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueRadio /// [DataContract(Name = "SignatureRequestResponseDataValueRadio")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueRadio : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueRadio() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueRadio(string type = "radio", bool value = default(bool), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueRadio(string type = @"radio", bool value = default(bool), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueRadio Init(string jsonData) /// An input field for radios [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public bool Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -175,31 +164,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "bool", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -209,7 +179,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -217,6 +187,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "bool", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueSignature.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueSignature.cs index 54308cabf..828a871fc 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueSignature.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueSignature.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueSignature /// [DataContract(Name = "SignatureRequestResponseDataValueSignature")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueSignature : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueSignature() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueSignature(string type = "signature", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueSignature(string type = @"signature", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueSignature Init(string jsonData) /// A signature input field [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueText.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueText.cs index 0db497c48..235579650 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueText.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueText /// [DataContract(Name = "SignatureRequestResponseDataValueText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueText : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueText() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueText(string type = "text", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueText(string type = @"text", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueText Init(string jsonData) /// A text input field [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueTextMerge.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueTextMerge.cs index 764ffd1fa..9bc45435a 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueTextMerge.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueTextMerge.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueTextMerge /// [DataContract(Name = "SignatureRequestResponseDataValueTextMerge")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueTextMerge : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueTextMerge() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueTextMerge(string type = "text-merge", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueTextMerge(string type = @"text-merge", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueTextMerge Init(string jsonData) /// A text field that has default text set by the api [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseSignatures.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseSignatures.cs index 46ed7f357..5b1e3d613 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseSignatures.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestResponseSignatures.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestResponseSignatures")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestResponseSignatures : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestResponseSignatures : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -106,133 +106,133 @@ public static SignatureRequestResponseSignatures Init(string jsonData) /// Signature identifier. [DataMember(Name = "signature_id", EmitDefaultValue = true)] public string SignatureId { get; set; } - + /// /// Signer Group GUID /// /// Signer Group GUID [DataMember(Name = "signer_group_guid", EmitDefaultValue = true)] public string SignerGroupGuid { get; set; } - + /// /// The email address of the signer. /// /// The email address of the signer. [DataMember(Name = "signer_email_address", EmitDefaultValue = true)] public string SignerEmailAddress { get; set; } - + /// /// The name of the signer. /// /// The name of the signer. [DataMember(Name = "signer_name", EmitDefaultValue = true)] public string SignerName { get; set; } - + /// /// The role of the signer. /// /// The role of the signer. [DataMember(Name = "signer_role", EmitDefaultValue = true)] public string SignerRole { get; set; } - + /// /// If signer order is assigned this is the 0-based index for this signer. /// /// If signer order is assigned this is the 0-based index for this signer. [DataMember(Name = "order", EmitDefaultValue = true)] public int? Order { get; set; } - + /// /// The current status of the signature. eg: awaiting_signature, signed, declined. /// /// The current status of the signature. eg: awaiting_signature, signed, declined. [DataMember(Name = "status_code", EmitDefaultValue = true)] public string StatusCode { get; set; } - + /// /// The reason provided by the signer for declining the request. /// /// The reason provided by the signer for declining the request. [DataMember(Name = "decline_reason", EmitDefaultValue = true)] public string DeclineReason { get; set; } - + /// /// Time that the document was signed or null. /// /// Time that the document was signed or null. [DataMember(Name = "signed_at", EmitDefaultValue = true)] public int? SignedAt { get; set; } - + /// /// The time that the document was last viewed by this signer or null. /// /// The time that the document was last viewed by this signer or null. [DataMember(Name = "last_viewed_at", EmitDefaultValue = true)] public int? LastViewedAt { get; set; } - + /// /// The time the last reminder email was sent to the signer or null. /// /// The time the last reminder email was sent to the signer or null. [DataMember(Name = "last_reminded_at", EmitDefaultValue = true)] public int? LastRemindedAt { get; set; } - + /// /// Boolean to indicate whether this signature requires a PIN to access. /// /// Boolean to indicate whether this signature requires a PIN to access. [DataMember(Name = "has_pin", EmitDefaultValue = true)] public bool HasPin { get; set; } - + /// /// Boolean to indicate whether this signature has SMS authentication enabled. /// /// Boolean to indicate whether this signature has SMS authentication enabled. [DataMember(Name = "has_sms_auth", EmitDefaultValue = true)] public bool? HasSmsAuth { get; set; } - + /// /// Boolean to indicate whether this signature has SMS delivery enabled. /// /// Boolean to indicate whether this signature has SMS delivery enabled. [DataMember(Name = "has_sms_delivery", EmitDefaultValue = true)] public bool? HasSmsDelivery { get; set; } - + /// /// The SMS phone number used for authentication or signature request delivery. /// /// The SMS phone number used for authentication or signature request delivery. [DataMember(Name = "sms_phone_number", EmitDefaultValue = true)] public string SmsPhoneNumber { get; set; } - + /// /// Email address of original signer who reassigned to this signer. /// /// Email address of original signer who reassigned to this signer. [DataMember(Name = "reassigned_by", EmitDefaultValue = true)] public string ReassignedBy { get; set; } - + /// /// Reason provided by original signer who reassigned to this signer. /// /// Reason provided by original signer who reassigned to this signer. [DataMember(Name = "reassignment_reason", EmitDefaultValue = true)] public string ReassignmentReason { get; set; } - + /// /// Previous signature identifier. /// /// Previous signature identifier. [DataMember(Name = "reassigned_from", EmitDefaultValue = true)] public string ReassignedFrom { get; set; } - + /// /// Error message pertaining to this signer, or null. /// /// Error message pertaining to this signer, or null. [DataMember(Name = "error", EmitDefaultValue = true)] public string Error { get; set; } - + /// /// Returns the string presentation of the object /// @@ -477,6 +477,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -597,16 +606,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendRequest.cs index b8c13f72a..56e90b06b 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestSendRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestSendRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestSendRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -120,104 +120,104 @@ public static SignatureRequestSendRequest Init(string jsonData) /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. /// /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. /// /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. [DataMember(Name = "grouped_signers", EmitDefaultValue = true)] public List GroupedSigners { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The email addresses that should be CCed. /// /// The email addresses that should be CCed. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. /// /// The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` /// /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. /// /// Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] public bool HideTextTags { get; set; } - + /// /// Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br> **NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. /// @@ -225,76 +225,76 @@ public static SignatureRequestSendRequest Init(string jsonData) [DataMember(Name = "is_qualified_signature", EmitDefaultValue = true)] [Obsolete] public bool IsQualifiedSignature { get; set; } - + /// /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. /// /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. [DataMember(Name = "is_eid", EmitDefaultValue = true)] public bool IsEid { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. /// /// Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] public bool UseTextTags { get; set; } - + /// /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. /// /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -596,6 +596,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -758,34 +785,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs index e48cf04c9..4beed0615 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestSendWithTemplateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestSendWithTemplateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestSendWithTemplateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -112,56 +112,56 @@ public static SignatureRequestSendWithTemplateRequest Init(string jsonData) /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// Add Signers to your Templated-based Signature Request. /// /// Add Signers to your Templated-based Signature Request. [DataMember(Name = "signers", IsRequired = true, EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Add CC email recipients. Required when a CC role exists for the Template. /// /// Add CC email recipients. Required when a CC role exists for the Template. [DataMember(Name = "ccs", EmitDefaultValue = true)] public List Ccs { get; set; } - + /// /// Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. /// /// Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br> **NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. /// @@ -169,62 +169,62 @@ public static SignatureRequestSendWithTemplateRequest Init(string jsonData) [DataMember(Name = "is_qualified_signature", EmitDefaultValue = true)] [Obsolete] public bool IsQualifiedSignature { get; set; } - + /// /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. /// /// Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. [DataMember(Name = "is_eid", EmitDefaultValue = true)] public bool IsEid { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Returns the string presentation of the object /// @@ -444,6 +444,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -552,34 +579,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestUpdateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestUpdateRequest.cs index 03570e75e..eb7b8bc6a 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestUpdateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SignatureRequestUpdateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestUpdateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestUpdateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestUpdateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -81,28 +81,28 @@ public static SignatureRequestUpdateRequest Init(string jsonData) /// The signature ID for the recipient. [DataMember(Name = "signature_id", IsRequired = true, EmitDefaultValue = true)] public string SignatureId { get; set; } - + /// /// The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided. /// /// The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The new name for the recipient. **NOTE:** Optional if `email_address` is provided. /// /// The new name for the recipient. **NOTE:** Optional if `email_address` is provided. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. /// /// The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -201,6 +201,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -231,16 +240,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubAttachment.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubAttachment.cs index 52a6afd5b..e941ee5d4 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubAttachment.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubAttachment.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubAttachment")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubAttachment : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubAttachment : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -81,28 +81,28 @@ public static SubAttachment Init(string jsonData) /// The name of attachment. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. /// /// The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. [DataMember(Name = "signer_index", IsRequired = true, EmitDefaultValue = true)] public int SignerIndex { get; set; } - + /// /// The instructions for uploading the attachment. /// /// The instructions for uploading the attachment. [DataMember(Name = "instructions", EmitDefaultValue = true)] public string Instructions { get; set; } - + /// /// Determines if the attachment must be uploaded. /// /// Determines if the attachment must be uploaded. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// Returns the string presentation of the object /// @@ -193,6 +193,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -223,16 +232,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubBulkSignerList.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubBulkSignerList.cs index 900ea919a..1f05616b4 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubBulkSignerList.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubBulkSignerList.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubBulkSignerList")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubBulkSignerList : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubBulkSignerList : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static SubBulkSignerList Init(string jsonData) /// An array of custom field values. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value. /// /// Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Returns the string presentation of the object /// @@ -160,6 +160,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -178,16 +187,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubBulkSignerListCustomField.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubBulkSignerListCustomField.cs index 2623b6468..0c8105606 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubBulkSignerListCustomField.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubBulkSignerListCustomField.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubBulkSignerListCustomField")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubBulkSignerListCustomField : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubBulkSignerListCustomField : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -82,14 +82,14 @@ public static SubBulkSignerListCustomField Init(string jsonData) /// The name of the custom field. Must be the field's `name` or `api_id`. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The value of the custom field. /// /// The value of the custom field. [DataMember(Name = "value", IsRequired = true, EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -168,6 +168,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -186,16 +195,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubCC.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubCC.cs index 37d8b1f64..1097fb452 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubCC.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubCC.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubCC")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubCC : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubCC : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -82,14 +82,14 @@ public static SubCC Init(string jsonData) /// Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. [DataMember(Name = "role", IsRequired = true, EmitDefaultValue = true)] public string Role { get; set; } - + /// /// The email address of the CC recipient. /// /// The email address of the CC recipient. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -168,6 +168,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -186,16 +195,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubCustomField.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubCustomField.cs index ed49fb294..c6a0211cb 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubCustomField.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubCustomField.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubCustomField")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubCustomField : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubCustomField : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -81,28 +81,28 @@ public static SubCustomField Init(string jsonData) /// The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. /// /// Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. [DataMember(Name = "editor", EmitDefaultValue = true)] public string Editor { get; set; } - + /// /// Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. /// /// Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing. /// /// The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -197,6 +197,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -227,16 +236,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorOptions.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorOptions.cs index 97e1581af..531f77804 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorOptions.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubEditorOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubEditorOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubEditorOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubEditorOptions : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static SubEditorOptions Init(string jsonData) /// Allows requesters to edit the list of signers [DataMember(Name = "allow_edit_signers", EmitDefaultValue = true)] public bool AllowEditSigners { get; set; } - + /// /// Allows requesters to edit documents, including delete and add /// /// Allows requesters to edit documents, including delete and add [DataMember(Name = "allow_edit_documents", EmitDefaultValue = true)] public bool AllowEditDocuments { get; set; } - + /// /// Returns the string presentation of the object /// @@ -150,6 +150,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -168,16 +177,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFieldOptions.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFieldOptions.cs index 327e984d4..b28139479 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFieldOptions.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFieldOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFieldOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFieldOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFieldOptions : IEquatable, IValidatableObject { /// /// Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. @@ -75,7 +75,6 @@ public enum DateFormatEnum /// [EnumMember(Value = "YYYY - MM - DD")] YYYY_MM_DD = 6 - } @@ -180,6 +179,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -192,16 +200,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldGroup.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldGroup.cs index b842f8b49..78910c7d7 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldGroup.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldGroup.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFormFieldGroup")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFormFieldGroup : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFormFieldGroup : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -89,21 +89,21 @@ public static SubFormFieldGroup Init(string jsonData) /// ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. [DataMember(Name = "group_id", IsRequired = true, EmitDefaultValue = true)] public string GroupId { get; set; } - + /// /// Name of the group /// /// Name of the group [DataMember(Name = "group_label", IsRequired = true, EmitDefaultValue = true)] public string GroupLabel { get; set; } - + /// /// Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. /// /// Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. [DataMember(Name = "requirement", IsRequired = true, EmitDefaultValue = true)] public string Requirement { get; set; } - + /// /// Returns the string presentation of the object /// @@ -192,6 +192,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -216,16 +225,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRule.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRule.cs index 9a8758135..e385fd185 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRule.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRule.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFormFieldRule")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFormFieldRule : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFormFieldRule : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -45,7 +45,7 @@ protected SubFormFieldRule() { } /// Currently only `AND` is supported. Support for `OR` is being worked on. (required) (default to "AND"). /// An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. (required). /// An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule. (required). - public SubFormFieldRule(string id = default(string), string triggerOperator = "AND", List triggers = default(List), List actions = default(List)) + public SubFormFieldRule(string id = default(string), string triggerOperator = @"AND", List triggers = default(List), List actions = default(List)) { // to ensure "id" is required (not null) @@ -96,28 +96,28 @@ public static SubFormFieldRule Init(string jsonData) /// Must be unique across all defined rules. [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] public string Id { get; set; } - + /// /// Currently only `AND` is supported. Support for `OR` is being worked on. /// /// Currently only `AND` is supported. Support for `OR` is being worked on. [DataMember(Name = "trigger_operator", IsRequired = true, EmitDefaultValue = true)] public string TriggerOperator { get; set; } - + /// /// An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. /// /// An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. [DataMember(Name = "triggers", IsRequired = true, EmitDefaultValue = true)] public List Triggers { get; set; } - + /// /// An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule. /// /// An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule. [DataMember(Name = "actions", IsRequired = true, EmitDefaultValue = true)] public List Actions { get; set; } - + /// /// Returns the string presentation of the object /// @@ -218,6 +218,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -248,16 +257,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs index 81c306887..b7a5d0a84 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFormFieldRuleAction")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFormFieldRuleAction : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFormFieldRuleAction : IEquatable, IValidatableObject { /// /// Defines Type @@ -50,7 +50,6 @@ public enum TypeEnum /// [EnumMember(Value = "change-group-visibility")] GroupVisibility = 2 - } @@ -102,21 +101,21 @@ public static SubFormFieldRuleAction Init(string jsonData) /// `true` to hide the target field when rule is satisfied, otherwise `false`. [DataMember(Name = "hidden", IsRequired = true, EmitDefaultValue = true)] public bool Hidden { get; set; } - + /// /// **field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer. /// /// **field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer. [DataMember(Name = "field_id", EmitDefaultValue = true)] public string FieldId { get; set; } - + /// /// **group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer. /// /// **group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer. [DataMember(Name = "group_id", EmitDefaultValue = true)] public string GroupId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -207,6 +206,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -237,16 +245,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleTrigger.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleTrigger.cs index 7645a09fd..af6728f42 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleTrigger.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldRuleTrigger.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFormFieldRuleTrigger")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFormFieldRuleTrigger : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFormFieldRuleTrigger : IEquatable, IValidatableObject { /// /// Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value @@ -69,7 +69,6 @@ public enum OperatorEnum /// [EnumMember(Value = "not")] Not = 5 - } @@ -88,10 +87,10 @@ protected SubFormFieldRuleTrigger() { } /// Initializes a new instance of the class. /// /// Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. (required). - /// Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value (required). + /// Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value (required). /// **value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1`. /// **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`. - public SubFormFieldRuleTrigger(string id = default(string), OperatorEnum _operator = default(OperatorEnum), string value = default(string), List values = default(List)) + public SubFormFieldRuleTrigger(string id = default(string), OperatorEnum varOperator = default(OperatorEnum), string value = default(string), List values = default(List)) { // to ensure "id" is required (not null) @@ -100,7 +99,7 @@ protected SubFormFieldRuleTrigger() { } throw new ArgumentNullException("id is a required property for SubFormFieldRuleTrigger and cannot be null"); } this.Id = id; - this.Operator = _operator; + this.Operator = varOperator; this.Value = value; this.Values = values; } @@ -127,21 +126,21 @@ public static SubFormFieldRuleTrigger Init(string jsonData) /// Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] public string Id { get; set; } - + /// /// **value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` /// /// **value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none` /// /// **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none` [DataMember(Name = "values", EmitDefaultValue = true)] public List Values { get; set; } - + /// /// Returns the string presentation of the object /// @@ -237,6 +236,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -267,16 +275,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentBase.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentBase.cs index 2aae8ac37..3b90d3637 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentBase.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentBase.cs @@ -32,16 +32,6 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFormFieldsPerDocumentBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "SubFormFieldsPerDocumentCheckbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "SubFormFieldsPerDocumentCheckboxMerge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "SubFormFieldsPerDocumentDateSigned")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "SubFormFieldsPerDocumentDropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "SubFormFieldsPerDocumentHyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "SubFormFieldsPerDocumentInitials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "SubFormFieldsPerDocumentRadio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "SubFormFieldsPerDocumentSignature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "SubFormFieldsPerDocumentText")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "SubFormFieldsPerDocumentTextMerge")] [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] @@ -53,7 +43,7 @@ namespace Dropbox.Sign.Model [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFormFieldsPerDocumentBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFormFieldsPerDocumentBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -127,28 +117,28 @@ public static SubFormFieldsPerDocumentBase Init(string jsonData) /// Represents the integer index of the `file` or `file_url` document the field should be attached to. [DataMember(Name = "document_index", IsRequired = true, EmitDefaultValue = true)] public int DocumentIndex { get; set; } - + /// /// An identifier for the field that is unique across all documents in the request. /// /// An identifier for the field that is unique across all documents in the request. [DataMember(Name = "api_id", IsRequired = true, EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// Size of the field in pixels. /// /// Size of the field in pixels. [DataMember(Name = "height", IsRequired = true, EmitDefaultValue = true)] public int Height { get; set; } - + /// /// Whether this field is required. /// /// Whether this field is required. [DataMember(Name = "required", IsRequired = true, EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. /// @@ -160,48 +150,47 @@ public object Signer { } private string _signer; - /// /// Gets or Sets Type /// [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Size of the field in pixels. /// /// Size of the field in pixels. [DataMember(Name = "width", IsRequired = true, EmitDefaultValue = true)] public int Width { get; set; } - + /// /// Location coordinates of the field in pixels. /// /// Location coordinates of the field in pixels. [DataMember(Name = "x", IsRequired = true, EmitDefaultValue = true)] public int X { get; set; } - + /// /// Location coordinates of the field in pixels. /// /// Location coordinates of the field in pixels. [DataMember(Name = "y", IsRequired = true, EmitDefaultValue = true)] public int Y { get; set; } - + /// /// Display name for the field. /// /// Display name for the field. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. /// /// Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. [DataMember(Name = "page", EmitDefaultValue = true)] public int? Page { get; set; } - + /// /// Returns the string presentation of the object /// @@ -346,6 +335,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -418,26 +426,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckbox.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckbox.cs index bd946a6ff..5123fdd5e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckbox.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentCheckbox : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -66,7 +54,7 @@ protected SubFormFieldsPerDocumentCheckbox() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentCheckbox(string type = "checkbox", string group = default(string), bool isChecked = default(bool), int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentCheckbox(string type = @"checkbox", string group = default(string), bool isChecked = default(bool), int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -111,21 +99,21 @@ public static SubFormFieldsPerDocumentCheckbox Init(string jsonData) /// A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// `true` for checking the checkbox field by default, otherwise `false`. /// /// `true` for checking the checkbox field by default, otherwise `false`. [DataMember(Name = "is_checked", IsRequired = true, EmitDefaultValue = true)] public bool IsChecked { get; set; } - + /// /// String referencing group defined in `form_field_groups` parameter. /// /// String referencing group defined in `form_field_groups` parameter. [DataMember(Name = "group", EmitDefaultValue = true)] public string Group { get; set; } - + /// /// Returns the string presentation of the object /// @@ -211,6 +199,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -235,30 +246,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckboxMerge.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckboxMerge.cs index 9c841b6dc..f3e578561 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckboxMerge.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckboxMerge.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentCheckboxMerge")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentCheckboxMerge : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -64,7 +52,7 @@ protected SubFormFieldsPerDocumentCheckboxMerge() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentCheckboxMerge(string type = "checkbox-merge", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentCheckboxMerge(string type = @"checkbox-merge", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -107,7 +95,7 @@ public static SubFormFieldsPerDocumentCheckboxMerge Init(string jsonData) /// A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,25 +165,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -205,7 +180,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -213,6 +188,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDateSigned.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDateSigned.cs index f6458c2c5..0706d57ca 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDateSigned.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDateSigned.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentDateSigned")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentDateSigned : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -147,7 +135,6 @@ public enum FontFamilyEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } @@ -178,7 +165,7 @@ protected SubFormFieldsPerDocumentDateSigned() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentDateSigned(string type = "date_signed", FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentDateSigned(string type = @"date_signed", FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -223,14 +210,14 @@ public static SubFormFieldsPerDocumentDateSigned Init(string jsonData) /// A date. Use the `SubFormFieldsPerDocumentDateSigned` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. /// /// The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. [DataMember(Name = "font_size", EmitDefaultValue = true)] public int FontSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -312,6 +299,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -336,30 +346,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDropdown.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDropdown.cs index 42b9c670e..c996ae2c3 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDropdown.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDropdown.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentDropdown")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentDropdown : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -147,7 +135,6 @@ public enum FontFamilyEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } @@ -180,7 +167,7 @@ protected SubFormFieldsPerDocumentDropdown() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentDropdown(string type = "dropdown", List options = default(List), string content = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentDropdown(string type = @"dropdown", List options = default(List), string content = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -232,28 +219,28 @@ public static SubFormFieldsPerDocumentDropdown Init(string jsonData) /// An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Array of string values representing dropdown values. /// /// Array of string values representing dropdown values. [DataMember(Name = "options", IsRequired = true, EmitDefaultValue = true)] public List Options { get; set; } - + /// /// Selected value in `options` array. Value must exist in array. /// /// Selected value in `options` array. Value must exist in array. [DataMember(Name = "content", EmitDefaultValue = true)] public string Content { get; set; } - + /// /// The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. /// /// The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. [DataMember(Name = "font_size", EmitDefaultValue = true)] public int FontSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -356,6 +343,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -392,30 +402,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentFontEnum.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentFontEnum.cs index 692aacede..84b4ad0d7 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentFontEnum.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentFontEnum.cs @@ -127,7 +127,6 @@ public enum SubFormFieldsPerDocumentFontEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentHyperlink.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentHyperlink.cs index 2d3e4cee8..52961a7c5 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentHyperlink.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentHyperlink.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentHyperlink")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentHyperlink : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -147,7 +135,6 @@ public enum FontFamilyEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } @@ -180,7 +167,7 @@ protected SubFormFieldsPerDocumentHyperlink() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentHyperlink(string type = "hyperlink", string content = default(string), string contentUrl = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentHyperlink(string type = @"hyperlink", string content = default(string), string contentUrl = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -237,28 +224,28 @@ public static SubFormFieldsPerDocumentHyperlink Init(string jsonData) /// A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Link Text. /// /// Link Text. [DataMember(Name = "content", IsRequired = true, EmitDefaultValue = true)] public string Content { get; set; } - + /// /// Link URL. /// /// Link URL. [DataMember(Name = "content_url", IsRequired = true, EmitDefaultValue = true)] public string ContentUrl { get; set; } - + /// /// The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. /// /// The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. [DataMember(Name = "font_size", EmitDefaultValue = true)] public int FontSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -360,6 +347,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -396,30 +406,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentInitials.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentInitials.cs index aca13bc35..729c8736e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentInitials.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentInitials.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentInitials")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentInitials : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -64,7 +52,7 @@ protected SubFormFieldsPerDocumentInitials() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentInitials(string type = "initials", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentInitials(string type = @"initials", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -107,7 +95,7 @@ public static SubFormFieldsPerDocumentInitials Init(string jsonData) /// An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,25 +165,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -205,7 +180,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -213,6 +188,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentRadio.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentRadio.cs index 7ea8dbe5f..10fc88ed5 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentRadio.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentRadio.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentRadio")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentRadio : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -66,7 +54,7 @@ protected SubFormFieldsPerDocumentRadio() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentRadio(string type = "radio", string group = default(string), bool isChecked = default(bool), int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentRadio(string type = @"radio", string group = default(string), bool isChecked = default(bool), int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -116,21 +104,21 @@ public static SubFormFieldsPerDocumentRadio Init(string jsonData) /// An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// String referencing group defined in `form_field_groups` parameter. /// /// String referencing group defined in `form_field_groups` parameter. [DataMember(Name = "group", IsRequired = true, EmitDefaultValue = true)] public string Group { get; set; } - + /// /// `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. /// /// `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. [DataMember(Name = "is_checked", IsRequired = true, EmitDefaultValue = true)] public bool IsChecked { get; set; } - + /// /// Returns the string presentation of the object /// @@ -216,6 +204,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -240,30 +251,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentSignature.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentSignature.cs index bf5a59a65..bff60b6fd 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentSignature.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentSignature.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentSignature")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentSignature : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -64,7 +52,7 @@ protected SubFormFieldsPerDocumentSignature() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentSignature(string type = "signature", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentSignature(string type = @"signature", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -107,7 +95,7 @@ public static SubFormFieldsPerDocumentSignature Init(string jsonData) /// A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,25 +165,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -205,7 +180,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -213,6 +188,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentText.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentText.cs index bea6ff44e..e0244d803 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentText.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentText : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -111,7 +99,6 @@ public enum ValidationTypeEnum /// [EnumMember(Value = "custom_regex")] CustomRegex = 10 - } @@ -223,7 +210,6 @@ public enum FontFamilyEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } @@ -262,7 +248,7 @@ protected SubFormFieldsPerDocumentText() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentText(string type = "text", string placeholder = default(string), string autoFillType = default(string), string linkId = default(string), bool masked = default(bool), ValidationTypeEnum? validationType = default(ValidationTypeEnum?), string validationCustomRegex = default(string), string validationCustomRegexFormatLabel = default(string), string content = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentText(string type = @"text", string placeholder = default(string), string autoFillType = default(string), string linkId = default(string), bool masked = default(bool), ValidationTypeEnum? validationType = default(ValidationTypeEnum?), string validationCustomRegex = default(string), string validationCustomRegexFormatLabel = default(string), string content = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -315,61 +301,61 @@ public static SubFormFieldsPerDocumentText Init(string jsonData) /// A text input field. Use the `SubFormFieldsPerDocumentText` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Placeholder value for text field. /// /// Placeholder value for text field. [DataMember(Name = "placeholder", EmitDefaultValue = true)] public string Placeholder { get; set; } - + /// /// Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. /// /// Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. [DataMember(Name = "auto_fill_type", EmitDefaultValue = true)] public string AutoFillType { get; set; } - + /// /// Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. /// /// Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. [DataMember(Name = "link_id", EmitDefaultValue = true)] public string LinkId { get; set; } - + /// /// Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`. /// /// Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`. [DataMember(Name = "masked", EmitDefaultValue = true)] public bool Masked { get; set; } - + /// /// Gets or Sets ValidationCustomRegex /// [DataMember(Name = "validation_custom_regex", EmitDefaultValue = true)] public string ValidationCustomRegex { get; set; } - + /// /// Gets or Sets ValidationCustomRegexFormatLabel /// [DataMember(Name = "validation_custom_regex_format_label", EmitDefaultValue = true)] public string ValidationCustomRegexFormatLabel { get; set; } - + /// /// Content of a `me_now` text field /// /// Content of a `me_now` text field [DataMember(Name = "content", EmitDefaultValue = true)] public string Content { get; set; } - + /// /// The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. /// /// The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. [DataMember(Name = "font_size", EmitDefaultValue = true)] public int FontSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -523,6 +509,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -595,30 +604,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTextMerge.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTextMerge.cs index 0aca25e6c..127d20ceb 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTextMerge.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTextMerge.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentTextMerge")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentTextMerge : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -147,7 +135,6 @@ public enum FontFamilyEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } @@ -178,7 +165,7 @@ protected SubFormFieldsPerDocumentTextMerge() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentTextMerge(string type = "text-merge", FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentTextMerge(string type = @"text-merge", FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -223,14 +210,14 @@ public static SubFormFieldsPerDocumentTextMerge Init(string jsonData) /// A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. /// /// The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. [DataMember(Name = "font_size", EmitDefaultValue = true)] public int FontSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -312,6 +299,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -336,30 +346,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTypeEnum.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTypeEnum.cs index f0158375d..4a45ad866 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTypeEnum.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTypeEnum.cs @@ -91,7 +91,6 @@ public enum SubFormFieldsPerDocumentTypeEnum /// [EnumMember(Value = "text-merge")] TextMerge = 10 - } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubMergeField.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubMergeField.cs index 9e1f7ddcf..17999938d 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubMergeField.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubMergeField.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubMergeField")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubMergeField : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubMergeField : IEquatable, IValidatableObject { /// /// The type of merge field. @@ -51,7 +51,6 @@ public enum TypeEnum /// [EnumMember(Value = "checkbox")] Checkbox = 2 - } @@ -105,7 +104,7 @@ public static SubMergeField Init(string jsonData) /// The name of the merge field. Must be unique. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -180,6 +179,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -198,16 +206,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubOAuth.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubOAuth.cs index 52f502a2e..288a8d3b1 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubOAuth.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubOAuth.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubOAuth")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubOAuth : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubOAuth : IEquatable, IValidatableObject { /// /// Defines Scopes @@ -86,17 +86,8 @@ public enum ScopesEnum /// [EnumMember(Value = "")] Empty = 8 - } - - - /// - /// A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). - /// - /// A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). - [DataMember(Name = "scopes", EmitDefaultValue = true)] - public List Scopes { get; set; } /// /// Initializes a new instance of the class. /// @@ -136,7 +127,14 @@ public static SubOAuth Init(string jsonData) /// The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + + /// + /// A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). + /// + /// A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). + [DataMember(Name = "scopes", EmitDefaultValue = true)] + public List Scopes { get; set; } + /// /// Returns the string presentation of the object /// @@ -189,6 +187,8 @@ public bool Equals(SubOAuth input) ) && ( this.Scopes == input.Scopes || + this.Scopes != null && + input.Scopes != null && this.Scopes.SequenceEqual(input.Scopes) ); } @@ -206,11 +206,23 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.CallbackUrl.GetHashCode(); } - hashCode = (hashCode * 59) + this.Scopes.GetHashCode(); + if (this.Scopes != null) + { + hashCode = (hashCode * 59) + this.Scopes.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(); @@ -223,22 +235,12 @@ public List GetOpenApiTypes() types.Add(new OpenApiType(){ Name = "scopes", Property = "Scopes", - Type = "List", + Type = "List", Value = Scopes, }); return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubOptions.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubOptions.cs index 82af0cf32..1df55a3fc 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubOptions.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubOptions : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static SubOptions Init(string jsonData) /// Determines if signers can use \"Insert Everywhere\" when signing a document. [DataMember(Name = "can_insert_everywhere", EmitDefaultValue = true)] public bool CanInsertEverywhere { get; set; } - + /// /// Returns the string presentation of the object /// @@ -135,6 +135,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -147,16 +156,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestGroupedSigners.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestGroupedSigners.cs index 7b64469cf..7f1e2fa5f 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestGroupedSigners.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestGroupedSigners.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubSignatureRequestGroupedSigners")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubSignatureRequestGroupedSigners : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubSignatureRequestGroupedSigners : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -84,21 +84,21 @@ public static SubSignatureRequestGroupedSigners Init(string jsonData) /// The name of the group. [DataMember(Name = "group", IsRequired = true, EmitDefaultValue = true)] public string Group { get; set; } - + /// /// Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. /// /// Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. [DataMember(Name = "signers", IsRequired = true, EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// The order the group is required to sign in. Use this instead of Signer-level `order`. /// /// The order the group is required to sign in. Use this instead of Signer-level `order`. [DataMember(Name = "order", EmitDefaultValue = true)] public int? Order { get; set; } - + /// /// Returns the string presentation of the object /// @@ -188,6 +188,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -212,16 +221,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestSigner.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestSigner.cs index b66691020..7b3a3f964 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestSigner.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestSigner.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubSignatureRequestSigner")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubSignatureRequestSigner : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubSignatureRequestSigner : IEquatable, IValidatableObject { /// /// Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). @@ -51,7 +51,6 @@ public enum SmsPhoneNumberTypeEnum /// [EnumMember(Value = "delivery")] Delivery = 2 - } @@ -118,35 +117,35 @@ public static SubSignatureRequestSigner Init(string jsonData) /// The name of the signer. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The email address of the signer. /// /// The email address of the signer. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The order the signer is required to sign in. /// /// The order the signer is required to sign in. [DataMember(Name = "order", EmitDefaultValue = true)] public int? Order { get; set; } - + /// /// The 4- to 12-character access code that will secure this signer's signature page. /// /// The 4- to 12-character access code that will secure this signer's signature page. [DataMember(Name = "pin", EmitDefaultValue = true)] public string Pin { get; set; } - + /// /// An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. /// /// An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. [DataMember(Name = "sms_phone_number", EmitDefaultValue = true)] public string SmsPhoneNumber { get; set; } - + /// /// Returns the string presentation of the object /// @@ -261,6 +260,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Pin (string) maxLength + if (this.Pin != null && this.Pin.Length > 12) + { + yield return new ValidationResult("Invalid value for Pin, length must be less than 12.", new [] { "Pin" }); + } + + // Pin (string) minLength + if (this.Pin != null && this.Pin.Length < 4) + { + yield return new ValidationResult("Invalid value for Pin, length must be greater than 4.", new [] { "Pin" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -303,28 +323,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Pin (string) maxLength - if (this.Pin != null && this.Pin.Length > 12) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Pin, length must be less than 12.", new [] { "Pin" }); - } - - // Pin (string) minLength - if (this.Pin != null && this.Pin.Length < 4) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Pin, length must be greater than 4.", new [] { "Pin" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestTemplateSigner.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestTemplateSigner.cs index 6f8b7a7fb..629a94d67 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestTemplateSigner.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubSignatureRequestTemplateSigner.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubSignatureRequestTemplateSigner")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubSignatureRequestTemplateSigner : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubSignatureRequestTemplateSigner : IEquatable, IValidatableObject { /// /// Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). @@ -51,7 +51,6 @@ public enum SmsPhoneNumberTypeEnum /// [EnumMember(Value = "delivery")] Delivery = 2 - } @@ -123,35 +122,35 @@ public static SubSignatureRequestTemplateSigner Init(string jsonData) /// Must match an existing role in chosen Template(s). It's case-sensitive. [DataMember(Name = "role", IsRequired = true, EmitDefaultValue = true)] public string Role { get; set; } - + /// /// The name of the signer. /// /// The name of the signer. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The email address of the signer. /// /// The email address of the signer. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The 4- to 12-character access code that will secure this signer's signature page. /// /// The 4- to 12-character access code that will secure this signer's signature page. [DataMember(Name = "pin", EmitDefaultValue = true)] public string Pin { get; set; } - + /// /// An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. /// /// An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. [DataMember(Name = "sms_phone_number", EmitDefaultValue = true)] public string SmsPhoneNumber { get; set; } - + /// /// Returns the string presentation of the object /// @@ -266,6 +265,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Pin (string) maxLength + if (this.Pin != null && this.Pin.Length > 12) + { + yield return new ValidationResult("Invalid value for Pin, length must be less than 12.", new [] { "Pin" }); + } + + // Pin (string) minLength + if (this.Pin != null && this.Pin.Length < 4) + { + yield return new ValidationResult("Invalid value for Pin, length must be greater than 4.", new [] { "Pin" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -308,28 +328,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Pin (string) maxLength - if (this.Pin != null && this.Pin.Length > 12) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Pin, length must be less than 12.", new [] { "Pin" }); - } - - // Pin (string) minLength - if (this.Pin != null && this.Pin.Length < 4) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Pin, length must be greater than 4.", new [] { "Pin" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubSigningOptions.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubSigningOptions.cs index 2aa89b537..c3d70070f 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubSigningOptions.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubSigningOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubSigningOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubSigningOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubSigningOptions : IEquatable, IValidatableObject { /// /// The default type shown (limited to the listed types) @@ -63,7 +63,6 @@ public enum DefaultTypeEnum /// [EnumMember(Value = "upload")] Upload = 4 - } @@ -118,28 +117,28 @@ public static SubSigningOptions Init(string jsonData) /// Allows drawing the signature [DataMember(Name = "draw", EmitDefaultValue = true)] public bool Draw { get; set; } - + /// /// Allows using a smartphone to email the signature /// /// Allows using a smartphone to email the signature [DataMember(Name = "phone", EmitDefaultValue = true)] public bool Phone { get; set; } - + /// /// Allows typing the signature /// /// Allows typing the signature [DataMember(Name = "type", EmitDefaultValue = true)] public bool Type { get; set; } - + /// /// Allows uploading the signature /// /// Allows uploading the signature [DataMember(Name = "upload", EmitDefaultValue = true)] public bool Upload { get; set; } - + /// /// Returns the string presentation of the object /// @@ -228,6 +227,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -264,16 +272,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubTeamResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubTeamResponse.cs index b1135552d..53a61528d 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubTeamResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubTeamResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubTeamResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubTeamResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubTeamResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static SubTeamResponse Init(string jsonData) /// The id of a team [DataMember(Name = "team_id", EmitDefaultValue = true)] public string TeamId { get; set; } - + /// /// The name of a team /// /// The name of a team [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubTemplateRole.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubTemplateRole.cs index 54a946ed0..6611d25d1 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubTemplateRole.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubTemplateRole.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubTemplateRole")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubTemplateRole : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubTemplateRole : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static SubTemplateRole Init(string jsonData) /// The role name of the signer that will be displayed when the template is used to create a signature request. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The order in which this signer role is required to sign. /// /// The order in which this signer role is required to sign. [DataMember(Name = "order", EmitDefaultValue = true)] public int? Order { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubUnclaimedDraftSigner.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubUnclaimedDraftSigner.cs index 56479d9b8..fe9f9346a 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubUnclaimedDraftSigner.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubUnclaimedDraftSigner.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubUnclaimedDraftSigner")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubUnclaimedDraftSigner : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubUnclaimedDraftSigner : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -84,21 +84,21 @@ public static SubUnclaimedDraftSigner Init(string jsonData) /// The email address of the signer. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The name of the signer. /// /// The name of the signer. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The order the signer is required to sign in. /// /// The order the signer is required to sign in. [DataMember(Name = "order", EmitDefaultValue = true)] public int? Order { get; set; } - + /// /// Returns the string presentation of the object /// @@ -187,6 +187,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -211,16 +220,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubUnclaimedDraftTemplateSigner.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubUnclaimedDraftTemplateSigner.cs index 1383c4fb6..3a2a6b8d1 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubUnclaimedDraftTemplateSigner.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubUnclaimedDraftTemplateSigner.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubUnclaimedDraftTemplateSigner")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubUnclaimedDraftTemplateSigner : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubUnclaimedDraftTemplateSigner : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -89,21 +89,21 @@ public static SubUnclaimedDraftTemplateSigner Init(string jsonData) /// Must match an existing role in chosen Template(s). [DataMember(Name = "role", IsRequired = true, EmitDefaultValue = true)] public string Role { get; set; } - + /// /// The name of the signer filling the role of `role`. /// /// The name of the signer filling the role of `role`. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The email address of the signer filling the role of `role`. /// /// The email address of the signer filling the role of `role`. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -192,6 +192,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -216,16 +225,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/SubWhiteLabelingOptions.cs b/sdks/dotnet/src/Dropbox.Sign/Model/SubWhiteLabelingOptions.cs index 36996b6e2..6f11e2b0d 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/SubWhiteLabelingOptions.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/SubWhiteLabelingOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubWhiteLabelingOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubWhiteLabelingOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubWhiteLabelingOptions : IEquatable, IValidatableObject { /// /// Defines LegalVersion @@ -50,7 +50,6 @@ public enum LegalVersionEnum /// [EnumMember(Value = "terms2")] Terms2 = 2 - } @@ -82,7 +81,7 @@ protected SubWhiteLabelingOptions() { } /// textColor1 (default to "#808080"). /// textColor2 (default to "#FFFFFF"). /// Resets white labeling options to defaults. Only useful when updating an API App.. - public SubWhiteLabelingOptions(string headerBackgroundColor = "#1A1A1A", LegalVersionEnum? legalVersion = LegalVersionEnum.Terms1, string linkColor = "#00B3E6", string pageBackgroundColor = "#F7F8F9", string primaryButtonColor = "#00B3E6", string primaryButtonColorHover = "#00B3E6", string primaryButtonTextColor = "#FFFFFF", string primaryButtonTextColorHover = "#FFFFFF", string secondaryButtonColor = "#FFFFFF", string secondaryButtonColorHover = "#FFFFFF", string secondaryButtonTextColor = "#00B3E6", string secondaryButtonTextColorHover = "#00B3E6", string textColor1 = "#808080", string textColor2 = "#FFFFFF", bool resetToDefault = default(bool)) + public SubWhiteLabelingOptions(string headerBackgroundColor = @"#1A1A1A", LegalVersionEnum? legalVersion = LegalVersionEnum.Terms1, string linkColor = @"#00B3E6", string pageBackgroundColor = @"#F7F8F9", string primaryButtonColor = @"#00B3E6", string primaryButtonColorHover = @"#00B3E6", string primaryButtonTextColor = @"#FFFFFF", string primaryButtonTextColorHover = @"#FFFFFF", string secondaryButtonColor = @"#FFFFFF", string secondaryButtonColorHover = @"#FFFFFF", string secondaryButtonTextColor = @"#00B3E6", string secondaryButtonTextColorHover = @"#00B3E6", string textColor1 = @"#808080", string textColor2 = @"#FFFFFF", bool resetToDefault = default(bool)) { // use default value if no "headerBackgroundColor" provided @@ -136,86 +135,86 @@ public static SubWhiteLabelingOptions Init(string jsonData) /// [DataMember(Name = "header_background_color", EmitDefaultValue = true)] public string HeaderBackgroundColor { get; set; } - + /// /// Gets or Sets LinkColor /// [DataMember(Name = "link_color", EmitDefaultValue = true)] public string LinkColor { get; set; } - + /// /// Gets or Sets PageBackgroundColor /// [DataMember(Name = "page_background_color", EmitDefaultValue = true)] public string PageBackgroundColor { get; set; } - + /// /// Gets or Sets PrimaryButtonColor /// [DataMember(Name = "primary_button_color", EmitDefaultValue = true)] public string PrimaryButtonColor { get; set; } - + /// /// Gets or Sets PrimaryButtonColorHover /// [DataMember(Name = "primary_button_color_hover", EmitDefaultValue = true)] public string PrimaryButtonColorHover { get; set; } - + /// /// Gets or Sets PrimaryButtonTextColor /// [DataMember(Name = "primary_button_text_color", EmitDefaultValue = true)] public string PrimaryButtonTextColor { get; set; } - + /// /// Gets or Sets PrimaryButtonTextColorHover /// [DataMember(Name = "primary_button_text_color_hover", EmitDefaultValue = true)] public string PrimaryButtonTextColorHover { get; set; } - + /// /// Gets or Sets SecondaryButtonColor /// [DataMember(Name = "secondary_button_color", EmitDefaultValue = true)] public string SecondaryButtonColor { get; set; } - + /// /// Gets or Sets SecondaryButtonColorHover /// [DataMember(Name = "secondary_button_color_hover", EmitDefaultValue = true)] public string SecondaryButtonColorHover { get; set; } - + /// /// Gets or Sets SecondaryButtonTextColor /// [DataMember(Name = "secondary_button_text_color", EmitDefaultValue = true)] public string SecondaryButtonTextColor { get; set; } - + /// /// Gets or Sets SecondaryButtonTextColorHover /// [DataMember(Name = "secondary_button_text_color_hover", EmitDefaultValue = true)] public string SecondaryButtonTextColorHover { get; set; } - + /// /// Gets or Sets TextColor1 /// [DataMember(Name = "text_color1", EmitDefaultValue = true)] public string TextColor1 { get; set; } - + /// /// Gets or Sets TextColor2 /// [DataMember(Name = "text_color2", EmitDefaultValue = true)] public string TextColor2 { get; set; } - + /// /// Resets white labeling options to defaults. Only useful when updating an API App. /// /// Resets white labeling options to defaults. Only useful when updating an API App. [DataMember(Name = "reset_to_default", EmitDefaultValue = true)] public bool ResetToDefault { get; set; } - + /// /// Returns the string presentation of the object /// @@ -416,6 +415,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -512,16 +520,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamAddMemberRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamAddMemberRequest.cs index 0f3cfe22a..9c988a286 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamAddMemberRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamAddMemberRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamAddMemberRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamAddMemberRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamAddMemberRequest : IEquatable, IValidatableObject { /// /// A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided. @@ -63,7 +63,6 @@ public enum RoleEnum /// [EnumMember(Value = "Admin")] Admin = 4 - } @@ -114,14 +113,14 @@ public static TeamAddMemberRequest Init(string jsonData) /// `account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// `account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team. /// /// `account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -206,6 +205,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -230,16 +238,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamCreateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamCreateRequest.cs index 50a199eb3..a73122b37 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamCreateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamCreateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -42,7 +42,7 @@ protected TeamCreateRequest() { } /// Initializes a new instance of the class. /// /// The name of your Team. (default to "Untitled Team"). - public TeamCreateRequest(string name = "Untitled Team") + public TeamCreateRequest(string name = @"Untitled Team") { // use default value if no "name" provided @@ -71,7 +71,7 @@ public static TeamCreateRequest Init(string jsonData) /// The name of your Team. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -140,6 +140,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -152,16 +161,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamGetInfoResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamGetInfoResponse.cs index 10bda49c3..47afb05e3 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamGetInfoResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamGetInfoResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamGetInfoResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamGetInfoResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamGetInfoResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TeamGetInfoResponse() { } /// /// Initializes a new instance of the class. /// - /// team. + /// team (required). /// A list of warnings.. public TeamGetInfoResponse(TeamInfoResponse team = default(TeamInfoResponse), List warnings = default(List)) { + // to ensure "team" is required (not null) + if (team == null) + { + throw new ArgumentNullException("team is a required property for TeamGetInfoResponse and cannot be null"); + } this.Team = team; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static TeamGetInfoResponse Init(string jsonData) /// /// Gets or Sets Team /// - [DataMember(Name = "team", EmitDefaultValue = true)] + [DataMember(Name = "team", IsRequired = true, EmitDefaultValue = true)] public TeamInfoResponse Team { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamGetResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamGetResponse.cs index 2087aa273..db7efe0e0 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamGetResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TeamGetResponse() { } /// /// Initializes a new instance of the class. /// - /// team. + /// team (required). /// A list of warnings.. public TeamGetResponse(TeamResponse team = default(TeamResponse), List warnings = default(List)) { + // to ensure "team" is required (not null) + if (team == null) + { + throw new ArgumentNullException("team is a required property for TeamGetResponse and cannot be null"); + } this.Team = team; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static TeamGetResponse Init(string jsonData) /// /// Gets or Sets Team /// - [DataMember(Name = "team", EmitDefaultValue = true)] + [DataMember(Name = "team", IsRequired = true, EmitDefaultValue = true)] public TeamResponse Team { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamInfoResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamInfoResponse.cs index 03756583b..b35c7a866 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamInfoResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamInfoResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamInfoResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamInfoResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamInfoResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -78,34 +78,34 @@ public static TeamInfoResponse Init(string jsonData) /// The id of a team [DataMember(Name = "team_id", EmitDefaultValue = true)] public string TeamId { get; set; } - + /// /// Gets or Sets TeamParent /// [DataMember(Name = "team_parent", EmitDefaultValue = true)] public TeamParentResponse TeamParent { get; set; } - + /// /// The name of a team /// /// The name of a team [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Number of members within a team /// /// Number of members within a team [DataMember(Name = "num_members", EmitDefaultValue = true)] public int NumMembers { get; set; } - + /// /// Number of sub teams within a team /// /// Number of sub teams within a team [DataMember(Name = "num_sub_teams", EmitDefaultValue = true)] public int NumSubTeams { get; set; } - + /// /// Returns the string presentation of the object /// @@ -206,6 +206,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -242,16 +251,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamInviteResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamInviteResponse.cs index 67a22d2f4..236118300 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamInviteResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamInviteResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamInviteResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamInviteResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamInviteResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,42 +80,42 @@ public static TeamInviteResponse Init(string jsonData) /// Email address of the user invited to this team. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Id of the team. /// /// Id of the team. [DataMember(Name = "team_id", EmitDefaultValue = true)] public string TeamId { get; set; } - + /// /// Role of the user invited to this team. /// /// Role of the user invited to this team. [DataMember(Name = "role", EmitDefaultValue = true)] public string Role { get; set; } - + /// /// Timestamp when the invitation was sent. /// /// Timestamp when the invitation was sent. [DataMember(Name = "sent_at", EmitDefaultValue = true)] public int SentAt { get; set; } - + /// /// Timestamp when the invitation was redeemed. /// /// Timestamp when the invitation was redeemed. [DataMember(Name = "redeemed_at", EmitDefaultValue = true)] public int RedeemedAt { get; set; } - + /// /// Timestamp when the invitation is expiring. /// /// Timestamp when the invitation is expiring. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -222,6 +222,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -264,16 +273,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamInvitesResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamInvitesResponse.cs index c06401f75..b4d6570d9 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamInvitesResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamInvitesResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamInvitesResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamInvitesResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamInvitesResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TeamInvitesResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains a list of team invites and their roles.. + /// Contains a list of team invites and their roles. (required). /// warnings. public TeamInvitesResponse(List teamInvites = default(List), List warnings = default(List)) { + // to ensure "teamInvites" is required (not null) + if (teamInvites == null) + { + throw new ArgumentNullException("teamInvites is a required property for TeamInvitesResponse and cannot be null"); + } this.TeamInvites = teamInvites; this.Warnings = warnings; } @@ -70,15 +75,15 @@ public static TeamInvitesResponse Init(string jsonData) /// Contains a list of team invites and their roles. /// /// Contains a list of team invites and their roles. - [DataMember(Name = "team_invites", EmitDefaultValue = true)] + [DataMember(Name = "team_invites", IsRequired = true, EmitDefaultValue = true)] public List TeamInvites { get; set; } - + /// /// Gets or Sets Warnings /// [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -159,6 +164,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -177,16 +191,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamMemberResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamMemberResponse.cs index 3273ae1f5..5eb2d0c28 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamMemberResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamMemberResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamMemberResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamMemberResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamMemberResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -74,21 +74,21 @@ public static TeamMemberResponse Init(string jsonData) /// Account id of the team member. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// Email address of the team member. /// /// Email address of the team member. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The specific role a member has on the team. /// /// The specific role a member has on the team. [DataMember(Name = "role", EmitDefaultValue = true)] public string Role { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,6 +177,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -201,16 +210,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamMembersResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamMembersResponse.cs index c0578d53d..e4ed27dcb 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamMembersResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamMembersResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamMembersResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamMembersResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamMembersResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected TeamMembersResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains a list of team members and their roles for a specific team.. - /// listInfo. + /// Contains a list of team members and their roles for a specific team. (required). + /// listInfo (required). /// warnings. public TeamMembersResponse(List teamMembers = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "teamMembers" is required (not null) + if (teamMembers == null) + { + throw new ArgumentNullException("teamMembers is a required property for TeamMembersResponse and cannot be null"); + } this.TeamMembers = teamMembers; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for TeamMembersResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,21 +82,21 @@ public static TeamMembersResponse Init(string jsonData) /// Contains a list of team members and their roles for a specific team. /// /// Contains a list of team members and their roles for a specific team. - [DataMember(Name = "team_members", EmitDefaultValue = true)] + [DataMember(Name = "team_members", IsRequired = true, EmitDefaultValue = true)] public List TeamMembers { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { get; set; } - + /// /// Gets or Sets Warnings /// [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,6 +187,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -201,16 +220,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamParentResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamParentResponse.cs index 314993200..30730d612 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamParentResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamParentResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamParentResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamParentResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamParentResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static TeamParentResponse Init(string jsonData) /// The id of a team [DataMember(Name = "team_id", EmitDefaultValue = true)] public string TeamId { get; set; } - + /// /// The name of a team /// /// The name of a team [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamRemoveMemberRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamRemoveMemberRequest.cs index e12e94f28..2d8d606e6 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamRemoveMemberRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamRemoveMemberRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamRemoveMemberRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamRemoveMemberRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamRemoveMemberRequest : IEquatable, IValidatableObject { /// /// A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided. @@ -63,7 +63,6 @@ public enum NewRoleEnum /// [EnumMember(Value = "Admin")] Admin = 4 - } @@ -118,28 +117,28 @@ public static TeamRemoveMemberRequest Init(string jsonData) /// **account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// **account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team. /// /// **account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans. /// /// The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans. [DataMember(Name = "new_owner_email_address", EmitDefaultValue = true)] public string NewOwnerEmailAddress { get; set; } - + /// /// Id of the new Team. /// /// Id of the new Team. [DataMember(Name = "new_team_id", EmitDefaultValue = true)] public string NewTeamId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -244,6 +243,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -280,16 +288,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamResponse.cs index 99ddc3020..fd47071f1 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,27 +76,27 @@ public static TeamResponse Init(string jsonData) /// The name of your Team [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Gets or Sets Accounts /// [DataMember(Name = "accounts", EmitDefaultValue = true)] public List Accounts { get; set; } - + /// /// A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. /// /// A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. [DataMember(Name = "invited_accounts", EmitDefaultValue = true)] public List InvitedAccounts { get; set; } - + /// /// A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. /// /// A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. [DataMember(Name = "invited_emails", EmitDefaultValue = true)] public List InvitedEmails { get; set; } - + /// /// Returns the string presentation of the object /// @@ -198,6 +198,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -228,16 +237,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamSubTeamsResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamSubTeamsResponse.cs index 0cb396f1b..5c525dfa0 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamSubTeamsResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamSubTeamsResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamSubTeamsResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamSubTeamsResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamSubTeamsResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected TeamSubTeamsResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains a list with sub teams.. - /// listInfo. + /// Contains a list with sub teams. (required). + /// listInfo (required). /// warnings. public TeamSubTeamsResponse(List subTeams = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "subTeams" is required (not null) + if (subTeams == null) + { + throw new ArgumentNullException("subTeams is a required property for TeamSubTeamsResponse and cannot be null"); + } this.SubTeams = subTeams; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for TeamSubTeamsResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,21 +82,21 @@ public static TeamSubTeamsResponse Init(string jsonData) /// Contains a list with sub teams. /// /// Contains a list with sub teams. - [DataMember(Name = "sub_teams", EmitDefaultValue = true)] + [DataMember(Name = "sub_teams", IsRequired = true, EmitDefaultValue = true)] public List SubTeams { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { get; set; } - + /// /// Gets or Sets Warnings /// [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,6 +187,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -201,16 +220,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TeamUpdateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TeamUpdateRequest.cs index ca0b0874d..4d555f817 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TeamUpdateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TeamUpdateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamUpdateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamUpdateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamUpdateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static TeamUpdateRequest Init(string jsonData) /// The name of your Team. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +139,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -151,16 +160,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateAddUserRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateAddUserRequest.cs index 65f0551f3..658f781a7 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateAddUserRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateAddUserRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateAddUserRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateAddUserRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateAddUserRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -74,21 +74,21 @@ public static TemplateAddUserRequest Init(string jsonData) /// The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided. /// /// The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. /// /// If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. [DataMember(Name = "skip_notification", EmitDefaultValue = true)] public bool SkipNotification { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,6 +173,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -197,16 +206,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftRequest.cs index 1acfdd73e..2bcd91895 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateEmbeddedDraftRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateEmbeddedDraftRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateEmbeddedDraftRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -123,173 +123,173 @@ public static TemplateCreateEmbeddedDraftRequest Init(string jsonData) /// Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. [DataMember(Name = "allow_ccs", EmitDefaultValue = true)] public bool AllowCcs { get; set; } - + /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The CC roles that must be assigned when using the template to send a signature request /// /// The CC roles that must be assigned when using the template to send a signature request [DataMember(Name = "cc_roles", EmitDefaultValue = true)] public List CcRoles { get; set; } - + /// /// Gets or Sets EditorOptions /// [DataMember(Name = "editor_options", EmitDefaultValue = true)] public SubEditorOptions EditorOptions { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// Provide users the ability to review/edit the template signer roles. /// /// Provide users the ability to review/edit the template signer roles. [DataMember(Name = "force_signer_roles", EmitDefaultValue = true)] public bool ForceSignerRoles { get; set; } - + /// /// Provide users the ability to review/edit the template subject and message. /// /// Provide users the ability to review/edit the template subject and message. [DataMember(Name = "force_subject_message", EmitDefaultValue = true)] public bool ForceSubjectMessage { get; set; } - + /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` /// /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. /// /// Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. [DataMember(Name = "merge_fields", EmitDefaultValue = true)] public List MergeFields { get; set; } - + /// /// The default template email message. /// /// The default template email message. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. /// /// This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. [DataMember(Name = "show_preview", EmitDefaultValue = true)] public bool ShowPreview { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. [DataMember(Name = "signer_roles", EmitDefaultValue = true)] public List SignerRoles { get; set; } - + /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. [DataMember(Name = "skip_me_now", EmitDefaultValue = true)] public bool SkipMeNow { get; set; } - + /// /// The template title (alias). /// /// The template title (alias). [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). /// /// Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). [DataMember(Name = "use_preexisting_fields", EmitDefaultValue = true)] public bool UsePreexistingFields { get; set; } - + /// /// Returns the string presentation of the object /// @@ -572,6 +572,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 200) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -728,28 +749,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 200) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponse.cs index 7ba9b8dd2..4bdc6475d 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateEmbeddedDraftResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateEmbeddedDraftResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateEmbeddedDraftResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TemplateCreateEmbeddedDraftResponse() { } /// /// Initializes a new instance of the class. /// - /// template. + /// template (required). /// A list of warnings.. public TemplateCreateEmbeddedDraftResponse(TemplateCreateEmbeddedDraftResponseTemplate template = default(TemplateCreateEmbeddedDraftResponseTemplate), List warnings = default(List)) { + // to ensure "template" is required (not null) + if (template == null) + { + throw new ArgumentNullException("template is a required property for TemplateCreateEmbeddedDraftResponse and cannot be null"); + } this.Template = template; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static TemplateCreateEmbeddedDraftResponse Init(string jsonData) /// /// Gets or Sets Template /// - [DataMember(Name = "template", EmitDefaultValue = true)] + [DataMember(Name = "template", IsRequired = true, EmitDefaultValue = true)] public TemplateCreateEmbeddedDraftResponseTemplate Template { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponseTemplate.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponseTemplate.cs index e25ebf007..23510e04a 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponseTemplate.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponseTemplate.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateEmbeddedDraftResponseTemplate")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateEmbeddedDraftResponseTemplate : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateEmbeddedDraftResponseTemplate : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,21 +76,21 @@ public static TemplateCreateEmbeddedDraftResponseTemplate Init(string jsonData) /// The id of the Template. [DataMember(Name = "template_id", EmitDefaultValue = true)] public string TemplateId { get; set; } - + /// /// Link to edit the template. /// /// Link to edit the template. [DataMember(Name = "edit_url", EmitDefaultValue = true)] public string EditUrl { get; set; } - + /// /// When the link expires. /// /// When the link expires. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// A list of warnings. /// @@ -98,7 +98,7 @@ public static TemplateCreateEmbeddedDraftResponseTemplate Init(string jsonData) [DataMember(Name = "warnings", EmitDefaultValue = true)] [Obsolete] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -194,6 +194,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -224,16 +233,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateRequest.cs index 5c7318841..424439edd 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -114,125 +114,125 @@ public static TemplateCreateRequest Init(string jsonData) /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` [DataMember(Name = "form_fields_per_document", IsRequired = true, EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. [DataMember(Name = "signer_roles", IsRequired = true, EmitDefaultValue = true)] public List SignerRoles { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The CC roles that must be assigned when using the template to send a signature request /// /// The CC roles that must be assigned when using the template to send a signature request [DataMember(Name = "cc_roles", EmitDefaultValue = true)] public List CcRoles { get; set; } - + /// /// Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. /// /// Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. /// /// Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. [DataMember(Name = "merge_fields", EmitDefaultValue = true)] public List MergeFields { get; set; } - + /// /// The default template email message. /// /// The default template email message. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// The template title (alias). /// /// The template title (alias). [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). /// /// Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). [DataMember(Name = "use_preexisting_fields", EmitDefaultValue = true)] public bool UsePreexistingFields { get; set; } - + /// /// Returns the string presentation of the object /// @@ -469,6 +469,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 200) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -583,28 +604,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 200) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateResponse.cs index a342dd966..93f898335 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TemplateCreateResponse() { } /// /// Initializes a new instance of the class. /// - /// template. + /// template (required). /// A list of warnings.. public TemplateCreateResponse(TemplateCreateResponseTemplate template = default(TemplateCreateResponseTemplate), List warnings = default(List)) { + // to ensure "template" is required (not null) + if (template == null) + { + throw new ArgumentNullException("template is a required property for TemplateCreateResponse and cannot be null"); + } this.Template = template; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static TemplateCreateResponse Init(string jsonData) /// /// Gets or Sets Template /// - [DataMember(Name = "template", EmitDefaultValue = true)] + [DataMember(Name = "template", IsRequired = true, EmitDefaultValue = true)] public TemplateCreateResponseTemplate Template { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateResponseTemplate.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateResponseTemplate.cs index 32b22c960..2ba366d49 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateResponseTemplate.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateCreateResponseTemplate.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateResponseTemplate")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateResponseTemplate : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateResponseTemplate : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static TemplateCreateResponseTemplate Init(string jsonData) /// The id of the Template. [DataMember(Name = "template_id", EmitDefaultValue = true)] public string TemplateId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +139,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -151,16 +160,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs index c885a955f..ee5f6586c 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateEditResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateEditResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateEditResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateEditResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,10 +41,15 @@ protected TemplateEditResponse() { } /// /// Initializes a new instance of the class. /// - /// The id of the Template.. + /// The id of the Template. (required). public TemplateEditResponse(string templateId = default(string)) { + // to ensure "templateId" is required (not null) + if (templateId == null) + { + throw new ArgumentNullException("templateId is a required property for TemplateEditResponse and cannot be null"); + } this.TemplateId = templateId; } @@ -68,9 +73,9 @@ public static TemplateEditResponse Init(string jsonData) /// The id of the Template. /// /// The id of the Template. - [DataMember(Name = "template_id", EmitDefaultValue = true)] + [DataMember(Name = "template_id", IsRequired = true, EmitDefaultValue = true)] public string TemplateId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +144,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -151,16 +165,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateGetResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateGetResponse.cs index 7e2f56081..2ead88686 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateGetResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TemplateGetResponse() { } /// /// Initializes a new instance of the class. /// - /// template. + /// template (required). /// A list of warnings.. public TemplateGetResponse(TemplateResponse template = default(TemplateResponse), List warnings = default(List)) { + // to ensure "template" is required (not null) + if (template == null) + { + throw new ArgumentNullException("template is a required property for TemplateGetResponse and cannot be null"); + } this.Template = template; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static TemplateGetResponse Init(string jsonData) /// /// Gets or Sets Template /// - [DataMember(Name = "template", EmitDefaultValue = true)] + [DataMember(Name = "template", IsRequired = true, EmitDefaultValue = true)] public TemplateResponse Template { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateListResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateListResponse.cs index 654a2e098..9c20b3d5f 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateListResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateListResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateListResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateListResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateListResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected TemplateListResponse() { } /// /// Initializes a new instance of the class. /// - /// List of templates that the API caller has access to.. - /// listInfo. + /// List of templates that the API caller has access to. (required). + /// listInfo (required). /// A list of warnings.. public TemplateListResponse(List templates = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "templates" is required (not null) + if (templates == null) + { + throw new ArgumentNullException("templates is a required property for TemplateListResponse and cannot be null"); + } this.Templates = templates; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for TemplateListResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,22 +82,22 @@ public static TemplateListResponse Init(string jsonData) /// List of templates that the API caller has access to. /// /// List of templates that the API caller has access to. - [DataMember(Name = "templates", EmitDefaultValue = true)] + [DataMember(Name = "templates", IsRequired = true, EmitDefaultValue = true)] public List Templates { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { 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 /// @@ -178,6 +188,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -202,16 +221,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateRemoveUserRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateRemoveUserRequest.cs index 2676f0a39..69e9fcfa8 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateRemoveUserRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateRemoveUserRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateRemoveUserRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateRemoveUserRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateRemoveUserRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static TemplateRemoveUserRequest Init(string jsonData) /// The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. /// /// The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponse.cs index 4037176bc..db054a3a1 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -98,84 +98,84 @@ public static TemplateResponse Init(string jsonData) /// The id of the Template. [DataMember(Name = "template_id", EmitDefaultValue = true)] public string TemplateId { get; set; } - + /// /// The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. /// /// The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. /// /// The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Time the template was last updated. /// /// Time the template was last updated. [DataMember(Name = "updated_at", EmitDefaultValue = true)] public int UpdatedAt { get; set; } - + /// /// `true` if this template was created using an embedded flow, `false` if it was created on our website. /// /// `true` if this template was created using an embedded flow, `false` if it was created on our website. [DataMember(Name = "is_embedded", EmitDefaultValue = true)] public bool? IsEmbedded { get; set; } - + /// /// `true` if you are the owner of this template, `false` if it's been shared with you by a team member. /// /// `true` if you are the owner of this template, `false` if it's been shared with you by a team member. [DataMember(Name = "is_creator", EmitDefaultValue = true)] public bool? IsCreator { get; set; } - + /// /// Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). /// /// Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). [DataMember(Name = "can_edit", EmitDefaultValue = true)] public bool? CanEdit { get; set; } - + /// /// Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. /// /// Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. [DataMember(Name = "is_locked", EmitDefaultValue = true)] public bool? IsLocked { get; set; } - + /// /// The metadata attached to the template. /// /// The metadata attached to the template. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Object Metadata { get; set; } - + /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. [DataMember(Name = "signer_roles", EmitDefaultValue = true)] public List SignerRoles { get; set; } - + /// /// An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. /// /// An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. [DataMember(Name = "cc_roles", EmitDefaultValue = true)] public List CcRoles { get; set; } - + /// /// An array describing each document associated with this Template. Includes form field data for each document. /// /// An array describing each document associated with this Template. Includes form field data for each document. [DataMember(Name = "documents", EmitDefaultValue = true)] public List Documents { get; set; } - + /// /// Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. /// @@ -183,7 +183,7 @@ public static TemplateResponse Init(string jsonData) [DataMember(Name = "custom_fields", EmitDefaultValue = true)] [Obsolete] public List CustomFields { get; set; } - + /// /// Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. /// @@ -191,14 +191,14 @@ public static TemplateResponse Init(string jsonData) [DataMember(Name = "named_form_fields", EmitDefaultValue = true)] [Obsolete] public List NamedFormFields { get; set; } - + /// /// An array of the Accounts that can use this Template. /// /// An array of the Accounts that can use this Template. [DataMember(Name = "accounts", EmitDefaultValue = true)] public List Accounts { get; set; } - + /// /// Returns the string presentation of the object /// @@ -409,6 +409,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -505,16 +514,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseAccount.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseAccount.cs index 5bcaa3781..315b8a595 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseAccount.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseAccount.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseAccount")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseAccount : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseAccount : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,41 +80,41 @@ public static TemplateResponseAccount Init(string jsonData) /// The id of the Account. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The email address associated with the Account. /// /// The email address associated with the Account. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns `true` if the user has been locked out of their account by a team admin. /// /// Returns `true` if the user has been locked out of their account by a team admin. [DataMember(Name = "is_locked", EmitDefaultValue = true)] public bool IsLocked { get; set; } - + /// /// Returns `true` if the user has a paid Dropbox Sign account. /// /// Returns `true` if the user has a paid Dropbox Sign account. [DataMember(Name = "is_paid_hs", EmitDefaultValue = true)] public bool IsPaidHs { get; set; } - + /// /// Returns `true` if the user has a paid HelloFax account. /// /// Returns `true` if the user has a paid HelloFax account. [DataMember(Name = "is_paid_hf", EmitDefaultValue = true)] public bool IsPaidHf { get; set; } - + /// /// Gets or Sets Quotas /// [DataMember(Name = "quotas", EmitDefaultValue = true)] public TemplateResponseAccountQuota Quotas { get; set; } - + /// /// Returns the string presentation of the object /// @@ -221,6 +221,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -263,16 +272,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseAccountQuota.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseAccountQuota.cs index 6341197e3..9ed9b170b 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseAccountQuota.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseAccountQuota.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseAccountQuota")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseAccountQuota : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseAccountQuota : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,28 +76,28 @@ public static TemplateResponseAccountQuota Init(string jsonData) /// API templates remaining. [DataMember(Name = "templates_left", EmitDefaultValue = true)] public int TemplatesLeft { get; set; } - + /// /// API signature requests remaining. /// /// API signature requests remaining. [DataMember(Name = "api_signature_requests_left", EmitDefaultValue = true)] public int ApiSignatureRequestsLeft { get; set; } - + /// /// Signature requests remaining. /// /// Signature requests remaining. [DataMember(Name = "documents_left", EmitDefaultValue = true)] public int DocumentsLeft { get; set; } - + /// /// SMS verifications remaining. /// /// SMS verifications remaining. [DataMember(Name = "sms_verifications_left", EmitDefaultValue = true)] public int SmsVerificationsLeft { get; set; } - + /// /// Returns the string presentation of the object /// @@ -180,6 +180,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -210,16 +219,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseCCRole.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseCCRole.cs index 6692584f0..7cb5bf542 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseCCRole.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseCCRole.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseCCRole")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseCCRole : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseCCRole : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static TemplateResponseCCRole Init(string jsonData) /// The name of the Role. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +139,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -151,16 +160,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocument.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocument.cs index 03dc7480c..38d7743e7 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocument.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocument.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocument")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocument : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocument : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,42 +80,42 @@ public static TemplateResponseDocument Init(string jsonData) /// Name of the associated file. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Document ordering, the lowest index is displayed first and the highest last (0-based indexing). /// /// Document ordering, the lowest index is displayed first and the highest last (0-based indexing). [DataMember(Name = "index", EmitDefaultValue = true)] public int Index { get; set; } - + /// /// An array of Form Field Group objects. /// /// An array of Form Field Group objects. [DataMember(Name = "field_groups", EmitDefaultValue = true)] public List FieldGroups { get; set; } - + /// /// An array of Form Field objects containing the name and type of each named field. /// /// An array of Form Field objects containing the name and type of each named field. [DataMember(Name = "form_fields", EmitDefaultValue = true)] public List FormFields { get; set; } - + /// /// An array of Form Field objects containing the name and type of each named field. /// /// An array of Form Field objects containing the name and type of each named field. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. /// /// An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. [DataMember(Name = "static_fields", EmitDefaultValue = true)] public List StaticFields { get; set; } - + /// /// Returns the string presentation of the object /// @@ -234,6 +234,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -276,16 +285,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldBase.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldBase.cs index 1ed5b4fce..c952de164 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldBase.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldBase.cs @@ -32,12 +32,10 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocumentCustomFieldBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldCheckbox), "TemplateResponseDocumentCustomFieldCheckbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldText), "TemplateResponseDocumentCustomFieldText")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocumentCustomFieldBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocumentCustomFieldBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -57,7 +55,7 @@ protected TemplateResponseDocumentCustomFieldBase() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentCustomFieldBase(string apiId = default(string), string name = default(string), string type = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentCustomFieldBase(string apiId = default(string), string name = default(string), string type = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { // to ensure "type" is required (not null) @@ -68,7 +66,7 @@ protected TemplateResponseDocumentCustomFieldBase() { } this.Type = type; this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -98,70 +96,74 @@ public static TemplateResponseDocumentCustomFieldBase Init(string jsonData) /// [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The unique ID for this field. /// /// The unique ID for this field. [DataMember(Name = "api_id", EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// The name of the Custom Field. /// /// The name of the Custom Field. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). /// /// The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). [DataMember(Name = "signer", EmitDefaultValue = true)] - public string Signer { get; set; } + public object Signer { + get => this._signer; + set => this._signer = Convert.ToString(value); + } + private string _signer; /// /// The horizontal offset in pixels for this form field. /// /// The horizontal offset in pixels for this form field. [DataMember(Name = "x", EmitDefaultValue = true)] public int X { get; set; } - + /// /// The vertical offset in pixels for this form field. /// /// The vertical offset in pixels for this form field. [DataMember(Name = "y", EmitDefaultValue = true)] public int Y { get; set; } - + /// /// The width in pixels of this form field. /// /// The width in pixels of this form field. [DataMember(Name = "width", EmitDefaultValue = true)] public int Width { get; set; } - + /// /// The height in pixels of this form field. /// /// The height in pixels of this form field. [DataMember(Name = "height", EmitDefaultValue = true)] public int Height { get; set; } - + /// /// Boolean showing whether or not this field is required. /// /// Boolean showing whether or not this field is required. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// The name of the group this field is in. If this field is not a group, this defaults to `null`. /// /// The name of the group this field is in. If this field is not a group, this defaults to `null`. [DataMember(Name = "group", EmitDefaultValue = true)] public string Group { get; set; } - + /// /// Returns the string presentation of the object /// @@ -300,6 +302,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -366,26 +387,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldCheckbox.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldCheckbox.cs index 309d29ab3..7ab66218f 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldCheckbox.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,9 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentCustomFieldBase` /// [DataContract(Name = "TemplateResponseDocumentCustomFieldCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentCustomFieldCheckbox : TemplateResponseDocumentCustomFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -55,11 +51,11 @@ protected TemplateResponseDocumentCustomFieldCheckbox() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentCustomFieldCheckbox(string type = "checkbox", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentCustomFieldCheckbox(string type = @"checkbox", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -97,7 +93,7 @@ public static TemplateResponseDocumentCustomFieldCheckbox Init(string jsonData) /// The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -167,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -195,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -203,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldText.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldText.cs index c07f639a9..8ac152e24 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldText.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,9 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentCustomFieldBase` /// [DataContract(Name = "TemplateResponseDocumentCustomFieldText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentCustomFieldText : TemplateResponseDocumentCustomFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -59,11 +55,11 @@ protected TemplateResponseDocumentCustomFieldText() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentCustomFieldText(string type = "text", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentCustomFieldText(string type = @"text", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -105,34 +101,34 @@ public static TemplateResponseDocumentCustomFieldText Init(string jsonData) /// The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Gets or Sets AvgTextLength /// [DataMember(Name = "avg_text_length", EmitDefaultValue = true)] public TemplateResponseFieldAvgTextLength AvgTextLength { get; set; } - + /// /// Whether this form field is multiline text. /// /// Whether this form field is multiline text. [DataMember(Name = "isMultiline", EmitDefaultValue = true)] public bool IsMultiline { get; set; } - + /// /// Original font size used in this form field's text. /// /// Original font size used in this form field's text. [DataMember(Name = "originalFontSize", EmitDefaultValue = true)] public int OriginalFontSize { get; set; } - + /// /// Font family used in this form field's text. /// /// Font family used in this form field's text. [DataMember(Name = "fontFamily", EmitDefaultValue = true)] public string FontFamily { get; set; } - + /// /// Returns the string presentation of the object /// @@ -234,6 +230,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -270,30 +289,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroup.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroup.cs index d8f59646f..63d9fa6d5 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroup.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroup.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocumentFieldGroup")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocumentFieldGroup : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocumentFieldGroup : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,13 +72,13 @@ public static TemplateResponseDocumentFieldGroup Init(string jsonData) /// The name of the form field group. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Gets or Sets Rule /// [DataMember(Name = "rule", EmitDefaultValue = true)] public TemplateResponseDocumentFieldGroupRule Rule { get; set; } - + /// /// Returns the string presentation of the object /// @@ -157,6 +157,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -175,16 +184,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroupRule.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroupRule.cs index 667be623a..68a46ff72 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroupRule.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroupRule.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocumentFieldGroupRule")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocumentFieldGroupRule : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocumentFieldGroupRule : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static TemplateResponseDocumentFieldGroupRule Init(string jsonData) /// Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. [DataMember(Name = "requirement", EmitDefaultValue = true)] public string Requirement { get; set; } - + /// /// Name of the group /// /// Name of the group [DataMember(Name = "groupLabel", EmitDefaultValue = true)] public string GroupLabel { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldBase.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldBase.cs index e14e87f2b..f8ce1a2c6 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldBase.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldBase.cs @@ -32,14 +32,6 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocumentFormFieldBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "TemplateResponseDocumentFormFieldCheckbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "TemplateResponseDocumentFormFieldDateSigned")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "TemplateResponseDocumentFormFieldDropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "TemplateResponseDocumentFormFieldHyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "TemplateResponseDocumentFormFieldInitials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "TemplateResponseDocumentFormFieldRadio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "TemplateResponseDocumentFormFieldSignature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "TemplateResponseDocumentFormFieldText")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] @@ -49,7 +41,7 @@ namespace Dropbox.Sign.Model [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocumentFormFieldBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocumentFormFieldBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -69,7 +61,7 @@ protected TemplateResponseDocumentFormFieldBase() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldBase(string apiId = default(string), string name = default(string), string type = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldBase(string apiId = default(string), string name = default(string), string type = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { // to ensure "type" is required (not null) @@ -80,7 +72,7 @@ protected TemplateResponseDocumentFormFieldBase() { } this.Type = type; this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -110,70 +102,74 @@ public static TemplateResponseDocumentFormFieldBase Init(string jsonData) /// [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// A unique id for the form field. /// /// A unique id for the form field. [DataMember(Name = "api_id", EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// The name of the form field. /// /// The name of the form field. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The signer of the Form Field. /// /// The signer of the Form Field. [DataMember(Name = "signer", EmitDefaultValue = true)] - public string Signer { get; set; } + public object Signer { + get => this._signer; + set => this._signer = Convert.ToString(value); + } + private string _signer; /// /// The horizontal offset in pixels for this form field. /// /// The horizontal offset in pixels for this form field. [DataMember(Name = "x", EmitDefaultValue = true)] public int X { get; set; } - + /// /// The vertical offset in pixels for this form field. /// /// The vertical offset in pixels for this form field. [DataMember(Name = "y", EmitDefaultValue = true)] public int Y { get; set; } - + /// /// The width in pixels of this form field. /// /// The width in pixels of this form field. [DataMember(Name = "width", EmitDefaultValue = true)] public int Width { get; set; } - + /// /// The height in pixels of this form field. /// /// The height in pixels of this form field. [DataMember(Name = "height", EmitDefaultValue = true)] public int Height { get; set; } - + /// /// Boolean showing whether or not this field is required. /// /// Boolean showing whether or not this field is required. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. /// /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. [DataMember(Name = "group", EmitDefaultValue = true)] public string Group { get; set; } - + /// /// Returns the string presentation of the object /// @@ -312,6 +308,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -378,26 +393,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldCheckbox.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldCheckbox.cs index 8ebf880b8..360c160ee 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldCheckbox.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldCheckbox : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldCheckbox() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldCheckbox(string type = "checkbox", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldCheckbox(string type = @"checkbox", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldCheckbox Init(string jsonData) /// The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDateSigned.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDateSigned.cs index 55fe07682..54eeb6ded 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDateSigned.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDateSigned.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldDateSigned")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldDateSigned : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldDateSigned() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldDateSigned(string type = "date_signed", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldDateSigned(string type = @"date_signed", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldDateSigned Init(string jsonData) /// The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDropdown.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDropdown.cs index e39b48a58..737adb5cb 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDropdown.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDropdown.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldDropdown")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldDropdown : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldDropdown() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldDropdown(string type = "dropdown", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldDropdown(string type = @"dropdown", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldDropdown Init(string jsonData) /// The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldHyperlink.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldHyperlink.cs index fe74f8e1c..3c6c4adb1 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldHyperlink.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldHyperlink.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldHyperlink")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldHyperlink : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -65,11 +55,11 @@ protected TemplateResponseDocumentFormFieldHyperlink() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldHyperlink(string type = "hyperlink", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldHyperlink(string type = @"hyperlink", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -111,34 +101,34 @@ public static TemplateResponseDocumentFormFieldHyperlink Init(string jsonData) /// The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Gets or Sets AvgTextLength /// [DataMember(Name = "avg_text_length", EmitDefaultValue = true)] public TemplateResponseFieldAvgTextLength AvgTextLength { get; set; } - + /// /// Whether this form field is multiline text. /// /// Whether this form field is multiline text. [DataMember(Name = "isMultiline", EmitDefaultValue = true)] public bool IsMultiline { get; set; } - + /// /// Original font size used in this form field's text. /// /// Original font size used in this form field's text. [DataMember(Name = "originalFontSize", EmitDefaultValue = true)] public int OriginalFontSize { get; set; } - + /// /// Font family used in this form field's text. /// /// Font family used in this form field's text. [DataMember(Name = "fontFamily", EmitDefaultValue = true)] public string FontFamily { get; set; } - + /// /// Returns the string presentation of the object /// @@ -240,6 +230,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -276,30 +289,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldInitials.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldInitials.cs index df5838d07..3d7328b70 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldInitials.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldInitials.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldInitials")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldInitials : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldInitials() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldInitials(string type = "initials", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldInitials(string type = @"initials", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldInitials Init(string jsonData) /// The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldRadio.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldRadio.cs index 62cb44f28..cc3c00a98 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldRadio.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldRadio.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldRadio")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldRadio : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldRadio() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. (required). - public TemplateResponseDocumentFormFieldRadio(string type = "radio", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldRadio(string type = @"radio", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldRadio Init(string jsonData) /// The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldSignature.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldSignature.cs index 98b3358c2..39e0edfce 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldSignature.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldSignature.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldSignature")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldSignature : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldSignature() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldSignature(string type = "signature", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldSignature(string type = @"signature", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldSignature Init(string jsonData) /// The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldText.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldText.cs index d81fc312f..31538b456 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldText.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldText : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -109,7 +99,6 @@ public enum ValidationTypeEnum /// [EnumMember(Value = "custom_regex")] CustomRegex = 10 - } @@ -142,11 +131,11 @@ protected TemplateResponseDocumentFormFieldText() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldText(string type = "text", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), ValidationTypeEnum? validationType = default(ValidationTypeEnum?), string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldText(string type = @"text", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), ValidationTypeEnum? validationType = default(ValidationTypeEnum?), string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -189,34 +178,34 @@ public static TemplateResponseDocumentFormFieldText Init(string jsonData) /// The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Gets or Sets AvgTextLength /// [DataMember(Name = "avg_text_length", EmitDefaultValue = true)] public TemplateResponseFieldAvgTextLength AvgTextLength { get; set; } - + /// /// Whether this form field is multiline text. /// /// Whether this form field is multiline text. [DataMember(Name = "isMultiline", EmitDefaultValue = true)] public bool IsMultiline { get; set; } - + /// /// Original font size used in this form field's text. /// /// Original font size used in this form field's text. [DataMember(Name = "originalFontSize", EmitDefaultValue = true)] public int OriginalFontSize { get; set; } - + /// /// Font family used in this form field's text. /// /// Font family used in this form field's text. [DataMember(Name = "fontFamily", EmitDefaultValue = true)] public string FontFamily { get; set; } - + /// /// Returns the string presentation of the object /// @@ -324,6 +313,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -366,30 +378,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldBase.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldBase.cs index 93359604d..4d663c74a 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldBase.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldBase.cs @@ -32,14 +32,6 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocumentStaticFieldBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "TemplateResponseDocumentStaticFieldCheckbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "TemplateResponseDocumentStaticFieldDateSigned")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "TemplateResponseDocumentStaticFieldDropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "TemplateResponseDocumentStaticFieldHyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "TemplateResponseDocumentStaticFieldInitials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "TemplateResponseDocumentStaticFieldRadio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "TemplateResponseDocumentStaticFieldSignature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "TemplateResponseDocumentStaticFieldText")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] @@ -49,7 +41,7 @@ namespace Dropbox.Sign.Model [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocumentStaticFieldBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocumentStaticFieldBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -69,7 +61,7 @@ protected TemplateResponseDocumentStaticFieldBase() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldBase(string apiId = default(string), string name = default(string), string type = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldBase(string apiId = default(string), string name = default(string), string type = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { // to ensure "type" is required (not null) @@ -111,70 +103,70 @@ public static TemplateResponseDocumentStaticFieldBase Init(string jsonData) /// [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// A unique id for the static field. /// /// A unique id for the static field. [DataMember(Name = "api_id", EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// The name of the static field. /// /// The name of the static field. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The signer of the Static Field. /// /// The signer of the Static Field. [DataMember(Name = "signer", EmitDefaultValue = true)] public string Signer { get; set; } - + /// /// The horizontal offset in pixels for this static field. /// /// The horizontal offset in pixels for this static field. [DataMember(Name = "x", EmitDefaultValue = true)] public int X { get; set; } - + /// /// The vertical offset in pixels for this static field. /// /// The vertical offset in pixels for this static field. [DataMember(Name = "y", EmitDefaultValue = true)] public int Y { get; set; } - + /// /// The width in pixels of this static field. /// /// The width in pixels of this static field. [DataMember(Name = "width", EmitDefaultValue = true)] public int Width { get; set; } - + /// /// The height in pixels of this static field. /// /// The height in pixels of this static field. [DataMember(Name = "height", EmitDefaultValue = true)] public int Height { get; set; } - + /// /// Boolean showing whether or not this field is required. /// /// Boolean showing whether or not this field is required. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// The name of the group this field is in. If this field is not a group, this defaults to `null`. /// /// The name of the group this field is in. If this field is not a group, this defaults to `null`. [DataMember(Name = "group", EmitDefaultValue = true)] public string Group { get; set; } - + /// /// Returns the string presentation of the object /// @@ -313,6 +305,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -379,26 +390,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldCheckbox.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldCheckbox.cs index e4618ec57..fec41a9f8 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldCheckbox.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldCheckbox : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldCheckbox() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldCheckbox(string type = "checkbox", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldCheckbox(string type = @"checkbox", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldCheckbox Init(string jsonData) /// The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDateSigned.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDateSigned.cs index 805b11ba5..e029aa8ca 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDateSigned.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDateSigned.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldDateSigned")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldDateSigned : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldDateSigned() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldDateSigned(string type = "date_signed", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldDateSigned(string type = @"date_signed", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldDateSigned Init(string jsonData /// The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDropdown.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDropdown.cs index 61c3c2169..ce159eb73 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDropdown.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDropdown.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldDropdown")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldDropdown : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldDropdown() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldDropdown(string type = "dropdown", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldDropdown(string type = @"dropdown", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldDropdown Init(string jsonData) /// The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldHyperlink.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldHyperlink.cs index a1499283e..c27885a2d 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldHyperlink.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldHyperlink.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldHyperlink")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldHyperlink : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldHyperlink() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldHyperlink(string type = "hyperlink", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldHyperlink(string type = @"hyperlink", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldHyperlink Init(string jsonData) /// The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldInitials.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldInitials.cs index 6033d3ad3..d4caf2723 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldInitials.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldInitials.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldInitials")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldInitials : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldInitials() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldInitials(string type = "initials", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldInitials(string type = @"initials", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldInitials Init(string jsonData) /// The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldRadio.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldRadio.cs index 8e783bfc7..365b45064 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldRadio.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldRadio.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldRadio")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldRadio : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldRadio() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldRadio(string type = "radio", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldRadio(string type = @"radio", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldRadio Init(string jsonData) /// The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldSignature.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldSignature.cs index 07f4b39f9..50744be93 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldSignature.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldSignature.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldSignature")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldSignature : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldSignature() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldSignature(string type = "signature", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldSignature(string type = @"signature", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldSignature Init(string jsonData) /// The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldText.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldText.cs index 292dc6169..69695eb63 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldText.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldText : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldText() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldText(string type = "text", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldText(string type = @"text", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldText Init(string jsonData) /// The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseFieldAvgTextLength.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseFieldAvgTextLength.cs index 653edf370..bebe8a6ca 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseFieldAvgTextLength.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseFieldAvgTextLength.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseFieldAvgTextLength")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseFieldAvgTextLength : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseFieldAvgTextLength : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static TemplateResponseFieldAvgTextLength Init(string jsonData) /// Number of lines. [DataMember(Name = "num_lines", EmitDefaultValue = true)] public int NumLines { get; set; } - + /// /// Number of characters per line. /// /// Number of characters per line. [DataMember(Name = "num_chars_per_line", EmitDefaultValue = true)] public int NumCharsPerLine { get; set; } - + /// /// Returns the string presentation of the object /// @@ -150,6 +150,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -168,16 +177,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseSignerRole.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseSignerRole.cs index 03bdca7ac..d7b04386d 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseSignerRole.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateResponseSignerRole.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseSignerRole")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseSignerRole : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseSignerRole : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static TemplateResponseSignerRole Init(string jsonData) /// The name of the Role. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// If signer order is assigned this is the 0-based index for this role. /// /// If signer order is assigned this is the 0-based index for this role. [DataMember(Name = "order", EmitDefaultValue = true)] public int Order { get; set; } - + /// /// Returns the string presentation of the object /// @@ -154,6 +154,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -172,16 +181,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesRequest.cs index 8ac2ed54e..c32ef2c88 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateUpdateFilesRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateUpdateFilesRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateUpdateFilesRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,42 +80,42 @@ public static TemplateUpdateFilesRequest Init(string jsonData) /// Client id of the app you're using to update this template. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// The new default template email message. /// /// The new default template email message. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// The new default template email subject. /// /// The new default template email subject. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// Returns the string presentation of the object /// @@ -232,6 +232,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 100) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 100.", new [] { "Subject" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -274,28 +295,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 100) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 100.", new [] { "Subject" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesResponse.cs index 09a1cd757..4c2fe8575 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateUpdateFilesResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateUpdateFilesResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateUpdateFilesResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,10 +41,15 @@ protected TemplateUpdateFilesResponse() { } /// /// Initializes a new instance of the class. /// - /// template. + /// template (required). public TemplateUpdateFilesResponse(TemplateUpdateFilesResponseTemplate template = default(TemplateUpdateFilesResponseTemplate)) { + // to ensure "template" is required (not null) + if (template == null) + { + throw new ArgumentNullException("template is a required property for TemplateUpdateFilesResponse and cannot be null"); + } this.Template = template; } @@ -67,9 +72,9 @@ public static TemplateUpdateFilesResponse Init(string jsonData) /// /// Gets or Sets Template /// - [DataMember(Name = "template", EmitDefaultValue = true)] + [DataMember(Name = "template", IsRequired = true, EmitDefaultValue = true)] public TemplateUpdateFilesResponseTemplate Template { get; set; } - + /// /// Returns the string presentation of the object /// @@ -138,6 +143,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -150,16 +164,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesResponseTemplate.cs b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesResponseTemplate.cs index 02babe572..4a04e8a07 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesResponseTemplate.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/TemplateUpdateFilesResponseTemplate.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateUpdateFilesResponseTemplate")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateUpdateFilesResponseTemplate : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateUpdateFilesResponseTemplate : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,7 +72,7 @@ public static TemplateUpdateFilesResponseTemplate Init(string jsonData) /// The id of the Template. [DataMember(Name = "template_id", EmitDefaultValue = true)] public string TemplateId { get; set; } - + /// /// A list of warnings. /// @@ -80,7 +80,7 @@ public static TemplateUpdateFilesResponseTemplate Init(string jsonData) [DataMember(Name = "warnings", EmitDefaultValue = true)] [Obsolete] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -160,6 +160,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -178,16 +187,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedRequest.cs index 688ca1958..6b2511508 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftCreateEmbeddedRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftCreateEmbeddedRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftCreateEmbeddedRequest : IEquatable, IValidatableObject { /// /// The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. @@ -51,7 +51,6 @@ public enum TypeEnum /// [EnumMember(Value = "request_signature")] RequestSignature = 2 - } @@ -178,242 +177,242 @@ public static UnclaimedDraftCreateEmbeddedRequest Init(string jsonData) /// Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. /// /// The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. [DataMember(Name = "requester_email_address", IsRequired = true, EmitDefaultValue = true)] public string RequesterEmailAddress { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. [DataMember(Name = "allow_ccs", EmitDefaultValue = true)] public bool AllowCcs { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The email addresses that should be CCed. /// /// The email addresses that should be CCed. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Gets or Sets EditorOptions /// [DataMember(Name = "editor_options", EmitDefaultValue = true)] public SubEditorOptions EditorOptions { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// Provide users the ability to review/edit the signers. /// /// Provide users the ability to review/edit the signers. [DataMember(Name = "force_signer_page", EmitDefaultValue = true)] public bool ForceSignerPage { get; set; } - + /// /// Provide users the ability to review/edit the subject and message. /// /// Provide users the ability to review/edit the subject and message. [DataMember(Name = "force_subject_message", EmitDefaultValue = true)] public bool ForceSubjectMessage { get; set; } - + /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` /// /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. /// /// Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] public bool HideTextTags { get; set; } - + /// /// The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. /// /// The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. [DataMember(Name = "hold_request", EmitDefaultValue = true)] public bool HoldRequest { get; set; } - + /// /// The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. /// /// The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. [DataMember(Name = "is_for_embedded_signing", EmitDefaultValue = true)] public bool IsForEmbeddedSigning { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// The URL you want signers redirected to after they successfully request a signature. /// /// The URL you want signers redirected to after they successfully request a signature. [DataMember(Name = "requesting_redirect_url", EmitDefaultValue = true)] public string RequestingRedirectUrl { get; set; } - + /// /// This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. /// /// This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. [DataMember(Name = "show_preview", EmitDefaultValue = true)] public bool ShowPreview { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// Add Signers to your Unclaimed Draft Signature Request. /// /// Add Signers to your Unclaimed Draft Signature Request. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. [DataMember(Name = "skip_me_now", EmitDefaultValue = true)] public bool SkipMeNow { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. /// /// Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. [DataMember(Name = "use_preexisting_fields", EmitDefaultValue = true)] public bool UsePreexistingFields { get; set; } - + /// /// Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. /// /// Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] public bool UseTextTags { get; set; } - + /// /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. /// /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] public bool PopulateAutoFillFields { get; set; } - + /// /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response. /// /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -778,6 +777,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 200) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -1000,28 +1020,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 200) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.cs index b4a67c388..5f465980d 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftCreateEmbeddedWithTemplateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftCreateEmbeddedWithTemplateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftCreateEmbeddedWithTemplateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -143,207 +143,207 @@ public static UnclaimedDraftCreateEmbeddedWithTemplateRequest Init(string jsonDa /// Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// The email address of the user that should be designated as the requester of this draft. /// /// The email address of the user that should be designated as the requester of this draft. [DataMember(Name = "requester_email_address", IsRequired = true, EmitDefaultValue = true)] public string RequesterEmailAddress { get; set; } - + /// /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. /// /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// Add CC email recipients. Required when a CC role exists for the Template. /// /// Add CC email recipients. Required when a CC role exists for the Template. [DataMember(Name = "ccs", EmitDefaultValue = true)] public List Ccs { get; set; } - + /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Gets or Sets EditorOptions /// [DataMember(Name = "editor_options", EmitDefaultValue = true)] public SubEditorOptions EditorOptions { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. /// /// Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. /// /// Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// Provide users the ability to review/edit the template signer roles. /// /// Provide users the ability to review/edit the template signer roles. [DataMember(Name = "force_signer_roles", EmitDefaultValue = true)] public bool ForceSignerRoles { get; set; } - + /// /// Provide users the ability to review/edit the template subject and message. /// /// Provide users the ability to review/edit the template subject and message. [DataMember(Name = "force_subject_message", EmitDefaultValue = true)] public bool ForceSubjectMessage { get; set; } - + /// /// The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. /// /// The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. [DataMember(Name = "hold_request", EmitDefaultValue = true)] public bool HoldRequest { get; set; } - + /// /// The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. /// /// The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. [DataMember(Name = "is_for_embedded_signing", EmitDefaultValue = true)] public bool IsForEmbeddedSigning { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set). /// /// This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set). [DataMember(Name = "preview_only", EmitDefaultValue = true)] public bool PreviewOnly { get; set; } - + /// /// The URL you want signers redirected to after they successfully request a signature. /// /// The URL you want signers redirected to after they successfully request a signature. [DataMember(Name = "requesting_redirect_url", EmitDefaultValue = true)] public string RequestingRedirectUrl { get; set; } - + /// /// This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. /// /// This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. [DataMember(Name = "show_preview", EmitDefaultValue = true)] public bool ShowPreview { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// Add Signers to your Templated-based Signature Request. /// /// Add Signers to your Templated-based Signature Request. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. [DataMember(Name = "skip_me_now", EmitDefaultValue = true)] public bool SkipMeNow { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. /// /// Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] public bool PopulateAutoFillFields { get; set; } - + /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. [DataMember(Name = "allow_ccs", EmitDefaultValue = true)] public bool AllowCcs { get; set; } - + /// /// Returns the string presentation of the object /// @@ -657,6 +657,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -843,34 +870,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateRequest.cs index 21a0bbe35..fd0e654cc 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftCreateRequest : IEquatable, IValidatableObject { /// /// The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. @@ -51,7 +51,6 @@ public enum TypeEnum /// [EnumMember(Value = "request_signature")] RequestSignature = 2 - } @@ -144,159 +143,159 @@ public static UnclaimedDraftCreateRequest Init(string jsonData) /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The email addresses that should be CCed. /// /// The email addresses that should be CCed. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. /// /// Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. /// /// When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. /// /// Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` /// /// The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. /// /// Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] public bool HideTextTags { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. /// /// Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// Add Signers to your Unclaimed Draft Signature Request. /// /// Add Signers to your Unclaimed Draft Signature Request. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. /// /// Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. [DataMember(Name = "use_preexisting_fields", EmitDefaultValue = true)] public bool UsePreexistingFields { get; set; } - + /// /// Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. /// /// Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] public bool UseTextTags { get; set; } - + /// /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response. /// /// When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -577,6 +576,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 200) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -727,28 +747,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 200) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); - } - - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateResponse.cs index a42b11897..e780a2352 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftCreateResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftCreateResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftCreateResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftCreateResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected UnclaimedDraftCreateResponse() { } /// /// Initializes a new instance of the class. /// - /// unclaimedDraft. + /// unclaimedDraft (required). /// A list of warnings.. public UnclaimedDraftCreateResponse(UnclaimedDraftResponse unclaimedDraft = default(UnclaimedDraftResponse), List warnings = default(List)) { + // to ensure "unclaimedDraft" is required (not null) + if (unclaimedDraft == null) + { + throw new ArgumentNullException("unclaimedDraft is a required property for UnclaimedDraftCreateResponse and cannot be null"); + } this.UnclaimedDraft = unclaimedDraft; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static UnclaimedDraftCreateResponse Init(string jsonData) /// /// Gets or Sets UnclaimedDraft /// - [DataMember(Name = "unclaimed_draft", EmitDefaultValue = true)] + [DataMember(Name = "unclaimed_draft", IsRequired = true, EmitDefaultValue = true)] public UnclaimedDraftResponse UnclaimedDraft { 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 /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftEditAndResendRequest.cs b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftEditAndResendRequest.cs index 4f12d3662..9639d3f71 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftEditAndResendRequest.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftEditAndResendRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftEditAndResendRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftEditAndResendRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftEditAndResendRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -89,55 +89,55 @@ public static UnclaimedDraftEditAndResendRequest Init(string jsonData) /// Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Gets or Sets EditorOptions /// [DataMember(Name = "editor_options", EmitDefaultValue = true)] public SubEditorOptions EditorOptions { get; set; } - + /// /// The request created from this draft will also be signable in embedded mode if set to `true`. /// /// The request created from this draft will also be signable in embedded mode if set to `true`. [DataMember(Name = "is_for_embedded_signing", EmitDefaultValue = true)] public bool IsForEmbeddedSigning { get; set; } - + /// /// The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used. /// /// The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used. [DataMember(Name = "requester_email_address", EmitDefaultValue = true)] public string RequesterEmailAddress { get; set; } - + /// /// The URL you want signers redirected to after they successfully request a signature. /// /// The URL you want signers redirected to after they successfully request a signature. [DataMember(Name = "requesting_redirect_url", EmitDefaultValue = true)] public string RequestingRedirectUrl { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// Returns the string presentation of the object /// @@ -264,6 +264,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -318,16 +327,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftResponse.cs index e1ca22a15..284195ce6 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/UnclaimedDraftResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,42 +80,42 @@ public static UnclaimedDraftResponse Init(string jsonData) /// The ID of the signature request that is represented by this UnclaimedDraft. [DataMember(Name = "signature_request_id", EmitDefaultValue = true)] public string SignatureRequestId { get; set; } - + /// /// The URL to be used to claim this UnclaimedDraft. /// /// The URL to be used to claim this UnclaimedDraft. [DataMember(Name = "claim_url", EmitDefaultValue = true)] public string ClaimUrl { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). /// /// The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). [DataMember(Name = "requesting_redirect_url", EmitDefaultValue = true)] public string RequestingRedirectUrl { get; set; } - + /// /// When the link expires. /// /// When the link expires. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Whether this is a test draft. Signature requests made from test drafts have no legal value. /// /// Whether this is a test draft. Signature requests made from test drafts have no legal value. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// Returns the string presentation of the object /// @@ -230,6 +230,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -272,16 +281,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Model/WarningResponse.cs b/sdks/dotnet/src/Dropbox.Sign/Model/WarningResponse.cs index 2ab467f77..7dcfa66fb 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Model/WarningResponse.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Model/WarningResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "WarningResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class WarningResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class WarningResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -82,14 +82,14 @@ public static WarningResponse Init(string jsonData) /// Warning message [DataMember(Name = "warning_msg", IsRequired = true, EmitDefaultValue = true)] public string WarningMsg { get; set; } - + /// /// Warning name /// /// Warning name [DataMember(Name = "warning_name", IsRequired = true, EmitDefaultValue = true)] public string WarningName { get; set; } - + /// /// Returns the string presentation of the object /// @@ -168,6 +168,15 @@ public override int GetHashCode() } } + /// + /// 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(); @@ -186,16 +195,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/sdks/dotnet/templates/AbstractOpenAPISchema.mustache b/sdks/dotnet/templates/AbstractOpenAPISchema.mustache index 6b40f25f5..269e4ee45 100644 --- a/sdks/dotnet/templates/AbstractOpenAPISchema.mustache +++ b/sdks/dotnet/templates/AbstractOpenAPISchema.mustache @@ -1,12 +1,15 @@ {{>partial_header}} using System; -using System.Collections.Generic; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +{{#useCustomTemplateCode}} +using System.Collections.Generic; +{{/useCustomTemplateCode}} namespace {{packageName}}.{{modelPackage}} { +{{#useCustomTemplateCode}} public struct OpenApiType { public string Name { set; get; } @@ -20,6 +23,7 @@ namespace {{packageName}}.{{modelPackage}} List GetOpenApiTypes(); } +{{/useCustomTemplateCode}} /// /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification /// diff --git a/sdks/dotnet/templates/ApiClient.mustache b/sdks/dotnet/templates/ApiClient.mustache index 54f7dea38..f8798bd23 100644 --- a/sdks/dotnet/templates/ApiClient.mustache +++ b/sdks/dotnet/templates/ApiClient.mustache @@ -14,20 +14,22 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -{{^netStandard}} +{{^net60OrLater}} using System.Web; -{{/netStandard}} +{{/net60OrLater}} using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; {{#supportsRetry}} using Polly; {{/supportsRetry}} {{#hasOAuthMethods}} using {{packageName}}.Client.Auth; {{/hasOAuthMethods}} +using {{packageName}}.{{modelPackage}}; namespace {{packageName}}.Client { @@ -37,7 +39,6 @@ namespace {{packageName}}.Client internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer { private readonly IReadableConfiguration _configuration; - private static readonly string _contentType = "application/json"; private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. @@ -69,10 +70,10 @@ namespace {{packageName}}.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -117,7 +118,7 @@ namespace {{packageName}}.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -128,7 +129,7 @@ namespace {{packageName}}.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -150,17 +151,13 @@ namespace {{packageName}}.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.Serializers.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => - contentType.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || - contentType.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public string ContentType - { - get { return _contentType; } - set { throw new InvalidOperationException("Not allowed to set content type."); } - } + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -173,10 +170,11 @@ namespace {{packageName}}.Client { private readonly string _baseUrl; +{{#useCustomTemplateCode}} private readonly RestClient _restClient; - - /// +{{/useCustomTemplateCode}} + /// /// Specifies the settings on a object. /// These settings can be adjusted to accommodate custom serialization rules. /// @@ -211,7 +209,7 @@ namespace {{packageName}}.Client /// public ApiClient() { - _baseUrl = {{packageName}}.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -227,6 +225,7 @@ namespace {{packageName}}.Client _baseUrl = basePath; } +{{#useCustomTemplateCode}} /// /// Initializes a new instance of the . This should be used in unit tests only /// @@ -242,6 +241,7 @@ namespace {{packageName}}.Client _restClient = mockClient; } +{{/useCustomTemplateCode}} /// /// Constructs the RestSharp version of an http method /// @@ -283,14 +283,14 @@ namespace {{packageName}}.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -398,7 +398,7 @@ namespace {{packageName}}.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -408,6 +408,13 @@ namespace {{packageName}}.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -452,236 +459,207 @@ namespace {{packageName}}.Client return transformed; } - private ApiResponse Exec(RestRequest req, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - - RestClient client = _restClient; - if (client == null) - { - client = new RestClient(clientOptions); - } - - client.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)); - + setOptions(clientOptions); + {{#hasOAuthMethods}} if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && !string.IsNullOrEmpty(configuration.OAuthClientId) && !string.IsNullOrEmpty(configuration.OAuthClientSecret) && configuration.OAuthFlow != null) { - client = client.UseAuthenticator(new OAuthAuthenticator( + clientOptions.Authenticator = new OAuthAuthenticator( configuration.OAuthTokenUrl, configuration.OAuthClientId, configuration.OAuthClientSecret, + configuration.OAuthScope, configuration.OAuthFlow, SerializerSettings, - configuration)); + configuration); } {{/hasOAuthMethods}} - InterceptRequest(req); - - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) +{{^useCustomTemplateCode}} + using (RestClient client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse - { - Request = req, - ErrorException = policyResult.FinalException - }; - } - else +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + RestClient client = _restClient; + if (client == null) { - response = client.Execute(req); + client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)) + ); } - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + using (client) +{{/useCustomTemplateCode}} { - try + InterceptRequest(request); + + RestResponse response = await getResponse(client); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + try + { + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } } - catch (Exception ex) + else if (typeof(T).Name == "Stream") // for binary response { - throw ex.InnerException != null ? ex.InnerException : ex; + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + else if (typeof(T).Name == "Byte[]") // for byte response + { + response.Data = (T)(object)response.RawBytes; + } + else if (typeof(T).Name == "String") // for string response + { + response.Data = (T)(object)response.Content; } - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - else if (typeof(T).Name == "String") // for string response - { - response.Data = (T)(object)response.Content; - } - InterceptResponse(req, response); + InterceptResponse(request, response); - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (response.Cookies != null && response.Cookies.Count > 0) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } } + return result; } - return result; } - {{#supportsAsync}} - private async Task> ExecAsync(RestRequest req, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) - { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent - }; - - RestClient client = new RestClient(clientOptions) - .UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)); - - {{#hasOAuthMethods}} - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) + if (policyResult.Outcome == OutcomeType.Successful) { - client = client.UseAuthenticator(new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthFlow, - SerializerSettings, - configuration)); + return client.Deserialize(policyResult.Result); } - - {{/hasOAuthMethods}} - InterceptRequest(req); - - RestResponse response; - {{#supportsRetry}} - if (RetryConfiguration.AsyncRetryPolicy != null) + else { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + return new RestResponse(request) { - Request = req, ErrorException = policyResult.FinalException }; } - else + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => { - {{/supportsRetry}} - response = await client.ExecuteAsync(req, cancellationToken).ConfigureAwait(false); - {{#supportsRetry}} - } - {{/supportsRetry}} + var cookies = new CookieContainer(); - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; + }; + + Func>> getResponse = (client) => { - response.Data = (T)(object)response.RawBytes; - } + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return Task.FromResult(DeserializeRestResponseFromPolicy(client, request, policyResult)); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; - InterceptResponse(req, response); + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + {{#supportsAsync}} + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => { - result.ErrorText = response.ErrorMessage; - } + //no extra options + }; - if (response.Cookies != null && response.Cookies.Count > 0) + Func>> getResponse = async (client) => { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; + else + { + {{/supportsRetry}} + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration); } #region IAsynchronousClient @@ -694,7 +672,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -709,7 +687,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -724,7 +702,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -739,7 +717,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -754,7 +732,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -769,7 +747,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -784,7 +762,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/sdks/dotnet/templates/ApiException.mustache b/sdks/dotnet/templates/ApiException.mustache index e5a99a56d..622d10c19 100644 --- a/sdks/dotnet/templates/ApiException.mustache +++ b/sdks/dotnet/templates/ApiException.mustache @@ -1,7 +1,9 @@ {{>partial_header}} using System; +{{#useCustomTemplateCode}} using Dropbox.Sign.Model; +{{/useCustomTemplateCode}} namespace {{packageName}}.Client { @@ -20,7 +22,12 @@ namespace {{packageName}}.Client /// Gets or sets the error content (body json object) /// /// The error content (Http response body). +{{^useCustomTemplateCode}} + public object ErrorContent { get; private set; } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public ErrorResponse ErrorContent { get; private set; } +{{/useCustomTemplateCode}} /// /// Gets or sets the HTTP headers @@ -50,7 +57,12 @@ namespace {{packageName}}.Client /// Error message. /// Error content. /// HTTP Headers. +{{^useCustomTemplateCode}} + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public ApiException(int errorCode, string message, ErrorResponse errorContent = null, Multimap headers = null) : base(message) +{{/useCustomTemplateCode}} { this.ErrorCode = errorCode; this.ErrorContent = errorContent; diff --git a/sdks/dotnet/templates/ClientUtils.mustache b/sdks/dotnet/templates/ClientUtils.mustache index 08a43623f..cacf67e42 100644 --- a/sdks/dotnet/templates/ClientUtils.mustache +++ b/sdks/dotnet/templates/ClientUtils.mustache @@ -6,14 +6,16 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using {{packageName}}.Model; {{#useCompareNetObjects}} using KellermanSoftware.CompareNetObjects; {{/useCompareNetObjects}} +{{#useCustomTemplateCode}} +using Newtonsoft.Json; +using {{packageName}}.Model; +{{/useCustomTemplateCode}} namespace {{packageName}}.Client { @@ -33,7 +35,11 @@ namespace {{packageName}}.Client /// static ClientUtils() { - compareLogic = new CompareLogic(); + {{#equatable}} + ComparisonConfig comparisonConfig = new{{^net70OrLater}} ComparisonConfig{{/net70OrLater}}(); + comparisonConfig.UseHashCodeIdentifier = true; + {{/equatable}} + compareLogic = new{{^net70OrLater}} CompareLogic{{/net70OrLater}}({{#equatable}}comparisonConfig{{/equatable}}); } {{/useCompareNetObjects}} @@ -114,8 +120,12 @@ namespace {{packageName}}.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); @@ -139,7 +149,7 @@ namespace {{packageName}}.Client /// Encoded string. public static string Base64Encode(string text) { - return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); } /// @@ -238,7 +248,12 @@ namespace {{packageName}}.Client /// /// /// EnumMember value as string otherwise null +{{^useCustomTemplateCode}} + private static string GetEnumMemberAttrValue(object enumVal) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public static string GetEnumMemberAttrValue(object enumVal) +{{/useCustomTemplateCode}} { if (enumVal == null) throw new ArgumentNullException(nameof(enumVal)); @@ -251,6 +266,7 @@ namespace {{packageName}}.Client } return null; } +{{#useCustomTemplateCode}} /// /// Tests if value is a System.IO.Stream or list of System.IO.Stream @@ -302,7 +318,7 @@ namespace {{packageName}}.Client item.Value.ToString() ); - continue; + continue; } if (item.Value is Enum) @@ -333,5 +349,6 @@ namespace {{packageName}}.Client ); } } +{{/useCustomTemplateCode}} } } diff --git a/sdks/dotnet/templates/Configuration.mustache b/sdks/dotnet/templates/Configuration.mustache index 54f87f8b4..64441d8de 100644 --- a/sdks/dotnet/templates/Configuration.mustache +++ b/sdks/dotnet/templates/Configuration.mustache @@ -11,14 +11,16 @@ using System.Net; using System.Reflection; using System.Security.Cryptography.X509Certificates; using System.Text; -using Newtonsoft.Json; using System.Net.Http; +using System.Net.Security; {{#useRestSharp}} {{#hasOAuthMethods}}using {{packageName}}.Client.Auth; {{/hasOAuthMethods}} {{/useRestSharp}} +{{#useCustomTemplateCode}} +using Newtonsoft.Json; using Dropbox.Sign.Model; - +{{/useCustomTemplateCode}} namespace {{packageName}}.Client { @@ -56,13 +58,23 @@ namespace {{packageName}}.Client { return new ApiException(status, string.Format("Error calling {0}: {1}", methodName, response.RawContent), +{{^useCustomTemplateCode}} + response.RawContent, response.Headers); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} JsonConvert.DeserializeObject(response.RawContent), response.Headers); +{{/useCustomTemplateCode}} } {{^netStandard}} if (status == 0) { return new ApiException(status, +{{^useCustomTemplateCode}} + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} string.Format("Error calling {0}: {1}", methodName, response.ErrorText), JsonConvert.DeserializeObject(response.ErrorText)); +{{/useCustomTemplateCode}} } {{/netStandard}} return null; @@ -78,6 +90,8 @@ namespace {{packageName}}.Client /// private string _basePath; + private bool _useDefaultCredentials = false; + /// /// Gets or sets the API key based on the authentication name. /// This is the key and value comprising the "secret" for accessing an API. @@ -122,7 +136,7 @@ namespace {{packageName}}.Client /// /// Initializes a new instance of the class /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration() { Proxy = null; @@ -148,7 +162,7 @@ namespace {{packageName}}.Client { "{{{name}}}", new Dictionary { {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, - {"default_value", "{{{defaultValue}}}"}, + {"default_value", {{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}"{{{defaultValue}}}"}, {{#enumValues}} {{#-first}} { @@ -208,7 +222,7 @@ namespace {{packageName}}.Client /// /// Initializes a new instance of the class /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration( IDictionary defaultHeaders, IDictionary apiKey, @@ -249,11 +263,21 @@ namespace {{packageName}}.Client /// /// Gets or sets the base path for API access. /// - public virtual string BasePath { + public virtual string BasePath + { get { return _basePath; } set { _basePath = value; } } + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + /// /// Gets or sets the default header. /// @@ -356,6 +380,12 @@ namespace {{packageName}}.Client /// The OAuth Client Secret. public virtual string OAuthClientSecret { get; set; } + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string{{nrt?}} OAuthScope { get; set; } + /// /// Gets or sets the flow for OAuth2 authentication. /// @@ -547,7 +577,7 @@ namespace {{packageName}}.Client /// The operation server URL. public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) { - if (OperationServers.TryGetValue(operation, out var operationServer)) + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) { return GetServerUrl(operationServer, index, inputVariables); } @@ -618,6 +648,11 @@ namespace {{packageName}}.Client set { _HttpSigningConfiguration = value; } } {{/hasHttpSignatureMethods}} + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } #endregion Properties @@ -696,6 +731,7 @@ namespace {{packageName}}.Client OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, {{/hasOAuthMethods}} {{/useRestSharp}} @@ -705,6 +741,8 @@ namespace {{packageName}}.Client TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, }; return config; } diff --git a/sdks/dotnet/templates/HttpSigningConfiguration.mustache b/sdks/dotnet/templates/HttpSigningConfiguration.mustache index 6b773b8d5..faca67594 100644 --- a/sdks/dotnet/templates/HttpSigningConfiguration.mustache +++ b/sdks/dotnet/templates/HttpSigningConfiguration.mustache @@ -18,7 +18,6 @@ namespace {{packageName}}.Client /// public class HttpSigningConfiguration { - #region /// /// Initialize the HashAlgorithm and SigningAlgorithm to default value /// @@ -27,9 +26,7 @@ namespace {{packageName}}.Client HashAlgorithm = HashAlgorithmName.SHA256; SigningAlgorithm = "PKCS1-v15"; } - #endregion - #region Properties /// ///Gets the Api keyId /// @@ -40,6 +37,11 @@ namespace {{packageName}}.Client /// public string KeyFilePath { get; set; } + /// + /// Specify the API key in the form of a string, either configure the KeyString property or configure the KeyFilePath property. + /// + public string KeyString { get; set; } + /// /// Gets the key pass phrase for password protected key /// @@ -65,18 +67,13 @@ namespace {{packageName}}.Client /// public int SignatureValidityPeriod { get; set; } - #endregion - - #region enum private enum PrivateKeyType { None = 0, RSA = 1, ECDSA = 2, } - #endregion - #region Methods /// /// Gets the Headers for HttpSigning /// @@ -85,7 +82,7 @@ namespace {{packageName}}.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests @@ -104,6 +101,16 @@ namespace {{packageName}}.Client //the list of signed headers and a base64-encoded signature. const string HEADER_AUTHORIZATION = "Authorization"; + //Read the api key from the file + if(File.Exists(KeyFilePath)) + { + this.KeyString = ReadApiKeyFromFile(KeyFilePath); + } + else if(string.IsNullOrEmpty(KeyString)) + { + throw new Exception("No API key has been provided. Supply it using either KeyFilePath or KeyString"); + } + //Hash table to store singed headers var HttpSignedRequestHeader = new Dictionary(); var HttpSignatureHeader = new Dictionary(); @@ -167,12 +174,12 @@ namespace {{packageName}}.Client if (HashAlgorithm == HashAlgorithmName.SHA256) { - var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); Digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); } else if (HashAlgorithm == HashAlgorithmName.SHA512) { - var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); Digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); } else @@ -240,9 +247,9 @@ namespace {{packageName}}.Client } //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); - var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); + var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); string headerSignatureStr = null; - var keyType = GetKeyType(KeyFilePath); + var keyType = GetKeyType(KeyString); if (keyType == PrivateKeyType.RSA) { @@ -276,11 +283,27 @@ namespace {{packageName}}.Client return HttpSignedRequestHeader; } - private byte[] GetStringHash(string hashName, string stringToBeHashed) + private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) { - var hashAlgorithm = System.Security.Cryptography.HashAlgorithm.Create(hashName); - var bytes = Encoding.UTF8.GetBytes(stringToBeHashed); - var stringHash = hashAlgorithm.ComputeHash(bytes); + HashAlgorithm{{nrt?}} hashAlgorithm = null; + + if (hashAlgorithmName == HashAlgorithmName.SHA1) + hashAlgorithm = SHA1.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA256) + hashAlgorithm = SHA256.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA512) + hashAlgorithm = SHA512.Create(); + + if (hashAlgorithmName == HashAlgorithmName.MD5) + hashAlgorithm = MD5.Create(); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + byte[] stringHash = hashAlgorithm.ComputeHash(bytes); return stringHash; } @@ -293,7 +316,11 @@ namespace {{packageName}}.Client private string GetRSASignature(byte[] stringToSign) { - RSA rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + if (string.IsNullOrEmpty(KeyString)) + { + throw new Exception("No API key has been provided."); + } + RSA rsa = GetRSAProviderFromPemFile(KeyString, KeyPassPhrase); if (SigningAlgorithm == "RSASSA-PSS") { var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); @@ -317,23 +344,19 @@ namespace {{packageName}}.Client /// ECDSA signature private string GetECDSASignature(byte[] dataToSign) { - string keyStr = string.Empty; - if (File.Exists(KeyFilePath)) - { - keyStr = File.ReadAllText(KeyFilePath); - } - else + {{#net60OrLater}} + if (!File.Exists(KeyFilePath) && string.IsNullOrEmpty(KeyString)) { - keyStr = KeyFilePath; + throw new Exception("No API key has been provided."); } + var keyStr = KeyString; const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); var ecdsa = ECDsa.Create(); -#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) var byteCount = 0; if (KeyPassPhrase != null) { @@ -353,19 +376,23 @@ namespace {{packageName}}.Client } } else - { ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); - } - var signedBytes = ecdsa.SignHash(dataToSign); - var derBytes = ConvertToECDSAANS1Format(signedBytes); + + var derBytes = ecdsa.SignHash(dataToSign, DSASignatureFormat.Rfc3279DerSequence); var signedString = System.Convert.ToBase64String(derBytes); return signedString; -#else + {{/net60OrLater}} + {{^net60OrLater}} throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); -#endif + {{/net60OrLater}} } + /// + /// Convert ANS1 format to DER format. Not recommended to use because it generate inavlid signature occationally. + /// + /// + /// private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); @@ -419,22 +446,18 @@ namespace {{packageName}}.Client return derBytes.ToArray(); } - private RSACryptoServiceProvider GetRSAProviderFromPemFile(string pemfile, SecureString keyPassPhrase = null) + private RSACryptoServiceProvider GetRSAProviderFromPemFile(string keyString, SecureString keyPassPhrase = null) { + if (string.IsNullOrEmpty(KeyString)) + { + throw new Exception("No API key has been provided."); + } + const string pempubheader = "-----BEGIN PUBLIC KEY-----"; const string pempubfooter = "-----END PUBLIC KEY-----"; bool isPrivateKeyFile = true; byte[] pemkey = null; - - string pemstr = string.Empty; - if (File.Exists(pemfile)) - { - pemstr = File.ReadAllText(pemfile).Trim(); - } - else - { - pemstr = pemfile; - } + string pemstr = keyString; if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) { @@ -475,7 +498,7 @@ namespace {{packageName}}.Client binkey = Convert.FromBase64String(pvkstr); return binkey; } - catch (System.FormatException) + catch (global::System.FormatException) { StringReader str = new StringReader(pvkstr); @@ -505,7 +528,7 @@ namespace {{packageName}}.Client { //should have b64 encrypted RSA key now binkey = Convert.FromBase64String(encryptedstr); } - catch (System.FormatException) + catch (global::System.FormatException) { //data is not in base64 format return null; } @@ -663,7 +686,7 @@ namespace {{packageName}}.Client Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- - MD5 md5 = new MD5CryptoServiceProvider(); + MD5 md5 = MD5.Create(); byte[] result = null; byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget @@ -721,20 +744,15 @@ namespace {{packageName}}.Client /// /// Detect the key type from the pem file. /// - /// key file path in pem format + /// api key in string format /// Private Key Type - private PrivateKeyType GetKeyType(string keyFilePath) + private PrivateKeyType GetKeyType(string keyString) { string[] key = null; - if (File.Exists(keyFilePath)) - { - key = File.ReadAllLines(keyFilePath); - } - else + if (string.IsNullOrEmpty(keyString)) { - // The ApiKeyFilePath is passed as string - key = new string[] { keyFilePath }; + throw new Exception("No API key has been provided."); } const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; @@ -744,6 +762,7 @@ namespace {{packageName}}.Client //var pkcs8Header = "BEGIN PRIVATE KEY"; //var pkcs8Footer = "END PRIVATE KEY"; PrivateKeyType keyType; + key = KeyString.TrimEnd().Split('\n'); if (key[0].Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) @@ -761,6 +780,24 @@ namespace {{packageName}}.Client } return keyType; } - #endregion + + /// + /// Read the api key form the api key file path and stored it in KeyString property. + /// + /// api key file path + private string ReadApiKeyFromFile(string apiKeyFilePath) + { + string apiKeyString = null; + + if(File.Exists(apiKeyFilePath)) + { + apiKeyString = File.ReadAllText(apiKeyFilePath); + } + else + { + throw new Exception("Provided API key file path does not exists."); + } + return apiKeyString; + } } } diff --git a/sdks/dotnet/templates/IAsynchronousClient.mustache b/sdks/dotnet/templates/IAsynchronousClient.mustache index f0c88fae4..76ddd4adb 100644 --- a/sdks/dotnet/templates/IAsynchronousClient.mustache +++ b/sdks/dotnet/templates/IAsynchronousClient.mustache @@ -21,7 +21,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -32,7 +32,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -43,7 +43,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -54,7 +54,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -65,7 +65,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -76,7 +76,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -87,6 +87,6 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); } } diff --git a/sdks/dotnet/templates/IReadableConfiguration.mustache b/sdks/dotnet/templates/IReadableConfiguration.mustache index 3d364834a..5981728b4 100644 --- a/sdks/dotnet/templates/IReadableConfiguration.mustache +++ b/sdks/dotnet/templates/IReadableConfiguration.mustache @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Net; +using System.Net.Security; using System.Security.Cryptography.X509Certificates; {{#useRestSharp}} {{#hasOAuthMethods}}using {{packageName}}.Client.Auth; @@ -42,6 +43,12 @@ namespace {{packageName}}.Client /// OAuth Client Secret. string OAuthClientSecret { get; } + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string{{nrt?}} OAuthScope { get; } + /// /// Gets the OAuth flow. /// @@ -123,6 +130,11 @@ namespace {{packageName}}.Client /// Password. string Password { get; } + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + /// /// Get the servers associated with the operation. /// @@ -156,5 +168,11 @@ namespace {{packageName}}.Client /// HttpSigningConfiguration HttpSigningConfiguration { get; } {{/hasHttpSignatureMethods}} + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } } } diff --git a/sdks/dotnet/templates/NullConditionalParameter.mustache b/sdks/dotnet/templates/NullConditionalParameter.mustache new file mode 100644 index 000000000..d8ad92666 --- /dev/null +++ b/sdks/dotnet/templates/NullConditionalParameter.mustache @@ -0,0 +1 @@ +{{#isNullable}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}} \ No newline at end of file diff --git a/sdks/dotnet/templates/NullConditionalProperty.mustache b/sdks/dotnet/templates/NullConditionalProperty.mustache new file mode 100644 index 000000000..7dcafa803 --- /dev/null +++ b/sdks/dotnet/templates/NullConditionalProperty.mustache @@ -0,0 +1 @@ +{{#lambda.first}}{{#isNullable}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} \ No newline at end of file diff --git a/sdks/dotnet/templates/README.mustache b/sdks/dotnet/templates/README.mustache index 78e685946..f70a5dae2 100644 --- a/sdks/dotnet/templates/README.mustache +++ b/sdks/dotnet/templates/README.mustache @@ -4,6 +4,7 @@ {{{.}}} {{/appDescriptionWithNewLines}} +{{#useCustomTemplateCode}} ## Migrating from legacy SDK This SDK is generated from our officially maintained [OpenAPI spec](https://github.com/hellosign/hellosign-openapi/blob/main/openapi.yaml). @@ -22,6 +23,7 @@ Pull Requests *must* be opened against the You must make SDK code changes in the mustache file within the `templates` directory that corresponds to the file you want updated. +{{/useCustomTemplateCode}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} @@ -29,11 +31,13 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) {{/infoUrl}} +{{#useCustomTemplateCode}} ### Building You must have `docker` (or `podman` linked to `docker`) installed. Highly @@ -50,7 +54,8 @@ Run the following and everything is done for you: to the OAS file and/or the mustache template files _will be lost_ when you run this command. - +{{/useCustomTemplateCode}} + ## Frameworks supported {{#netStandard}} - .NET Core >=1.0 @@ -58,14 +63,14 @@ this command. - Mono/Xamarin >=vNext {{/netStandard}} - + ## Dependencies {{#useRestSharp}} -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 108.0.1 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later {{/useRestSharp}} -- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.1 or later -- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.9.0 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later {{#useCompareNetObjects}} - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later {{/useCompareNetObjects}} @@ -73,7 +78,65 @@ this command. - [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later {{/validatable}} - +{{^useCustomTemplateCode}} +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +{{#useRestSharp}} +Install-Package RestSharp +{{/useRestSharp}} +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +{{#validatable}} +Install-Package System.ComponentModel.Annotations +{{/validatable}} +{{#useCompareNetObjects}} +Install-Package CompareNETObjects +{{/useCompareNetObjects}} +``` +{{#useRestSharp}} + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). +NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). + +{{/useRestSharp}} + +## Installation +{{#netStandard}} +Generate the DLL using your preferred tool (e.g. `dotnet build`) +{{/netStandard}} +{{^netStandard}} +Run the following command to generate the DLL +- [Mac/Linux] `/bin/sh build.sh` +- [Windows] `build.bat` +{{/netStandard}} + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; +``` +{{^netStandard}} + +## Packaging + +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out {{packageName}}.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + +{{/netStandard}} +{{/useCustomTemplateCode}} + +{{^useCustomTemplateCode}} +## Usage +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ## Installation & Usage ### NuGet Package Manager @@ -85,6 +148,7 @@ The Dropbox Sign .NET SDK can be installed using the NuGet package manager, unde You can follow the NuGet quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli#publish-the-package) the package via the dotnet CLI. Or, you can [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio?tabs=netcore-cli) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio?tabs=netcore-cli#publish-the-package) using Visual Studio. Alternatively, the .nupkg can be published to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consumed via NuGet as usual. +{{/useCustomTemplateCode}} To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` ```csharp @@ -123,14 +187,103 @@ services.AddHttpClient(httpClient => {{/useHttpClient}} - + +{{^useCustomTemplateCode}} +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace Example +{ + public class {{operationId}}Example + { + public static void Main() + { +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + {{#useHttpClient}} + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); + {{/useHttpClient}} + {{^useHttpClient}} + var apiInstance = new {{classname}}(config); + {{/useHttpClient}} + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result);{{/returnType}} + } + catch (ApiException e) + { + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + } + } +} +``` +{{/useCustomTemplateCode}} + +{{#useCustomTemplateCode}} ## Getting Started + {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} ```csharp REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_C#_CODE ``` {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - +{{/useCustomTemplateCode}} + + ## Documentation for API Endpoints All URIs are relative to *{{{basePath}}}* @@ -140,7 +293,7 @@ Class | Method | HTTP request | Description {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - + ## Documentation for Models {{#modelPackage}} @@ -151,19 +304,13 @@ Class | Method | HTTP request | Description No model defined in this package {{/modelPackage}} - + ## Documentation for Authorization -{{^authMethods}} -All endpoints do not require authorization. -{{/authMethods}} -{{#authMethods}} -{{#last}} -Authentication schemes defined for the API: -{{/last}} -{{/authMethods}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} {{#authMethods}} - + ### {{name}} {{#isApiKey}}- **Type**: API key @@ -174,6 +321,8 @@ Authentication schemes defined for the API: {{/isBasicBasic}} {{#isBasicBearer}}- **Type**: Bearer Authentication {{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/sdks/dotnet/templates/RequestOptions.mustache b/sdks/dotnet/templates/RequestOptions.mustache index 40436b965..cfc146925 100644 --- a/sdks/dotnet/templates/RequestOptions.mustache +++ b/sdks/dotnet/templates/RequestOptions.mustache @@ -25,7 +25,7 @@ namespace {{packageName}}.Client public Multimap QueryParameters { get; set; } /// - /// Header parameters to be applied to to the request. + /// Header parameters to be applied to the request. /// Keys may have 1 or more values associated. /// public Multimap HeaderParameters { get; set; } @@ -35,10 +35,12 @@ namespace {{packageName}}.Client /// public Dictionary FormParameters { get; set; } + {{#supportsFileParameters}} /// /// File parameters to be sent along with the request. /// public Multimap FileParameters { get; set; } + {{/supportsFileParameters}} /// /// Cookies to be sent along with the request. @@ -76,7 +78,9 @@ namespace {{packageName}}.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); + {{#supportsFileParameters}} FileParameters = new Multimap(); + {{/supportsFileParameters}} Cookies = new List(); } } diff --git a/sdks/dotnet/templates/Solution.mustache b/sdks/dotnet/templates/Solution.mustache index c8f0eebed..f5589670a 100644 --- a/sdks/dotnet/templates/Solution.mustache +++ b/sdks/dotnet/templates/Solution.mustache @@ -4,12 +4,16 @@ VisualStudioVersion = {{^netStandard}}12.0.0.0{{/netStandard}}{{#netStandard}}14 MinimumVisualStudioVersion = {{^netStandard}}10.0.0.1{{/netStandard}}{{#netStandard}}10.0.40219.1{{/netStandard}} Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" EndProject +{{^useCustomTemplateCode}} {{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "src\{{testPackageName}}\{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject -{{/excludeTests}} +{{/excludeTests}}Global +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dropbox.Sign.Test", "src\Dropbox.Sign.Test\Dropbox.Sign.Test.csproj", "{C305EB17-93FE-4BDA-89A4-120BD8C8A88A}" EndProject Global +{{/useCustomTemplateCode}} GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU @@ -23,10 +27,12 @@ Global {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU +{{#useCustomTemplateCode}} {C305EB17-93FE-4BDA-89A4-120BD8C8A88A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C305EB17-93FE-4BDA-89A4-120BD8C8A88A}.Debug|Any CPU.Build.0 = Debug|Any CPU {C305EB17-93FE-4BDA-89A4-120BD8C8A88A}.Release|Any CPU.ActiveCfg = Release|Any CPU {C305EB17-93FE-4BDA-89A4-120BD8C8A88A}.Release|Any CPU.Build.0 = Release|Any CPU +{{/useCustomTemplateCode}} EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdks/dotnet/templates/TestProject.mustache b/sdks/dotnet/templates/TestProject.mustache index e5f01e568..05df99a79 100644 --- a/sdks/dotnet/templates/TestProject.mustache +++ b/sdks/dotnet/templates/TestProject.mustache @@ -22,10 +22,15 @@ 512 +{{^useCustomTemplateCode}} + +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} - - +{{/useCustomTemplateCode}} + + diff --git a/sdks/dotnet/templates/ValidateRegex.mustache b/sdks/dotnet/templates/ValidateRegex.mustache new file mode 100644 index 000000000..15cf626dc --- /dev/null +++ b/sdks/dotnet/templates/ValidateRegex.mustache @@ -0,0 +1,6 @@ +// {{{name}}} ({{{dataType}}}) pattern +Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); +if (!regex{{{name}}}.Match(this.{{{name}}}{{#isUuid}}.ToString(){{/isUuid}}).Success) +{ + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); +} \ No newline at end of file diff --git a/sdks/dotnet/templates/api.mustache b/sdks/dotnet/templates/api.mustache index c19edc23b..632833ab9 100644 --- a/sdks/dotnet/templates/api.mustache +++ b/sdks/dotnet/templates/api.mustache @@ -82,7 +82,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// {{summary}} @@ -100,7 +100,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); {{/operation}} #endregion Asynchronous Operations } @@ -276,6 +276,14 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}} {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); +{{^useCustomTemplateCode}} + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#bodyParam}} var localVarContentType = ""; var openApiTypes = {{paramName}}.GetOpenApiTypes(); @@ -298,6 +306,7 @@ namespace {{packageName}}.{{apiPackage}} }; var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); {{/bodyParam}} +{{/useCustomTemplateCode}} // to determine the Accept header string[] _accepts = new string[] { @@ -306,6 +315,9 @@ namespace {{packageName}}.{{apiPackage}} {{/produces}} }; +{{^useCustomTemplateCode}} + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); +{{/useCustomTemplateCode}} if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -349,7 +361,7 @@ namespace {{packageName}}.{{apiPackage}} {{#items.vars}} if ({{paramName}}.{{name}} != null) { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); } {{/items.vars}} {{^items}} @@ -377,13 +389,17 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} @@ -395,21 +411,31 @@ namespace {{packageName}}.{{apiPackage}} { {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter {{/isFile}} } {{/required}} {{/formParams}} +{{^useCustomTemplateCode}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} +{{/useCustomTemplateCode}} + localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; localVarRequestOptions.OperationIndex = operationIndex; @@ -516,7 +542,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -535,7 +561,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { {{#allParams}} {{#required}} @@ -552,6 +578,14 @@ namespace {{packageName}}.{{apiPackage}} {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); +{{^useCustomTemplateCode}} + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#bodyParam}} var localVarContentType = ""; var openApiTypes = {{paramName}}.GetOpenApiTypes(); @@ -572,9 +606,9 @@ namespace {{packageName}}.{{apiPackage}} "{{{mediaType}}}"{{^-last}}, {{/-last}} {{/consumes}} }; - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); {{/bodyParam}} +{{/useCustomTemplateCode}} // to determine the Accept header string[] _accepts = new string[] { @@ -583,6 +617,9 @@ namespace {{packageName}}.{{apiPackage}} {{/produces}} }; +{{^useCustomTemplateCode}} + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); +{{/useCustomTemplateCode}} if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -594,6 +631,12 @@ namespace {{packageName}}.{{apiPackage}} localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} {{#pathParams}} {{#required}} localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter @@ -605,17 +648,52 @@ namespace {{packageName}}.{{apiPackage}} } {{/required}} {{/pathParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} {{#queryParams}} {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} {{/required}} {{^required}} if ({{paramName}} != null) { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} } {{/required}} {{/queryParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} {{#headerParams}} {{#required}} localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter @@ -631,17 +709,21 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter {{/isFile}} {{/required}} {{^required}} @@ -649,21 +731,31 @@ namespace {{packageName}}.{{apiPackage}} { {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter {{/isFile}} } {{/required}} {{/formParams}} +{{^useCustomTemplateCode}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} +{{/useCustomTemplateCode}} + localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/sdks/dotnet/templates/api_doc.mustache b/sdks/dotnet/templates/api_doc.mustache index 24578dff0..341bd79d7 100644 --- a/sdks/dotnet/templates/api_doc.mustache +++ b/sdks/dotnet/templates/api_doc.mustache @@ -13,7 +13,7 @@ All URIs are relative to *{{{basePath}}}* {{#operations}} {{#operation}} - + # **{{{operationId}}}** > {{returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) @@ -22,9 +22,91 @@ All URIs are relative to *{{{basePath}}}* {{{.}}}{{/notes}} ### Example +{{^useCustomTemplateCode}} +```csharp +using System.Collections.Generic; +using System.Diagnostics; +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace Example +{ + public class {{operationId}}Example + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.AddApiKey("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + {{#useHttpClient}} + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); + {{/useHttpClient}} + {{^useHttpClient}} + var apiInstance = new {{classname}}(config); + {{/useHttpClient}} + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result);{{/returnType}} + } + catch (ApiException e) + { + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ```csharp REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_C#_CODE ``` +{{/useCustomTemplateCode}} #### Using the {{operationId}}WithHttpInfo variant This returns an ApiResponse object which contains the response data, status code and headers. diff --git a/sdks/dotnet/templates/auth/OAuthAuthenticator.mustache b/sdks/dotnet/templates/auth/OAuthAuthenticator.mustache index cc0b3894a..d71f262a8 100644 --- a/sdks/dotnet/templates/auth/OAuthAuthenticator.mustache +++ b/sdks/dotnet/templates/auth/OAuthAuthenticator.mustache @@ -16,6 +16,7 @@ namespace {{packageName}}.Client.Auth readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; + readonly string{{nrt?}} _scope; readonly string _grantType; readonly JsonSerializerSettings _serializerSettings; readonly IReadableConfiguration _configuration; @@ -27,6 +28,7 @@ namespace {{packageName}}.Client.Auth string tokenUrl, string clientId, string clientSecret, + string{{nrt?}} scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) : base("") @@ -34,6 +36,7 @@ namespace {{packageName}}.Client.Auth _tokenUrl = tokenUrl; _clientId = clientId; _clientSecret = clientSecret; + _scope = scope; _serializerSettings = serializerSettings; _configuration = configuration; @@ -63,7 +66,7 @@ namespace {{packageName}}.Client.Auth /// An authentication parameter. protected override async ValueTask GetAuthenticationParameter(string accessToken) { - var token = string.IsNullOrEmpty(Token) ? await GetToken() : Token; + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); } @@ -73,15 +76,31 @@ namespace {{packageName}}.Client.Auth /// An authentication token. async Task GetToken() { - var client = new RestClient(_tokenUrl) - .UseSerializer(() => new CustomJsonCodec(_serializerSettings, _configuration)); + var client = new RestClient(_tokenUrl, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(_serializerSettings, _configuration))); var request = new RestRequest() .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); - var response = await client.PostAsync(request); - return $"{response.TokenType} {response.AccessToken}"; + + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + + var response = await client.PostAsync(request).ConfigureAwait(false); + + // RFC6749 - token_type is case insensitive. + // RFC6750 - In Authorization header Bearer should be capitalized. + // Fix the capitalization irrespective of token_type casing. + switch (response.TokenType?.ToLower()) + { + case "bearer": + return $"Bearer {response.AccessToken}"; + default: + return $"{response.TokenType} {response.AccessToken}"; + } } } } diff --git a/sdks/dotnet/templates/gitignore.mustache b/sdks/dotnet/templates/gitignore.mustache index 0a5d07c58..0cf6ba6d4 100644 --- a/sdks/dotnet/templates/gitignore.mustache +++ b/sdks/dotnet/templates/gitignore.mustache @@ -27,6 +27,9 @@ x86/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ +{{#useCustomTemplateCode}} +#[Bb]in/ +{{/useCustomTemplateCode}} [Oo]bj/ [Ll]og/ [Ll]ogs/ @@ -360,6 +363,8 @@ MigrationBackup/ # Fody - auto-generated XML schema FodyWeavers.xsd +{{#useCustomTemplateCode}} vendor - +api .openapi-generator +{{/useCustomTemplateCode}} diff --git a/sdks/dotnet/templates/libraries/generichost/AfterOperationDefaultImplementation.mustache b/sdks/dotnet/templates/libraries/generichost/AfterOperationDefaultImplementation.mustache new file mode 100644 index 000000000..394c65720 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/AfterOperationDefaultImplementation.mustache @@ -0,0 +1,2 @@ + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/ApiException.mustache b/sdks/dotnet/templates/libraries/generichost/ApiException.mustache index 7777fd09c..c14c1010f 100644 --- a/sdks/dotnet/templates/libraries/generichost/ApiException.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ApiException.mustache @@ -6,7 +6,7 @@ {{/nrt}} using System; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// API Exception @@ -29,7 +29,7 @@ namespace {{packageName}}.Client public string RawContent { get; } /// - /// Construct the ApiException from parts of the reponse + /// Construct the ApiException from parts of the response /// /// /// diff --git a/sdks/dotnet/templates/libraries/generichost/ApiFactory.mustache b/sdks/dotnet/templates/libraries/generichost/ApiFactory.mustache new file mode 100644 index 000000000..a445d2169 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/ApiFactory.mustache @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{apiPackage}}; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// An IApiFactory interface + /// + {{>visibility}} interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + {{>visibility}} class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/sdks/dotnet/templates/libraries/generichost/ApiKeyToken.mustache b/sdks/dotnet/templates/libraries/generichost/ApiKeyToken.mustache index 25a751ad6..d3f1f5214 100644 --- a/sdks/dotnet/templates/libraries/generichost/ApiKeyToken.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ApiKeyToken.mustache @@ -6,56 +6,51 @@ {{/nrt}} using System; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A token constructed from an apiKey. /// - public class ApiKeyToken : TokenBase + {{>visibility}} class ApiKeyToken : TokenBase { private string _raw; + /// + /// The header that this token will be used with. + /// + public ClientUtils.ApiKeyHeader Header { get; } + /// /// Constructs an ApiKeyToken object. /// /// + /// /// - /// - public ApiKeyToken(string value, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + /// + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) { + Header = header; _raw = $"{ prefix }{ value }"; } - /// - /// Places the token in the cookie. - /// - /// - /// - public virtual void UseInCookie(System.Net.Http.HttpRequestMessage request, string cookieName) - { - request.Headers.Add("Cookie", $"{ cookieName }=_raw"); - } - /// /// Places the token in the header. /// /// - /// - public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) { - request.Headers.Add(headerName, _raw); + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); } - + /// /// Places the token in the query. /// /// /// /// - /// - public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString, string parameterName) + public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) { - parseQueryString[parameterName] = Uri.EscapeDataString(_raw).ToString(){{nrt!}}; + parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(){{nrt!}}; } } } \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/ApiResponseEventArgs.mustache b/sdks/dotnet/templates/libraries/generichost/ApiResponseEventArgs.mustache deleted file mode 100644 index 5ff161993..000000000 --- a/sdks/dotnet/templates/libraries/generichost/ApiResponseEventArgs.mustache +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Net; - -namespace {{packageName}}.Client -{ - /// - /// Useful for tracking server health. - /// - public class ApiResponseEventArgs : EventArgs - { - /// - /// The time the request was sent. - /// - public DateTime RequestedAt { get; } - /// - /// The time the response was received. - /// - public DateTime ReceivedAt { get; } - /// - /// The HttpStatusCode received. - /// - public HttpStatusCode HttpStatus { get; } - /// - /// The path requested. - /// - public string Path { get; } - /// - /// The elapsed time from request to response. - /// - public TimeSpan ToTimeSpan => this.ReceivedAt - this.RequestedAt; - - /// - /// The event args used to track server health. - /// - /// - /// - /// - /// - public ApiResponseEventArgs(DateTime requestedAt, DateTime receivedAt, HttpStatusCode httpStatus, string path) - { - RequestedAt = requestedAt; - ReceivedAt = receivedAt; - HttpStatus = httpStatus; - Path = path; - } - } -} diff --git a/sdks/dotnet/templates/libraries/generichost/ApiResponseEventArgs`1.mustache b/sdks/dotnet/templates/libraries/generichost/ApiResponseEventArgs`1.mustache new file mode 100644 index 000000000..aea35fae1 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/ApiResponseEventArgs`1.mustache @@ -0,0 +1,24 @@ +using System; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Useful for tracking server health + /// + {{>visibility}} class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/sdks/dotnet/templates/libraries/generichost/ApiResponse`1.mustache b/sdks/dotnet/templates/libraries/generichost/ApiResponse`1.mustache index 1bcf4a841..1b12e4173 100644 --- a/sdks/dotnet/templates/libraries/generichost/ApiResponse`1.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ApiResponse`1.mustache @@ -5,64 +5,80 @@ {{/nrt}} using System; -using System.Collections.Generic; +{{^netStandard}} +using System.Diagnostics.CodeAnalysis; +{{/netStandard}} using System.Net; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// Provides a non-generic contract for the ApiResponse wrapper. /// - public interface IApiResponse + {{>visibility}} partial interface IApiResponse { /// - /// The data type of + /// The IsSuccessStatusCode from the api response /// - Type ResponseType { get; } + bool IsSuccessStatusCode { get; } /// - /// Gets or sets the status code (HTTP status code) + /// Gets the status code (HTTP status code) /// /// The status code. HttpStatusCode StatusCode { get; } /// - /// The raw content of this response + /// The raw content of this response. /// string RawContent { get; } - } - /// - /// API Response - /// - {{>visibility}} partial class ApiResponse : IApiResponse - { - #region Properties + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } /// - /// The deserialized content + /// The headers contained in the api response /// - {{! .net 3.1 does not support unconstrained nullable T }} - public T{{#nrt}}{{^netcoreapp3.1}}?{{/netcoreapp3.1}}{{/nrt}} Content { get; set; } + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } /// - /// Gets or sets the status code (HTTP status code) + /// The path used when making the request. /// - /// The status code. - public HttpStatusCode StatusCode { get; } + string Path { get; } /// - /// The content of this response + /// The reason phrase contained in the api response /// - public Type ResponseType - { - get { return typeof(T); } - } + string{{nrt?}} ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri{{nrt?}} RequestUri { get; } + } + + /// + /// API Response + /// + {{>visibility}} partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } /// /// The raw data /// - public string RawContent { get; } + public string RawContent { get; protected set; } /// /// The IsSuccessStatusCode from the api response @@ -79,20 +95,76 @@ namespace {{packageName}}.Client /// public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } - #endregion Properties + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } /// - /// Construct the reponse using an HttpResponseMessage + /// The Uri used when making the request. /// - /// + public Uri{{nrt?}} RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// /// - public ApiResponse(System.Net.Http.HttpResponseMessage response, string rawContent) + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) { - StatusCode = response.StatusCode; - Headers = response.Headers; - IsSuccessStatusCode = response.IsSuccessStatusCode; - ReasonPhrase = response.ReasonPhrase; + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + {{#x-http-statuses-with-return}} + + /// + /// An interface for responses of type {{TType}} + /// + /// + {{>visibility}} interface I{{.}} : IApiResponse + { + /// + /// Deserializes the response if the response is {{.}} + /// + /// + TType {{.}}(); + + /// + /// Returns true if the response is {{.}} and the deserialized response is not null + /// + /// + /// + bool Try{{.}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out TType{{nrt?}} result); } + {{/x-http-statuses-with-return}} } diff --git a/sdks/dotnet/templates/libraries/generichost/ApiTestsBase.mustache b/sdks/dotnet/templates/libraries/generichost/ApiTestsBase.mustache index 57dd3c7ed..3292a1e86 100644 --- a/sdks/dotnet/templates/libraries/generichost/ApiTestsBase.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ApiTestsBase.mustache @@ -3,14 +3,15 @@ using System; using System.Collections.Generic; using System.Security.Cryptography; using Microsoft.Extensions.Hosting; -using {{packageName}}.Client;{{#hasImport}} +using {{packageName}}.{{clientPackage}};{{#hasImport}} using {{packageName}}.{{modelPackage}};{{/hasImport}} +using {{packageName}}.Extensions; -{{{testInstructions}}} +{{>testInstructions}} -namespace {{packageName}}.Test.Api +namespace {{packageName}}.Test.{{apiPackage}} { /// /// Base class for API tests @@ -25,23 +26,40 @@ namespace {{packageName}}.Test.Api } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .Configure{{apiName}}((context, options) => + .Configure{{apiName}}((context, services, options) => { - {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(apiKeyToken); - {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerToken bearerToken = new BearerToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(bearerToken); - {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicToken basicToken = new BasicToken(context.Configuration[""], context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(basicToken); - {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} - HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); - HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(httpSignatureToken); - {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OAuthToken oauthToken = new OAuthToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken);{{/hasOAuthMethods}} + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + string apiKeyTokenValue{{-index}} = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(apiKeyTokenValue{{-index}}, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + string bearerTokenValue{{-index}} = context.Configuration[""] ?? throw new Exception("Token not found."); + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}(bearerTokenValue{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + string basicTokenUsername{{-index}} = context.Configuration[""] ?? throw new Exception("Username not found."); + string basicTokenPassword{{-index}} = context.Configuration[""] ?? throw new Exception("Password not found."); + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}(basicTokenUsername{{-index}}, basicTokenPassword{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + string oauthTokenValue{{-index}} = context.Configuration[""] ?? throw new Exception("Token not found."); + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}(oauthTokenValue{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} }); } } diff --git a/sdks/dotnet/templates/libraries/generichost/AsModel.mustache b/sdks/dotnet/templates/libraries/generichost/AsModel.mustache new file mode 100644 index 000000000..96bedfa46 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/AsModel.mustache @@ -0,0 +1,4 @@ +// This logic may be modified with the AsModel.mustache template +return Is{{vendorExtensions.x-http-status}} + ? System.Text.Json.JsonSerializer.Deserialize<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}>(RawContent, _jsonSerializerOptions) + : {{#net60OrLater}}null{{/net60OrLater}}{{^net60OrLater}}default{{/net60OrLater}}; diff --git a/sdks/dotnet/templates/libraries/generichost/Assembly.mustache b/sdks/dotnet/templates/libraries/generichost/Assembly.mustache new file mode 100644 index 000000000..a22cc2326 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/Assembly.mustache @@ -0,0 +1,2 @@ +[assembly: InternalsVisibleTo("{{packageName}}.Test")] + diff --git a/sdks/dotnet/templates/libraries/generichost/BasicToken.mustache b/sdks/dotnet/templates/libraries/generichost/BasicToken.mustache index a8a2b910a..ed6f53e54 100644 --- a/sdks/dotnet/templates/libraries/generichost/BasicToken.mustache +++ b/sdks/dotnet/templates/libraries/generichost/BasicToken.mustache @@ -9,12 +9,12 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A token constructed from a username and password. /// - public class BasicToken : TokenBase + {{>visibility}} class BasicToken : TokenBase { private string _username; @@ -38,7 +38,7 @@ namespace {{packageName}}.Client /// /// /// - public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) { request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", {{packageName}}.Client.ClientUtils.Base64Encode(_username + ":" + _password)); } diff --git a/sdks/dotnet/templates/libraries/generichost/BearerToken.mustache b/sdks/dotnet/templates/libraries/generichost/BearerToken.mustache index b6062bfc2..761f598d8 100644 --- a/sdks/dotnet/templates/libraries/generichost/BearerToken.mustache +++ b/sdks/dotnet/templates/libraries/generichost/BearerToken.mustache @@ -9,12 +9,12 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A token constructed from a token from a bearer token. /// - public class BearerToken : TokenBase + {{>visibility}} class BearerToken : TokenBase { private string _raw; @@ -33,7 +33,7 @@ namespace {{packageName}}.Client /// /// /// - public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) { request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); } diff --git a/sdks/dotnet/templates/libraries/generichost/ClientUtils.mustache b/sdks/dotnet/templates/libraries/generichost/ClientUtils.mustache index 572565262..269d20c4d 100644 --- a/sdks/dotnet/templates/libraries/generichost/ClientUtils.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ClientUtils.mustache @@ -6,24 +6,21 @@ using System; using System.IO; using System.Linq; -using System.Net.Http; +using System.Collections; +using System.Collections.Generic; using System.Text; using System.Text.Json; -using System.Text.RegularExpressions; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.DependencyInjection;{{#supportsRetry}} -using Polly.Timeout; -using Polly.Extensions.Http; -using Polly;{{/supportsRetry}} -using {{packageName}}.Api;{{#useCompareNetObjects}} +using System.Text.RegularExpressions;{{#useCompareNetObjects}} using KellermanSoftware.CompareNetObjects;{{/useCompareNetObjects}} +using {{packageName}}.{{modelPackage}}; +using System.Runtime.CompilerServices; -namespace {{packageName}}.Client +{{>Assembly}}namespace {{packageName}}.{{clientPackage}} { /// /// Utility functions providing some benefit to API client consumers. /// - public static class ClientUtils + {{>visibility}} static class ClientUtils { {{#useCompareNetObjects}} /// @@ -36,7 +33,11 @@ namespace {{packageName}}.Client /// static ClientUtils() { - compareLogic = new CompareLogic(); + {{#equatable}} + ComparisonConfig comparisonConfig = new{{^net70OrLater}} ComparisonConfig{{/net70OrLater}}(); + comparisonConfig.UseHashCodeIdentifier = true; + {{/equatable}} + compareLogic = new{{^net70OrLater}} CompareLogic{{/net70OrLater}}({{#equatable}}comparisonConfig{{/equatable}}); } {{/useCompareNetObjects}} @@ -49,6 +50,51 @@ namespace {{packageName}}.Client /// public delegate void EventHandler(object sender, T e) where T : EventArgs; + {{#hasApiKeyMethods}} + /// + /// An enum of headers + /// + public enum ApiKeyHeader + { + {{#apiKeyMethods}} + /// + /// The {{keyParamName}} header + /// + {{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}{{^-last}},{{/-last}} + {{/apiKeyMethods}} + } + + /// + /// Converte an ApiKeyHeader to a string + /// + /// + /// + /// + {{>visibility}} static string ApiKeyHeaderToString(ApiKeyHeader value) + { + {{#net80OrLater}} + return value switch + { + {{#apiKeyMethods}} + ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}} => "{{keyParamName}}", + {{/apiKeyMethods}} + _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), + }; + {{/net80OrLater}} + {{^net80OrLater}} + switch(value) + { + {{#apiKeyMethods}} + case ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}: + return "{{keyParamName}}"; + {{/apiKeyMethods}} + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); + } + {{/net80OrLater}} + } + + {{/hasApiKeyMethods}} /// /// Returns true when deserialization succeeds. /// @@ -57,7 +103,7 @@ namespace {{packageName}}.Client /// /// /// - public static bool TryDeserialize(string json, JsonSerializerOptions options, {{^netStandard}}[System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/netStandard}}out T{{#nrt}}{{^netStandard}}?{{/netStandard}}{{/nrt}} result) + public static bool TryDeserialize(string json, JsonSerializerOptions options, {{#net60OrLater}}[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/net60OrLater}}out T{{#nrt}}{{#net60OrLater}}?{{/net60OrLater}}{{/nrt}} result) { try { @@ -79,7 +125,7 @@ namespace {{packageName}}.Client /// /// /// - public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, {{^netStandard}}[System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/netStandard}}out T{{#nrt}}{{^netStandard}}?{{/netStandard}}{{/nrt}} result) + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, {{#net60OrLater}}[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/net60OrLater}}out T{{#nrt}}{{#net60OrLater}}?{{/net60OrLater}}{{/nrt}} result) { try { @@ -112,7 +158,7 @@ namespace {{packageName}}.Client /// The parameter (header, path, query, form). /// The DateTime serialization format. /// Formatted string. - public static string{{nrt?}} ParameterToString(object obj, string{{nrt?}} format = ISO8601_DATETIME_FORMAT) + public static string{{nrt?}} ParameterToString(object{{nrt?}} obj, string{{nrt?}} format = ISO8601_DATETIME_FORMAT) { if (obj is DateTime dateTime) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat @@ -127,9 +173,45 @@ namespace {{packageName}}.Client // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString(format); if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is System.Collections.ICollection collection) - return string.Join(",", collection.Cast()); + return boolean + ? "true" + : "false"; + {{#models}} + {{#model}} + {{#isEnum}} + if (obj is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{classname}}ValueConverter.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/isEnum}} + {{^isEnum}} + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} + if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} + if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/complexType}} + {{/isEnum}} + {{/vars}} + {{/isEnum}} + {{/model}} + {{/models}} + if (obj is ICollection collection) + { + List entries = new{{^net70OrLater}} List{{/net70OrLater}}(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } @@ -176,7 +258,7 @@ namespace {{packageName}}.Client /// Encoded string. public static string Base64Encode(string text) { - return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); } /// @@ -255,169 +337,65 @@ namespace {{packageName}}.Client } /// - /// The base path of the API - /// - public const string BASE_ADDRESS = "{{{basePath}}}"; - - /// - /// The scheme of the API + /// Get the discriminator /// - public const string SCHEME = "{{{scheme}}}"; - - /// - /// The context path of the API - /// - public const string CONTEXT_PATH = "{{contextPath}}"; - - /// - /// The host of the API - /// - public const string HOST = "{{{host}}}"; - - /// - /// The format to use for DateTime serialization - /// - public const string ISO8601_DATETIME_FORMAT = "o"; - - {{^hasAuthMethods}} - /// - /// Add the api to your host builder. - /// - /// - /// - public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder) + /// + /// + /// + /// + public static string{{nrt?}} GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) { - builder.ConfigureServices((context, services) => - { - HostConfiguration config = new HostConfiguration(services); + int currentDepth = utf8JsonReader.CurrentDepth; - Add{{apiName}}(services, config); - }); + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); - return builder; - } + JsonTokenType startingTokenType = utf8JsonReader.TokenType; - {{/hasAuthMethods}} - /// - /// Add the api to your host builder. - /// - /// - /// - public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder, Action options) - { - builder.ConfigureServices((context, services) => + while (utf8JsonReader.Read()) { - HostConfiguration config = new HostConfiguration(services); + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; - options(context, config); + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); - Add{{apiName}}(services, config); - }); + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } - return builder; + throw new JsonException("The specified discriminator was not found."); } - {{^hasAuthMethods}} /// - /// Add the api to your host builder. + /// The base path of the API /// - /// - /// - public static void Add{{apiName}}(this IServiceCollection services) - { - HostConfiguration config = new HostConfiguration(services); - Add{{apiName}}(services, config); - } + public const string BASE_ADDRESS = "{{{basePath}}}"; - {{/hasAuthMethods}} /// - /// Add the api to your host builder. + /// The scheme of the API /// - /// - /// - public static void Add{{apiName}}(this IServiceCollection services, Action options) - { - HostConfiguration config = new HostConfiguration(services); - options(config); - Add{{apiName}}(services, config); - } - - private static void Add{{apiName}}(IServiceCollection services, HostConfiguration host) - { - if (!host.HttpClientsAdded) - host.Add{{apiName}}HttpClients(); - - // ensure that a token provider was provided for this token type - // if not, default to RateLimitProvider - var containerServices = services.Where(s => s.ServiceType.IsGenericType && - s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); - - foreach(var containerService in containerServices) - { - var tokenType = containerService.ServiceType.GenericTypeArguments[0]; - - var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); - - if (provider == null) - { - services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); - services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), - s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); - } - } - }{{#supportsRetry}} + public const string SCHEME = "{{{scheme}}}"; /// - /// Adds a Polly retry policy to your clients. + /// The context path of the API /// - /// - /// - /// - public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) - { - client.AddPolicyHandler(RetryPolicy(retries)); - - return client; - } + public const string CONTEXT_PATH = "{{contextPath}}"; /// - /// Adds a Polly timeout policy to your clients. + /// The host of the API /// - /// - /// - /// - public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) - { - client.AddPolicyHandler(TimeoutPolicy(timeout)); - - return client; - } + public const string HOST = "{{{host}}}"; /// - /// Adds a Polly circiut breaker to your clients. + /// The format to use for DateTime serialization /// - /// - /// - /// - /// - public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) - { - client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); - - return client; - } - - private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) - => HttpPolicyExtensions - .HandleTransientHttpError() - .Or() - .RetryAsync(retries); - - private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) - => Policy.TimeoutAsync(timeout); - - private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( - PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) - => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak);{{/supportsRetry}} + public const string ISO8601_DATETIME_FORMAT = "o"; } } diff --git a/sdks/dotnet/templates/libraries/generichost/CookieContainer.mustache b/sdks/dotnet/templates/libraries/generichost/CookieContainer.mustache new file mode 100644 index 000000000..f96d4fb41 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/CookieContainer.mustache @@ -0,0 +1,22 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System.Linq; +using System.Collections.Generic; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A class containing a CookieContainer + /// + {{>visibility}} sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/DateFormats.mustache b/sdks/dotnet/templates/libraries/generichost/DateFormats.mustache new file mode 100644 index 000000000..920ecda88 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/DateFormats.mustache @@ -0,0 +1,2 @@ + "yyyy'-'MM'-'dd", + "yyyyMMdd" diff --git a/sdks/dotnet/templates/libraries/generichost/DateOnlyJsonConverter.mustache b/sdks/dotnet/templates/libraries/generichost/DateOnlyJsonConverter.mustache new file mode 100644 index 000000000..209979c8d --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/DateOnlyJsonConverter.mustache @@ -0,0 +1,51 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateOnlyJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateFormats}} + }; + + /// + /// Returns a DateOnly from the Json object + /// + /// + /// + /// + /// + public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnly dateOnlyValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateOnlyValue.ToString("{{{dateFormat}}}", CultureInfo.InvariantCulture)); + } +} diff --git a/sdks/dotnet/templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache b/sdks/dotnet/templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache new file mode 100644 index 000000000..17c847365 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache @@ -0,0 +1,56 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateOnlyNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateFormats}} + }; + + /// + /// Returns a DateOnly from the Json object + /// + /// + /// + /// + /// + public override DateOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnly? dateOnlyValue, JsonSerializerOptions options) + { + if (dateOnlyValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateOnlyValue.Value.ToString("{{{dateFormat}}}", CultureInfo.InvariantCulture)); + } + } +} diff --git a/sdks/dotnet/templates/libraries/generichost/DateTimeFormats.mustache b/sdks/dotnet/templates/libraries/generichost/DateTimeFormats.mustache new file mode 100644 index 000000000..85ed99a2c --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/DateTimeFormats.mustache @@ -0,0 +1,22 @@ + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + {{^supportsDateOnly}} + "yyyy'-'MM'-'dd", + {{/supportsDateOnly}} + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + {{^supportsDateOnly}} + "yyyyMMdd" + {{/supportsDateOnly}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/DateTimeJsonConverter.mustache b/sdks/dotnet/templates/libraries/generichost/DateTimeJsonConverter.mustache new file mode 100644 index 000000000..c5187f508 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/DateTimeJsonConverter.mustache @@ -0,0 +1,51 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for {{#supportsDateOnly}}'date-time'{{/supportsDateOnly}}{{^supportsDateOnly}}'date' and 'date-time'{{/supportsDateOnly}} openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateTimeFormats}} + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("{{{dateTimeFormat}}}", CultureInfo.InvariantCulture)); + } +} diff --git a/sdks/dotnet/templates/libraries/generichost/DateTimeNullableJsonConverter.mustache b/sdks/dotnet/templates/libraries/generichost/DateTimeNullableJsonConverter.mustache new file mode 100644 index 000000000..646c72947 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/DateTimeNullableJsonConverter.mustache @@ -0,0 +1,56 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for {{#supportsDateOnly}}'date-time'{{/supportsDateOnly}}{{^supportsDateOnly}}'date' and 'date-time'{{/supportsDateOnly}} openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateTimeFormats}} + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("{{{dateTimeFormat}}}", CultureInfo.InvariantCulture)); + } + } +} diff --git a/sdks/dotnet/templates/libraries/generichost/DependencyInjectionTests.mustache b/sdks/dotnet/templates/libraries/generichost/DependencyInjectionTests.mustache index ac4a4d8e2..aadf2c731 100644 --- a/sdks/dotnet/templates/libraries/generichost/DependencyInjectionTests.mustache +++ b/sdks/dotnet/templates/libraries/generichost/DependencyInjectionTests.mustache @@ -4,104 +4,157 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; using System.Collections.Generic; using System.Security.Cryptography; -using {{packageName}}.Client; +using {{packageName}}.{{clientPackage}}; using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Extensions; using Xunit; -namespace {{packageName}}.Test.Api +namespace {{packageName}}.Test.{{apiPackage}} { /// /// Tests the dependency injection. /// public class DependencyInjectionTest { - private readonly IHost _hostUsingConfigureWithoutAClient = - Host.CreateDefaultBuilder(Array.Empty()).Configure{{apiName}}((context, options) => + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).Configure{{apiName}}((context, services, options) => { - {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(apiKeyToken); - {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(bearerToken); - {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(basicToken); - {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} - HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); - HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(httpSignatureToken); - {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken);{{/hasOAuthMethods}} + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} }) .Build(); private readonly IHost _hostUsingConfigureWithAClient = - Host.CreateDefaultBuilder(Array.Empty()).Configure{{apiName}}((context, options) => + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).Configure{{apiName}}((context, services, options) => { - {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(apiKeyToken); - {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(bearerToken); - {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(basicToken); - {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} - HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); - HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(httpSignatureToken); - {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken);{{/hasOAuthMethods}} + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} options.Add{{apiName}}HttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); }) .Build(); private readonly IHost _hostUsingAddWithoutAClient = - Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).ConfigureServices((host, services) => { services.Add{{apiName}}(options => { - {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(apiKeyToken); - {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(bearerToken); - {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(basicToken); - {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} - HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); - HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(httpSignatureToken); - {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken);{{/hasOAuthMethods}} + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} }); }) .Build(); private readonly IHost _hostUsingAddWithAClient = - Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).ConfigureServices((host, services) => { services.Add{{apiName}}(options => { - {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(apiKeyToken); - {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(bearerToken); - {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(basicToken); - {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} - HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); - HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(httpSignatureToken); - {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken);{{/hasOAuthMethods}} + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} options.Add{{apiName}}HttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); }); }) @@ -113,9 +166,9 @@ namespace {{packageName}}.Test.Api [Fact] public void ConfigureApiWithAClientTest() { - {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingConfigureWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); - Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} - + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingConfigureWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + {{/-last}}{{/apis}}{{/apiInfo}} } @@ -125,9 +178,9 @@ namespace {{packageName}}.Test.Api [Fact] public void ConfigureApiWithoutAClientTest() { - {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); - Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} - + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + {{/-last}}{{/apis}}{{/apiInfo}} } @@ -137,8 +190,8 @@ namespace {{packageName}}.Test.Api [Fact] public void AddApiWithAClientTest() { - {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingAddWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); - Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingAddWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} {{/-last}}{{/apis}}{{/apiInfo}} } @@ -149,9 +202,9 @@ namespace {{packageName}}.Test.Api [Fact] public void AddApiWithoutAClientTest() { - {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingAddWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); - Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} - + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingAddWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + {{/-last}}{{/apis}}{{/apiInfo}} } } diff --git a/sdks/dotnet/templates/libraries/generichost/EnumValueDataType.mustache b/sdks/dotnet/templates/libraries/generichost/EnumValueDataType.mustache new file mode 100644 index 000000000..e92e67b36 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/EnumValueDataType.mustache @@ -0,0 +1 @@ +{{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}{{^isNumeric}}string{{/isNumeric}}{{/isString}}{{#isNumeric}}{{#isLong}}long{{/isLong}}{{#isFloat}}float{{/isFloat}}{{#isDouble}}double{{/isDouble}}{{#isDecimal}}decimal{{/isDecimal}}{{^isLong}}{{^isFloat}}{{^isDouble}}{{^isDecimal}}int{{/isDecimal}}{{/isDouble}}{{/isFloat}}{{/isLong}}{{/isNumeric}}{{/-first}}{{/enumVars}}{{/allowableValues}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/ExceptionEventArgs.mustache b/sdks/dotnet/templates/libraries/generichost/ExceptionEventArgs.mustache new file mode 100644 index 000000000..016ef7c69 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/ExceptionEventArgs.mustache @@ -0,0 +1,24 @@ +using System; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Useful for tracking server health + /// + {{>visibility}} class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/sdks/dotnet/templates/libraries/generichost/HostConfiguration.mustache b/sdks/dotnet/templates/libraries/generichost/HostConfiguration.mustache index e74707baa..d7d1e3bf3 100644 --- a/sdks/dotnet/templates/libraries/generichost/HostConfiguration.mustache +++ b/sdks/dotnet/templates/libraries/generichost/HostConfiguration.mustache @@ -10,18 +10,18 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Net.Http; using Microsoft.Extensions.DependencyInjection; -using {{packageName}}.Api; -using {{packageName}}.Model; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{modelPackage}}; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// Provides hosting configuration for {{packageName}} /// - public class HostConfiguration + {{>visibility}} class HostConfiguration { private readonly IServiceCollection _services; - private JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); internal bool HttpClientsAdded { get; private set; } @@ -33,30 +33,51 @@ namespace {{packageName}}.Client { _services = services; _jsonOptions.Converters.Add(new JsonStringEnumConverter()); - _jsonOptions.Converters.Add(new OpenAPIDateJsonConverter()); -{{#models}} -{{#model}} -{{^isEnum}} -{{#allOf}} -{{#-first}} + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + {{#supportsDateOnly}} + _jsonOptions.Converters.Add(new DateOnlyJsonConverter()); + _jsonOptions.Converters.Add(new DateOnlyNullableJsonConverter()); + {{/supportsDateOnly}} + {{#models}} + {{#model}} + {{#isEnum}} + _jsonOptions.Converters.Add(new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter()); + _jsonOptions.Converters.Add(new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter()); + {{/isEnum}} + {{^isEnum}} _jsonOptions.Converters.Add(new {{classname}}JsonConverter()); -{{/-first}} -{{/allOf}} -{{#anyOf}} -{{#-first}} - _jsonOptions.Converters.Add(new {{classname}}JsonConverter()); -{{/-first}} -{{/anyOf}} -{{#oneOf}} -{{#-first}} - _jsonOptions.Converters.Add(new {{classname}}JsonConverter()); -{{/-first}} -{{/oneOf}} -{{/isEnum}} -{{/model}} -{{/models}} - _services.AddSingleton(new JsonSerializerOptionsProvider(_jsonOptions));{{#apiInfo}}{{#apis}} - _services.AddSingleton<{{interfacePrefix}}{{classname}}, {{classname}}>();{{/apis}}{{/apiInfo}} + {{/isEnum}} + {{/model}} + {{/models}} + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new{{^net60OrLater}} JsonSerializerOptionsProvider{{/net60OrLater}}(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + {{#useSourceGeneration}} + + {{#models}} + {{#-first}} + _jsonOptions.TypeInfoResolver = System.Text.Json.Serialization.Metadata.JsonTypeInfoResolver.Combine( + {{/-first}} + {{/models}} + {{#lambda.joinLinesWithComma}} + {{#models}} + {{#model}} + new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}SerializationContext(){{#-last}},{{/-last}} + {{/model}} + {{/models}} + {{/lambda.joinLinesWithComma}} + {{#models}} + {{#-last}} + + new System.Text.Json.Serialization.Metadata.DefaultJsonTypeInfoResolver() + ); + {{/-last}} + {{/models}} + + {{/useSourceGeneration}} + _services.AddSingleton();{{#apiInfo}}{{#apis}} + _services.AddSingleton<{{classname}}Events>(); + _services.AddTransient<{{interfacePrefix}}{{classname}}, {{classname}}>();{{/apis}}{{/apiInfo}} } /// @@ -65,17 +86,16 @@ namespace {{packageName}}.Client /// /// /// - public HostConfiguration Add{{apiName}}HttpClients<{{#apiInfo}}{{#apis}}T{{classname}}{{^-last}}, {{/-last}}{{/apis}}> + public HostConfiguration Add{{apiName}}HttpClients ( - Action{{nrt?}} client = null, Action{{nrt?}} builder = null){{#apis}} - where T{{classname}} : class, {{interfacePrefix}}{{classname}}{{/apis}} + Action{{nrt?}} client = null, Action{{nrt?}} builder = null) { if (client == null) client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); List builders = new List(); - - {{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, T{{classname}}>(client)); + + {{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(client)); {{/apis}}{{/apiInfo}} if (builder != null) foreach (IHttpClientBuilder instance in builders) @@ -86,19 +106,6 @@ namespace {{packageName}}.Client return this; } - /// - /// Configures the HttpClients. - /// - /// - /// - /// - public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} client = null, Action{{nrt?}} builder = null) - { - Add{{apiName}}HttpClients<{{#apiInfo}}{{#apis}}{{classname}}{{^-last}}, {{/-last}}{{/apis}}{{/apiInfo}}>(client, builder); - - return this; - } - /// /// Configures the JsonSerializerSettings /// diff --git a/sdks/dotnet/templates/libraries/generichost/HttpSigningConfiguration.mustache b/sdks/dotnet/templates/libraries/generichost/HttpSigningConfiguration.mustache index 29ea23594..5e0f7739d 100644 --- a/sdks/dotnet/templates/libraries/generichost/HttpSigningConfiguration.mustache +++ b/sdks/dotnet/templates/libraries/generichost/HttpSigningConfiguration.mustache @@ -13,14 +13,13 @@ using System.Security.Cryptography; using System.Text; using System.Web; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// Class for HttpSigning auth related parameter and methods /// - public class HttpSigningConfiguration + {{>visibility}} class HttpSigningConfiguration { - #region /// /// Create an instance /// @@ -34,9 +33,7 @@ namespace {{packageName}}.Client SigningAlgorithm = signingAlgorithm; SignatureValidityPeriod = signatureValidityPeriod; } - #endregion - #region Properties /// ///Gets the Api keyId /// @@ -72,25 +69,20 @@ namespace {{packageName}}.Client /// public int SignatureValidityPeriod { get; set; } - #endregion - - #region enum private enum PrivateKeyType { None = 0, RSA = 1, ECDSA = 2, } - #endregion - #region Methods /// /// Gets the Headers for HttpSigning /// /// /// /// - internal Dictionary GetHttpSignedHeader(System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken? cancellationToken = null) + internal Dictionary GetHttpSignedHeader(global::System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) { if (request.RequestUri == null) throw new NullReferenceException("The request URI was null"); @@ -130,12 +122,12 @@ namespace {{packageName}}.Client if (HashAlgorithm == HashAlgorithmName.SHA256) { - var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); } else if (HashAlgorithm == HashAlgorithmName.SHA512) { - var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); } else @@ -190,9 +182,9 @@ namespace {{packageName}}.Client foreach (var keyVal in httpSignatureHeader) headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); - //Concatinate headers value separated by new line + //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); - var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); + var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); string{{nrt?}} headerSignatureStr = null; var keyType = GetKeyType(KeyFilePath); @@ -219,15 +211,27 @@ namespace {{packageName}}.Client return HttpSignedRequestHeader; } - private byte[] GetStringHash(string hashName, string stringToBeHashed) + private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) { - var hashAlgorithm = System.Security.Cryptography.HashAlgorithm.Create(hashName); + HashAlgorithm{{nrt?}} hashAlgorithm = null; + + if (hashAlgorithmName == HashAlgorithmName.SHA1) + hashAlgorithm = SHA1.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA256) + hashAlgorithm = SHA256.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA512) + hashAlgorithm = SHA512.Create(); + + if (hashAlgorithmName == HashAlgorithmName.MD5) + hashAlgorithm = MD5.Create(); if (hashAlgorithm == null) throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); - var bytes = Encoding.UTF8.GetBytes(stringToBeHashed); - var stringHash = hashAlgorithm.ComputeHash(bytes); + byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + byte[] stringHash = hashAlgorithm.ComputeHash(bytes); return stringHash; } @@ -268,10 +272,9 @@ namespace {{packageName}}.Client /// private string GetECDSASignature(byte[] dataToSign) { + {{#net60OrLater}} if (!File.Exists(KeyFilePath)) - { throw new Exception("key file path does not exist."); - } var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; var ecKeyFooter = "-----END EC PRIVATE KEY-----"; @@ -280,7 +283,6 @@ namespace {{packageName}}.Client var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); var ecdsa = ECDsa.Create(); -#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) var byteCount = 0; if (KeyPassPhrase != null) { @@ -301,24 +303,23 @@ namespace {{packageName}}.Client } } else - { ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); - } + var signedBytes = ecdsa.SignHash(dataToSign); var derBytes = ConvertToECDSAANS1Format(signedBytes); var signedString = System.Convert.ToBase64String(derBytes); return signedString; -#else + {{/net60OrLater}} + {{^net60OrLater}} throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); -#endif - + {{/net60OrLater}} } private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); - byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44 + byte derLength = 68; //default length for ECDSA code signing bit 0x44 byte rbytesLength = 32; //R length 0x20 byte sbytesLength = 32; //S length 0x20 var rBytes = new List(); @@ -353,7 +354,7 @@ namespace {{packageName}}.Client } derBytes.Add(48); //start of the sequence 0x30 - derBytes.Add(derLength); //total length r lenth, type and r bytes + derBytes.Add(derLength); //total length r length, type and r bytes derBytes.Add(2); //tag for integer derBytes.Add(rbytesLength); //length of r @@ -365,7 +366,7 @@ namespace {{packageName}}.Client return derBytes.ToArray(); } - private RSACryptoServiceProvider{{nrt?}} GetRSAProviderFromPemFile(String pemfile, SecureString{{nrt?}} keyPassPharse = null) + private RSACryptoServiceProvider{{nrt?}} GetRSAProviderFromPemFile(String pemfile, SecureString{{nrt?}} keyPassPhrase = null) { const String pempubheader = "-----BEGIN PUBLIC KEY-----"; const String pempubfooter = "-----END PUBLIC KEY-----"; @@ -382,7 +383,7 @@ namespace {{packageName}}.Client if (isPrivateKeyFile) { - pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse); + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase); if (pemkey == null) return null; @@ -392,7 +393,7 @@ namespace {{packageName}}.Client return null; } - private byte[]{{nrt?}} ConvertPrivateKeyToBytes(String instr, SecureString{{nrt?}} keyPassPharse = null) + private byte[]{{nrt?}} ConvertPrivateKeyToBytes(String instr, SecureString{{nrt?}} keyPassPhrase = null) { const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; @@ -412,7 +413,7 @@ namespace {{packageName}}.Client binkey = Convert.FromBase64String(pvkstr); return binkey; } - catch (System.FormatException) + catch (global::System.FormatException) { StringReader str = new StringReader(pvkstr); @@ -439,13 +440,13 @@ namespace {{packageName}}.Client { //should have b64 encrypted RSA key now binkey = Convert.FromBase64String(encryptedstr); } - catch (System.FormatException) - { //data is not in base64 fromat + catch (global::System.FormatException) + { //data is not in base64 format return null; } - // TODO: what do we do here if keyPassPharse is null? - byte[] deskey = GetEncryptedKey(salt, keyPassPharse{{nrt!}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + // TODO: what do we do here if keyPassPhrase is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPhrase{{nrt!}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes if (deskey == null) return null; @@ -584,7 +585,7 @@ namespace {{packageName}}.Client Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- - MD5 md5 = new MD5CryptoServiceProvider(); + MD5 md5 = MD5.Create(); byte[]{{nrt?}} result = null; byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget @@ -673,6 +674,5 @@ namespace {{packageName}}.Client return keyType; } - #endregion } } diff --git a/sdks/dotnet/templates/libraries/generichost/HttpSigningToken.mustache b/sdks/dotnet/templates/libraries/generichost/HttpSigningToken.mustache index 224714027..881682e89 100644 --- a/sdks/dotnet/templates/libraries/generichost/HttpSigningToken.mustache +++ b/sdks/dotnet/templates/libraries/generichost/HttpSigningToken.mustache @@ -9,12 +9,12 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A token constructed from an HttpSigningConfiguration /// - public class HttpSignatureToken : TokenBase + {{>visibility}} class HttpSignatureToken : TokenBase { private HttpSigningConfiguration _configuration; @@ -34,7 +34,7 @@ namespace {{packageName}}.Client /// /// /// - public void UseInHeader(System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken? cancellationToken = null) + public void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) { var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); diff --git a/sdks/dotnet/templates/libraries/generichost/IApi.mustache b/sdks/dotnet/templates/libraries/generichost/IApi.mustache index 019132830..af31cffe9 100644 --- a/sdks/dotnet/templates/libraries/generichost/IApi.mustache +++ b/sdks/dotnet/templates/libraries/generichost/IApi.mustache @@ -1,21 +1,15 @@ using System.Net.Http; -namespace {{packageName}}.Client +namespace {{packageName}}.{{apiPackage}} { /// /// Any Api client /// - public interface {{interfacePrefix}}Api + {{>visibility}} interface {{interfacePrefix}}Api { /// /// The HttpClient /// HttpClient HttpClient { get; } - - /// - /// An event to track the health of the server. - /// If you store these event args, be sure to purge old event args to prevent a memory leak. - /// - event ClientUtils.EventHandler{{nrt?}} ApiResponded; } } \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/IHostBuilderExtensions.mustache b/sdks/dotnet/templates/libraries/generichost/IHostBuilderExtensions.mustache new file mode 100644 index 000000000..948f06648 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/IHostBuilderExtensions.mustache @@ -0,0 +1,55 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using {{packageName}}.{{clientPackage}}; + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + {{>visibility}} static class IHostBuilderExtensions + { + {{^hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.Add{{apiName}}(services, config); + }); + + return builder; + } + + {{/hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.Add{{apiName}}(services, config); + }); + + return builder; + } + } +} diff --git a/sdks/dotnet/templates/libraries/generichost/IHttpClientBuilderExtensions.mustache b/sdks/dotnet/templates/libraries/generichost/IHttpClientBuilderExtensions.mustache new file mode 100644 index 000000000..053c0226a --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/IHttpClientBuilderExtensions.mustache @@ -0,0 +1,75 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection;{{#supportsRetry}} +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly;{{/supportsRetry}} + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + {{>visibility}} static class IHttpClientBuilderExtensions + { + {{#supportsRetry}} + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + {{/supportsRetry}} + } +} diff --git a/sdks/dotnet/templates/libraries/generichost/IServiceCollectionExtensions.mustache b/sdks/dotnet/templates/libraries/generichost/IServiceCollectionExtensions.mustache new file mode 100644 index 000000000..14184ac4a --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/IServiceCollectionExtensions.mustache @@ -0,0 +1,69 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{clientPackage}}; + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + {{>visibility}} static class IServiceCollectionExtensions + { + {{^hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + public static void Add{{apiName}}(this IServiceCollection services) + { + HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); + Add{{apiName}}(services, config); + } + + {{/hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + /// + public static void Add{{apiName}}(this IServiceCollection services, Action options) + { + HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); + options(config); + Add{{apiName}}(services, config); + } + + internal static void Add{{apiName}}(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.Add{{apiName}}HttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/sdks/dotnet/templates/libraries/generichost/ImplementsIEquatable.mustache b/sdks/dotnet/templates/libraries/generichost/ImplementsIEquatable.mustache new file mode 100644 index 000000000..dd576dd0f --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/ImplementsIEquatable.mustache @@ -0,0 +1 @@ +{{#equatable}}{{#readOnlyVars}}{{#-first}}IEquatable<{{classname}}{{nrt?}}> {{/-first}}{{/readOnlyVars}}{{/equatable}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/ImplementsValidatable.mustache b/sdks/dotnet/templates/libraries/generichost/ImplementsValidatable.mustache new file mode 100644 index 000000000..7c3f0e02a --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/ImplementsValidatable.mustache @@ -0,0 +1 @@ +{{#validatable}}IValidatableObject {{/validatable}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/JsonConverter.mustache b/sdks/dotnet/templates/libraries/generichost/JsonConverter.mustache index 0a0f7540c..189acfd74 100644 --- a/sdks/dotnet/templates/libraries/generichost/JsonConverter.mustache +++ b/sdks/dotnet/templates/libraries/generichost/JsonConverter.mustache @@ -1,131 +1,648 @@ /// - /// A Json converter for type {{classname}} + /// A Json converter for type /// - public class {{classname}}JsonConverter : JsonConverter<{{classname}}> + {{>visibility}} class {{classname}}JsonConverter : JsonConverter<{{classname}}> { + {{#allVars}} + {{#isDateTime}} /// - /// Returns a boolean if the type is compatible with this converter. + /// The format to use to serialize {{name}} /// - /// - /// - public override bool CanConvert(Type typeToConvert) => typeof({{classname}}).IsAssignableFrom(typeToConvert); + public static string {{name}}Format { get; set; } = "{{{dateTimeFormat}}}"; + + {{/isDateTime}} + {{#isDate}} + /// + /// The format to use to serialize {{name}} + /// + public static string {{name}}Format { get; set; } = "{{{dateFormat}}}"; + {{/isDate}} + {{/allVars}} /// - /// A Json reader. + /// Deserializes json to /// - /// + /// /// - /// + /// /// /// - public override {{classname}} Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override {{classname}} Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - int currentDepth = reader.CurrentDepth; + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.trimLineBreaks}} + int currentDepth = utf8JsonReader.CurrentDepth; - if (reader.TokenType != JsonTokenType.StartObject) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) throw new JsonException(); - {{#composedSchemas.anyOf}} - Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = reader; - bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, options, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}); - - {{/composedSchemas.anyOf}} - {{#composedSchemas.oneOf}} - Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = reader; - bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, options, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}); - - {{/composedSchemas.oneOf}} - {{#composedSchemas.allOf}} - {{^isInherited}} - Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = reader; - bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, options, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}); + JsonTokenType startingTokenType = utf8JsonReader.TokenType; - {{/isInherited}} - {{/composedSchemas.allOf}} {{#allVars}} - {{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = default; + Option<{{#isInnerEnum}}{{^isMap}}{{classname}}.{{/isMap}}{{/isInnerEnum}}{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = default; + {{#-last}} + + {{/-last}} {{/allVars}} + {{#discriminator}} + {{#children}} + {{#-first}} + string{{nrt?}} discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "{{discriminator.propertyBaseName}}"); + + {{/-first}} + if (discriminator != null && discriminator.Equals("{{name}}")) + return JsonSerializer.Deserialize<{{{name}}}>(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + {{/children}} + {{/discriminator}} + {{#model.discriminator}} + {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{#mappedModels}} + {{#model}} + {{^vendorExtensions.x-duplicated-data-type}} + {{classname}}{{nrt?}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} = null; + {{#-last}} + + {{/-last}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/model}} + {{/mappedModels}} + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; - while (reader.Read()) + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName{{nrt?}}.Equals("{{propertyBaseName}}"){{#nrt}} ?? false{{/nrt}}) + { + string{{nrt?}} discriminator = utf8JsonReaderDiscriminator.GetString(); + {{#mappedModels}} + if (discriminator{{nrt?}}.Equals("{{mappingName}}"){{#nrt}} ?? false{{/nrt}}) + { + Utf8JsonReader utf8JsonReader{{model.classname}} = utf8JsonReader; + {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} = JsonSerializer.Deserialize<{{{model.classname}}}>(ref utf8JsonReader{{model.classname}}, jsonSerializerOptions); + } + {{/mappedModels}} + } + } + } + + {{/model.hasDiscriminatorWithNonEmptyMapping}} + {{/model.discriminator}} + {{^model.discriminator}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = default; + {{#-last}} + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) { - if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) break; - if (reader.TokenType == JsonTokenType.PropertyName) + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { - string{{nrt?}} propertyName = reader.GetString(); - reader.Read(); + {{#oneOf}} + Utf8JsonReader utf8JsonReader{{name}} = utf8JsonReader; + ClientUtils.TryDeserialize<{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}>(ref utf8JsonReader{{name}}, jsonSerializerOptions, out {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + {{^-last}} - switch (propertyName) + {{/-last}} + {{/oneOf}} + } + } + {{/-last}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = default; + {{#-last}} + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + {{#anyOf}} + Utf8JsonReader utf8JsonReader{{name}} = utf8JsonReader; + ClientUtils.TryDeserialize<{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}>(ref utf8JsonReader{{name}}, jsonSerializerOptions, out {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + {{^-last}} + + {{/-last}} + {{/anyOf}} + } + } + {{/-last}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + + {{/composedSchemas}} + {{/model.discriminator}} + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) { {{#allVars}} case "{{baseName}}": {{#isString}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetString(); + {{^isMap}} + {{^isEnum}} + {{^isUuid}} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetString(){{^isNullable}}{{nrt!}}{{/isNullable}}); + {{/isUuid}} + {{/isEnum}} + {{/isMap}} {{/isString}} {{#isBoolean}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetBoolean()); {{/isBoolean}} + {{#isNumeric}} + {{^isEnum}} + {{#isDouble}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDouble()); + {{/isDouble}} {{#isDecimal}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetDecimal(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal()); {{/isDecimal}} - {{#isNumeric}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetInt32(); - {{/isNumeric}} + {{#isFloat}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}(float)utf8JsonReader.GetDouble()); + {{/isFloat}} {{#isLong}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64()); {{/isLong}} - {{#isDouble}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetDouble(); + {{^isLong}} + {{^isFloat}} + {{^isDecimal}} + {{^isDouble}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); {{/isDouble}} + {{/isDecimal}} + {{/isFloat}} + {{/isLong}} + {{/isEnum}} + {{/isNumeric}} {{#isDate}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetDateTime(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); {{/isDate}} {{#isDateTime}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetDateTime(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); {{/isDateTime}} + {{#isEnum}} + {{^isMap}} + {{#isNumeric}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); + {{/isNumeric}} + {{^isNumeric}} + string{{nrt?}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = utf8JsonReader.GetString(); + {{^isInnerEnum}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{{datatypeWithEnum}}}ValueConverter.FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); + {{/isInnerEnum}} + {{#isInnerEnum}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{classname}}.{{{datatypeWithEnum}}}FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); + {{/isInnerEnum}} + {{/isNumeric}} + {{/isMap}} + {{/isEnum}} + {{#isUuid}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetGuid()); + {{/isUuid}} + {{^isUuid}} + {{^isEnum}} {{^isString}} {{^isBoolean}} - {{^isDecimal}} {{^isNumeric}} - {{^isLong}} - {{^isDouble}} {{^isDate}} {{^isDateTime}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref reader, options); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}}); {{/isDateTime}} {{/isDate}} - {{/isDouble}} - {{/isLong}} {{/isNumeric}} - {{/isDecimal}} {{/isBoolean}} {{/isString}} + {{/isEnum}} + {{/isUuid}} break; {{/allVars}} + default: + break; } } } - {{#composedSchemas.oneOf}} - if ({{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized) - return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}} {{#model.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/isInherited}}{{/model.composedSchemas.allOf}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} {{/allVars}}{{/lambda.joinWithComma}}); + {{#allVars}} + {{#required}} + if (!{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet) + throw new ArgumentException("Property is required for class {{classname}}.", nameof({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}})); + + {{/required}} + {{/allVars}} + {{#allVars}} + {{^isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet && {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.Value == null) + throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}), "Property is not nullable for class {{classname}}."); + + {{/isNullable}} + {{/allVars}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#model.discriminator}} + {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{#mappedModels}} + if ({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} != null) + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); {{#-last}} throw new JsonException(); {{/-last}} - {{/composedSchemas.oneOf}} + {{/mappedModels}} + {{/model.hasDiscriminatorWithNonEmptyMapping}} + {{/model.discriminator}} {{^composedSchemas.oneOf}} - return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}} {{/model.composedSchemas.anyOf}}{{#model.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}} {{/isInherited}}{{/model.composedSchemas.allOf}}{{#allVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} {{/allVars}}{{/lambda.joinWithComma}}); + {{^required}} + {{#model.composedSchemas.anyOf}} + Option<{{baseType}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null + ? default + : new Option<{{baseType}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + {{/model.composedSchemas.anyOf}} + {{#-last}} + + {{/-last}} + {{/required}} + return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue{{#required}}.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/required}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); + {{/composedSchemas.oneOf}} + {{^model.discriminator}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} != null) + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}ParsedValue{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); + + {{/vendorExtensions.x-duplicated-data-type}} + {{#-last}} + throw new JsonException(); + {{/-last}} + {{/oneOf}} + {{/composedSchemas}} + {{/model.discriminator}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/lambda.trimLineBreaks}} + {{/lambda.trimTrailingWithNewLine}} + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) + { + {{#lambda.trimLineBreaks}} + {{#lambda.copy}} + {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} + {{/lambda.copy}} + {{#discriminator}} + {{#children}} + if ({{#lambda.pasteLine}}{{/lambda.pasteLine}} is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){ + JsonSerializer.Serialize<{{{name}}}>(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); + return; + } + + {{/children}} + {{/discriminator}} + writer.WriteStartObject(); + + {{#model.discriminator}} + {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + {{#isPrimitiveType}} + {{#isString}} + writer.WriteString("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value); + {{/isString}} + {{#isBoolean}} + writer.WriteBoolean("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isBoolean}} + {{#isNumeric}} + writer.WriteNumber("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isNumeric}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + { + {{baseType}}JsonConverter {{#lambda.camelcase_sanitize_param}}{{baseType}}JsonConverter{{/lambda.camelcase_sanitize_param}} = ({{baseType}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.GetType())); + {{#lambda.camelcase_sanitize_param}}{{baseType}}JsonConverter{{/lambda.camelcase_sanitize_param}}.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + {{/isPrimitiveType}} + + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} + {{/model.hasDiscriminatorWithNonEmptyMapping}} + {{/model.discriminator}} + {{^model.discriminator}} + {{#composedSchemas}} + {{#anyOf}} + if ({{#lambda.joinWithAmpersand}}{{^required}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet {{/required}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}} != null{{/lambda.joinWithAmpersand}}) + {{#isPrimitiveType}} + {{#isString}} + writer.WriteString("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value); + {{/isString}} + {{#isBoolean}} + writer.WriteBoolean("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isBoolean}} + {{#isNumeric}} + writer.WriteNumber("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isNumeric}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + { + {{datatypeWithEnum}}JsonConverter {{datatypeWithEnum}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); + {{datatypeWithEnum}}JsonConverter.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); + } + {{/isPrimitiveType}} + + {{/anyOf}} + {{/composedSchemas}} + {{/model.discriminator}} + WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); + writer.WriteEndObject(); + {{/lambda.trimLineBreaks}} } /// - /// A Json writer + /// Serializes the properties of /// /// - /// - /// + /// + /// /// - public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}, JsonSerializerOptions options) => throw new NotImplementedException(); + public void WriteProperties(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) + { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.trimLineBreaks}} + {{#allVars}} + {{^isDiscriminator}} + {{^isNullable}} + {{#vendorExtensions.x-is-reference-type}} + if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) + throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}), "Property is required for class {{classname}}."); + + {{/vendorExtensions.x-is-reference-type}} + {{/isNullable}} + {{/isDiscriminator}} + {{/allVars}} + {{#allVars}} + {{#isDiscriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} + writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}.Value{{/required}}){{/isEnum}}{{/isNew}}); + + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/isDiscriminator}} + {{^isDiscriminator}} + {{#isString}} + {{^isMap}} + {{^isEnum}} + {{^isUuid}} + {{#lambda.copy}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isUuid}} + {{/isEnum}} + {{/isMap}} + {{/isString}} + {{#isBoolean}} + {{#lambda.copy}} + writer.WriteBoolean("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isBoolean}} + {{^isEnum}} + {{#isNumeric}} + {{#lambda.copy}} + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isNumeric}} + {{/isEnum}} + {{#isDate}} + {{#lambda.copy}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isDate}} + {{#isDateTime}} + {{#lambda.copy}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isDateTime}} + {{#isEnum}} + {{#isNumeric}} + {{#lambda.copy}} + writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isNumeric}} + {{^isMap}} + {{^isNumeric}} + {{#isInnerEnum}} + {{#isNullable}} + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); + else + writer.WriteNull("{{baseName}}"); + + {{/isNullable}} + {{^isNullable}} + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); + {{/isNullable}} + {{/isInnerEnum}} + {{^isInnerEnum}} + {{#lambda.copy}} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} + {{/lambda.copy}} + {{#required}} + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) + writer.WriteNull("{{baseName}}"); + else + { + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.Value); + {{#allowableValues}} + {{#enumVars}} + {{#-first}} + {{#isString}} + if ({{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue != null){{! we cant use name here because enumVar also has a name property, so use the paste lambda instead }} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInPascalCase}}{{/lambda.camelcase_sanitize_param}}RawValue); + else + writer.WriteNull("{{baseName}}"); + {{/isString}} + {{^isString}} + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInPascalCase}}{{/lambda.camelcase_sanitize_param}}RawValue); + {{/isString}} + {{/-first}} + {{/enumVars}} + {{/allowableValues}} + } + {{/isNullable}} + {{^isNullable}} + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); + {{#allowableValues}} + {{#enumVars}} + {{#-first}} + {{^isNumeric}} + writer.WriteString("{{baseName}}", {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue); + {{/isNumeric}} + {{#isNumeric}} + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{#lambda.pasteLine}}{{/lambda.pasteLine}}{{/lambda.camelcase_sanitize_param}}RawValue); + {{/isNumeric}} + {{/-first}} + {{/enumVars}} + {{/allowableValues}} + {{/isNullable}} + + {{/required}} + {{^required}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option{{nrt!}}.Value != null) + { + var {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value{{nrt!}}.Value); + writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue); + } + else + writer.WriteNull("{{baseName}}"); + {{/isNullable}} + {{^isNullable}} + { + var {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{nrt!}}.Value); + writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue); + } + {{/isNullable}} + {{/required}} + {{/isInnerEnum}} + {{/isNumeric}} + {{/isMap}} + {{/isEnum}} + {{#isUuid}} + {{#lambda.copy}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isUuid}} + {{^isUuid}} + {{^isEnum}} + {{^isString}} + {{^isBoolean}} + {{^isNumeric}} + {{^isDate}} + {{^isDateTime}} + {{#required}} + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + { + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + else + writer.WriteNull("{{baseName}}"); + {{/isNullable}} + {{^isNullable}} + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + {{/isNullable}} + {{/required}} + {{^required}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value != null) + { + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + else + writer.WriteNull("{{baseName}}"); + {{/isNullable}} + {{^isNullable}} + { + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + {{/isNullable}} + {{/required}} + {{/isDateTime}} + {{/isDate}} + {{/isNumeric}} + {{/isBoolean}} + {{/isString}} + {{/isEnum}} + {{/isUuid}} + {{/isDiscriminator}} + {{/allVars}} + {{/lambda.trimLineBreaks}} + {{/lambda.trimTrailingWithNewLine}} + } } \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache b/sdks/dotnet/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache index 4b28944a2..93f805403 100644 --- a/sdks/dotnet/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache +++ b/sdks/dotnet/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache @@ -6,12 +6,12 @@ {{/nrt}} using System.Text.Json; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// Provides the JsonSerializerOptions /// - public class JsonSerializerOptionsProvider + {{>visibility}} class JsonSerializerOptionsProvider { /// /// the JsonSerializerOptions diff --git a/sdks/dotnet/templates/libraries/generichost/ModelBaseSignature.mustache b/sdks/dotnet/templates/libraries/generichost/ModelBaseSignature.mustache new file mode 100644 index 000000000..909a68e35 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/ModelBaseSignature.mustache @@ -0,0 +1 @@ +{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{parent}}{{/lambda.camelcase_sanitize_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#isInherited}}{{^isNew}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/isNew}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^required}}.Value{{/required}}){{/isEnum}}{{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.ToString(){{/isEnum}}{{/isNew}} {{/isInherited}}{{/isDiscriminator}}{{/allVars}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/ModelSignature.mustache b/sdks/dotnet/templates/libraries/generichost/ModelSignature.mustache new file mode 100644 index 000000000..39aa11f82 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/ModelSignature.mustache @@ -0,0 +1 @@ +{{#model.allVars}}{{^isDiscriminator}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/isDiscriminator}}{{/model.allVars}} diff --git a/sdks/dotnet/templates/libraries/generichost/OAuthToken.mustache b/sdks/dotnet/templates/libraries/generichost/OAuthToken.mustache index b5410ea07..23b3cab91 100644 --- a/sdks/dotnet/templates/libraries/generichost/OAuthToken.mustache +++ b/sdks/dotnet/templates/libraries/generichost/OAuthToken.mustache @@ -9,12 +9,12 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A token constructed with OAuth. /// - public class OAuthToken : TokenBase + {{>visibility}} class OAuthToken : TokenBase { private string _raw; @@ -33,7 +33,7 @@ namespace {{packageName}}.Client /// /// /// - public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) { request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); } diff --git a/sdks/dotnet/templates/libraries/generichost/OnDeserializationError.mustache b/sdks/dotnet/templates/libraries/generichost/OnDeserializationError.mustache new file mode 100644 index 000000000..ff83a5076 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/OnDeserializationError.mustache @@ -0,0 +1,2 @@ +if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/OnErrorDefaultImplementation.mustache b/sdks/dotnet/templates/libraries/generichost/OnErrorDefaultImplementation.mustache new file mode 100644 index 000000000..7af8e0760 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/OnErrorDefaultImplementation.mustache @@ -0,0 +1,2 @@ + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/OpenAPIDateConverter.mustache b/sdks/dotnet/templates/libraries/generichost/OpenAPIDateConverter.mustache deleted file mode 100644 index 144ac7328..000000000 --- a/sdks/dotnet/templates/libraries/generichost/OpenAPIDateConverter.mustache +++ /dev/null @@ -1,34 +0,0 @@ -{{>partial_header}} -using System; -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace {{packageName}}.Client -{ - /// - /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 - /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types - /// - public class OpenAPIDateJsonConverter : JsonConverter - { - /// - /// Returns a DateTime from the Json object - /// - /// - /// - /// - /// - public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => - DateTime.ParseExact(reader.GetString(){{nrt!}}, "yyyy-MM-dd", CultureInfo.InvariantCulture); - - /// - /// Writes the DateTime to the json writer - /// - /// - /// - /// - public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => - writer.WriteStringValue(dateTimeValue.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)); - } -} diff --git a/sdks/dotnet/templates/libraries/generichost/OperationSignature.mustache b/sdks/dotnet/templates/libraries/generichost/OperationSignature.mustache new file mode 100644 index 000000000..caa9d144c --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/OperationSignature.mustache @@ -0,0 +1 @@ +{{#lambda.joinWithComma}}{{#allParams}}{{#required}}{{{dataType}}}{{>NullConditionalParameter}}{{/required}}{{^required}}Option<{{{dataType}}}{{>NullConditionalParameter}}>{{/required}} {{paramName}}{{#notRequiredOrIsNullable}} = default{{/notRequiredOrIsNullable}} {{/allParams}}System.Threading.CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}{{/lambda.joinWithComma}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/Option.mustache b/sdks/dotnet/templates/libraries/generichost/Option.mustache new file mode 100644 index 000000000..eed49143e --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/Option.mustache @@ -0,0 +1,47 @@ +// +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/OptionProperty.mustache b/sdks/dotnet/templates/libraries/generichost/OptionProperty.mustache new file mode 100644 index 000000000..d75041887 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/OptionProperty.mustache @@ -0,0 +1 @@ +new Option<{{#isInnerEnum}}{{^isMap}}{{classname}}.{{/isMap}}{{/isInnerEnum}}{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}>( \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/README.client.mustache b/sdks/dotnet/templates/libraries/generichost/README.client.mustache new file mode 100644 index 000000000..371b9daa9 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/README.client.mustache @@ -0,0 +1,245 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName={{apiName}}', + 'targetFramework={{targetFramework}}', + 'validatable={{validatable}}', + 'nullableReferenceTypes={{nullableReferenceTypes}}', + 'hideGenerationTimestamp={{hideGenerationTimestamp}}', + 'packageVersion={{packageVersion}}', + 'packageAuthors={{packageAuthors}}', + 'packageCompany={{packageCompany}}', + 'packageCopyright={{packageCopyright}}', + 'packageDescription={{packageDescription}}',{{#licenseId}} + 'licenseId={{.}}',{{/licenseId}} + 'packageName={{packageName}}', + 'packageTags={{packageTags}}', + 'packageTitle={{packageTitle}}' +) -join "," + +$global = @( + 'apiDocs={{generateApiDocs}}', + 'modelDocs={{generateModelDocs}}', + 'apiTests={{generateApiTests}}', + 'modelTests={{generateModelTests}}' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "{{gitHost}}" ` + --git-repo-id "{{gitRepoId}}" ` + --git-user-id "{{gitUserId}}" ` + --release-note "{{releaseNote}}" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.Api; +using {{packageName}}.Client; +using {{packageName}}.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build();{{#apiInfo}}{{#apis}}{{#-first}} + var api = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + {{#operations}} + {{#-first}} + {{#operation}} + {{#-first}} + {{operationId}}ApiResponse apiResponse = await api.{{operationId}}Async("todo"); + {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}} model = apiResponse.Ok(); + {{/-first}} + {{/operation}} + {{/-first}} + {{/operations}} + {{/-first}} + {{/apis}} + {{/apiInfo}} + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .Configure{{apiName}}((context, options) => + { + {{#authMethods}} + {{#-first}} + // the type of token here depends on the api security specifications + ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + {{/-first}} + {{/authMethods}} + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.Add{{apiName}}HttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace {{packageName}}.Rest.DefaultApi. + Or provide your own class by using the generic Configure{{apiName}} method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later{{#supportsRetry}} +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later{{/supportsRetry}}{{#useCompareNetObjects}} +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later{{/useCompareNetObjects}}{{#validatable}} +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later{{/validatable}}{{#apiDocs}} + + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | -------------{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} +*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}{{/apiDocs}}{{#modelDocs}} + + +## Documentation for Models + +{{#modelPackage}}{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md){{/model}}{{/models}}{{/modelPackage}} +{{^modelPackage}}No model defined in this package{{/modelPackage}}{{/modelDocs}} + + +## Documentation for Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}} +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} +- **Type**: Bearer Authentication +{{/isBasicBearer}} +{{#isHttpSignature}} +- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}} +- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}}{{#scopes}} +- {{scope}}: {{description}}{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Build +- SDK version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} +- Build package: {{generatorClass}} + +## Api Information +- appName: {{appName}} +- appVersion: {{appVersion}} +- appDescription: {{appDescription}} + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: {{generateAliasAsModel}} +- supportingFiles: {{supportingFiles}} +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: {{generateApiDocs}} +- modelDocs: {{generateModelDocs}} +- apiTests: {{generateApiTests}} +- modelTests: {{generateModelTests}} + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}} +- apiName: {{apiName}} +- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}} +- conditionalSerialization: {{conditionalSerialization}} +- disallowAdditionalPropertiesIfNotPresent: {{disallowAdditionalPropertiesIfNotPresent}} +- gitHost: {{gitHost}} +- gitRepoId: {{gitRepoId}} +- gitUserId: {{gitUserId}} +- hideGenerationTimestamp: {{hideGenerationTimestamp}} +- interfacePrefix: {{interfacePrefix}} +- library: {{library}} +- licenseId: {{licenseId}} +- modelPropertyNaming: {{modelPropertyNaming}} +- netCoreProjectFile: {{netCoreProjectFile}} +- nonPublicApi: {{nonPublicApi}} +- nullableReferenceTypes: {{nullableReferenceTypes}} +- optionalAssemblyInfo: {{optionalAssemblyInfo}} +- optionalEmitDefaultValues: {{optionalEmitDefaultValues}} +- optionalMethodArgument: {{optionalMethodArgument}} +- optionalProjectFile: {{optionalProjectFile}} +- packageAuthors: {{packageAuthors}} +- packageCompany: {{packageCompany}} +- packageCopyright: {{packageCopyright}} +- packageDescription: {{packageDescription}} +- packageGuid: {{packageGuid}} +- packageName: {{packageName}} +- packageTags: {{packageTags}} +- packageTitle: {{packageTitle}} +- packageVersion: {{packageVersion}} +- releaseNote: {{releaseNote}} +- returnICollection: {{returnICollection}} +- sortParamsByRequiredFlag: {{sortParamsByRequiredFlag}} +- sourceFolder: {{sourceFolder}} +- targetFramework: {{targetFramework}} +- useCollection: {{useCollection}} +- useDateTimeOffset: {{useDateTimeOffset}} +- useOneOfDiscriminatorLookup: {{useOneOfDiscriminatorLookup}} +- validatable: {{validatable}}{{#infoUrl}} +For more information, please visit [{{{.}}}]({{{.}}}){{/infoUrl}} + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/sdks/dotnet/templates/libraries/generichost/README.mustache b/sdks/dotnet/templates/libraries/generichost/README.mustache deleted file mode 100644 index 28ace9bfd..000000000 --- a/sdks/dotnet/templates/libraries/generichost/README.mustache +++ /dev/null @@ -1,214 +0,0 @@ -# Created with Openapi Generator - - -## Run the following powershell command to generate the library - -```ps1 -$properties = @( - 'apiName={{apiName}}', - 'targetFramework={{targetFramework}}', - 'validatable={{validatable}}', - 'nullableReferenceTypes={{nullableReferenceTypes}}', - 'hideGenerationTimestamp={{hideGenerationTimestamp}}', - 'packageVersion={{packageVersion}}', - 'packageAuthors={{packageAuthors}}', - 'packageCompany={{packageCompany}}', - 'packageCopyright={{packageCopyright}}', - 'packageDescription={{packageDescription}}',{{#licenseId}} - 'licenseId={{.}}',{{/licenseId}} - 'packageName={{packageName}}', - 'packageTags={{packageTags}}', - 'packageTitle={{packageTitle}}' -) -join "," - -$global = @( - 'apiDocs={{generateApiDocs}}', - 'modelDocs={{generateModelDocs}}', - 'apiTests={{generateApiTests}}', - 'modelTests={{generateModelTests}}' -) -join "," - -java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` - -g csharp-netcore ` - -i .yaml ` - -o ` - --library generichost ` - --additional-properties $properties ` - --global-property $global ` - --git-host "{{gitHost}}" ` - --git-repo-id "{{gitRepoId}}" ` - --git-user-id "{{gitUserId}}" ` - --release-note "{{releaseNote}}" - # -t templates -``` - - -## Using the library in your project - -```cs -using System; -using System.Threading.Tasks; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.DependencyInjection; -using {{packageName}}.Api; -using {{packageName}}.Client; -using {{packageName}}.Model; - -namespace YourProject -{ - public class Program - { - public static async Task Main(string[] args) - { - var host = CreateHostBuilder(args).Build();{{#apiInfo}}{{#apis}}{{#-first}} - var api = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>();{{#operations}}{{#-first}}{{#operation}}{{#-first}} - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> foo = await api.{{operationId}}WithHttpInfoAsync("todo");{{/-first}}{{/operation}}{{/-first}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - } - - public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .Configure{{apiName}}((context, options) => - { - {{#authMethods}}// the type of token here depends on the api security specifications - ApiKeyToken token = new(""); - options.AddTokens(token); - - // optionally choose the method the tokens will be provided with, default is RateLimitProvider - options.UseProvider, ApiKeyToken>(); - - {{/authMethods}}options.ConfigureJsonOptions((jsonOptions) => - { - // your custom converters if any - }); - - options.Add{{apiName}}HttpClients(builder: builder => builder - .AddRetryPolicy(2) - .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) - .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) - // add whatever middleware you prefer - ); - }); - } -} -``` - -## Questions - -- What about HttpRequest failures and retries? - If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. -- How are tokens used? - Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. - Other providers can be used with the UseProvider method. -- Does an HttpRequest throw an error when the server response is not Ok? - It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. - StatusCode and ReasonPhrase will contain information about the error. - If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. - - -## Dependencies - -- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later -- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later{{#supportsRetry}} -- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later -- [Polly](https://www.nuget.org/packages/Polly/) - 7.2.3 or later{{/supportsRetry}} -- [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.1 or later -- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later{{#useCompareNetObjects}} -- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later{{/useCompareNetObjects}}{{#validatable}} -- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later{{/validatable}}{{#apiDocs}} - - -## Documentation for API Endpoints - -All URIs are relative to *{{{basePath}}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | -------------{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} -*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}{{/apiDocs}}{{#modelDocs}} - - -## Documentation for Models - -{{#modelPackage}}{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md){{/model}}{{/models}}{{/modelPackage}} -{{^modelPackage}}No model defined in this package{{/modelPackage}}{{/modelDocs}} - - -## Documentation for Authorization - -{{^authMethods}}All endpoints do not require authorization.{{/authMethods}}{{#authMethods}}{{#-last}}Authentication schemes defined for the API:{{/-last}}{{/authMethods}}{{#authMethods}} - - -### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}{{/isApiKey}}{{#isBasicBasic}} -- **Type**: HTTP basic authentication{{/isBasicBasic}}{{#isBasicBearer}} -- **Type**: Bearer Authentication{{/isBasicBearer}}{{#isOAuth}} -- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}}{{#scopes}} -- {{scope}}: {{description}}{{/scopes}}{{/isOAuth}}{{/authMethods}} - -## Build -- SDK version: {{packageVersion}}{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}}{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} - -## Api Information -- appName: {{appName}} -- appVersion: {{appVersion}} -- appDescription: {{appDescription}} - -## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) -- generateAliasAsModel: {{generateAliasAsModel}} -- supportingFiles: {{supportingFiles}} -- models: omitted for brevity -- apis: omitted for brevity -- apiDocs: {{generateApiDocs}} -- modelDocs: {{generateModelDocs}} -- apiTests: {{generateApiTests}} -- modelTests: {{generateModelTests}} -- withXml: {{withXml}} - -## [OpenApi Generator Parameteres](https://openapi-generator.tech/docs/generators/csharp-netcore) -- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}} -- apiName: {{apiName}} -- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}} -- conditionalSerialization: {{conditionalSerialization}} -- disallowAdditionalPropertiesIfNotPresent: {{disallowAdditionalPropertiesIfNotPresent}} -- gitHost: {{gitHost}} -- gitRepoId: {{gitRepoId}} -- gitUserId: {{gitUserId}} -- hideGenerationTimestamp: {{hideGenerationTimestamp}} -- interfacePrefix: {{interfacePrefix}} -- library: {{library}} -- licenseId: {{licenseId}} -- modelPropertyNaming: {{modelPropertyNaming}} -- netCoreProjectFile: {{netCoreProjectFile}} -- nonPublicApi: {{nonPublicApi}} -- nullableReferenceTypes: {{nullableReferenceTypes}} -- optionalAssemblyInfo: {{optionalAssemblyInfo}} -- optionalEmitDefaultValues: {{optionalEmitDefaultValues}} -- optionalMethodArgument: {{optionalMethodArgument}} -- optionalProjectFile: {{optionalProjectFile}} -- packageAuthors: {{packageAuthors}} -- packageCompany: {{packageCompany}} -- packageCopyright: {{packageCopyright}} -- packageDescription: {{packageDescription}} -- packageGuid: {{packageGuid}} -- packageName: {{packageName}} -- packageTags: {{packageTags}} -- packageTitle: {{packageTitle}} -- packageVersion: {{packageVersion}} -- releaseNote: {{releaseNote}} -- returnICollection: {{returnICollection}} -- sortParamsByRequiredFlag: {{sortParamsByRequiredFlag}} -- sourceFolder: {{sourceFolder}} -- targetFramework: {{targetFramework}} -- useCollection: {{useCollection}} -- useDateTimeOffset: {{useDateTimeOffset}} -- useOneOfDiscriminatorLookup: {{useOneOfDiscriminatorLookup}} -- validatable: {{validatable}}{{#infoUrl}} -For more information, please visit [{{{.}}}]({{{.}}}){{/infoUrl}} - -This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/sdks/dotnet/templates/libraries/generichost/README.solution.mustache b/sdks/dotnet/templates/libraries/generichost/README.solution.mustache new file mode 100644 index 000000000..f9c1c7f74 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/README.solution.mustache @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/sdks/dotnet/templates/libraries/generichost/README.test.mustache b/sdks/dotnet/templates/libraries/generichost/README.test.mustache new file mode 100644 index 000000000..e69de29bb diff --git a/sdks/dotnet/templates/libraries/generichost/RateLimitProvider`1.mustache b/sdks/dotnet/templates/libraries/generichost/RateLimitProvider`1.mustache index 944c0061f..857a505ab 100644 --- a/sdks/dotnet/templates/libraries/generichost/RateLimitProvider`1.mustache +++ b/sdks/dotnet/templates/libraries/generichost/RateLimitProvider`1.mustache @@ -4,22 +4,20 @@ #nullable enable {{/nrt}} -using System;{{^netStandard}} -using System.Threading.Channels;{{/netStandard}}{{#netStandard}} -using System.Collections.Concurrent; +using System; +using System.Collections.Generic; using System.Linq; -using System.Threading; -using System.Threading.Tasks;{{/netStandard}} +using System.Threading.Channels; -namespace {{packageName}}.Client {{^netStandard}} +namespace {{packageName}}.{{clientPackage}} { /// /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. /// /// - public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + {{>visibility}} class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - internal Channel AvailableTokens { get; } + internal Dictionary> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary>{{/net70OrLater}}(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -30,79 +28,49 @@ namespace {{packageName}}.Client {{^netStandard}} foreach(TTokenBase token in _tokens) token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); - BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) - { - FullMode = BoundedChannelFullMode.DropWrite + {{#lambda.copy}} + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite }; - AvailableTokens = Channel.CreateBounded(options); - - for (int i = 0; i < _tokens.Length; i++) - _tokens[i].TokenBecameAvailable += ((sender) => AvailableTokens.Writer.TryWrite((TTokenBase) sender)); - } - - internal override async System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null) - => await AvailableTokens.Reader.ReadAsync(cancellation.GetValueOrDefault()).ConfigureAwait(false); - } -} {{/netStandard}}{{#netStandard}} -{ - /// - /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. - /// - /// - public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase - { - internal ConcurrentDictionary AvailableTokens = new ConcurrentDictionary(); - private SemaphoreSlim _semaphore; - - /// - /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. - /// - /// - public RateLimitProvider(TokenContainer container) : base(container.Tokens) - { - _semaphore = new SemaphoreSlim(1, 1); - - foreach(TTokenBase token in _tokens) - token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); - - for (int i = 0; i < _tokens.Length; i++) + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + {{/lambda.copy}} + {{#hasApiKeyMethods}} + if (container is TokenContainer apiKeyTokenContainer) { - _tokens[i].TokenBecameAvailable += ((sender) => - { - TTokenBase token = (TTokenBase)sender; - - AvailableTokens.TryAdd(token, token); - }); - } - } - - internal override async System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null) - { - await _semaphore.WaitAsync().ConfigureAwait(false); + string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); - try - { - TTokenBase result = null; - - while (result == null) + foreach (string header in headers) { - TTokenBase tokenToRemove = AvailableTokens.FirstOrDefault().Value; - - if (tokenToRemove != null && AvailableTokens.TryRemove(tokenToRemove, out result)) - return result; + BoundedChannelOptions options = new BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) + { + FullMode = BoundedChannelFullMode.DropWrite + }; - await Task.Delay(40).ConfigureAwait(false); - - tokenToRemove = AvailableTokens.FirstOrDefault().Value; + AvailableTokens.Add(header, Channel.CreateBounded(options)); } - - return result; } - finally + else { - _semaphore.Release(); + {{#lambda.indent1}}{{#lambda.pasteLine}}{{/lambda.pasteLine}}{{/lambda.indent1}} } + {{/hasApiKeyMethods}} + {{^hasApiKeyMethods}} + {{#lambda.pasteLine}}{{/lambda.pasteLine}} + {{/hasApiKeyMethods}} + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) + { + if (!AvailableTokens.TryGetValue(header, out Channel{{nrt?}} tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); } } -} {{/netStandard}} +} diff --git a/sdks/dotnet/templates/libraries/generichost/SourceGenerationContext.mustache b/sdks/dotnet/templates/libraries/generichost/SourceGenerationContext.mustache new file mode 100644 index 000000000..b1798c98e --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/SourceGenerationContext.mustache @@ -0,0 +1,9 @@ +{{#useSourceGeneration}} + + /// + /// The {{classname}}SerializationContext + /// + [JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof({{classname}}))] + {{>visibility}} partial class {{classname}}SerializationContext : JsonSerializerContext { } +{{/useSourceGeneration}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/TokenBase.mustache b/sdks/dotnet/templates/libraries/generichost/TokenBase.mustache index fd720d1dc..05f06b4a7 100644 --- a/sdks/dotnet/templates/libraries/generichost/TokenBase.mustache +++ b/sdks/dotnet/templates/libraries/generichost/TokenBase.mustache @@ -6,12 +6,12 @@ {{/nrt}} using System; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// The base for all tokens. /// - public abstract class TokenBase + {{>visibility}} abstract class TokenBase { private DateTime _nextAvailable = DateTime.UtcNow; private object _nextAvailableLock = new object(); @@ -64,7 +64,7 @@ namespace {{packageName}}.Client _nextAvailable = DateTime.UtcNow.AddSeconds(5); } - private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + private void OnTimer(object{{nrt?}} sender, System.Timers.ElapsedEventArgs e) { if (TokenBecameAvailable != null && !IsRateLimited) TokenBecameAvailable.Invoke(this); diff --git a/sdks/dotnet/templates/libraries/generichost/TokenContainer`1.mustache b/sdks/dotnet/templates/libraries/generichost/TokenContainer`1.mustache index 9d742241d..24c84a551 100644 --- a/sdks/dotnet/templates/libraries/generichost/TokenContainer`1.mustache +++ b/sdks/dotnet/templates/libraries/generichost/TokenContainer`1.mustache @@ -7,13 +7,13 @@ using System.Linq; using System.Collections.Generic; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A container for a collection of tokens. /// /// - public sealed class TokenContainer where TTokenBase : TokenBase + {{>visibility}} sealed class TokenContainer where TTokenBase : TokenBase { /// /// The collection of tokens @@ -31,7 +31,7 @@ namespace {{packageName}}.Client /// Instantiates a TokenContainer /// /// - public TokenContainer(System.Collections.Generic.IEnumerable tokens) + public TokenContainer(global::System.Collections.Generic.IEnumerable tokens) { Tokens = tokens.ToList(); } diff --git a/sdks/dotnet/templates/libraries/generichost/TokenProvider`1.mustache b/sdks/dotnet/templates/libraries/generichost/TokenProvider`1.mustache index cc8bbd72e..7226551b7 100644 --- a/sdks/dotnet/templates/libraries/generichost/TokenProvider`1.mustache +++ b/sdks/dotnet/templates/libraries/generichost/TokenProvider`1.mustache @@ -7,21 +7,21 @@ using System; using System.Linq; using System.Collections.Generic; -using {{packageName}}.Client; +using {{packageName}}.{{clientPackage}}; namespace {{packageName}} { /// /// A class which will provide tokens. /// - public abstract class TokenProvider where TTokenBase : TokenBase + {{>visibility}} abstract class TokenProvider where TTokenBase : TokenBase { /// /// The array of tokens. /// protected TTokenBase[] _tokens; - internal abstract System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null); + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}); /// /// Instantiates a TokenProvider. diff --git a/sdks/dotnet/templates/libraries/generichost/ValidateRegex.mustache b/sdks/dotnet/templates/libraries/generichost/ValidateRegex.mustache new file mode 100644 index 000000000..78aba8fb3 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/ValidateRegex.mustache @@ -0,0 +1,7 @@ +// {{{name}}} ({{{dataType}}}) pattern +Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); +{{#lambda.copy}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null && {{/lambda.copy}} +if ({{#lambda.first}}{{^required}}{{#lambda.pasteLine}}{{/lambda.pasteLine}} {{/required}}{{#isNullable}}{{#lambda.pasteLine}}{{/lambda.pasteLine}}{{/isNullable}}{{/lambda.first}}!regex{{{name}}}.Match(this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}}{{#isUuid}}.ToString(){{#lambda.first}}{{^required}}{{nrt!}} {{/required}}{{#isNullable}}! {{/isNullable}}{{/lambda.first}}{{/isUuid}}).Success) +{ + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); +} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/WriteProperty.mustache b/sdks/dotnet/templates/libraries/generichost/WriteProperty.mustache new file mode 100644 index 000000000..99659ac26 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/WriteProperty.mustache @@ -0,0 +1,9 @@ +{{#required}} +{{>WritePropertyHelper}} +{{/required}} +{{^required}} +if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + {{#lambda.indent1}} + {{>WritePropertyHelper}} + {{/lambda.indent1}} +{{/required}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/WritePropertyHelper.mustache b/sdks/dotnet/templates/libraries/generichost/WritePropertyHelper.mustache new file mode 100644 index 000000000..183946cf7 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/WritePropertyHelper.mustache @@ -0,0 +1,9 @@ +{{#isNullable}} +if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}} != null) + {{#lambda.pasteLine}}{{/lambda.pasteLine}} +else + writer.WriteNull("{{baseName}}"); +{{/isNullable}} +{{^isNullable}} +{{#lambda.pasteLine}}{{/lambda.pasteLine}} +{{/isNullable}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/api.mustache b/sdks/dotnet/templates/libraries/generichost/api.mustache index 5e2bb67c2..8c02da8f1 100644 --- a/sdks/dotnet/templates/libraries/generichost/api.mustache +++ b/sdks/dotnet/templates/libraries/generichost/api.mustache @@ -1,3 +1,4 @@ +{{#lambda.trimLineBreaks}} // {{>partial_header}} {{#nrt}} @@ -6,25 +7,45 @@ {{/nrt}} using System; using System.Collections.Generic; +{{#net80OrLater}} +{{#lambda.uniqueLines}} +{{#operations}} +{{#operation}} +{{#vendorExtensions.x-set-cookie}} +using System.Linq; +{{/vendorExtensions.x-set-cookie}} +{{/operation}} +{{/operations}} +{{/lambda.uniqueLines}} +{{/net80OrLater}} using System.Net; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using System.Net.Http; using System.Net.Http.Headers; using System.Text.Json; -using {{packageName}}.Client; +using {{packageName}}.{{clientPackage}}; {{#hasImport}} using {{packageName}}.{{modelPackage}}; {{/hasImport}} +{{^netStandard}} +using System.Diagnostics.CodeAnalysis; +{{/netStandard}} namespace {{packageName}}.{{apiPackage}} { {{#operations}} /// /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. /// {{>visibility}} interface {{interfacePrefix}}{{classname}} : IApi { + /// + /// The class containing the events + /// + {{classname}}Events Events { get; } + {{#operation}} /// /// {{summary}} @@ -34,11 +55,14 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task<ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>> - Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null); + /// <> + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}); /// /// {{summary}} @@ -46,44 +70,95 @@ namespace {{packageName}}.{{apiPackage}} /// /// {{notes}} /// - /// Thrown when fails to make API call {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}> - Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}Async({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null);{{#nrt}} + /// <{{nrt?}}> + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}); + {{^-last}} + {{/-last}} + {{/operation}} + } + {{#operation}} + {{#responses}} + {{#-first}} + + /// + /// The + /// + {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} + { + {{#responses}} + {{#vendorExtensions.x-http-status-is-default}} /// - /// {{summary}} + /// Returns true if the response is the default response type /// - /// - /// {{notes}} - /// - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}?> - Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null); + /// + bool Is{{vendorExtensions.x-http-status}} { get; } + {{/vendorExtensions.x-http-status-is-default}} + {{^vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + bool Is{{vendorExtensions.x-http-status}} { get; } + {{/vendorExtensions.x-http-status-is-default}} + {{^-last}} - {{/nrt}}{{^-last}} {{/-last}} + {{/responses}} + } + {{/-first}} + {{/responses}} + {{/operation}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} class {{classname}}Events + { + {{#lambda.trimTrailingWithNewLine}} + {{#operation}} + /// + /// The event raised after the server response + /// + public event EventHandler{{nrt?}} On{{operationId}}; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler{{nrt?}} OnError{{operationId}}; + + internal void ExecuteOn{{operationId}}({{classname}}.{{operationId}}ApiResponse apiResponse) + { + On{{operationId}}?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnError{{operationId}}(Exception exception) + { + OnError{{operationId}}?.Invoke(this, new ExceptionEventArgs(exception)); + } + {{/operation}} + {{/lambda.trimTrailingWithNewLine}} } /// /// Represents a collection of functions to interact with the API endpoints /// - {{>visibility}} partial class {{classname}} : {{interfacePrefix}}{{classname}} + {{>visibility}} sealed partial class {{classname}} : {{interfacePrefix}}{{classname}} { private JsonSerializerOptions _jsonSerializerOptions; /// - /// An event to track the health of the server. - /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// The logger factory /// - public event ClientUtils.EventHandler{{nrt?}} ApiResponded; + public ILoggerFactory LoggerFactory { get; } /// /// The logger @@ -93,7 +168,12 @@ namespace {{packageName}}.{{apiPackage}} /// /// The HttpClient /// - public HttpClient HttpClient { get; }{{#hasApiKeyMethods}} + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public {{classname}}Events Events { get; }{{#hasApiKeyMethods}} /// /// A token provider of type @@ -120,106 +200,154 @@ namespace {{packageName}}.{{apiPackage}} /// public TokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} + {{#net80OrLater}} + {{#lambda.unique}} + {{#operation}} + {{#vendorExtensions.x-set-cookie}} + /// + /// The token cookie container + /// + public {{packageName}}.{{clientPackage}}.CookieContainer CookieContainer { get; } + + {{/vendorExtensions.x-set-cookie}} + {{/operation}} + {{/lambda.unique}} + {{/net80OrLater}} /// /// Initializes a new instance of the class. /// /// - public {{classname}}(ILogger<{{classname}}> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider{{#hasApiKeyMethods}}, - TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, - TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, - TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, - TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, - TokenProvider oauthTokenProvider{{/hasOAuthMethods}}) + public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, + TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, + TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, + TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, + TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, + TokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, + {{packageName}}.{{clientPackage}}.CookieContainer cookieContainer{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}}) { _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; - Logger = logger; - HttpClient = httpClient;{{#hasApiKeyMethods}} + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger<{{classname}}>(); + HttpClient = httpClient; + Events = {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}};{{#hasApiKeyMethods}} ApiKeyProvider = apiKeyProvider;{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} BearerTokenProvider = bearerTokenProvider;{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} BasicTokenProvider = basicTokenProvider;{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} HttpSignatureTokenProvider = httpSignatureTokenProvider;{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OauthTokenProvider = oauthTokenProvider;{{/hasOAuthMethods}} + OauthTokenProvider = oauthTokenProvider;{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}} + CookieContainer = cookieContainer;{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}} } {{#operation}} + {{#allParams}} + {{#-first}} + partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + {{/-first}} + {{/allParams}} + {{#vendorExtensions.x-has-not-nullable-reference-types}} /// - /// {{summary}} {{notes}} + /// Validates the request parameters /// - /// Thrown when fails to make API call + {{#vendorExtensions.x-not-nullable-reference-types}} + /// + {{/vendorExtensions.x-not-nullable-reference-types}} + /// + private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) + { + {{#lambda.trimTrailingWithNewLine}} + {{#vendorExtensions.x-not-nullable-reference-types}} + {{#required}} + {{^vendorExtensions.x-is-value-type}} + if ({{paramName}} == null) + throw new ArgumentNullException(nameof({{paramName}})); + + {{/vendorExtensions.x-is-value-type}} + {{/required}} + {{^required}} + {{^vendorExtensions.x-is-value-type}} + if ({{paramName}}.IsSet && {{paramName}}.Value == null) + throw new ArgumentNullException(nameof({{paramName}})); + + {{/vendorExtensions.x-is-value-type}} + {{/required}} + {{/vendorExtensions.x-not-nullable-reference-types}} + {{/lambda.trimTrailingWithNewLine}} + } + + {{/vendorExtensions.x-has-not-nullable-reference-types}} + /// + /// Processes the server response + /// + /// {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// {{/allParams}} - /// Cancellation Token to cancel the request. - /// <> - public async Task<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}Async({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); - - {{^nrt}}{{#returnTypeIsPrimitive}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - {{/returnTypeIsPrimitive}}{{/nrt}}if (result.Content == null){{^nrt}}{{#returnTypeIsPrimitive}} - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/returnTypeIsPrimitive}}{{/nrt}} - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); - - return result.Content; + bool suppressDefaultLog = false; + After{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); +{{>AfterOperationDefaultImplementation}} } - {{#nrt}} /// - /// {{summary}} {{notes}} + /// Processes the server response /// - /// Thrown when fails to make API call + /// + /// {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// {{/allParams}} - /// Cancellation Token to cancel the request. - /// <> - public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) - { - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>{{nrt?}} result = null; - try - { - result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - } + partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); - return result != null && result.IsSuccessStatusCode - ? result.Content - : null; + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + {{#allParams}} + /// + {{/allParams}} + private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + { + bool suppressDefaultLog = false; + OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog exception pathFormat path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); +{{>OnErrorDefaultImplementation}} } - {{/nrt}} - {{^nrt}} - {{^returnTypeIsPrimitive}} - {{! Note that this method is a copy paste of above due to NRT complexities }} + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + {{#allParams}} + /// + {{/allParams}} + partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + /// /// {{summary}} {{notes}} /// - /// Thrown when fails to make API call {{#allParams}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} /// Cancellation Token to cancel the request. - /// <> - public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + /// <> + public async Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}) { - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>{{nrt?}} result = null; - try + try { - result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + return await {{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); } catch (Exception) { + return null; } - - return result != null && result.IsSuccessStatusCode - ? result.Content - : null; } - {{/returnTypeIsPrimitive}} - {{/nrt}} /// /// {{summary}} {{notes}} /// @@ -228,179 +356,444 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} /// Cancellation Token to cancel the request. - /// <> where T : - public async Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + /// <> + public async Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}) { + {{#lambda.trimLineBreaks}} + UriBuilder uriBuilderLocalVar = new UriBuilder(); + try { - {{#hasRequiredParams}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/hasRequiredParams}}{{#allParams}}{{#required}}{{#nrt}} - - if ({{paramName}} == null) - throw new ArgumentNullException(nameof({{paramName}}));{{/nrt}}{{^nrt}}{{^vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-has-not-nullable-reference-types}} + Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}); - if ({{paramName}} == null) - throw new ArgumentNullException(nameof({{paramName}}));{{/vendorExtensions.x-csharp-value-type}}{{/nrt}}{{/required}}{{/allParams}}{{#hasRequiredParams}} + {{/vendorExtensions.x-has-not-nullable-reference-types}} + {{#allParams}} + {{#-first}} + Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - - {{/hasRequiredParams}}using (HttpRequestMessage request = new HttpRequestMessage()) + {{/-first}} + {{/allParams}} + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - UriBuilder uriBuilder = new UriBuilder(); - uriBuilder.Host = HttpClient.BaseAddress{{nrt!}}.Host; - uriBuilder.Port = HttpClient.BaseAddress{{nrt!}}.Port; - uriBuilder.Scheme = ClientUtils.SCHEME; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "{{path}}";{{#pathParams}}{{#required}} - uriBuilder.Path = uriBuilder.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString()));{{/required}}{{^required}} - - if ({{paramName}} != null) - uriBuilder.Path = uriBuilder.Path + $"/{ Uri.EscapeDataString({{paramName}}).ToString()) }"; - {{/required}}{{/pathParams}}{{#queryParams}}{{#-first}} - - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/-first}}{{/queryParams}}{{^queryParams}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} - - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/queryParams}}{{#queryParams}}{{#required}}{{#-first}} - - {{! all the redundant tags here are to get the spacing just right }} - {{/-first}}{{/required}}{{/queryParams}}{{#queryParams}}{{#required}}parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{nrt!}}); - {{/required}}{{/queryParams}}{{#queryParams}}{{#-first}} - {{/-first}}{{/queryParams}}{{#queryParams}}{{^required}}if ({{paramName}} != null) - parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{nrt!}}); - - {{/required}}{{#-last}}uriBuilder.Query = parseQueryString.ToString();{{/-last}}{{/queryParams}}{{#headerParams}}{{#required}} - - request.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}));{{/required}}{{^required}} - - if ({{paramName}} != null) - request.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}));{{/required}}{{/headerParams}}{{#formParams}}{{#-first}} - - MultipartContent multipartContent = new MultipartContent(); - - request.Content = multipartContent; - - List> formParams = new List>(); - - multipartContent.Add(new FormUrlEncodedContent(formParams));{{/-first}}{{^isFile}}{{#required}} - - formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}})));{{/required}}{{^required}} - - if ({{paramName}} != null) - formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}})));{{/required}}{{/isFile}}{{#isFile}}{{#required}} - - multipartContent.Add(new StreamContent({{paramName}}));{{/required}}{{^required}} - - if ({{paramName}} != null) - multipartContent.Add(new StreamContent({{paramName}}));{{/required}}{{/isFile}}{{/formParams}}{{#bodyParam}} - - request.Content = ({{paramName}} as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize({{paramName}}, _jsonSerializerOptions));{{/bodyParam}}{{#authMethods}}{{#-first}} - - List tokens = new List();{{/-first}}{{#isApiKey}} - - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - - tokens.Add(apiKey);{{#isKeyInHeader}} - - apiKey.UseInHeader(request, "{{keyParamName}}");{{/isKeyInHeader}}{{#isKeyInQuery}} - - apiKey.UseInQuery(request, uriBuilder, parseQueryString, "{{keyParamName}}"); - - uriBuilder.Query = parseQueryString.ToString();{{/isKeyInQuery}}{{#isKeyInCookie}} - - apiKey.UseInCookie(request, parseQueryString, "{{keyParamName}}"); - - uriBuilder.Query = parseQueryString.ToString();{{/isKeyInCookie}}{{/isApiKey}}{{/authMethods}} - - {{! below line must be after any UseInQuery calls, but before using the HttpSignatureToken}} - request.RequestUri = uriBuilder.Uri;{{#authMethods}}{{#isBasicBasic}} - - BasicToken basicToken = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - - tokens.Add(basicToken); - - basicToken.UseInHeader(request, "{{keyParamName}}");{{/isBasicBasic}}{{#isBasicBearer}} - - BearerToken bearerToken = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - - tokens.Add(bearerToken); - - bearerToken.UseInHeader(request, "{{keyParamName}}");{{/isBasicBearer}}{{#isOAuth}} + {{^servers}} + uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{path}}"; + {{/servers}} + {{#servers}} + {{#-first}} + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("{{url}}"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + {{/-first}} + {{/servers}} + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString(ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}))); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} + {{#pathParams}} + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString())); + {{#-last}} + + {{/-last}} + {{/pathParams}} + {{#queryParams}} + {{#-first}} + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + {{/-first}} + {{/queryParams}} + {{^queryParams}} + {{#authMethods}} + {{#isApiKey}} + {{#isKeyInQuery}} + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} + {{/queryParams}} + {{#queryParams}} + {{#required}} + {{#-first}} + + {{/-first}} + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}); + {{/required}} + {{/queryParams}} + + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} + {{#queryParams}} + {{^required}} + if ({{paramName}}.IsSet) + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}.Value); + + {{/required}} + {{#-last}} + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + {{/-last}} + {{/queryParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} + {{#headerParams}} + {{#required}} + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value)); + + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#-first}} + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars));{{/-first}}{{^isFile}}{{#required}} + + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value))); + + {{/required}} + {{/isFile}} + {{#isFile}} + {{#required}} + multipartContentLocalVar.Add(new StreamContent({{paramName}})); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + multipartContentLocalVar.Add(new StreamContent({{paramName}}.Value)); + + {{/required}} + {{/isFile}} + {{/formParams}} + {{#bodyParam}} + {{#required}} + httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + {{/required}} + + {{/bodyParam}} + {{#authMethods}} + {{#-first}} + List tokenBaseLocalVars = new List(); + {{/-first}} + {{#isApiKey}} + {{^isKeyInCookie}} + ApiKeyToken apiKeyTokenLocalVar{{-index}} = (ApiKeyToken) await ApiKeyProvider.GetAsync("{{keyParamName}}", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar{{-index}}); + {{#isKeyInHeader}} + apiKeyTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar); + + {{/isKeyInHeader}} + {{/isKeyInCookie}} + {{#isKeyInQuery}} + + apiKeyTokenLocalVar{{-index}}.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + {{#authMethods}} + {{#isBasicBasic}} + + BasicToken basicTokenLocalVar{{-index}} = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar{{-index}}); + + basicTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isBasicBasic}} + {{#isBasicBearer}} + + BearerToken bearerTokenLocalVar{{-index}} = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar{{-index}}); + + bearerTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isBasicBearer}} + {{#isOAuth}} + + OAuthToken oauthTokenLocalVar{{-index}} = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar{{-index}}); + + oauthTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isOAuth}} + {{#isHttpSignature}} + + HttpSignatureToken httpSignatureTokenLocalVar{{-index}} = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar{{-index}}); - tokens.Add(oauthToken); + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); - oauthToken.UseInHeader(request, "{{keyParamName}}");{{/isOAuth}}{{#isHttpSignature}} - - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + httpSignatureTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + {{/isHttpSignature}} + {{/authMethods}} + {{#consumes}} + {{#-first}} + + {{=<% %>=}} + string[] contentTypes = new string[] {<%/-first%> + <%={{ }}=%> + "{{{mediaType}}}"{{^-last}},{{/-last}}{{#-last}} + }; + {{/-last}} + {{/consumes}} + {{#consumes}} + {{#-first}} + + string{{nrt?}} contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + {{/-first}} + {{/consumes}} + {{#produces}} + {{#-first}} + + {{=<% %>=}} + string[] acceptLocalVars = new string[] {<%/-first%> + <%={{ }}=%> + "{{{mediaType}}}"{{^-last}},{{/-last}}{{#-last}} + }; + {{/-last}} + {{/produces}} + {{#produces}} + {{#-first}} + + string{{nrt?}} acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + {{/-first}} + {{/produces}} + {{#net60OrLater}} + + httpRequestMessageLocalVar.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}; + {{/net60OrLater}} + {{^net60OrLater}} + httpRequestMessageLocalVar.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}"); + {{/net60OrLater}} + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); - tokens.Add(signatureToken); + ILogger<{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{operationId}}ApiResponse>(); - string requestBody = await request.Content{{nrt!}}.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); + {{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{path}}", requestedAtLocalVar, _jsonSerializerOptions); - signatureToken.UseInHeader(request, requestBody, cancellationToken);{{/isHttpSignature}}{{/authMethods}}{{#consumes}}{{#-first}} + After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); - string[] contentTypes = new string[] { - {{/-first}}"{{{mediaType}}}"{{^-last}}, - {{/-last}}{{#-last}} - };{{/-last}}{{/consumes}}{{#consumes}}{{#-first}} + Events.ExecuteOn{{operationId}}(apiResponseLocalVar); - string{{nrt?}} contentType = ClientUtils.SelectHeaderContentType(contentTypes); + {{#authMethods}} + {{#-first}} + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - if (contentType != null) - request.Content.Headers.Add("ContentType", contentType);{{/-first}}{{/consumes}}{{#produces}}{{#-first}} + {{/-first}} + {{/authMethods}} + {{#net80OrLater}} + {{#responses}} + {{#vendorExtensions.x-set-cookie}} + if (httpResponseMessageLocalVar.StatusCode == (HttpStatusCode) {{code}} && httpResponseMessageLocalVar.Headers.TryGetValues("Set-Cookie", out var cookieHeadersLocalVar)) + { + foreach(string cookieHeader in cookieHeadersLocalVar) + { + IList setCookieHeaderValuesLocalVar = Microsoft.Net.Http.Headers.SetCookieHeaderValue.ParseList(cookieHeadersLocalVar.ToArray()); - string[] accepts = new string[] { {{/-first}}{{/produces}} - {{#produces}}"{{{mediaType}}}"{{^-last}}, - {{/-last}}{{/produces}}{{#produces}}{{#-last}} - };{{/-last}}{{/produces}}{{#produces}}{{#-first}} + foreach(Microsoft.Net.Http.Headers.SetCookieHeaderValue setCookieHeaderValueLocalVar in setCookieHeaderValuesLocalVar) + { + Cookie cookieLocalVar = new Cookie(setCookieHeaderValueLocalVar.Name.ToString(), setCookieHeaderValueLocalVar.Value.ToString()) + { + HttpOnly = setCookieHeaderValueLocalVar.HttpOnly + }; - string{{nrt?}} accept = ClientUtils.SelectHeaderAccept(accepts); + if (setCookieHeaderValueLocalVar.Expires.HasValue) + cookieLocalVar.Expires = setCookieHeaderValueLocalVar.Expires.Value.UtcDateTime; - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); - {{/-first}}{{/produces}}{{^netStandard}} - request.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}};{{/netStandard}}{{#netStandard}} - request.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}");{{/netStandard}}{{! early standard versions do not have HttpMethod.Patch }} + if (setCookieHeaderValueLocalVar.Path.HasValue) + cookieLocalVar.Path = setCookieHeaderValueLocalVar.Path.Value; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) - { - DateTime requestedAt = DateTime.UtcNow; + if (setCookieHeaderValueLocalVar.Domain.HasValue) + cookieLocalVar.Domain = setCookieHeaderValueLocalVar.Domain.Value; - string responseContent = await responseMessage.Content.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); - - if (ApiResponded != null) - { - try - { - ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "{{path}}")); - } - catch(Exception e) - { - Logger.LogError(e, "An error occured while invoking ApiResponded."); + CookieContainer.Value.Add(new Uri($"{uriBuilderLocalVar.Scheme}://{uriBuilderLocalVar.Host}"), cookieLocalVar); + } } } - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> apiResponse = new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>(responseMessage, responseContent); - - if (apiResponse.IsSuccessStatusCode) - apiResponse.Content = JsonSerializer.Deserialize<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}>(apiResponse.RawContent, _jsonSerializerOptions);{{#authMethods}} - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit();{{/authMethods}} - - return apiResponse; + {{/vendorExtensions.x-set-cookie}} + {{/responses}} + {{/net80OrLater}} + return apiResponseLocalVar; } } } catch(Exception e) { - Logger.LogError(e, "An error occured while sending the request to the server."); + OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{path}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + Events.ExecuteOnError{{operationId}}(e); throw; } - }{{^-last}} - {{/-last}} + {{/lambda.trimLineBreaks}} + } + {{#responses}} + {{#-first}} + + /// + /// The + /// + {{>visibility}} partial class {{operationId}}ApiResponse : {{packageName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{operationId}}ApiResponse + { + /// + /// The logger + /// + public ILogger<{{operationId}}ApiResponse> Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public {{operationId}}ApiResponse(ILogger<{{operationId}}ApiResponse> logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + {{#responses}} + + {{#vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is the default response type + /// + /// + public bool Is{{vendorExtensions.x-http-status}} => {{#vendorExtensions.x-only-default}}true{{/vendorExtensions.x-only-default}}{{^vendorExtensions.x-only-default}}{{#lambda.joinConditions}}{{#responses}}{{^vendorExtensions.x-http-status-is-default}}!Is{{vendorExtensions.x-http-status}} {{/vendorExtensions.x-http-status-is-default}}{{/responses}}{{/lambda.joinConditions}}{{/vendorExtensions.x-only-default}}; + {{/vendorExtensions.x-http-status-is-default}} + {{^vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + {{#vendorExtensions.x-http-status-range}} + public bool Is{{vendorExtensions.x-http-status}} + { + get + { + int statusCode = (int)StatusCode; + return {{vendorExtensions.x-http-status-range}}00 >= statusCode && {{vendorExtensions.x-http-status-range}}99 <= statusCode; + } + } + {{/vendorExtensions.x-http-status-range}} + {{^vendorExtensions.x-http-status-range}} + public bool Is{{vendorExtensions.x-http-status}} => {{code}} == (int)StatusCode; + {{/vendorExtensions.x-http-status-range}} + {{/vendorExtensions.x-http-status-is-default}} + {{#dataType}} + + /// + /// Deserializes the response if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + public {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{vendorExtensions.x-http-status}}() + { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>AsModel}} + {{/lambda.indent4}} + {{/lambda.trimTrailingWithNewLine}} + } + + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} and the deserialized response is not null + /// + /// + /// + public bool Try{{vendorExtensions.x-http-status}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result) + { + result = null; + + try + { + result = {{vendorExtensions.x-http-status}}(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode){{#vendorExtensions.x-http-status-range}}{{.}}{{/vendorExtensions.x-http-status-range}}{{^vendorExtensions.x-http-status-range}}{{code}}{{/vendorExtensions.x-http-status-range}}); + } + + return result != null; + } + {{/dataType}} + {{#-last}} + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>OnDeserializationError}} + {{/lambda.indent4}} + {{/lambda.trimTrailingWithNewLine}} + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + {{/-last}} + {{/responses}} + } + {{/-first}} + {{/responses}} {{/operation}} } {{/operations}} } +{{/lambda.trimLineBreaks}} diff --git a/sdks/dotnet/templates/libraries/generichost/api_test.mustache b/sdks/dotnet/templates/libraries/generichost/api_test.mustache index b64731f81..02ce22168 100644 --- a/sdks/dotnet/templates/libraries/generichost/api_test.mustache +++ b/sdks/dotnet/templates/libraries/generichost/api_test.mustache @@ -8,10 +8,10 @@ using {{packageName}}.{{apiPackage}};{{#hasImport}} using {{packageName}}.{{modelPackage}};{{/hasImport}} -{{{testInstructions}}} +{{>testInstructions}} -namespace {{packageName}}.Test.Api +namespace {{packageName}}.Test.{{apiPackage}} { /// /// Class for testing {{classname}} @@ -24,7 +24,6 @@ namespace {{packageName}}.Test.Api { _instance = _host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); } - {{#operations}} {{#operation}} @@ -35,10 +34,16 @@ namespace {{packageName}}.Test.Api public async Task {{operationId}}AsyncTest() { {{#allParams}} - {{{dataType}}} {{paramName}} = default; + {{^required}}Client.Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} = default{{nrt!}}; {{/allParams}} - {{#returnType}}var response = {{/returnType}}await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - Assert.IsType<{{{.}}}>(response);{{/returnType}} + {{#returnType}} + var response = await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + var model = response.{{#lambda.first}}{{#responses}}{{vendorExtensions.x-http-status}} {{/responses}}{{/lambda.first}}(); + Assert.IsType<{{{.}}}>(model); + {{/returnType}} + {{^returnType}} + await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/returnType}} } {{/operation}} {{/operations}} diff --git a/sdks/dotnet/templates/libraries/generichost/git_push.ps1.mustache b/sdks/dotnet/templates/libraries/generichost/git_push.ps1.mustache index 0f4084ef8..f263c2bc5 100644 --- a/sdks/dotnet/templates/libraries/generichost/git_push.ps1.mustache +++ b/sdks/dotnet/templates/libraries/generichost/git_push.ps1.mustache @@ -49,7 +49,7 @@ Set-StrictMode -Version 3.0 if ($Help){ Write-Output " This script will initialize a git repository, then add and commit all files. - The local repository will then be pushed to your prefered git provider. + The local repository will then be pushed to your preferred git provider. If the remote repository does not exist yet and you are using GitHub, the repository will be created for you provided you have the GitHub CLI installed. diff --git a/sdks/dotnet/templates/libraries/generichost/model.mustache b/sdks/dotnet/templates/libraries/generichost/model.mustache index d6e643a2f..f9931574d 100644 --- a/sdks/dotnet/templates/libraries/generichost/model.mustache +++ b/sdks/dotnet/templates/libraries/generichost/model.mustache @@ -10,7 +10,9 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.IO; +{{^useGenericHost}} using System.Runtime.Serialization; +{{/useGenericHost}} using System.Text; using System.Text.RegularExpressions; using System.Text.Json; @@ -21,29 +23,28 @@ using System.ComponentModel.DataAnnotations; {{#useCompareNetObjects}} using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; {{/useCompareNetObjects}} +{{#useGenericHost}} +{{#useSourceGeneration}} +using System.Text.Json.Serialization.Metadata; +{{/useSourceGeneration}} +using {{packageName}}.{{clientPackage}}; +{{/useGenericHost}} {{#models}} +{{#lambda.trimTrailingWithNewLine}} {{#model}} namespace {{packageName}}.{{modelPackage}} { -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}} +{{#isEnum}} +{{>modelEnum}} +{{/isEnum}} +{{^isEnum}} +{{>modelGeneric}} -{{#allOf}} -{{#-first}} -{{>JsonConverter}} -{{/-first}} -{{/allOf}} -{{#anyOf}} -{{#-first}} -{{>JsonConverter}} -{{/-first}} -{{/anyOf}} -{{#oneOf}} -{{#-first}} {{>JsonConverter}} -{{/-first}} -{{/oneOf}} {{/isEnum}} +{{>SourceGenerationContext}} {{/model}} +{{/lambda.trimTrailingWithNewLine}} {{/models}} } diff --git a/sdks/dotnet/templates/libraries/generichost/modelGeneric.mustache b/sdks/dotnet/templates/libraries/generichost/modelGeneric.mustache index 1f18f91bc..6bf210bbc 100644 --- a/sdks/dotnet/templates/libraries/generichost/modelGeneric.mustache +++ b/sdks/dotnet/templates/libraries/generichost/modelGeneric.mustache @@ -1,96 +1,83 @@ /// /// {{description}}{{^description}}{{classname}}{{/description}} /// - {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}{{^parentModel}}, IValidatableObject{{/parentModel}}{{/validatable}} + {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}}{{#readOnlyVars}}{{#-first}} : .{{/-first}}{{/readOnlyVars}}{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{>ImplementsIEquatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} { {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} /// /// Initializes a new instance of the class. /// - /// - {{#composedSchemas.allOf}} - {{^isInherited}} - /// - {{/isInherited}} - {{/composedSchemas.allOf}} + /// {{#composedSchemas.anyOf}} - /// + /// {{/composedSchemas.anyOf}} {{#allVars}} - /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{^isDiscriminator}} + /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{/isDiscriminator}} {{/allVars}} - public {{classname}}({{#lambda.joinWithComma}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{#model.composedSchemas.allOf}}{{^isInherited}}{{{dataType}}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/isInherited}}{{/model.composedSchemas.allOf}}{{#model.composedSchemas.anyOf}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/model.composedSchemas.anyOf}}{{#model.allVars}}{{^compulsory}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/compulsory}}{{#compulsory}}{{{datatypeWithEnum}}}{{/compulsory}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#defaultValue}} = {{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}{{^compulsory}} = default{{/compulsory}}{{/defaultValue}} {{/model.allVars}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{#parentModel.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/isInherited}}{{/parentModel.composedSchemas.allOf}}{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{parent}}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{#isInherited}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} {{/isInherited}}{{/allVars}}{{/lambda.joinWithComma}}){{/parent}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{#model.composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{baseType}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{parent}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { - {{#allVars}} - {{^isInherited}} - {{#required}} - {{^isNullable}} - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) - throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null."); - - {{/isNullable}} - {{/required}} - {{/isInherited}} - {{/allVars}} - {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; - {{#composedSchemas.allOf}} - {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; - {{/composedSchemas.allOf}} {{#composedSchemas.anyOf}} - {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; + {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/composedSchemas.anyOf}} + {{name}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{#allVars}} + {{^isDiscriminator}} {{^isInherited}} - {{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/isInherited}} + {{#isInherited}} + {{#isNew}} + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/isNew}} + {{/isInherited}} + {{/isDiscriminator}} {{/allVars}} + OnCreated(); } + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} {{^composedSchemas.oneOf}} /// /// Initializes a new instance of the class. /// - {{#composedSchemas.allOf}} - {{^isInherited}} - /// - {{/isInherited}} - {{/composedSchemas.allOf}} {{#composedSchemas.anyOf}} - /// + /// {{/composedSchemas.anyOf}} {{#allVars}} - /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{^isDiscriminator}} + /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{/isDiscriminator}} {{/allVars}} - public {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.allOf}}{{^isInherited}}{{{dataType}}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/isInherited}}{{/composedSchemas.allOf}}{{#composedSchemas.anyOf}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/composedSchemas.anyOf}}{{#allVars}}{{^compulsory}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/compulsory}}{{#compulsory}}{{{datatypeWithEnum}}}{{/compulsory}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#defaultValue}} = {{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}{{^compulsory}} = default{{/compulsory}}{{/defaultValue}} {{/allVars}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{#parentModel.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/isInherited}}{{/parentModel.composedSchemas.allOf}}{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{parent}}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{#isInherited}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} {{/isInherited}}{{/allVars}}{{/lambda.joinWithComma}}){{/parent}} + {{^composedSchemas.anyOf}} + [JsonConstructor] + {{/composedSchemas.anyOf}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{baseType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { - {{#allVars}} - {{^isInherited}} - {{#required}} - {{^isNullable}} - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) - throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null."); - - {{/isNullable}} - {{/required}} - {{/isInherited}} - {{/allVars}} - {{#composedSchemas.allOf}} - {{^isInherited}} - {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; - {{/isInherited}} - {{/composedSchemas.allOf}} {{#composedSchemas.anyOf}} - {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}; + {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/composedSchemas.anyOf}} {{#allVars}} + {{^isDiscriminator}} {{^isInherited}} - {{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/isInherited}} + {{#isInherited}} + {{#isNew}} + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/isNew}} {{/isInherited}} + {{/isDiscriminator}} {{/allVars}} + OnCreated(); } {{/composedSchemas.oneOf}} + partial void OnCreated(); + {{#vars}} {{#items.isEnum}} {{#items}} @@ -104,71 +91,144 @@ {{>modelInnerEnum}} {{/complexType}} {{/isEnum}} + {{^isDiscriminator}} {{#isEnum}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} /// /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}} {{/description}} + {{#example}} + /// {{.}} + {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#isNullable}}{{#required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{#required}}{{{datatypeWithEnum}}}{{/required}}{{/isNullable}}{{#isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public {{#isNew}}new {{/isNew}}{{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} {{/isEnum}} + {{/isDiscriminator}} {{/vars}} {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} /// - /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{#deprecated}} [Obsolete] {{/deprecated}} - public {{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option; } {{^isReadOnly}}set { this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.anyOf}} {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} /// - /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{#deprecated}} [Obsolete] {{/deprecated}} - public {{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public {{{dataType}}}{{>NullConditionalProperty}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}} { get; {{^isReadOnly}}set; {{/isReadOnly}}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} - {{#composedSchemas.allOf}} - {{^isInherited}} + {{#allVars}} + {{#isDiscriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} /// - /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}} + /// The discriminator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public {{#isNew}}new {{/isNew}}{{datatypeWithEnum}} {{name}} { get; } = {{^isNew}}"{{classname}}"{{/isNew}}{{#isNew}}{{^isEnum}}"{{classname}}"{{/isEnum}}{{#isEnum}}({{datatypeWithEnum}})Enum.Parse(typeof({{datatypeWithEnum}}), "{{classname}}"){{/isEnum}}{{/isNew}}; + + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/isDiscriminator}} + {{^isDiscriminator}} + {{^isEnum}} + {{#isInherited}} + {{#isNew}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} + [JsonPropertyName("{{baseName}}")] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{{dataType}}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public new {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + {{/isNew}} {{/isInherited}} - {{/composedSchemas.allOf}} - {{#allVars}} {{^isInherited}} - {{^isEnum}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} /// /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{^compulsory}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/compulsory}}{{#compulsory}}{{{datatypeWithEnum}}}{{/compulsory}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} - {{/isEnum}} {{/isInherited}} + {{/isEnum}} + {{/isDiscriminator}} {{/allVars}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} @@ -176,7 +236,7 @@ /// Gets or Sets additional properties /// [JsonExtensionData] - public Dictionary AdditionalProperties { get; set; } = new Dictionary(); + public Dictionary AdditionalProperties { get; } = new Dictionary(); {{/parentModel}} {{/isAdditionalPropertiesTrue}} @@ -189,10 +249,12 @@ StringBuilder sb = new StringBuilder(); sb.Append("class {{classname}} {\n"); {{#parent}} - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); {{/parent}} {{#vars}} + {{^isDiscriminator}} sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); + {{/isDiscriminator}} {{/vars}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} @@ -202,6 +264,9 @@ sb.Append("}\n"); return sb.ToString(); } + {{#equatable}} + {{#readOnlyVars}} + {{#-first}} /// /// Returns true if objects are equal @@ -230,29 +295,28 @@ {{/useCompareNetObjects}} {{^useCompareNetObjects}} if (input == null) - { return false; - } - return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}} + + return {{#parent}}base.Equals(input) && {{/parent}}{{#readOnlyVars}}{{^isInherited}}{{^isContainer}} ( - this.{{name}} == input.{{name}} || + {{name}} == input.{{name}} || {{^vendorExtensions.x-is-value-type}} - (this.{{name}} != null && - this.{{name}}.Equals(input.{{name}})) + ({{name}} != null && + {{name}}.Equals(input.{{name}})) {{/vendorExtensions.x-is-value-type}} {{#vendorExtensions.x-is-value-type}} - this.{{name}}.Equals(input.{{name}}) + {{name}}.Equals(input.{{name}}) {{/vendorExtensions.x-is-value-type}} ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}} ( - this.{{name}} == input.{{name}} || - {{^vendorExtensions.x-is-value-type}}this.{{name}} != null && + {{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}}{{name}} != null && input.{{name}} != null && - {{/vendorExtensions.x-is-value-type}}this.{{name}}.SequenceEqual(input.{{name}}) - ){{^-last}} && {{/-last}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} + {{/vendorExtensions.x-is-value-type}}{{name}}.SequenceEqual(input.{{name}}) + ){{^-last}} && {{/-last}}{{/isContainer}}{{/isInherited}}{{/readOnlyVars}}{{^readOnlyVars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/readOnlyVars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); + && (AdditionalProperties.Count == input.AdditionalProperties.Count && !AdditionalProperties.Except(input.AdditionalProperties).Any()); {{/parentModel}} {{/isAdditionalPropertiesTrue}} {{/useCompareNetObjects}} @@ -272,31 +336,41 @@ {{^parent}} int hashCode = 41; {{/parent}} - {{#vars}} - {{^vendorExtensions.x-is-value-type}} - if (this.{{name}} != null) - { - hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); - } - {{/vendorExtensions.x-is-value-type}} - {{#vendorExtensions.x-is-value-type}} - hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); - {{/vendorExtensions.x-is-value-type}} - {{/vars}} + {{#readOnlyVars}} + {{#required}} + {{^isNullable}} + hashCode = (hashCode * 59) + {{name}}.GetHashCode(); + {{/isNullable}} + {{/required}} + {{/readOnlyVars}} + {{#readOnlyVars}} + {{#lambda.copy}} + + if ({{name}} != null) + hashCode = (hashCode * 59) + {{name}}.GetHashCode(); + {{/lambda.copy}} + {{#isNullable}} + {{#lambda.pasteOnce}}{{/lambda.pasteOnce}} + {{/isNullable}} + {{^required}} + {{#lambda.pasteOnce}}{{/lambda.pasteOnce}} + {{/required}} + {{/readOnlyVars}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); {{/parentModel}} {{/isAdditionalPropertiesTrue}} + return hashCode; } } - + {{/-first}} + {{/readOnlyVars}} + {{/equatable}} {{#validatable}} {{^parentModel}} + {{>validatable}} {{/parentModel}} {{/validatable}} diff --git a/sdks/dotnet/templates/libraries/generichost/testInstructions.mustache b/sdks/dotnet/templates/libraries/generichost/testInstructions.mustache new file mode 100644 index 000000000..7bf738e20 --- /dev/null +++ b/sdks/dotnet/templates/libraries/generichost/testInstructions.mustache @@ -0,0 +1,18 @@ +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/httpclient/ApiClient.mustache b/sdks/dotnet/templates/libraries/httpclient/ApiClient.mustache index 866f036e6..cefe6be9f 100644 --- a/sdks/dotnet/templates/libraries/httpclient/ApiClient.mustache +++ b/sdks/dotnet/templates/libraries/httpclient/ApiClient.mustache @@ -79,7 +79,7 @@ namespace {{packageName}}.Client public async Task Deserialize(HttpResponseMessage response) { - var result = (T) await Deserialize(response, typeof(T)); + var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); return result; } @@ -91,30 +91,54 @@ namespace {{packageName}}.Client /// Object representation of the JSON string. internal async Task Deserialize(HttpResponseMessage response, Type type) { - IList headers = response.Headers.Select(x => x.Key + "=" + x.Value).ToList(); + IList headers = new List(); + // process response headers, e.g. Access-Control-Allow-Methods + foreach (var responseHeader in response.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + + // process response content headers, e.g. Content-Type + foreach (var responseHeader in response.Content.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + // RFC 2183 & RFC 2616 + var fileNameRegex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$", RegexOptions.IgnoreCase); if (type == typeof(byte[])) // return byte array { - return await response.Content.ReadAsByteArrayAsync(); + return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); } else if (type == typeof(FileParameter)) { - return new FileParameter(await response.Content.ReadAsStreamAsync()); + if (headers != null) { + foreach (var header in headers) + { + var match = fileNameRegex.Match(header.ToString()); + if (match.Success) + { + string fileName = ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + return new FileParameter(fileName, await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + } + } + return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); } // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) if (type == typeof(Stream)) { - var bytes = await response.Content.ReadAsByteArrayAsync(); + var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); if (headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) ? Path.GetTempPath() : _configuration.TempFolderPath; - var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in headers) { - var match = regex.Match(header.ToString()); + var match = fileNameRegex.Match(header.ToString()); if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); @@ -129,18 +153,18 @@ namespace {{packageName}}.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(await response.Content.ReadAsStringAsync(), null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type { - return Convert.ChangeType(await response.Content.ReadAsStringAsync(), type); + return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); } // at this point, it must be a model (json) try { - return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync(), type, _serializerSettings); + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); } catch (Exception e) { @@ -401,7 +425,7 @@ namespace {{packageName}}.Client private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) { T result = (T) responseData; - string rawContent = await response.Content.ReadAsStringAsync(); + string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) { @@ -448,7 +472,7 @@ namespace {{packageName}}.Client private async Task> ExecAsync(HttpRequestMessage req, IReadableConfiguration configuration, - System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { CancellationTokenSource timeoutTokenSource = null; CancellationTokenSource finalTokenSource = null; @@ -514,10 +538,10 @@ namespace {{packageName}}.Client if (!response.IsSuccessStatusCode) { - return await ToApiResponse(response, default(T), req.RequestUri); + return await ToApiResponse(response, default(T), req.RequestUri).ConfigureAwait(false); } - object responseData = await deserializer.Deserialize(response); + object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) @@ -526,12 +550,21 @@ namespace {{packageName}}.Client } else if (typeof(T).Name == "Stream") // for binary response { - responseData = (T) (object) await response.Content.ReadAsStreamAsync(); + responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); } InterceptResponse(req, response); - return await ToApiResponse(response, responseData, req.RequestUri); + return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); + } + catch (OperationCanceledException original) + { + if (timeoutTokenSource != null && timeoutTokenSource.IsCancellationRequested) + { + throw new TaskCanceledException($"[{req.Method}] {req.RequestUri} was timeout.", + new TimeoutException(original.Message, original)); + } + throw; } finally { @@ -558,7 +591,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); @@ -573,7 +606,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); @@ -588,7 +621,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); @@ -603,7 +636,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); @@ -618,7 +651,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); @@ -633,7 +666,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); @@ -648,7 +681,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); diff --git a/sdks/dotnet/templates/libraries/httpclient/RequestOptions.mustache b/sdks/dotnet/templates/libraries/httpclient/RequestOptions.mustache index 62859649c..25e76d03d 100644 --- a/sdks/dotnet/templates/libraries/httpclient/RequestOptions.mustache +++ b/sdks/dotnet/templates/libraries/httpclient/RequestOptions.mustache @@ -25,7 +25,7 @@ namespace {{packageName}}.Client public Multimap QueryParameters { get; set; } /// - /// Header parameters to be applied to to the request. + /// Header parameters to be applied to the request. /// Keys may have 1 or more values associated. /// public Multimap HeaderParameters { get; set; } diff --git a/sdks/dotnet/templates/libraries/httpclient/api.mustache b/sdks/dotnet/templates/libraries/httpclient/api.mustache index c0d49570a..ebf563b5e 100644 --- a/sdks/dotnet/templates/libraries/httpclient/api.mustache +++ b/sdks/dotnet/templates/libraries/httpclient/api.mustache @@ -78,7 +78,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// {{summary}} @@ -95,7 +95,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); {{/operation}} #endregion Asynchronous Operations } @@ -552,7 +552,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -570,7 +570,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { {{#allParams}} {{#required}} @@ -605,6 +605,12 @@ namespace {{packageName}}.{{apiPackage}} var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} {{#pathParams}} {{#required}} localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter @@ -616,6 +622,12 @@ namespace {{packageName}}.{{apiPackage}} } {{/required}} {{/pathParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} {{#queryParams}} {{#required}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); @@ -627,6 +639,12 @@ namespace {{packageName}}.{{apiPackage}} } {{/required}} {{/queryParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} {{#headerParams}} {{#required}} localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/ApiClient.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/ApiClient.mustache new file mode 100644 index 000000000..df7b9d054 --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/ApiClient.mustache @@ -0,0 +1,639 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using System.Net.Http; +using System.Net.Http.Headers; +using UnityEngine.Networking; +using UnityEngine; + +namespace {{packageName}}.Client +{ + /// + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public T Deserialize(UnityWebRequest request) + { + var result = (T) Deserialize(request, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The UnityWebRequest after it has a response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(UnityWebRequest request, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return request.downloadHandler.data; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + // NOTE: Ignoring Content-Disposition filename support, since not all platforms + // have a location on disk to write arbitrary data (tvOS, consoles). + return new MemoryStream(request.downloadHandler.data); + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(request.downloadHandler.text, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(request.downloadHandler.text, type); + } + + var contentType = request.GetResponseHeader("Content-Type"); + + if (!string.IsNullOrEmpty(contentType) && contentType.Contains("application/json")) + { + var text = request.downloadHandler?.text; + + // Generated APIs that don't expect a return value provide System.Object as the type + if (type == typeof(global::System.Object) && (string.IsNullOrEmpty(text) || text.Trim() == "null")) + { + return null; + } + + if (request.responseCode >= 200 && request.responseCode < 300) + { + try + { + // Deserialize as a model + return JsonConvert.DeserializeObject(text, type, _serializerSettings); + } + catch (Exception e) + { + throw new UnexpectedResponseException(request, type, e.ToString()); + } + } + else + { + throw new ApiException((int)request.responseCode, request.error, text); + } + } + + if (type != typeof(global::System.Object) && request.responseCode >= 200 && request.responseCode < 300) + { + throw new UnexpectedResponseException(request, type); + } + + return null; + + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + /// + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// + {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() : + this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// + /// Initializes a new instance of the . + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + } + + /// + /// Provides all logic for constructing a new UnityWebRequest. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the UnityWebRequest. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new UnityWebRequest instance. + /// + private UnityWebRequest NewRequest( + string method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + var uri = builder.GetFullUri(); + UnityWebRequest request = null; + + if (contentType == "multipart/form-data") + { + var formData = new List(); + foreach (var formParameter in options.FormParameters) + { + formData.Add(new MultipartFormDataSection(formParameter.Key, formParameter.Value)); + } + + request = UnityWebRequest.Post(uri, formData); + request.method = method; + } + else if (contentType == "application/x-www-form-urlencoded") + { + var form = new WWWForm(); + foreach (var kvp in options.FormParameters) + { + form.AddField(kvp.Key, kvp.Value); + } + + request = UnityWebRequest.Post(uri, form); + request.method = method; + } + else if (options.Data != null) + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + var jsonData = serializer.Serialize(options.Data); + + // Making a post body application/json encoded is whack with UnityWebRequest. + // See: https://stackoverflow.com/questions/68156230/unitywebrequest-post-not-sending-body + request = UnityWebRequest.Put(uri, jsonData); + request.method = method; + request.SetRequestHeader("Content-Type", "application/json"); + } + else + { + request = new UnityWebRequest(builder.GetFullUri(), method); + } + + if (request.downloadHandler == null && typeof(T) != typeof(global::System.Object)) + { + request.downloadHandler = new DownloadHandlerBuffer(); + } + +#if UNITY_EDITOR || !UNITY_WEBGL + if (configuration.UserAgent != null) + { + request.SetRequestHeader("User-Agent", configuration.UserAgent); + } +#endif + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.SetRequestHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.SetRequestHeader(headerParam.Key, value); + } + } + } + + if (options.Cookies != null && options.Cookies.Count > 0) + { + #if UNITY_WEBGL + throw new System.InvalidOperationException("UnityWebRequest does not support setting cookies in WebGL"); + #else + if (options.Cookies.Count != 1) + { + UnityEngine.Debug.LogError("Only one cookie supported, ignoring others"); + } + + request.SetRequestHeader("Cookie", options.Cookies[0].ToString()); + #endif + } + + return request; + + } + + partial void InterceptRequest(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration); + partial void InterceptResponse(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration, ref object responseData); + + private ApiResponse ToApiResponse(UnityWebRequest request, object responseData) + { + T result = (T) responseData; + + var transformed = new ApiResponse((HttpStatusCode)request.responseCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, request.downloadHandler?.text ?? "") + { + ErrorText = request.error, + Cookies = new List() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + var responseHeaders = request.GetResponseHeaders(); + if (responseHeaders != null) + { + foreach (var responseHeader in request.GetResponseHeaders()) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + return transformed; + } + + private async Task> ExecAsync( + UnityWebRequest request, + string path, + RequestOptions options, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + + using (request) + { + if (configuration.Timeout > 0) + { + request.timeout = (int)Math.Ceiling(configuration.Timeout / 1000.0f); + } + + if (configuration.Proxy != null) + { + throw new InvalidOperationException("Configuration `Proxy` not supported by UnityWebRequest"); + } + + if (configuration.ClientCertificates != null) + { + // Only Android/iOS/tvOS/Standalone players can support certificates, and this + // implementation is intended to work on all platforms. + // + // TODO: Could optionally allow support for this on these platforms. + // + // See: https://docs.unity3d.com/ScriptReference/Networking.CertificateHandler.html + throw new InvalidOperationException("Configuration `ClientCertificates` not supported by UnityWebRequest on all platforms"); + } + + InterceptRequest(request, path, options, configuration); + + var asyncOp = request.SendWebRequest(); + + TaskCompletionSource tsc = new TaskCompletionSource(); + asyncOp.completed += (_) => tsc.TrySetResult(request.result); + + using (var tokenRegistration = cancellationToken.Register(request.Abort, true)) + { + await tsc.Task; + } + + if (request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.DataProcessingError) + { + throw new ConnectionException(request); + } + + object responseData = deserializer.Deserialize(request); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { new ByteArrayContent(request.downloadHandler.data) }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) new MemoryStream(request.downloadHandler.data); + } + + InterceptResponse(request, path, options, configuration, ref responseData); + + return ToApiResponse(request, responseData); + } + } + + {{#supportsAsync}} + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("GET", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("POST", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("PUT", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("DELETE", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("HEAD", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("OPTIONS", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("PATCH", path, options, config), path, options, config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + #endregion ISynchronousClient + } +} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/ConnectionException.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/ConnectionException.mustache new file mode 100644 index 000000000..108ea3bf5 --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/ConnectionException.mustache @@ -0,0 +1,21 @@ +{{>partial_header}} + +using System; +using UnityEngine.Networking; + +namespace {{packageName}}.Client +{ + public class ConnectionException : Exception + { + public UnityWebRequest.Result Result { get; private set; } + public string Error { get; private set; } + + // NOTE: Cannot keep reference to the request since it will be disposed. + public ConnectionException(UnityWebRequest request) + : base($"result={request.result} error={request.error}") + { + Result = request.result; + Error = request.error ?? ""; + } + } +} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/README.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/README.mustache new file mode 100644 index 000000000..b0a140dd6 --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/README.mustache @@ -0,0 +1,175 @@ +# {{packageName}} - the C# library for the {{appName}} + +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- SDK version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} +- Build package: {{generatorClass}} +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + + +## Version support +This generator should support all current LTS versions of Unity +- Unity 2020.3 (LTS) and up +- .NET Standard 2.1 / .NET Framework + + +## Dependencies + +- [Newtonsoft.Json](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.0/manual/index.html) - 3.0.2 or later +- [Unity Test Framework](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/index.html) - 1.1.33 or later + + +## Installation +Add the dependencies to `Packages/manifest.json` +``` +{ + "dependencies": { + ... + "com.unity.nuget.newtonsoft-json": "3.0.2", + "com.unity.test-framework": "1.1.33", + } +} +``` + +Then use the namespaces: +```csharp +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; +``` + + +## Getting Started + +```csharp +using System; +using System.Collections.Generic; +using UnityEngine; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace {{packageName}}Example +{ +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} + public class {{operationId}}Example : MonoBehaviour + { + async void Start() + { + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + var apiInstance = new {{classname}}(config); + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}await apiInstance.{{{operationId}}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.Log(result);{{/returnType}} + Debug.Log("Done!"); + } + catch (ApiException e) + { + Debug.LogError("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + Debug.LogError("Status Code: "+ e.ErrorCode); + Debug.LogError(e.StackTrace); + } +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + + +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} + + +## Documentation for Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: Bearer Authentication +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/RequestOptions.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/RequestOptions.mustache new file mode 100644 index 000000000..0dd18c4ed --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/RequestOptions.mustache @@ -0,0 +1,60 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + Cookies = new List(); + } + } +} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/UnexpectedResponseException.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/UnexpectedResponseException.mustache new file mode 100644 index 000000000..a976b2a76 --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/UnexpectedResponseException.mustache @@ -0,0 +1,26 @@ +{{>partial_header}} + +using System; +using UnityEngine.Networking; + +namespace {{packageName}}.Client +{ + // Thrown when a backend doesn't return an expected response based on the expected type + // of the response data. + public class UnexpectedResponseException : Exception + { + public int ErrorCode { get; private set; } + + // NOTE: Cannot keep reference to the request since it will be disposed. + public UnexpectedResponseException(UnityWebRequest request, System.Type type, string extra = "") + : base(CreateMessage(request, type, extra)) + { + ErrorCode = (int)request.responseCode; + } + + private static string CreateMessage(UnityWebRequest request, System.Type type, string extra) + { + return $"httpcode={request.responseCode}, expected {type.Name} but got data: {extra}"; + } + } +} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/api.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/api.mustache new file mode 100644 index 000000000..189ebfea9 --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/api.mustache @@ -0,0 +1,690 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using {{packageName}}.Client; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + {{#notes}} + /// + /// {{.}} + /// + {{/notes}} + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/operation}} + #endregion Synchronous Operations + } + + {{#supportsAsync}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor + { + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + {{/operation}} + #endregion Asynchronous Operations + } + {{/supportsAsync}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : IDisposable, {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public {{classname}}() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public {{classname}}(string basePath) + { + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public {{classname}}({{packageName}}.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access.{{#supportsAsync}} + /// The client interface for asynchronous API access.{{/supportsAsync}} + /// The configuration object. + /// + public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + {{#supportsAsync}} + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + {{/supportsAsync}} + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + {{#supportsAsync}} + this.AsynchronousClient = asyncClient; + {{/supportsAsync}} + this.Configuration = configuration; + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public {{packageName}}.Client.ApiClient ApiClient { get; set; } = null; + + {{#supportsAsync}} + /// + /// The client for accessing this underlying API asynchronously. + /// + public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } + {{/supportsAsync}} + + /// + /// The client for accessing this underlying API synchronously. + /// + public {{packageName}}.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 {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.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; } + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var task = {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken); + {{#returnType}} +#if UNITY_EDITOR || !UNITY_WEBGL + {{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await task.ConfigureAwait(false); +#else + {{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await task; +#endif + return localVarResponse.Data; + {{/returnType}} + {{^returnType}} +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + {{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + + var task = this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/api_test.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/api_test.mustache new file mode 100644 index 000000000..0f7f49f7f --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/api_test.mustache @@ -0,0 +1,74 @@ +{{>partial_header}} +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using {{packageName}}.Client; +using {{packageName}}.{{apiPackage}}; +{{#hasImport}} +// uncomment below to import models +//using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.Test.Api +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class {{classname}}Tests : IDisposable + { + {{^nonPublicApi}} + private {{classname}} instance; + + {{/nonPublicApi}} + public {{classname}}Tests() + { + {{^nonPublicApi}} + instance = new {{classname}}(); + {{/nonPublicApi}} + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{operationId}}InstanceTest() + { + // TODO uncomment below to test 'IsType' {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + {{#operations}} + {{#operation}} + + /// + /// Test {{operationId}} + /// + [Test] + public void {{operationId}}Test() + { + // TODO uncomment below to test the method and replace null with proper value + {{#allParams}} + //{{{dataType}}} {{paramName}} = null; + {{/allParams}} + //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + //Assert.IsType<{{{.}}}>(response); + {{/returnType}} + } + {{/operation}} + {{/operations}} + } +} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/asmdef.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/asmdef.mustache new file mode 100644 index 000000000..a30cba8cc --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/asmdef.mustache @@ -0,0 +1,7 @@ +{ + "name": "{{packageName}}", + "overrideReferences": true, + "precompiledReferences": [ + "Newtonsoft.Json.dll" + ] +} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/asmdef_test.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/asmdef_test.mustache new file mode 100644 index 000000000..c5e2d5852 --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/asmdef_test.mustache @@ -0,0 +1,15 @@ +{ + "name": "{{testPackageName}}", + "references": [ + "{{packageName}}", + "UnityEngine.TestRunner" + ], + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll", + "Newtonsoft.Json.dll" + ], + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ] +} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/model.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/model.mustache new file mode 100644 index 000000000..3c1c6c0e2 --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/model.mustache @@ -0,0 +1,47 @@ +{{>partial_header}} + +{{#models}} +{{#model}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +{{#vendorExtensions.x-com-visible}} +using System.Runtime.InteropServices; +{{/vendorExtensions.x-com-visible}} +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +{{/model}} +{{/models}} +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/oneOf}} +{{#anyOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/anyOf}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/model_test.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/model_test.mustache new file mode 100644 index 000000000..404623281 --- /dev/null +++ b/sdks/dotnet/templates/libraries/unityWebRequest/model_test.mustache @@ -0,0 +1,64 @@ +{{>partial_header}} + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{modelPackage}}; +using {{packageName}}.{{clientPackage}}; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +{{#models}} +{{#model}} +namespace {{packageName}}.Test.Model +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class {{classname}}Tests : IDisposable + { + // TODO uncomment below to declare an instance variable for {{classname}} + //private {{classname}} instance; + + public {{classname}}Tests() + { + // TODO uncomment below to create an instance of {{classname}} + //instance = new {{classname}}(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{classname}}InstanceTest() + { + // TODO uncomment below to test "IsType" {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + + {{#vars}} + /// + /// Test the property '{{name}}' + /// + [Test] + public void {{name}}Test() + { + // TODO unit test for the property '{{name}}' + } + {{/vars}} + } +} +{{/model}} +{{/models}} diff --git a/sdks/dotnet/templates/modelAnyOf.mustache b/sdks/dotnet/templates/modelAnyOf.mustache index 7e318b309..f3eac973d 100644 --- a/sdks/dotnet/templates/modelAnyOf.mustache +++ b/sdks/dotnet/templates/modelAnyOf.mustache @@ -10,7 +10,7 @@ {{/vendorExtensions.x-com-visible}} [JsonConverter(typeof({{classname}}JsonConverter))] [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} { {{#isNullable}} /// @@ -18,12 +18,13 @@ /// public {{classname}}() { - this.IsNullable = true; - this.SchemaType= "anyOf"; + IsNullable = true; + SchemaType= "anyOf"; } {{/isNullable}} {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{^isNull}} /// /// Initializes a new instance of the class @@ -32,12 +33,13 @@ /// An instance of {{dataType}}. public {{classname}}({{{dataType}}} actualInstance) { - this.IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; + IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; + SchemaType= "anyOf"; + ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; } {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.anyOf}} private Object _actualInstance; @@ -56,7 +58,7 @@ {{#anyOf}} {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) { - this._actualInstance = value; + _actualInstance = value; } {{/anyOf}} else @@ -66,6 +68,7 @@ } } {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{^isNull}} /// @@ -75,9 +78,10 @@ /// An instance of {{dataType}} public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() { - return ({{{dataType}}})this.ActualInstance; + return ({{{dataType}}})ActualInstance; } {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.anyOf}} /// @@ -88,7 +92,7 @@ { var sb = new StringBuilder(); sb.Append("class {{classname}} {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -99,7 +103,7 @@ /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, {{classname}}.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, {{classname}}.SerializerSettings); } /// @@ -133,6 +137,7 @@ // no match found, throw an exception throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); } + {{#equatable}} /// /// Returns true if objects are equal @@ -145,7 +150,7 @@ return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; {{/useCompareNetObjects}} {{^useCompareNetObjects}} - return this.Equals(input as {{classname}}); + return Equals(input as {{classname}}); {{/useCompareNetObjects}} } @@ -163,7 +168,7 @@ if (input == null) return false; - return this.ActualInstance.Equals(input.ActualInstance); + return ActualInstance.Equals(input.ActualInstance); {{/useCompareNetObjects}} } @@ -176,11 +181,12 @@ unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } + {{/equatable}} {{#validatable}} /// @@ -221,11 +227,39 @@ /// The object converted from the JSON string public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { - if(reader.TokenType != JsonToken.Null) + switch(reader.TokenType) { - return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#isInteger}} + case JsonToken.Integer: + return new {{classname}}(Convert.ToInt32(reader.Value)); + {{/isInteger}} + {{#isNumber}} + case JsonToken.Float: + return new {{classname}}(Convert.ToDecimal(reader.Value)); + {{/isNumber}} + {{#isString}} + case JsonToken.String: + return new {{classname}}(Convert.ToString(reader.Value)); + {{/isString}} + {{#isBoolean}} + case JsonToken.Boolean: + return new {{classname}}(Convert.ToBoolean(reader.Value)); + {{/isBoolean}} + {{#isDate}} + case JsonToken.Date: + return new {{classname}}(Convert.ToDateTime(reader.Value)); + {{/isDate}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.anyOf}} + case JsonToken.StartObject: + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; } - return null; } /// diff --git a/sdks/dotnet/templates/modelEnum.mustache b/sdks/dotnet/templates/modelEnum.mustache index 514542d70..37fb53f5f 100644 --- a/sdks/dotnet/templates/modelEnum.mustache +++ b/sdks/dotnet/templates/modelEnum.mustache @@ -29,10 +29,157 @@ /// Enum {{name}} for value: {{value}} /// {{#isString}} + {{^useGenericHost}} + {{! EnumMember not currently supported in System.Text.Json, use a converter instead }} [EnumMember(Value = "{{{value}}}")] + {{/useGenericHost}} {{/isString}} - {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}} = {{-index}}{{/isString}}{{^-last}},{{/-last}} + {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} + {{^-last}} + {{/-last}} {{/enumVars}} {{/allowableValues}} - }{{! NOTE: This model's enumVars is modified to look like CodegenProperty}} + } + {{#useGenericHost}} + + /// + /// Converts to and from the JSON value + /// + public static class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} FromString(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? FromStringOrDefault(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static {{>EnumValueDataType}} ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} value) + { + {{^isString}} + return ({{>EnumValueDataType}}) value; + {{/isString}} + {{#isString}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isString}} + } + } + + /// + /// A Json converter for type + /// + /// + public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> + { + /// + /// Returns a {{datatypeWithEnum}} from the Json object + /// + /// + /// + /// + /// + public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string{{nrt?}} rawValue = reader.GetString(); + + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null + ? null + : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) + { + writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}?> + { + /// + /// Returns a {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} from the Json object + /// + /// + /// + /// + /// + public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string{{nrt?}} rawValue = reader.GetString(); + + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null + ? null + : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) + { + writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}?.ToString() ?? "null"); + } + } + {{/useGenericHost}} diff --git a/sdks/dotnet/templates/modelGeneric.mustache b/sdks/dotnet/templates/modelGeneric.mustache index c5dc0a64e..7392b272f 100644 --- a/sdks/dotnet/templates/modelGeneric.mustache +++ b/sdks/dotnet/templates/modelGeneric.mustache @@ -8,14 +8,21 @@ [ComVisible({{{vendorExtensions.x-com-visible}}})] {{/vendorExtensions.x-com-visible}} [DataContract(Name = "{{{name}}}")] + {{^useUnityWebRequest}} {{#discriminator}} [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] {{#mappedModels}} [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] {{/mappedModels}} {{/discriminator}} + {{/useUnityWebRequest}} +{{^useCustomTemplateCode}} + {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}} : .{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IOpenApiTyped, IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, IOpenApiTyped, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} +{{/useCustomTemplateCode}} { {{#vars}} {{#items.isEnum}} @@ -38,6 +45,9 @@ {{#description}} /// {{.}} {{/description}} + {{#example}} + /// {{.}} + {{/example}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} @@ -104,6 +114,9 @@ {{/conditionalSerialization}} {{/isEnum}} {{/vars}} +{{^useCustomTemplateCode}} + {{#hasRequired}} + {{^hasOnlyReadOnly}} /// /// Initializes a new instance of the class. /// @@ -117,47 +130,81 @@ this.AdditionalProperties = new Dictionary(); } {{/isAdditionalPropertiesTrue}} + {{/hasOnlyReadOnly}} + {{/hasRequired}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + {{^isAdditionalPropertiesTrue}} + protected {{classname}}() { } + {{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + protected {{classname}}() + { + this.AdditionalProperties = new Dictionary(); + } + {{/isAdditionalPropertiesTrue}} +{{/useCustomTemplateCode}} /// /// Initializes a new instance of the class. /// {{#readWriteVars}} - /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. + /// {{description}}{{^description}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. {{/readWriteVars}} {{#hasOnlyReadOnly}} [JsonConstructorAttribute] {{/hasOnlyReadOnly}} - public {{classname}}({{#readWriteVars}}{{#vendorExtensions.x-int-or-string}}Object{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{datatypeWithEnum}}}{{/vendorExtensions.x-int-or-string}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#vendorExtensions.x-int-or-string}}null{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#defaultValue}}{{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{/vendorExtensions.x-int-or-string}}{{^-last}}, {{/-last}}{{/readWriteVars}}) +{{^useCustomTemplateCode}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + public {{classname}}({{#readWriteVars}}{{#vendorExtensions.x-int-or-string}}Object{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{datatypeWithEnum}}}{{/vendorExtensions.x-int-or-string}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#vendorExtensions.x-int-or-string}}null{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{/vendorExtensions.x-int-or-string}}{{^-last}}, {{/-last}}{{/readWriteVars}}) { - {{#parent}}{{#parentVars}}this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/vendorExtensions.x-int-or-string}}; + {{#parent}}{{#parentVars}}this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/vendorExtensions.x-int-or-string}}; {{/parentVars}}{{/parent}} +{{/useCustomTemplateCode}} {{#vars}} {{^isInherited}} {{^isReadOnly}} {{#required}} {{^conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} - // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) + // to ensure "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" is required (not null) + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null) { - throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + throw new ArgumentNullException("{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} is a required property for {{classname}} and cannot be null"); } - this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/vendorExtensions.x-int-or-string}}; +{{^useCustomTemplateCode}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/vendorExtensions.x-int-or-string}}; +{{/useCustomTemplateCode}} {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/vendorExtensions.x-int-or-string}}; +{{^useCustomTemplateCode}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/vendorExtensions.x-int-or-string}}; +{{/useCustomTemplateCode}} {{/vendorExtensions.x-csharp-value-type}} {{/conditionalSerialization}} {{#conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} - // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) + // to ensure "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" is required (not null) + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null) { - throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + throw new ArgumentNullException("{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} is a required property for {{classname}} and cannot be null"); } - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; {{/vendorExtensions.x-csharp-value-type}} {{/conditionalSerialization}} {{/required}} @@ -171,20 +218,35 @@ {{#defaultValue}} {{^conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} - // use default value if no "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" provided - this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? {{{defaultValue}}}{{/vendorExtensions.x-int-or-string}}; + // use default value if no "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" provided +{{^useCustomTemplateCode}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} ?? {{#isString}}@{{/isString}}{{{defaultValue}}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} ?? {{{defaultValue}}}{{/vendorExtensions.x-int-or-string}}; +{{/useCustomTemplateCode}} {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/vendorExtensions.x-int-or-string}}; +{{^useCustomTemplateCode}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/vendorExtensions.x-int-or-string}}; +{{/useCustomTemplateCode}} {{/vendorExtensions.x-csharp-value-type}} {{/conditionalSerialization}} {{/defaultValue}} {{^defaultValue}} {{^conditionalSerialization}} - this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/vendorExtensions.x-int-or-string}}; +{{^useCustomTemplateCode}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/vendorExtensions.x-int-or-string}}; +{{/useCustomTemplateCode}} {{/conditionalSerialization}} {{#conditionalSerialization}} - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; if (this.{{name}} != null) { this._flag{{name}} = true; @@ -199,6 +261,7 @@ this.AdditionalProperties = new Dictionary(); {{/isAdditionalPropertiesTrue}} } +{{#useCustomTemplateCode}} {{^mappedModels}} /// @@ -217,6 +280,7 @@ return obj; } {{/mappedModels}} +{{/useCustomTemplateCode}} {{#vars}} {{^isInherited}} @@ -225,21 +289,33 @@ /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#isDate}} + {{^supportsDateOnly}} [JsonConverter(typeof(OpenAPIDateConverter))] + {{/supportsDateOnly}} {{/isDate}} {{#deprecated}} [Obsolete] {{/deprecated}} - {{^vendorExtensions.x-int-or-string}}public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{/vendorExtensions.x-int-or-string}}{{#vendorExtensions.x-int-or-string}}public object {{name}} { - get => this._{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - set => this._{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = Convert.ToString(value); +{{^useCustomTemplateCode}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + {{^vendorExtensions.x-int-or-string}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + {{/vendorExtensions.x-int-or-string}} + {{#vendorExtensions.x-int-or-string}}public object {{name}} { + get => this._{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; + set => this._{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = Convert.ToString(value); } - private string _{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}};{{/vendorExtensions.x-int-or-string}} - + private string _{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};{{/vendorExtensions.x-int-or-string}} +{{/useCustomTemplateCode}} {{#isReadOnly}} /// /// Returns false as {{name}} should not be serialized given that it's read-only. @@ -341,6 +417,7 @@ { return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } +{{! CUSTOM - remove #equatable }} /// /// Returns true if objects are equal @@ -429,7 +506,12 @@ return hashCode; } } +{{! CUSTOM - remove /equatable }} +{{#validatable}} +{{>validatable}} +{{/validatable}} +{{#useCustomTemplateCode}} public List GetOpenApiTypes() { var types = new List(); @@ -444,8 +526,5 @@ return types; } - -{{#validatable}} -{{>validatable}} -{{/validatable}} +{{/useCustomTemplateCode}} } diff --git a/sdks/dotnet/templates/modelInnerEnum.mustache b/sdks/dotnet/templates/modelInnerEnum.mustache index f879f022d..462ded84d 100644 --- a/sdks/dotnet/templates/modelInnerEnum.mustache +++ b/sdks/dotnet/templates/modelInnerEnum.mustache @@ -17,12 +17,83 @@ /// /// Enum {{name}} for value: {{value}} /// + {{^useGenericHost}} {{#isString}} [EnumMember(Value = "{{{value}}}")] {{/isString}} - {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}} = {{-index}}{{/isString}}{{^-last}},{{/-last}} + {{/useGenericHost}} + {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} + {{^-last}} + {{/-last}} {{/enumVars}} {{/allowableValues}} } - {{/isContainer}} + {{#useGenericHost}} + + /// + /// Returns a + /// + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromString(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromStringOrDefault(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + {{#isString}} + /// + {{/isString}} + public static {{>EnumValueDataType}}{{#lambda.first}}{{#nrt}}{{#isString}}{{#isNullable}}{{nrt?}} {{^nrt}}{{#vendorExtensions.x-is-value-type}}? {{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}}{{/isString}}{{/nrt}}{{/lambda.first}} {{datatypeWithEnum}}ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#isString}}{{>NullConditionalProperty}}{{/isString}} value) + { + {{^isString}} + return ({{>EnumValueDataType}}) value; + {{/isString}} + {{#isString}} + {{#isNullable}} + if (value == null) + return null; + + {{/isNullable}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isString}} + } + {{/useGenericHost}} + {{/isContainer}} \ No newline at end of file diff --git a/sdks/dotnet/templates/modelOneOf.mustache b/sdks/dotnet/templates/modelOneOf.mustache index a7756c160..ab42e4eef 100644 --- a/sdks/dotnet/templates/modelOneOf.mustache +++ b/sdks/dotnet/templates/modelOneOf.mustache @@ -10,7 +10,7 @@ {{/vendorExtensions.x-com-visible}} [JsonConverter(typeof({{classname}}JsonConverter))] [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : {{#lambda.joinWithComma}}AbstractOpenAPISchema {{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} { {{#isNullable}} /// @@ -24,6 +24,7 @@ {{/isNullable}} {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{^isNull}} /// /// Initializes a new instance of the class @@ -38,6 +39,7 @@ } {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} private Object _actualInstance; @@ -54,7 +56,7 @@ set { {{#oneOf}} - {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) + {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}}) || value is {{{.}}}) { this._actualInstance = value; } @@ -66,6 +68,7 @@ } } {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{^isNull}} /// @@ -78,6 +81,7 @@ return ({{{dataType}}})this.ActualInstance; } {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} /// @@ -172,13 +176,14 @@ } else if (match > 1) { - throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + String.Join(",", matchedTypes)); } // deserialization is considered successful at this point if no exception has been thrown. return new{{classname}}; } + {{#equatable}} /// /// Returns true if objects are equal /// @@ -226,8 +231,9 @@ return hashCode; } } - + {{/equatable}} {{#validatable}} + /// /// To validate all properties of the instance /// @@ -266,11 +272,39 @@ /// The object converted from the JSON string public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { - if(reader.TokenType != JsonToken.Null) + switch(reader.TokenType) { - return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#isInteger}} + case JsonToken.Integer: + return new {{classname}}(Convert.ToInt32(reader.Value)); + {{/isInteger}} + {{#isNumber}} + case JsonToken.Float: + return new {{classname}}(Convert.ToDecimal(reader.Value)); + {{/isNumber}} + {{#isString}} + case JsonToken.String: + return new {{classname}}(Convert.ToString(reader.Value)); + {{/isString}} + {{#isBoolean}} + case JsonToken.Boolean: + return new {{classname}}(Convert.ToBoolean(reader.Value)); + {{/isBoolean}} + {{#isDate}} + case JsonToken.Date: + return new {{classname}}(Convert.ToDateTime(reader.Value)); + {{/isDate}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + case JsonToken.StartObject: + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; } - return null; } /// diff --git a/sdks/dotnet/templates/model_doc.mustache b/sdks/dotnet/templates/model_doc.mustache index 9e73307d2..7dd060c70 100644 --- a/sdks/dotnet/templates/model_doc.mustache +++ b/sdks/dotnet/templates/model_doc.mustache @@ -10,11 +10,21 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- {{#parent}} {{#parentVars}} +{{^useCustomTemplateCode}} +**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/useCustomTemplateCode}} {{/parentVars}} {{/parent}} -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{^useCustomTemplateCode}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}{{/vars}} +{{/useCustomTemplateCode}} [[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) diff --git a/sdks/dotnet/templates/model_test.mustache b/sdks/dotnet/templates/model_test.mustache index b4aefe510..1feaeb9d8 100644 --- a/sdks/dotnet/templates/model_test.mustache +++ b/sdks/dotnet/templates/model_test.mustache @@ -6,11 +6,12 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using {{packageName}}.{{apiPackage}}; using {{packageName}}.{{modelPackage}}; -using {{packageName}}.Client; +using {{packageName}}.{{clientPackage}}; using System.Reflection; +{{^useGenericHost}} using Newtonsoft.Json; +{{/useGenericHost}} {{#models}} {{#model}} @@ -39,6 +40,8 @@ namespace {{packageName}}.Test.Model // Cleanup when everything is done. } + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.trimLineBreaks}} /// /// Test an instance of {{classname}} /// @@ -51,6 +54,7 @@ namespace {{packageName}}.Test.Model {{#discriminator}} {{#children}} + /// /// Test deserialize a {{classname}} from type {{parent}} /// @@ -60,10 +64,12 @@ namespace {{packageName}}.Test.Model // TODO uncomment below to test deserialize a {{classname}} from type {{parent}} //Assert.IsType<{{parent}}>(JsonConvert.DeserializeObject<{{parent}}>(new {{classname}}().ToJson())); } + {{/children}} {{/discriminator}} - {{#vars}} + + /// /// Test the property '{{name}}' /// @@ -73,9 +79,9 @@ namespace {{packageName}}.Test.Model // TODO unit test for the property '{{name}}' } {{/vars}} - + {{/lambda.trimLineBreaks}} + {{/lambda.trimTrailingWithNewLine}} } - } {{/model}} {{/models}} diff --git a/sdks/dotnet/templates/netcore_project.additions.mustache b/sdks/dotnet/templates/netcore_project.additions.mustache new file mode 100644 index 000000000..8c6f3ad52 --- /dev/null +++ b/sdks/dotnet/templates/netcore_project.additions.mustache @@ -0,0 +1 @@ +{{! if needed users can add this file to their templates folder to append to the csproj }} \ No newline at end of file diff --git a/sdks/dotnet/templates/netcore_project.mustache b/sdks/dotnet/templates/netcore_project.mustache index 0bacbadeb..01717e65a 100644 --- a/sdks/dotnet/templates/netcore_project.mustache +++ b/sdks/dotnet/templates/netcore_project.mustache @@ -11,41 +11,84 @@ {{packageCompany}} {{packageTitle}} {{packageDescription}} + {{packageCopyright}} {{packageName}} {{packageVersion}} bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} {{.}}{{/licenseId}} +{{^useCustomTemplateCode}} + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} https://github.com/hellosign/dropbox-sign-dotnet.git +{{/useCustomTemplateCode}} git{{#releaseNote}} {{.}}{{/releaseNote}}{{#packageTags}} {{{.}}}{{/packageTags}}{{#nrt}} {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} + false {{#useCompareNetObjects}} - + {{/useCompareNetObjects}} {{^useGenericHost}} - - + + + {{/useGenericHost}} + {{#useRestSharp}} +{{^useCustomTemplateCode}} + +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + +{{/useCustomTemplateCode}} + {{/useRestSharp}} + {{#useGenericHost}} + + + {{#supportsRetry}} + + {{/supportsRetry}} + {{#net80OrLater}} + + {{/net80OrLater}} + {{^net60OrLater}} + + {{#net47OrLater}} + + {{/net47OrLater}} + {{/net60OrLater}} + {{/useGenericHost}} + {{^useGenericHost}} + {{#supportsRetry}} + + {{/supportsRetry}} {{/useGenericHost}} - {{#useRestSharp}} - - {{/useRestSharp}} - {{#useGenericHost}} - - - {{#supportsRetry}} - - {{/supportsRetry}} - {{/useGenericHost}} - {{#supportsRetry}} - - {{/supportsRetry}} {{#validatable}} + {{^net60OrLater}} + {{/net60OrLater}} {{/validatable}} - +{{^useGenericHost}} + + {{^net60OrLater}} + + {{/net60OrLater}} + {{#net48}} + + {{/net48}} + + + {{^net60OrLater}} + + {{/net60OrLater}} + {{#net48}} + + {{/net48}} + +{{/useGenericHost}} +{{>netcore_project.additions}} diff --git a/sdks/dotnet/templates/netcore_testproject.additions.mustache b/sdks/dotnet/templates/netcore_testproject.additions.mustache new file mode 100644 index 000000000..8c6f3ad52 --- /dev/null +++ b/sdks/dotnet/templates/netcore_testproject.additions.mustache @@ -0,0 +1 @@ +{{! if needed users can add this file to their templates folder to append to the csproj }} \ No newline at end of file diff --git a/sdks/dotnet/templates/netcore_testproject.mustache b/sdks/dotnet/templates/netcore_testproject.mustache index 329b98218..90d11eb82 100644 --- a/sdks/dotnet/templates/netcore_testproject.mustache +++ b/sdks/dotnet/templates/netcore_testproject.mustache @@ -9,13 +9,12 @@ - - - + + + - - +{{>netcore_testproject.additions}} diff --git a/sdks/dotnet/templates/nuspec.mustache b/sdks/dotnet/templates/nuspec.mustache index b8ef5a00d..b473cbd64 100644 --- a/sdks/dotnet/templates/nuspec.mustache +++ b/sdks/dotnet/templates/nuspec.mustache @@ -30,19 +30,24 @@ - + {{#useRestSharp}} - +{{^useCustomTemplateCode}} + +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + +{{/useCustomTemplateCode}} {{/useRestSharp}} {{#useCompareNetObjects}} {{/useCompareNetObjects}} - + {{#validatable}} {{/validatable}} {{#supportsRetry}} - + {{/supportsRetry}} diff --git a/sdks/dotnet/templates/openapi.mustache b/sdks/dotnet/templates/openapi.mustache new file mode 100644 index 000000000..34fbb53f3 --- /dev/null +++ b/sdks/dotnet/templates/openapi.mustache @@ -0,0 +1 @@ +{{{openapi-yaml}}} diff --git a/sdks/dotnet/templates/validatable.mustache b/sdks/dotnet/templates/validatable.mustache index 6322bf599..140ff9217 100644 --- a/sdks/dotnet/templates/validatable.mustache +++ b/sdks/dotnet/templates/validatable.mustache @@ -4,7 +4,7 @@ /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -14,22 +14,48 @@ /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { {{/discriminator}} {{^discriminator}} + {{#parent}} /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + {{/parent}} + {{^parent}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + {{/parent}} {{/discriminator}} {{#parent}} {{^isArray}} {{^isMap}} +{{^useCustomTemplateCode}} + foreach (var x in {{#discriminator}}base.{{/discriminator}}BaseValidate(validationContext)) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} foreach (var x in BaseValidate(validationContext)) +{{/useCustomTemplateCode}} { yield return x; } @@ -43,7 +69,7 @@ // {{{name}}} ({{{dataType}}}) maxLength if (this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); } {{/maxLength}} @@ -51,35 +77,60 @@ // {{{name}}} ({{{dataType}}}) minLength if (this.{{{name}}} != null && this.{{{name}}}.Length < {{minLength}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); } {{/minLength}} {{#maximum}} // {{{name}}} ({{{dataType}}}) maximum - if (this.{{{name}}} > ({{{dataType}}}){{maximum}}) + if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} {{#exclusiveMaximum}}<={{/exclusiveMaximum}}{{^exclusiveMaximum}}>{{/exclusiveMaximum}} ({{{dataType}}}){{maximum}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value less than or equal to {{maximum}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.", new [] { "{{{name}}}" }); } {{/maximum}} {{#minimum}} // {{{name}}} ({{{dataType}}}) minimum - if (this.{{{name}}} < ({{{dataType}}}){{minimum}}) + if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} {{#exclusiveMaximum}}>={{/exclusiveMaximum}}{{^exclusiveMaximum}}<{{/exclusiveMaximum}} ({{{dataType}}}){{minimum}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value greater than or equal to {{minimum}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.", new [] { "{{{name}}}" }); } {{/minimum}} {{#pattern}} {{^isByteArray}} - // {{{name}}} ({{{dataType}}}) pattern - Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); - if (false == regex{{{name}}}.Match(this.{{{name}}}).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); + {{#vendorExtensions.x-is-value-type}} + {{#isNullable}} + if (this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null){ + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>ValidateRegex}} + {{/lambda.indent4}} + + {{/lambda.trimTrailingWithNewLine}} + } + + {{/isNullable}} + {{^isNullable}} + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent3}} + {{>ValidateRegex}} + {{/lambda.indent3}} + + {{/lambda.trimTrailingWithNewLine}} + {{/isNullable}} + {{/vendorExtensions.x-is-value-type}} + {{^vendorExtensions.x-is-value-type}} + if (this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null) { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>ValidateRegex}} + {{/lambda.indent4}} + + {{/lambda.trimTrailingWithNewLine}} } + {{/vendorExtensions.x-is-value-type}} {{/isByteArray}} {{/pattern}} {{/isEnum}} diff --git a/sdks/java-v1/.gitignore b/sdks/java-v1/.gitignore index b6717f0ee..e275017bf 100644 --- a/sdks/java-v1/.gitignore +++ b/sdks/java-v1/.gitignore @@ -8,8 +8,6 @@ *.war *.ear -# exclude jar for gradle wrapper -!gradle/wrapper/*.jar # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* @@ -18,12 +16,11 @@ hs_err_pid* **/target target .gradle -build/ +build .composer vendor - -# Intellij .idea/ - .openapi-generator +.github/workflows/maven.yml +gradle diff --git a/sdks/java-v1/README.md b/sdks/java-v1/README.md index 228374aac..b78da75be 100644 --- a/sdks/java-v1/README.md +++ b/sdks/java-v1/README.md @@ -55,7 +55,7 @@ Add this dependency to your project's POM: com.dropbox.sign dropbox-sign - 1.5-dev + 1.6-dev compile ``` @@ -71,7 +71,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.dropbox.sign:dropbox-sign:1.5-dev" + implementation "com.dropbox.sign:dropbox-sign:1.6-dev" } ``` @@ -85,7 +85,7 @@ mvn clean package Then manually install the following JARs: -- `target/dropbox-sign-1.5-dev.jar` +- `target/dropbox-sign-1.6-dev.jar` - `target/lib/*.jar` ## Getting Started @@ -132,31 +132,30 @@ public class Example { ``` - ## Using a Proxy +## Using a Proxy - To add a HTTP proxy for the API client, use `ClientConfig`: +To add a HTTP proxy for the API client, use `ClientConfig`: +```java + +import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import com.dropbox.sign.*; +import com.dropbox.sign.api.AccountApi; - ```java - - import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; - import org.glassfish.jersey.client.ClientConfig; - import org.glassfish.jersey.client.ClientProperties; - import com.dropbox.sign.*; - import com.dropbox.sign.api.AccountApi; +... - ... +ApiClient defaultClient = Configuration.getDefaultApiClient(); +ClientConfig clientConfig = defaultClient.getClientConfig(); +clientConfig.connectorProvider(new ApacheConnectorProvider()); +clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); +clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); +clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); +defaultClient.setClientConfig(clientConfig); - ApiClient defaultClient = Configuration.getDefaultApiClient(); - ClientConfig clientConfig = defaultClient.getClientConfig(); - clientConfig.connectorProvider(new ApacheConnectorProvider()); - clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); - clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); - clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); - defaultClient.setClientConfig(clientConfig); +AccountApi apiInstance = new AccountApi(defaultClient); - AccountApi apiInstance = new AccountApi(defaultClient); - - ``` +``` ## Documentation for API Endpoints @@ -178,6 +177,13 @@ 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 +*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 +*FaxLineApi* | [**faxLineDelete**](docs/FaxLineApi.md#faxLineDelete) | **DELETE** /fax_line | Delete Fax Line +*FaxLineApi* | [**faxLineGet**](docs/FaxLineApi.md#faxLineGet) | **GET** /fax_line | Get Fax Line +*FaxLineApi* | [**faxLineList**](docs/FaxLineApi.md#faxLineList) | **GET** /fax_line/list | List Fax Lines +*FaxLineApi* | [**faxLineRemoveUser**](docs/FaxLineApi.md#faxLineRemoveUser) | **PUT** /fax_line/remove_user | Remove Fax Line Access *OAuthApi* | [**oauthTokenGenerate**](docs/OAuthApi.md#oauthTokenGenerate) | **POST** /oauth/token | OAuth Token Generate *OAuthApi* | [**oauthTokenRefresh**](docs/OAuthApi.md#oauthTokenRefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh *ReportApi* | [**reportCreate**](docs/ReportApi.md#reportCreate) | **POST** /report/create | Create Report @@ -260,6 +266,17 @@ Class | Method | HTTP request | Description - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) + - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) + - [FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) + - [FaxLineAreaCodeGetResponse](docs/FaxLineAreaCodeGetResponse.md) + - [FaxLineAreaCodeGetStateEnum](docs/FaxLineAreaCodeGetStateEnum.md) + - [FaxLineCreateRequest](docs/FaxLineCreateRequest.md) + - [FaxLineDeleteRequest](docs/FaxLineDeleteRequest.md) + - [FaxLineListResponse](docs/FaxLineListResponse.md) + - [FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) + - [FaxLineResponse](docs/FaxLineResponse.md) + - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) @@ -400,18 +417,22 @@ Class | Method | HTTP request | Description - [WarningResponse](docs/WarningResponse.md) + ## Documentation for Authorization + Authentication schemes defined for the API: + ### api_key - **Type**: HTTP basic authentication + ### oauth2 -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ## Recommendation @@ -428,7 +449,7 @@ apisupport@hellosign.com This Java package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: `3.0.0` - - Package version: `1.5-dev` + - Package version: `1.6-dev` - Build package: `org.openapitools.codegen.languages.JavaClientCodegen` diff --git a/sdks/java-v1/VERSION b/sdks/java-v1/VERSION index 6f3dd2f48..78ca9a102 100644 --- a/sdks/java-v1/VERSION +++ b/sdks/java-v1/VERSION @@ -1 +1 @@ -1.5-dev +1.6-dev diff --git a/sdks/java-v1/build.gradle b/sdks/java-v1/build.gradle index 5c563d2ab..723287efa 100644 --- a/sdks/java-v1/build.gradle +++ b/sdks/java-v1/build.gradle @@ -1,11 +1,12 @@ + buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' } } @@ -20,7 +21,7 @@ apply plugin: 'signing' group = 'com.dropbox.sign' archivesBaseName = 'dropbox-sign' -version = '1.5-dev' +version = '1.6-dev' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -115,13 +116,12 @@ publishing { } ext { - swagger_annotations_version = "1.6.3" - jackson_version = "2.13.0" - jackson_databind_version = "2.13.0" + swagger_annotations_version = "1.6.5" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" - junit_version = "4.13.2" - threetenbp_version = "2.9.10" + junit_version = "5.8.2" mockito_version = "3.12.4" } @@ -138,12 +138,16 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" testImplementation "org.mockito:mockito-core:$mockito_version" } +test { + useJUnitPlatform() +} + javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] } diff --git a/sdks/java-v1/build.sbt b/sdks/java-v1/build.sbt index 391a42952..9c367c976 100644 --- a/sdks/java-v1/build.sbt +++ b/sdks/java-v1/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.dropbox.sign", name := "dropbox-sign", - version := "1.5-dev", + version := "1.6-dev", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), Compile / javacOptions ++= Seq("-Xlint:deprecation"), @@ -11,19 +11,17 @@ lazy val root = (project in file(".")). libraryDependencies ++= Seq( libraryDependencies += "commons-codec" % "commons-codec" % "1.15" "com.google.code.findbugs" % "jsr305" % "3.0.0", - "io.swagger" % "swagger-annotations" % "1.6.3", + "io.swagger" % "swagger-annotations" % "1.6.5", "org.glassfish.jersey.core" % "jersey-client" % "2.35", "org.glassfish.jersey.inject" % "jersey-hk2" % "2.35", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/sdks/java-v1/docs/AccountApi.md b/sdks/java-v1/docs/AccountApi.md index 6f258c3f7..494853dda 100644 --- a/sdks/java-v1/docs/AccountApi.md +++ b/sdks/java-v1/docs/AccountApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**accountCreate**](AccountApi.md#accountCreate) | **POST** /account/create | Create Account [**accountGet**](AccountApi.md#accountGet) | **GET** /account | Get Account [**accountUpdate**](AccountApi.md#accountUpdate) | **PUT** /account | Update Account @@ -62,8 +62,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountCreateRequest** | [**AccountCreateRequest**](AccountCreateRequest.md)| | ### Return type @@ -134,8 +134,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountId** | **String**| `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. | [optional] **emailAddress** | **String**| `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. | [optional] @@ -210,8 +210,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountUpdateRequest** | [**AccountUpdateRequest**](AccountUpdateRequest.md)| | ### Return type @@ -285,8 +285,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountVerifyRequest** | [**AccountVerifyRequest**](AccountVerifyRequest.md)| | ### Return type diff --git a/sdks/java-v1/docs/AccountCreateRequest.md b/sdks/java-v1/docs/AccountCreateRequest.md index a10ed0814..9c75292a7 100644 --- a/sdks/java-v1/docs/AccountCreateRequest.md +++ b/sdks/java-v1/docs/AccountCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```String``` | The email address which will be associated with the new Account. | | | `clientId` | ```String``` | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | | | `clientSecret` | ```String``` | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | | diff --git a/sdks/java-v1/docs/AccountCreateResponse.md b/sdks/java-v1/docs/AccountCreateResponse.md index 59279d18d..7e09def2b 100644 --- a/sdks/java-v1/docs/AccountCreateResponse.md +++ b/sdks/java-v1/docs/AccountCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `account` | [```AccountResponse```](AccountResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `oauthData` | [```OAuthTokenResponse```](OAuthTokenResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/AccountGetResponse.md b/sdks/java-v1/docs/AccountGetResponse.md index 41508ab37..f5ed78b06 100644 --- a/sdks/java-v1/docs/AccountGetResponse.md +++ b/sdks/java-v1/docs/AccountGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `account` | [```AccountResponse```](AccountResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/AccountResponse.md b/sdks/java-v1/docs/AccountResponse.md index e76348752..5b73aa02d 100644 --- a/sdks/java-v1/docs/AccountResponse.md +++ b/sdks/java-v1/docs/AccountResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The ID of the Account | | | `emailAddress` | ```String``` | The email address associated with the Account. | | | `isLocked` | ```Boolean``` | Returns `true` if the user has been locked out of their account by a team admin. | | diff --git a/sdks/java-v1/docs/AccountResponseQuotas.md b/sdks/java-v1/docs/AccountResponseQuotas.md index c591ff814..3b7fe4e58 100644 --- a/sdks/java-v1/docs/AccountResponseQuotas.md +++ b/sdks/java-v1/docs/AccountResponseQuotas.md @@ -6,8 +6,8 @@ Details concerning remaining monthly quotas. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `apiSignatureRequestsLeft` | ```Integer``` | API signature requests remaining. | | | `documentsLeft` | ```Integer``` | Signature requests remaining. | | | `templatesTotal` | ```Integer``` | Total API templates allowed. | | diff --git a/sdks/java-v1/docs/AccountResponseUsage.md b/sdks/java-v1/docs/AccountResponseUsage.md index f9f367135..1cdb76629 100644 --- a/sdks/java-v1/docs/AccountResponseUsage.md +++ b/sdks/java-v1/docs/AccountResponseUsage.md @@ -6,8 +6,8 @@ Details concerning monthly usage ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `faxPagesSent` | ```Integer``` | Number of fax pages sent | | diff --git a/sdks/java-v1/docs/AccountUpdateRequest.md b/sdks/java-v1/docs/AccountUpdateRequest.md index d1dac210e..43121c890 100644 --- a/sdks/java-v1/docs/AccountUpdateRequest.md +++ b/sdks/java-v1/docs/AccountUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The ID of the Account | | | `callbackUrl` | ```String``` | The URL that Dropbox Sign should POST events to. | | | `locale` | ```String``` | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | | diff --git a/sdks/java-v1/docs/AccountVerifyRequest.md b/sdks/java-v1/docs/AccountVerifyRequest.md index de912c5d4..d14a8eb2b 100644 --- a/sdks/java-v1/docs/AccountVerifyRequest.md +++ b/sdks/java-v1/docs/AccountVerifyRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```String``` | Email address to run the verification for. | | diff --git a/sdks/java-v1/docs/AccountVerifyResponse.md b/sdks/java-v1/docs/AccountVerifyResponse.md index 07f01ffd1..8868f15b2 100644 --- a/sdks/java-v1/docs/AccountVerifyResponse.md +++ b/sdks/java-v1/docs/AccountVerifyResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `account` | [```AccountVerifyResponseAccount```](AccountVerifyResponseAccount.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/AccountVerifyResponseAccount.md b/sdks/java-v1/docs/AccountVerifyResponseAccount.md index efa24dcb4..f83f9f0eb 100644 --- a/sdks/java-v1/docs/AccountVerifyResponseAccount.md +++ b/sdks/java-v1/docs/AccountVerifyResponseAccount.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress` | ```String``` | The email address associated with the Account. | | diff --git a/sdks/java-v1/docs/ApiAppApi.md b/sdks/java-v1/docs/ApiAppApi.md index a22cd2e7c..02630c9d7 100644 --- a/sdks/java-v1/docs/ApiAppApi.md +++ b/sdks/java-v1/docs/ApiAppApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**apiAppCreate**](ApiAppApi.md#apiAppCreate) | **POST** /api_app | Create API App [**apiAppDelete**](ApiAppApi.md#apiAppDelete) | **DELETE** /api_app/{client_id} | Delete API App [**apiAppGet**](ApiAppApi.md#apiAppGet) | **GET** /api_app/{client_id} | Get API App @@ -80,8 +80,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **apiAppCreateRequest** | [**ApiAppCreateRequest**](ApiAppCreateRequest.md)| | ### Return type @@ -152,8 +152,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **clientId** | **String**| The client id of the API App to delete. | ### Return type @@ -226,8 +226,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **clientId** | **String**| The client id of the API App to retrieve. | ### Return type @@ -301,8 +301,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **page** | **Integer**| Which page number of the API App List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -396,8 +396,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **clientId** | **String**| The client id of the API App to update. | **apiAppUpdateRequest** | [**ApiAppUpdateRequest**](ApiAppUpdateRequest.md)| | diff --git a/sdks/java-v1/docs/ApiAppCreateRequest.md b/sdks/java-v1/docs/ApiAppCreateRequest.md index 59c20286d..b787bc7c0 100644 --- a/sdks/java-v1/docs/ApiAppCreateRequest.md +++ b/sdks/java-v1/docs/ApiAppCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `domains`*_required_ | ```List``` | The domain names the ApiApp will be associated with. | | | `name`*_required_ | ```String``` | The name you want to assign to the ApiApp. | | | `callbackUrl` | ```String``` | The URL at which the ApiApp should receive event callbacks. | | diff --git a/sdks/java-v1/docs/ApiAppGetResponse.md b/sdks/java-v1/docs/ApiAppGetResponse.md index b90c30a5f..98e2f98d6 100644 --- a/sdks/java-v1/docs/ApiAppGetResponse.md +++ b/sdks/java-v1/docs/ApiAppGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `apiApp` | [```ApiAppResponse```](ApiAppResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `apiApp`*_required_ | [```ApiAppResponse```](ApiAppResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/ApiAppListResponse.md b/sdks/java-v1/docs/ApiAppListResponse.md index 144b0f45b..14c287f97 100644 --- a/sdks/java-v1/docs/ApiAppListResponse.md +++ b/sdks/java-v1/docs/ApiAppListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `apiApps` | [```List```](ApiAppResponse.md) | Contains information about API Apps. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `apiApps`*_required_ | [```List```](ApiAppResponse.md) | Contains information about API Apps. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/ApiAppResponse.md b/sdks/java-v1/docs/ApiAppResponse.md index bb0836dbf..afe95c850 100644 --- a/sdks/java-v1/docs/ApiAppResponse.md +++ b/sdks/java-v1/docs/ApiAppResponse.md @@ -6,8 +6,8 @@ Contains information about an API App. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The app's callback URL (for events) | | | `clientId` | ```String``` | The app's client id | | | `createdAt` | ```Integer``` | The time that the app was created | | diff --git a/sdks/java-v1/docs/ApiAppResponseOAuth.md b/sdks/java-v1/docs/ApiAppResponseOAuth.md index 20c678a7b..c2f705c7a 100644 --- a/sdks/java-v1/docs/ApiAppResponseOAuth.md +++ b/sdks/java-v1/docs/ApiAppResponseOAuth.md @@ -6,8 +6,8 @@ An object describing the app's OAuth properties, or null if OAuth is not con ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The app's OAuth callback URL. | | | `secret` | ```String``` | The app's OAuth secret, or null if the app does not belong to user. | | | `scopes` | ```List``` | Array of OAuth scopes used by the app. | | diff --git a/sdks/java-v1/docs/ApiAppResponseOptions.md b/sdks/java-v1/docs/ApiAppResponseOptions.md index 827b3b51a..07979f387 100644 --- a/sdks/java-v1/docs/ApiAppResponseOptions.md +++ b/sdks/java-v1/docs/ApiAppResponseOptions.md @@ -6,8 +6,8 @@ An object with options that override account settings. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `canInsertEverywhere` | ```Boolean``` | Boolean denoting if signers can "Insert Everywhere" in one click while signing a document | | diff --git a/sdks/java-v1/docs/ApiAppResponseOwnerAccount.md b/sdks/java-v1/docs/ApiAppResponseOwnerAccount.md index 0ac35eec2..b4d6d4249 100644 --- a/sdks/java-v1/docs/ApiAppResponseOwnerAccount.md +++ b/sdks/java-v1/docs/ApiAppResponseOwnerAccount.md @@ -6,8 +6,8 @@ An object describing the app's owner ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The owner account's ID | | | `emailAddress` | ```String``` | The owner account's email address | | diff --git a/sdks/java-v1/docs/ApiAppResponseWhiteLabelingOptions.md b/sdks/java-v1/docs/ApiAppResponseWhiteLabelingOptions.md index 1ed534a0c..be6d022fd 100644 --- a/sdks/java-v1/docs/ApiAppResponseWhiteLabelingOptions.md +++ b/sdks/java-v1/docs/ApiAppResponseWhiteLabelingOptions.md @@ -6,8 +6,8 @@ An object with options to customize the app's signer page ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `headerBackgroundColor` | ```String``` | | | | `legalVersion` | ```String``` | | | | `linkColor` | ```String``` | | | diff --git a/sdks/java-v1/docs/ApiAppUpdateRequest.md b/sdks/java-v1/docs/ApiAppUpdateRequest.md index 62bc8fd75..1c0efafdc 100644 --- a/sdks/java-v1/docs/ApiAppUpdateRequest.md +++ b/sdks/java-v1/docs/ApiAppUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The URL at which the API App should receive event callbacks. | | | `customLogoFile` | ```File``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | | `domains` | ```List``` | The domain names the ApiApp will be associated with. | | diff --git a/sdks/java-v1/docs/BulkSendJobApi.md b/sdks/java-v1/docs/BulkSendJobApi.md index c369376b6..5d7335a12 100644 --- a/sdks/java-v1/docs/BulkSendJobApi.md +++ b/sdks/java-v1/docs/BulkSendJobApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**bulkSendJobGet**](BulkSendJobApi.md#bulkSendJobGet) | **GET** /bulk_send_job/{bulk_send_job_id} | Get Bulk Send Job [**bulkSendJobList**](BulkSendJobApi.md#bulkSendJobList) | **GET** /bulk_send_job/list | List Bulk Send Jobs @@ -59,8 +59,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **bulkSendJobId** | **String**| The id of the BulkSendJob to retrieve. | **page** | **Integer**| Which page number of the BulkSendJob list to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. | [optional] [default to 20] @@ -136,8 +136,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **page** | **Integer**| Which page number of the BulkSendJob List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. | [optional] [default to 20] diff --git a/sdks/java-v1/docs/BulkSendJobGetResponse.md b/sdks/java-v1/docs/BulkSendJobGetResponse.md index 977a108f8..93395ee2d 100644 --- a/sdks/java-v1/docs/BulkSendJobGetResponse.md +++ b/sdks/java-v1/docs/BulkSendJobGetResponse.md @@ -6,11 +6,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `bulkSendJob` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `signatureRequests` | [```List```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `bulkSendJob`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `signatureRequests`*_required_ | [```List```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/BulkSendJobGetResponseSignatureRequests.md b/sdks/java-v1/docs/BulkSendJobGetResponseSignatureRequests.md index 8cf2c0b4c..ba283afd8 100644 --- a/sdks/java-v1/docs/BulkSendJobGetResponseSignatureRequests.md +++ b/sdks/java-v1/docs/BulkSendJobGetResponseSignatureRequests.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `testMode` | ```Boolean``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | | | `signatureRequestId` | ```String``` | The id of the SignatureRequest. | | | `requesterEmailAddress` | ```String``` | The email address of the initiator of the SignatureRequest. | | diff --git a/sdks/java-v1/docs/BulkSendJobListResponse.md b/sdks/java-v1/docs/BulkSendJobListResponse.md index f0ef7df55..e5eb2315d 100644 --- a/sdks/java-v1/docs/BulkSendJobListResponse.md +++ b/sdks/java-v1/docs/BulkSendJobListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `bulkSendJobs` | [```List```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `bulkSendJobs`*_required_ | [```List```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/BulkSendJobResponse.md b/sdks/java-v1/docs/BulkSendJobResponse.md index c97fb3d72..eb2278a34 100644 --- a/sdks/java-v1/docs/BulkSendJobResponse.md +++ b/sdks/java-v1/docs/BulkSendJobResponse.md @@ -6,8 +6,8 @@ Contains information about the BulkSendJob such as when it was created and how m ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `bulkSendJobId` | ```String``` | The id of the BulkSendJob. | | | `total` | ```Integer``` | The total amount of Signature Requests queued for sending. | | | `isCreator` | ```Boolean``` | True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. | | diff --git a/sdks/java-v1/docs/BulkSendJobSendResponse.md b/sdks/java-v1/docs/BulkSendJobSendResponse.md index 9ca50957b..532b64b5b 100644 --- a/sdks/java-v1/docs/BulkSendJobSendResponse.md +++ b/sdks/java-v1/docs/BulkSendJobSendResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `bulkSendJob` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `bulkSendJob`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/EmbeddedApi.md b/sdks/java-v1/docs/EmbeddedApi.md index 7ea121bdf..62955f908 100644 --- a/sdks/java-v1/docs/EmbeddedApi.md +++ b/sdks/java-v1/docs/EmbeddedApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**embeddedEditUrl**](EmbeddedApi.md#embeddedEditUrl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL [**embeddedSignUrl**](EmbeddedApi.md#embeddedSignUrl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL @@ -65,8 +65,8 @@ public class Main { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template to edit. | **embeddedEditUrlRequest** | [**EmbeddedEditUrlRequest**](EmbeddedEditUrlRequest.md)| | @@ -140,8 +140,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureId** | **String**| The id of the signature to get a signature url for. | ### Return type diff --git a/sdks/java-v1/docs/EmbeddedEditUrlRequest.md b/sdks/java-v1/docs/EmbeddedEditUrlRequest.md index 302651222..4e2d8c2e9 100644 --- a/sdks/java-v1/docs/EmbeddedEditUrlRequest.md +++ b/sdks/java-v1/docs/EmbeddedEditUrlRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `allowEditCcs` | ```Boolean``` | This allows the requester to enable/disable to add or change CC roles when editing the template. | | | `ccRoles` | ```List``` | The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. | | | `editorOptions` | [```SubEditorOptions```](SubEditorOptions.md) | | | diff --git a/sdks/java-v1/docs/EmbeddedEditUrlResponse.md b/sdks/java-v1/docs/EmbeddedEditUrlResponse.md index ec2ce550a..959e0c75f 100644 --- a/sdks/java-v1/docs/EmbeddedEditUrlResponse.md +++ b/sdks/java-v1/docs/EmbeddedEditUrlResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `embedded` | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `embedded`*_required_ | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/EmbeddedEditUrlResponseEmbedded.md b/sdks/java-v1/docs/EmbeddedEditUrlResponseEmbedded.md index 640655581..78ad7026c 100644 --- a/sdks/java-v1/docs/EmbeddedEditUrlResponseEmbedded.md +++ b/sdks/java-v1/docs/EmbeddedEditUrlResponseEmbedded.md @@ -6,8 +6,8 @@ An embedded template object. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `editUrl` | ```String``` | A template url that can be opened in an iFrame. | | | `expiresAt` | ```Integer``` | The specific time that the the `edit_url` link expires, in epoch. | | diff --git a/sdks/java-v1/docs/EmbeddedSignUrlResponse.md b/sdks/java-v1/docs/EmbeddedSignUrlResponse.md index a6f119ccf..6f39b97fe 100644 --- a/sdks/java-v1/docs/EmbeddedSignUrlResponse.md +++ b/sdks/java-v1/docs/EmbeddedSignUrlResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `embedded` | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `embedded`*_required_ | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/EmbeddedSignUrlResponseEmbedded.md b/sdks/java-v1/docs/EmbeddedSignUrlResponseEmbedded.md index 4f3a83402..b2fd6c9df 100644 --- a/sdks/java-v1/docs/EmbeddedSignUrlResponseEmbedded.md +++ b/sdks/java-v1/docs/EmbeddedSignUrlResponseEmbedded.md @@ -6,8 +6,8 @@ An object that contains necessary information to set up embedded signing. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signUrl` | ```String``` | A signature url that can be opened in an iFrame. | | | `expiresAt` | ```Integer``` | The specific time that the the `sign_url` link expires, in epoch. | | diff --git a/sdks/java-v1/docs/ErrorResponse.md b/sdks/java-v1/docs/ErrorResponse.md index e3153c6d8..f1a560c3b 100644 --- a/sdks/java-v1/docs/ErrorResponse.md +++ b/sdks/java-v1/docs/ErrorResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `error`*_required_ | [```ErrorResponseError```](ErrorResponseError.md) | | | diff --git a/sdks/java-v1/docs/ErrorResponseError.md b/sdks/java-v1/docs/ErrorResponseError.md index 91f1e8ed8..656aa5c7f 100644 --- a/sdks/java-v1/docs/ErrorResponseError.md +++ b/sdks/java-v1/docs/ErrorResponseError.md @@ -6,8 +6,8 @@ Contains information about an error that occurred. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `errorMsg`*_required_ | ```String``` | Message describing an error. | | | `errorName`*_required_ | ```String``` | Name of the error. | | | `errorPath` | ```String``` | Path at which an error occurred. | | diff --git a/sdks/java-v1/docs/EventCallbackRequest.md b/sdks/java-v1/docs/EventCallbackRequest.md index 9286aecff..73daf943e 100644 --- a/sdks/java-v1/docs/EventCallbackRequest.md +++ b/sdks/java-v1/docs/EventCallbackRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `event`*_required_ | [```EventCallbackRequestEvent```](EventCallbackRequestEvent.md) | | | | `account` | [```AccountResponse```](AccountResponse.md) | | | | `signatureRequest` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | diff --git a/sdks/java-v1/docs/EventCallbackRequestEvent.md b/sdks/java-v1/docs/EventCallbackRequestEvent.md index 1e71c972a..19ab491c2 100644 --- a/sdks/java-v1/docs/EventCallbackRequestEvent.md +++ b/sdks/java-v1/docs/EventCallbackRequestEvent.md @@ -6,8 +6,8 @@ Basic information about the event that occurred. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `eventTime`*_required_ | ```String``` | Time the event was created (using Unix time). | | | `eventType`*_required_ | [```EventTypeEnum```](#EventTypeEnum) | Type of callback event that was triggered. | | | `eventHash`*_required_ | ```String``` | Generated hash used to verify source of event data. | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: EventTypeEnum -Name | Value +| Name | Value | ---- | ----- | ACCOUNT_CONFIRMED | "account_confirmed" | | UNKNOWN_ERROR | "unknown_error" | diff --git a/sdks/java-v1/docs/EventCallbackRequestEventMetadata.md b/sdks/java-v1/docs/EventCallbackRequestEventMetadata.md index c8a911f82..13208c2d1 100644 --- a/sdks/java-v1/docs/EventCallbackRequestEventMetadata.md +++ b/sdks/java-v1/docs/EventCallbackRequestEventMetadata.md @@ -6,8 +6,8 @@ Specific metadata about the event. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `relatedSignatureId` | ```String``` | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | | | `reportedForAccountId` | ```String``` | Account ID the event was reported for. | | | `reportedForAppId` | ```String``` | App ID the event was reported for. | | diff --git a/sdks/java-v1/docs/FaxLineAddUserRequest.md b/sdks/java-v1/docs/FaxLineAddUserRequest.md new file mode 100644 index 000000000..1c9e997f9 --- /dev/null +++ b/sdks/java-v1/docs/FaxLineAddUserRequest.md @@ -0,0 +1,16 @@ + + +# FaxLineAddUserRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number`*_required_ | ```String``` | The Fax Line number. | | +| `accountId` | ```String``` | Account ID | | +| `emailAddress` | ```String``` | Email address | | + + + diff --git a/sdks/java-v1/docs/FaxLineApi.md b/sdks/java-v1/docs/FaxLineApi.md new file mode 100644 index 000000000..1997f1f12 --- /dev/null +++ b/sdks/java-v1/docs/FaxLineApi.md @@ -0,0 +1,504 @@ +# FaxLineApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +[**faxLineAddUser**](FaxLineApi.md#faxLineAddUser) | **PUT** /fax_line/add_user | Add Fax Line User +[**faxLineAreaCodeGet**](FaxLineApi.md#faxLineAreaCodeGet) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes +[**faxLineCreate**](FaxLineApi.md#faxLineCreate) | **POST** /fax_line/create | Purchase Fax Line +[**faxLineDelete**](FaxLineApi.md#faxLineDelete) | **DELETE** /fax_line | Delete Fax Line +[**faxLineGet**](FaxLineApi.md#faxLineGet) | **GET** /fax_line | Get Fax Line +[**faxLineList**](FaxLineApi.md#faxLineList) | **GET** /fax_line/list | List Fax Lines +[**faxLineRemoveUser**](FaxLineApi.md#faxLineRemoveUser) | **PUT** /fax_line/remove_user | Remove Fax Line Access + + + +## faxLineAddUser + +> FaxLineResponse faxLineAddUser(faxLineAddUserRequest) + +Add Fax Line User + +Grants a user access to the specified Fax Line. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineAddUserRequest() + .number("[FAX_NUMBER]") + .emailAddress("member@dropboxsign.com"); + + try { + FaxLineResponse result = faxLineApi.faxLineAddUser(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 | +|------------- | ------------- | ------------- | -------------| + **faxLineAddUserRequest** | [**FaxLineAddUserRequest**](FaxLineAddUserRequest.md)| | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + + +## faxLineAreaCodeGet + +> FaxLineAreaCodeGetResponse faxLineAreaCodeGet(country, state, province, city) + +Get Available Fax Line Area Codes + +Returns a response with the area codes available for a given state/provice and city. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineAreaCodeGetResponse result = faxLineApi.faxLineAreaCodeGet("US", "CA"); + 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 | +|------------- | ------------- | ------------- | -------------| + **country** | **String**| Filter area codes by country. | [enum: CA, US, UK] + **state** | **String**| Filter area codes by state. | [optional] [enum: 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] + **province** | **String**| Filter area codes by province. | [optional] [enum: AB, BC, MB, NB, NL, NT, NS, NU, ON, PE, QC, SK, YT] + **city** | **String**| Filter area codes by city. | [optional] + +### Return type + +[**FaxLineAreaCodeGetResponse**](FaxLineAreaCodeGetResponse.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 | - | + + +## faxLineCreate + +> FaxLineResponse faxLineCreate(faxLineCreateRequest) + +Purchase Fax Line + +Purchases a new Fax Line. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineCreateRequest() + .areaCode(209) + .country("US"); + + try { + FaxLineResponse result = faxLineApi.faxLineCreate(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 | +|------------- | ------------- | ------------- | -------------| + **faxLineCreateRequest** | [**FaxLineCreateRequest**](FaxLineCreateRequest.md)| | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + + +## faxLineDelete + +> faxLineDelete(faxLineDeleteRequest) + +Delete Fax Line + +Deletes the specified Fax Line from the subscription. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineDeleteRequest() + .number("[FAX_NUMBER]"); + + try { + faxLineApi.faxLineDelete(data); + } 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 | +|------------- | ------------- | ------------- | -------------| + **faxLineDeleteRequest** | [**FaxLineDeleteRequest**](FaxLineDeleteRequest.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + + +## faxLineGet + +> FaxLineResponse faxLineGet(number) + +Get Fax Line + +Returns the properties and settings of a Fax Line. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineResponse result = faxLineApi.faxLineGet("[FAX_NUMBER]"); + 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 | +|------------- | ------------- | ------------- | -------------| + **number** | **String**| The Fax Line number. | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.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 | - | + + +## faxLineList + +> FaxLineListResponse faxLineList(accountId, page, pageSize, showTeamLines) + +List Fax Lines + +Returns the properties and settings of multiple Fax Lines. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineListResponse result = faxLineApi.faxLineList(); + 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 | +|------------- | ------------- | ------------- | -------------| + **accountId** | **String**| Account ID | [optional] + **page** | **Integer**| Page | [optional] [default to 1] + **pageSize** | **Integer**| Page size | [optional] [default to 20] + **showTeamLines** | **Boolean**| Show team lines | [optional] + +### Return type + +[**FaxLineListResponse**](FaxLineListResponse.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 | - | + + +## faxLineRemoveUser + +> FaxLineResponse faxLineRemoveUser(faxLineRemoveUserRequest) + +Remove Fax Line Access + +Removes a user's access to the specified Fax Line. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineRemoveUserRequest() + .number("[FAX_NUMBER]") + .emailAddress("member@dropboxsign.com"); + + try { + FaxLineResponse result = faxLineApi.faxLineRemoveUser(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 | +|------------- | ------------- | ------------- | -------------| + **faxLineRemoveUserRequest** | [**FaxLineRemoveUserRequest**](FaxLineRemoveUserRequest.md)| | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + diff --git a/sdks/java-v1/docs/FaxLineAreaCodeGetCountryEnum.md b/sdks/java-v1/docs/FaxLineAreaCodeGetCountryEnum.md new file mode 100644 index 000000000..10275bc6c --- /dev/null +++ b/sdks/java-v1/docs/FaxLineAreaCodeGetCountryEnum.md @@ -0,0 +1,15 @@ + + +# FaxLineAreaCodeGetCountryEnum + +## Enum + + +* `CA` (value: `"CA"`) + +* `US` (value: `"US"`) + +* `UK` (value: `"UK"`) + + + diff --git a/sdks/java-v1/docs/FaxLineAreaCodeGetProvinceEnum.md b/sdks/java-v1/docs/FaxLineAreaCodeGetProvinceEnum.md new file mode 100644 index 000000000..13cf50078 --- /dev/null +++ b/sdks/java-v1/docs/FaxLineAreaCodeGetProvinceEnum.md @@ -0,0 +1,35 @@ + + +# FaxLineAreaCodeGetProvinceEnum + +## Enum + + +* `AB` (value: `"AB"`) + +* `BC` (value: `"BC"`) + +* `MB` (value: `"MB"`) + +* `NB` (value: `"NB"`) + +* `NL` (value: `"NL"`) + +* `NT` (value: `"NT"`) + +* `NS` (value: `"NS"`) + +* `NU` (value: `"NU"`) + +* `ON` (value: `"ON"`) + +* `PE` (value: `"PE"`) + +* `QC` (value: `"QC"`) + +* `SK` (value: `"SK"`) + +* `YT` (value: `"YT"`) + + + diff --git a/sdks/java-v1/docs/FaxLineAreaCodeGetResponse.md b/sdks/java-v1/docs/FaxLineAreaCodeGetResponse.md new file mode 100644 index 000000000..002619333 --- /dev/null +++ b/sdks/java-v1/docs/FaxLineAreaCodeGetResponse.md @@ -0,0 +1,14 @@ + + +# FaxLineAreaCodeGetResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `areaCodes`*_required_ | ```List``` | | | + + + diff --git a/sdks/java-v1/docs/FaxLineAreaCodeGetStateEnum.md b/sdks/java-v1/docs/FaxLineAreaCodeGetStateEnum.md new file mode 100644 index 000000000..577a48c63 --- /dev/null +++ b/sdks/java-v1/docs/FaxLineAreaCodeGetStateEnum.md @@ -0,0 +1,111 @@ + + +# FaxLineAreaCodeGetStateEnum + +## Enum + + +* `AK` (value: `"AK"`) + +* `AL` (value: `"AL"`) + +* `AR` (value: `"AR"`) + +* `AZ` (value: `"AZ"`) + +* `CA` (value: `"CA"`) + +* `CO` (value: `"CO"`) + +* `CT` (value: `"CT"`) + +* `DC` (value: `"DC"`) + +* `DE` (value: `"DE"`) + +* `FL` (value: `"FL"`) + +* `GA` (value: `"GA"`) + +* `HI` (value: `"HI"`) + +* `IA` (value: `"IA"`) + +* `ID` (value: `"ID"`) + +* `IL` (value: `"IL"`) + +* `IN` (value: `"IN"`) + +* `KS` (value: `"KS"`) + +* `KY` (value: `"KY"`) + +* `LA` (value: `"LA"`) + +* `MA` (value: `"MA"`) + +* `MD` (value: `"MD"`) + +* `ME` (value: `"ME"`) + +* `MI` (value: `"MI"`) + +* `MN` (value: `"MN"`) + +* `MO` (value: `"MO"`) + +* `MS` (value: `"MS"`) + +* `MT` (value: `"MT"`) + +* `NC` (value: `"NC"`) + +* `ND` (value: `"ND"`) + +* `NE` (value: `"NE"`) + +* `NH` (value: `"NH"`) + +* `NJ` (value: `"NJ"`) + +* `NM` (value: `"NM"`) + +* `NV` (value: `"NV"`) + +* `NY` (value: `"NY"`) + +* `OH` (value: `"OH"`) + +* `OK` (value: `"OK"`) + +* `OR` (value: `"OR"`) + +* `PA` (value: `"PA"`) + +* `RI` (value: `"RI"`) + +* `SC` (value: `"SC"`) + +* `SD` (value: `"SD"`) + +* `TN` (value: `"TN"`) + +* `TX` (value: `"TX"`) + +* `UT` (value: `"UT"`) + +* `VA` (value: `"VA"`) + +* `VT` (value: `"VT"`) + +* `WA` (value: `"WA"`) + +* `WI` (value: `"WI"`) + +* `WV` (value: `"WV"`) + +* `WY` (value: `"WY"`) + + + diff --git a/sdks/java-v1/docs/FaxLineCreateRequest.md b/sdks/java-v1/docs/FaxLineCreateRequest.md new file mode 100644 index 000000000..da9ba3953 --- /dev/null +++ b/sdks/java-v1/docs/FaxLineCreateRequest.md @@ -0,0 +1,27 @@ + + +# FaxLineCreateRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `areaCode`*_required_ | ```Integer``` | Area code | | +| `country`*_required_ | [```CountryEnum```](#CountryEnum) | Country | | +| `city` | ```String``` | City | | +| `accountId` | ```String``` | Account ID | | + + + +## Enum: CountryEnum + +| Name | Value | +---- | ----- +| CA | "CA" | +| US | "US" | +| UK | "UK" | + + + diff --git a/sdks/java-v1/docs/FaxLineDeleteRequest.md b/sdks/java-v1/docs/FaxLineDeleteRequest.md new file mode 100644 index 000000000..de1748fa1 --- /dev/null +++ b/sdks/java-v1/docs/FaxLineDeleteRequest.md @@ -0,0 +1,14 @@ + + +# FaxLineDeleteRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number`*_required_ | ```String``` | The Fax Line number. | | + + + diff --git a/sdks/java-v1/docs/FaxLineListResponse.md b/sdks/java-v1/docs/FaxLineListResponse.md new file mode 100644 index 000000000..69891dc2f --- /dev/null +++ b/sdks/java-v1/docs/FaxLineListResponse.md @@ -0,0 +1,16 @@ + + +# FaxLineListResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `faxLines`*_required_ | [```List```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + + + diff --git a/sdks/java-v1/docs/FaxLineRemoveUserRequest.md b/sdks/java-v1/docs/FaxLineRemoveUserRequest.md new file mode 100644 index 000000000..51d81b8fa --- /dev/null +++ b/sdks/java-v1/docs/FaxLineRemoveUserRequest.md @@ -0,0 +1,16 @@ + + +# FaxLineRemoveUserRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number`*_required_ | ```String``` | The Fax Line number. | | +| `accountId` | ```String``` | Account ID | | +| `emailAddress` | ```String``` | Email address | | + + + diff --git a/sdks/java-v1/docs/FaxLineResponse.md b/sdks/java-v1/docs/FaxLineResponse.md new file mode 100644 index 000000000..c5256bbc6 --- /dev/null +++ b/sdks/java-v1/docs/FaxLineResponse.md @@ -0,0 +1,15 @@ + + +# FaxLineResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxLine`*_required_ | [```FaxLineResponseFaxLine```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + + + diff --git a/sdks/java-v1/docs/FaxLineResponseFaxLine.md b/sdks/java-v1/docs/FaxLineResponseFaxLine.md new file mode 100644 index 000000000..daf0d206a --- /dev/null +++ b/sdks/java-v1/docs/FaxLineResponseFaxLine.md @@ -0,0 +1,17 @@ + + +# FaxLineResponseFaxLine + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number` | ```String``` | Number | | +| `createdAt` | ```Integer``` | Created at | | +| `updatedAt` | ```Integer``` | Updated at | | +| `accounts` | [```List```](AccountResponse.md) | | | + + + diff --git a/sdks/java-v1/docs/FileResponse.md b/sdks/java-v1/docs/FileResponse.md index 4851cb4f7..058a80ed5 100644 --- a/sdks/java-v1/docs/FileResponse.md +++ b/sdks/java-v1/docs/FileResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `fileUrl` | ```String``` | URL to the file. | | -| `expiresAt` | ```Integer``` | When the link expires. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `fileUrl`*_required_ | ```String``` | URL to the file. | | +| `expiresAt`*_required_ | ```Integer``` | When the link expires. | | diff --git a/sdks/java-v1/docs/FileResponseDataUri.md b/sdks/java-v1/docs/FileResponseDataUri.md index 19502239d..65c0b7dbc 100644 --- a/sdks/java-v1/docs/FileResponseDataUri.md +++ b/sdks/java-v1/docs/FileResponseDataUri.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `dataUri` | ```String``` | File as base64 encoded string. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `dataUri`*_required_ | ```String``` | File as base64 encoded string. | | diff --git a/sdks/java-v1/docs/ListInfoResponse.md b/sdks/java-v1/docs/ListInfoResponse.md index 02063e79c..b9d464ec7 100644 --- a/sdks/java-v1/docs/ListInfoResponse.md +++ b/sdks/java-v1/docs/ListInfoResponse.md @@ -6,8 +6,8 @@ Contains pagination information about the data returned. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `numPages` | ```Integer``` | Total number of pages available. | | | `numResults` | ```Integer``` | Total number of objects available. | | | `page` | ```Integer``` | Number of the page being returned. | | diff --git a/sdks/java-v1/docs/OAuthApi.md b/sdks/java-v1/docs/OAuthApi.md index 466367afd..533052ba2 100644 --- a/sdks/java-v1/docs/OAuthApi.md +++ b/sdks/java-v1/docs/OAuthApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**oauthTokenGenerate**](OAuthApi.md#oauthTokenGenerate) | **POST** /oauth/token | OAuth Token Generate [**oauthTokenRefresh**](OAuthApi.md#oauthTokenRefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh @@ -56,8 +56,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **oauthTokenGenerateRequest** | [**OAuthTokenGenerateRequest**](OAuthTokenGenerateRequest.md)| | ### Return type @@ -123,8 +123,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **oauthTokenRefreshRequest** | [**OAuthTokenRefreshRequest**](OAuthTokenRefreshRequest.md)| | ### Return type diff --git a/sdks/java-v1/docs/OAuthTokenGenerateRequest.md b/sdks/java-v1/docs/OAuthTokenGenerateRequest.md index 7f376db16..45ad0b08e 100644 --- a/sdks/java-v1/docs/OAuthTokenGenerateRequest.md +++ b/sdks/java-v1/docs/OAuthTokenGenerateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | The client id of the app requesting authorization. | | | `clientSecret`*_required_ | ```String``` | The secret token of your app. | | | `code`*_required_ | ```String``` | The code passed to your callback when the user granted access. | | diff --git a/sdks/java-v1/docs/OAuthTokenRefreshRequest.md b/sdks/java-v1/docs/OAuthTokenRefreshRequest.md index b88bb9ed4..2b985fa91 100644 --- a/sdks/java-v1/docs/OAuthTokenRefreshRequest.md +++ b/sdks/java-v1/docs/OAuthTokenRefreshRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `grantType`*_required_ | ```String``` | When refreshing an existing token use `refresh_token`. | | | `refreshToken`*_required_ | ```String``` | The token provided when you got the expired access token. | | diff --git a/sdks/java-v1/docs/OAuthTokenResponse.md b/sdks/java-v1/docs/OAuthTokenResponse.md index 28da6205f..86824ccb0 100644 --- a/sdks/java-v1/docs/OAuthTokenResponse.md +++ b/sdks/java-v1/docs/OAuthTokenResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accessToken` | ```String``` | | | | `tokenType` | ```String``` | | | | `refreshToken` | ```String``` | | | diff --git a/sdks/java-v1/docs/ReportApi.md b/sdks/java-v1/docs/ReportApi.md index e6af8facf..e0a409741 100644 --- a/sdks/java-v1/docs/ReportApi.md +++ b/sdks/java-v1/docs/ReportApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**reportCreate**](ReportApi.md#reportCreate) | **POST** /report/create | Create Report @@ -68,8 +68,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **reportCreateRequest** | [**ReportCreateRequest**](ReportCreateRequest.md)| | ### Return type diff --git a/sdks/java-v1/docs/ReportCreateRequest.md b/sdks/java-v1/docs/ReportCreateRequest.md index 99053df76..d2f4b67e2 100644 --- a/sdks/java-v1/docs/ReportCreateRequest.md +++ b/sdks/java-v1/docs/ReportCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `endDate`*_required_ | ```String``` | The (inclusive) end date for the report data in `MM/DD/YYYY` format. | | | `reportType`*_required_ | [```List<ReportTypeEnum>```](#List<ReportTypeEnum>) | The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | | | `startDate`*_required_ | ```String``` | The (inclusive) start date for the report data in `MM/DD/YYYY` format. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: List<ReportTypeEnum> -Name | Value +| Name | Value | ---- | ----- | USER_ACTIVITY | "user_activity" | | DOCUMENT_STATUS | "document_status" | diff --git a/sdks/java-v1/docs/ReportCreateResponse.md b/sdks/java-v1/docs/ReportCreateResponse.md index 9f8c1177f..9fc8565de 100644 --- a/sdks/java-v1/docs/ReportCreateResponse.md +++ b/sdks/java-v1/docs/ReportCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `report` | [```ReportResponse```](ReportResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `report`*_required_ | [```ReportResponse```](ReportResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/ReportResponse.md b/sdks/java-v1/docs/ReportResponse.md index ade5b6395..b48dde6f4 100644 --- a/sdks/java-v1/docs/ReportResponse.md +++ b/sdks/java-v1/docs/ReportResponse.md @@ -6,8 +6,8 @@ Contains information about the report request. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `success` | ```String``` | A message indicating the requested operation's success | | | `startDate` | ```String``` | The (inclusive) start date for the report data in MM/DD/YYYY format. | | | `endDate` | ```String``` | The (inclusive) end date for the report data in MM/DD/YYYY format. | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: List<ReportTypeEnum> -Name | Value +| Name | Value | ---- | ----- | USER_ACTIVITY | "user_activity" | | DOCUMENT_STATUS | "document_status" | diff --git a/sdks/java-v1/docs/SignatureRequestApi.md b/sdks/java-v1/docs/SignatureRequestApi.md index f8e0100b2..ee42461ce 100644 --- a/sdks/java-v1/docs/SignatureRequestApi.md +++ b/sdks/java-v1/docs/SignatureRequestApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**signatureRequestBulkCreateEmbeddedWithTemplate**](SignatureRequestApi.md#signatureRequestBulkCreateEmbeddedWithTemplate) | **POST** /signature_request/bulk_create_embedded_with_template | Embedded Bulk Send with Template [**signatureRequestBulkSendWithTemplate**](SignatureRequestApi.md#signatureRequestBulkSendWithTemplate) | **POST** /signature_request/bulk_send_with_template | Bulk Send with Template [**signatureRequestCancel**](SignatureRequestApi.md#signatureRequestCancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request @@ -115,8 +115,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestBulkCreateEmbeddedWithTemplateRequest** | [**SignatureRequestBulkCreateEmbeddedWithTemplateRequest**](SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md)| | ### Return type @@ -231,8 +231,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestBulkSendWithTemplateRequest** | [**SignatureRequestBulkSendWithTemplateRequest**](SignatureRequestBulkSendWithTemplateRequest.md)| | ### Return type @@ -311,8 +311,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the incomplete SignatureRequest to cancel. | ### Return type @@ -414,8 +414,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestCreateEmbeddedRequest** | [**SignatureRequestCreateEmbeddedRequest**](SignatureRequestCreateEmbeddedRequest.md)| | ### Return type @@ -508,8 +508,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestCreateEmbeddedWithTemplateRequest** | [**SignatureRequestCreateEmbeddedWithTemplateRequest**](SignatureRequestCreateEmbeddedWithTemplateRequest.md)| | ### Return type @@ -585,8 +585,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | **fileType** | **String**| Set to `pdf` for a single merged document or `zip` for a collection of individual documents. | [optional] [default to pdf] [enum: pdf, zip] @@ -662,8 +662,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | ### Return type @@ -738,8 +738,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | **forceDownload** | **Integer**| By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. | [optional] [default to 1] @@ -813,8 +813,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | ### Return type @@ -897,8 +897,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountId** | **String**| Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. | [optional] **page** | **Integer**| Which page number of the SignatureRequest List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -974,8 +974,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to release. | ### Return type @@ -1053,8 +1053,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to send a reminder for. | **signatureRequestRemindRequest** | [**SignatureRequestRemindRequest**](SignatureRequestRemindRequest.md)| | @@ -1130,8 +1130,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to remove. | ### Return type @@ -1238,8 +1238,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestSendRequest** | [**SignatureRequestSendRequest**](SignatureRequestSendRequest.md)| | ### Return type @@ -1344,8 +1344,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestSendWithTemplateRequest** | [**SignatureRequestSendWithTemplateRequest**](SignatureRequestSendWithTemplateRequest.md)| | ### Return type @@ -1426,8 +1426,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to update. | **signatureRequestUpdateRequest** | [**SignatureRequestUpdateRequest**](SignatureRequestUpdateRequest.md)| | diff --git a/sdks/java-v1/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/java-v1/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index fae117acd..4243ead1c 100644 --- a/sdks/java-v1/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/java-v1/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | | `signerFile` | ```File``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | diff --git a/sdks/java-v1/docs/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/java-v1/docs/SignatureRequestBulkSendWithTemplateRequest.md index e57352287..1798f6fdc 100644 --- a/sdks/java-v1/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/java-v1/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `signerFile` | ```File``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | | `signerList` | [```List```](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | | diff --git a/sdks/java-v1/docs/SignatureRequestCreateEmbeddedRequest.md b/sdks/java-v1/docs/SignatureRequestCreateEmbeddedRequest.md index fcfd18518..383f8a8f3 100644 --- a/sdks/java-v1/docs/SignatureRequestCreateEmbeddedRequest.md +++ b/sdks/java-v1/docs/SignatureRequestCreateEmbeddedRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | diff --git a/sdks/java-v1/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/sdks/java-v1/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md index a4dd8ce50..050a7e631 100644 --- a/sdks/java-v1/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/sdks/java-v1/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | | `signers`*_required_ | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | diff --git a/sdks/java-v1/docs/SignatureRequestGetResponse.md b/sdks/java-v1/docs/SignatureRequestGetResponse.md index 7ce17ba9a..25ce665c4 100644 --- a/sdks/java-v1/docs/SignatureRequestGetResponse.md +++ b/sdks/java-v1/docs/SignatureRequestGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `signatureRequest` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `signatureRequest`*_required_ | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/SignatureRequestListResponse.md b/sdks/java-v1/docs/SignatureRequestListResponse.md index 94fb15690..6384d2ad0 100644 --- a/sdks/java-v1/docs/SignatureRequestListResponse.md +++ b/sdks/java-v1/docs/SignatureRequestListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `signatureRequests` | [```List```](SignatureRequestResponse.md) | Contains information about signature requests. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `signatureRequests`*_required_ | [```List```](SignatureRequestResponse.md) | Contains information about signature requests. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/SignatureRequestRemindRequest.md b/sdks/java-v1/docs/SignatureRequestRemindRequest.md index 1a16fc55a..bf76e08f4 100644 --- a/sdks/java-v1/docs/SignatureRequestRemindRequest.md +++ b/sdks/java-v1/docs/SignatureRequestRemindRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```String``` | The email address of the signer to send a reminder to. | | | `name` | ```String``` | The name of the signer to send a reminder to. Include if two or more signers share an email address. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponse.md b/sdks/java-v1/docs/SignatureRequestResponse.md index 50ae41719..2c9efa532 100644 --- a/sdks/java-v1/docs/SignatureRequestResponse.md +++ b/sdks/java-v1/docs/SignatureRequestResponse.md @@ -6,8 +6,8 @@ Contains information about a signature request. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `testMode` | ```Boolean``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | | | `signatureRequestId` | ```String``` | The id of the SignatureRequest. | | | `requesterEmailAddress` | ```String``` | The email address of the initiator of the SignatureRequest. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseAttachment.md b/sdks/java-v1/docs/SignatureRequestResponseAttachment.md index 23267b60e..1ef3a209b 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseAttachment.md +++ b/sdks/java-v1/docs/SignatureRequestResponseAttachment.md @@ -6,8 +6,8 @@ Signer attachments. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `id`*_required_ | ```String``` | The unique ID for this attachment. | | | `signer`*_required_ | ```String``` | The Signer this attachment is assigned to. | | | `name`*_required_ | ```String``` | The name of this attachment. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseCustomFieldBase.md b/sdks/java-v1/docs/SignatureRequestResponseCustomFieldBase.md index 7dbca6c01..7b5f104c4 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseCustomFieldBase.md +++ b/sdks/java-v1/docs/SignatureRequestResponseCustomFieldBase.md @@ -9,8 +9,8 @@ An array of Custom Field objects containing the name and type of each custom fie ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `name`*_required_ | ```String``` | The name of the Custom Field. | | | `required` | ```Boolean``` | A boolean value denoting if this field is required. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseCustomFieldCheckbox.md b/sdks/java-v1/docs/SignatureRequestResponseCustomFieldCheckbox.md index e0f8e10fc..c2cb8414b 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseCustomFieldCheckbox.md +++ b/sdks/java-v1/docs/SignatureRequestResponseCustomFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `SignatureRequestResponseCustomFieldBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `value` | ```Boolean``` | A true/false for checkbox fields | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseCustomFieldText.md b/sdks/java-v1/docs/SignatureRequestResponseCustomFieldText.md index c78e24d5d..23ceb565c 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseCustomFieldText.md +++ b/sdks/java-v1/docs/SignatureRequestResponseCustomFieldText.md @@ -6,8 +6,8 @@ This class extends `SignatureRequestResponseCustomFieldBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `value` | ```String``` | A text string for text fields | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseDataBase.md b/sdks/java-v1/docs/SignatureRequestResponseDataBase.md index 7504c495d..a9605a44a 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseDataBase.md +++ b/sdks/java-v1/docs/SignatureRequestResponseDataBase.md @@ -6,8 +6,8 @@ An array of form field objects containing the name, value, and type of each text ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `apiId` | ```String``` | The unique ID for this field. | | | `signatureId` | ```String``` | The ID of the signature to which this response is linked. | | | `name` | ```String``` | The name of the form field. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseDataValueCheckbox.md b/sdks/java-v1/docs/SignatureRequestResponseDataValueCheckbox.md index 972c48d91..fda57045a 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseDataValueCheckbox.md +++ b/sdks/java-v1/docs/SignatureRequestResponseDataValueCheckbox.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A yes/no checkbox | | | `value` | ```Boolean``` | The value of the form field. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseDataValueCheckboxMerge.md b/sdks/java-v1/docs/SignatureRequestResponseDataValueCheckboxMerge.md index 6abdf9698..96af5ebaf 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseDataValueCheckboxMerge.md +++ b/sdks/java-v1/docs/SignatureRequestResponseDataValueCheckboxMerge.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A checkbox field that has default value set by the api | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseDataValueDateSigned.md b/sdks/java-v1/docs/SignatureRequestResponseDataValueDateSigned.md index 2b9e5a759..308bd8bf2 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseDataValueDateSigned.md +++ b/sdks/java-v1/docs/SignatureRequestResponseDataValueDateSigned.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A date | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseDataValueDropdown.md b/sdks/java-v1/docs/SignatureRequestResponseDataValueDropdown.md index 8b5a0f105..599cb3cef 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseDataValueDropdown.md +++ b/sdks/java-v1/docs/SignatureRequestResponseDataValueDropdown.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | An input field for dropdowns | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseDataValueInitials.md b/sdks/java-v1/docs/SignatureRequestResponseDataValueInitials.md index f1d04539f..7f82d742c 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseDataValueInitials.md +++ b/sdks/java-v1/docs/SignatureRequestResponseDataValueInitials.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | An input field for initials | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseDataValueRadio.md b/sdks/java-v1/docs/SignatureRequestResponseDataValueRadio.md index 2897f89a6..b8e073f1f 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseDataValueRadio.md +++ b/sdks/java-v1/docs/SignatureRequestResponseDataValueRadio.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | An input field for radios | | | `value` | ```Boolean``` | The value of the form field. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseDataValueSignature.md b/sdks/java-v1/docs/SignatureRequestResponseDataValueSignature.md index bb7ce7fe9..910932c19 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseDataValueSignature.md +++ b/sdks/java-v1/docs/SignatureRequestResponseDataValueSignature.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A signature input field | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseDataValueText.md b/sdks/java-v1/docs/SignatureRequestResponseDataValueText.md index 837f27c3f..e08ec8ff8 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseDataValueText.md +++ b/sdks/java-v1/docs/SignatureRequestResponseDataValueText.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A text input field | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseDataValueTextMerge.md b/sdks/java-v1/docs/SignatureRequestResponseDataValueTextMerge.md index 60349e25a..2b5e0d3fe 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseDataValueTextMerge.md +++ b/sdks/java-v1/docs/SignatureRequestResponseDataValueTextMerge.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A text field that has default text set by the api | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v1/docs/SignatureRequestResponseSignatures.md b/sdks/java-v1/docs/SignatureRequestResponseSignatures.md index 3eac9dfb9..2f0e16dc0 100644 --- a/sdks/java-v1/docs/SignatureRequestResponseSignatures.md +++ b/sdks/java-v1/docs/SignatureRequestResponseSignatures.md @@ -6,8 +6,8 @@ An array of signature objects, 1 for each signer. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signatureId` | ```String``` | Signature identifier. | | | `signerGroupGuid` | ```String``` | Signer Group GUID | | | `signerEmailAddress` | ```String``` | The email address of the signer. | | diff --git a/sdks/java-v1/docs/SignatureRequestSendRequest.md b/sdks/java-v1/docs/SignatureRequestSendRequest.md index 5b156ef05..914303935 100644 --- a/sdks/java-v1/docs/SignatureRequestSendRequest.md +++ b/sdks/java-v1/docs/SignatureRequestSendRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

This endpoint requires either **signers** or **grouped_signers**, but not both. | | diff --git a/sdks/java-v1/docs/SignatureRequestSendWithTemplateRequest.md b/sdks/java-v1/docs/SignatureRequestSendWithTemplateRequest.md index 5ccd15d24..7a8d8c88a 100644 --- a/sdks/java-v1/docs/SignatureRequestSendWithTemplateRequest.md +++ b/sdks/java-v1/docs/SignatureRequestSendWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `signers`*_required_ | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | | `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | diff --git a/sdks/java-v1/docs/SignatureRequestUpdateRequest.md b/sdks/java-v1/docs/SignatureRequestUpdateRequest.md index 4e1159535..4b38c53e7 100644 --- a/sdks/java-v1/docs/SignatureRequestUpdateRequest.md +++ b/sdks/java-v1/docs/SignatureRequestUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signatureId`*_required_ | ```String``` | The signature ID for the recipient. | | | `emailAddress` | ```String``` | The new email address for the recipient.

This will generate a new `signature_id` value.

**NOTE:** Optional if `name` is provided. | | | `name` | ```String``` | The new name for the recipient.

**NOTE:** Optional if `email_address` is provided. | | diff --git a/sdks/java-v1/docs/SubAttachment.md b/sdks/java-v1/docs/SubAttachment.md index a7e00e026..b5e9c80fd 100644 --- a/sdks/java-v1/docs/SubAttachment.md +++ b/sdks/java-v1/docs/SubAttachment.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of attachment. | | | `signerIndex`*_required_ | ```Integer``` | The signer's index in the `signers` parameter (0-based indexing).

**NOTE:** Only one signer can be assigned per attachment. | | | `instructions` | ```String``` | The instructions for uploading the attachment. | | diff --git a/sdks/java-v1/docs/SubBulkSignerList.md b/sdks/java-v1/docs/SubBulkSignerList.md index 043abbb91..918c935b1 100644 --- a/sdks/java-v1/docs/SubBulkSignerList.md +++ b/sdks/java-v1/docs/SubBulkSignerList.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `customFields` | [```List```](SubBulkSignerListCustomField.md) | An array of custom field values. | | | `signers` | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document.

Currently only templates with a single role are supported. All signers must have the same `role` value. | | diff --git a/sdks/java-v1/docs/SubBulkSignerListCustomField.md b/sdks/java-v1/docs/SubBulkSignerListCustomField.md index 2a7c9c0d9..b37ad53bc 100644 --- a/sdks/java-v1/docs/SubBulkSignerListCustomField.md +++ b/sdks/java-v1/docs/SubBulkSignerListCustomField.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of the custom field. Must be the field's `name` or `api_id`. | | | `value`*_required_ | ```String``` | The value of the custom field. | | diff --git a/sdks/java-v1/docs/SubCC.md b/sdks/java-v1/docs/SubCC.md index 4f59a7661..37eacd3b8 100644 --- a/sdks/java-v1/docs/SubCC.md +++ b/sdks/java-v1/docs/SubCC.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `role`*_required_ | ```String``` | Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. | | | `emailAddress`*_required_ | ```String``` | The email address of the CC recipient. | | diff --git a/sdks/java-v1/docs/SubCustomField.md b/sdks/java-v1/docs/SubCustomField.md index b65f80470..a309fd6e0 100644 --- a/sdks/java-v1/docs/SubCustomField.md +++ b/sdks/java-v1/docs/SubCustomField.md @@ -10,8 +10,8 @@ For using pre-filled on repeatable signature requests, merge fields are added to ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. | | | `editor` | ```String``` | Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`.

**NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. | | | `required` | ```Boolean``` | Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. | | diff --git a/sdks/java-v1/docs/SubEditorOptions.md b/sdks/java-v1/docs/SubEditorOptions.md index b1c284b19..5483d255f 100644 --- a/sdks/java-v1/docs/SubEditorOptions.md +++ b/sdks/java-v1/docs/SubEditorOptions.md @@ -6,8 +6,8 @@ This allows the requester to specify editor options when a preparing a document ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `allowEditSigners` | ```Boolean``` | Allows requesters to edit the list of signers | | | `allowEditDocuments` | ```Boolean``` | Allows requesters to edit documents, including delete and add | | diff --git a/sdks/java-v1/docs/SubFieldOptions.md b/sdks/java-v1/docs/SubFieldOptions.md index 92ef40d0f..e1be7690d 100644 --- a/sdks/java-v1/docs/SubFieldOptions.md +++ b/sdks/java-v1/docs/SubFieldOptions.md @@ -6,15 +6,15 @@ This allows the requester to specify field options for a signature request. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `dateFormat`*_required_ | [```DateFormatEnum```](#DateFormatEnum) | Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats))

**NOTE:** Only available for Premium and higher. | | ## Enum: DateFormatEnum -Name | Value +| Name | Value | ---- | ----- | MMDDYYYY | "MM / DD / YYYY" | | MM_DD_YYYY | "MM - DD - YYYY" | diff --git a/sdks/java-v1/docs/SubFormFieldGroup.md b/sdks/java-v1/docs/SubFormFieldGroup.md index 676afdd91..c55ffa355 100644 --- a/sdks/java-v1/docs/SubFormFieldGroup.md +++ b/sdks/java-v1/docs/SubFormFieldGroup.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `groupId`*_required_ | ```String``` | ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. | | | `groupLabel`*_required_ | ```String``` | Name of the group | | | `requirement`*_required_ | ```String``` | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | | diff --git a/sdks/java-v1/docs/SubFormFieldRule.md b/sdks/java-v1/docs/SubFormFieldRule.md index eb4d25e4e..ca44afdb6 100644 --- a/sdks/java-v1/docs/SubFormFieldRule.md +++ b/sdks/java-v1/docs/SubFormFieldRule.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `id`*_required_ | ```String``` | Must be unique across all defined rules. | | | `triggerOperator`*_required_ | ```String``` | Currently only `AND` is supported. Support for `OR` is being worked on. | | | `triggers`*_required_ | [```List```](SubFormFieldRuleTrigger.md) | An array of trigger definitions, the "if this" part of "**if this**, then that". Currently only a single trigger per rule is allowed. | | diff --git a/sdks/java-v1/docs/SubFormFieldRuleAction.md b/sdks/java-v1/docs/SubFormFieldRuleAction.md index 12828ad85..6a2d43481 100644 --- a/sdks/java-v1/docs/SubFormFieldRuleAction.md +++ b/sdks/java-v1/docs/SubFormFieldRuleAction.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `hidden`*_required_ | ```Boolean``` | `true` to hide the target field when rule is satisfied, otherwise `false`. | | | `type`*_required_ | [```TypeEnum```](#TypeEnum) | | | | `fieldId` | ```String``` | **field_id** or **group_id** is required, but not both.

Must reference the `api_id` of an existing field defined within `form_fields_per_document`.

Cannot use with `group_id`. Trigger and action fields must belong to the same signer. | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | FIELD_VISIBILITY | "change-field-visibility" | | GROUP_VISIBILITY | "change-group-visibility" | diff --git a/sdks/java-v1/docs/SubFormFieldRuleTrigger.md b/sdks/java-v1/docs/SubFormFieldRuleTrigger.md index ed866d07c..3a82561bd 100644 --- a/sdks/java-v1/docs/SubFormFieldRuleTrigger.md +++ b/sdks/java-v1/docs/SubFormFieldRuleTrigger.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `id`*_required_ | ```String``` | Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. | | | `operator`*_required_ | [```OperatorEnum```](#OperatorEnum) | Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value | | | `value` | ```String``` | **value** or **values** is required, but not both.

The value to match against **operator**.

- When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match`

Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: OperatorEnum -Name | Value +| Name | Value | ---- | ----- | ANY | "any" | | IS | "is" | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentBase.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentBase.md index 26ce88d91..a44994a32 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentBase.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentBase.md @@ -19,8 +19,8 @@ The fields that should appear on the document, expressed as an array of objects. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `documentIndex`*_required_ | ```Integer``` | Represents the integer index of the `file` or `file_url` document the field should be attached to. | | | `apiId`*_required_ | ```String``` | An identifier for the field that is unique across all documents in the request. | | | `height`*_required_ | ```Integer``` | Size of the field in pixels. | | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentCheckbox.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentCheckbox.md index efcf95dfb..c4e473f3f 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentCheckbox.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentCheckbox.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | | | `isChecked`*_required_ | ```Boolean``` | `true` for checking the checkbox field by default, otherwise `false`. | | | `group` | ```String``` | String referencing group defined in `form_field_groups` parameter. | | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentCheckboxMerge.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentCheckboxMerge.md index efdc81199..824359645 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentCheckboxMerge.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentCheckboxMerge.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. | | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentDateSigned.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentDateSigned.md index 49d4b5fa0..bffc1a4b5 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentDateSigned.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentDateSigned.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | | | `fontFamily` | [```FontFamilyEnum```](#FontFamilyEnum) | Font family for the field. | | | `fontSize` | ```Integer``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -28,12 +28,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentDropdown.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentDropdown.md index afed12e2a..ca470eaa4 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentDropdown.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentDropdown.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | | | `options`*_required_ | ```List``` | Array of string values representing dropdown values. | | | `content` | ```String``` | Selected value in `options` array. Value must exist in array. | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -30,12 +30,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentFontEnum.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentFontEnum.md index c4ea6231e..b7582a236 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentFontEnum.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentFontEnum.md @@ -25,17 +25,17 @@ * `ROBOTO` (value: `"roboto"`) -* `ROBOTOMONO` (value: `"robotoMono"`) +* `ROBOTO_MONO` (value: `"robotoMono"`) -* `NOTOSANS` (value: `"notoSans"`) +* `NOTO_SANS` (value: `"notoSans"`) -* `NOTOSERIF` (value: `"notoSerif"`) +* `NOTO_SERIF` (value: `"notoSerif"`) -* `NOTOCJK_JP_REGULAR` (value: `"notoCJK-JP-Regular"`) +* `NOTO_CJK_JP_REGULAR` (value: `"notoCJK-JP-Regular"`) -* `NOTOHEBREW_REGULAR` (value: `"notoHebrew-Regular"`) +* `NOTO_HEBREW_REGULAR` (value: `"notoHebrew-Regular"`) -* `NOTOSANTHAIMERGED` (value: `"notoSanThaiMerged"`) +* `NOTO_SAN_THAI_MERGED` (value: `"notoSanThaiMerged"`) diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentHyperlink.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentHyperlink.md index 220f6f9fc..543312b59 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentHyperlink.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentHyperlink.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | | | `content`*_required_ | ```String``` | Link Text. | | | `contentUrl`*_required_ | ```String``` | Link URL. | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -30,12 +30,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentInitials.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentInitials.md index 155c7a57e..c3537c2d1 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentInitials.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentInitials.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. | | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentRadio.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentRadio.md index 38150a4ab..c19487677 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentRadio.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentRadio.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | | | `group`*_required_ | ```String``` | String referencing group defined in `form_field_groups` parameter. | | | `isChecked`*_required_ | ```Boolean``` | `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. | | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentSignature.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentSignature.md index 949922a6b..187b14538 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentSignature.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentSignature.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. | | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentText.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentText.md index 9a0c2d6cc..d431f5422 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentText.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentText.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A text input field. Use the `SubFormFieldsPerDocumentText` class. | | | `placeholder` | ```String``` | Placeholder value for text field. | | | `autoFillType` | ```String``` | Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. | | @@ -24,7 +24,7 @@ Name | Type | Description | Notes ## Enum: ValidationTypeEnum -Name | Value +| Name | Value | ---- | ----- | NUMBERS_ONLY | "numbers_only" | | LETTERS_ONLY | "letters_only" | @@ -41,7 +41,7 @@ Name | Value ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -53,12 +53,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/sdks/java-v1/docs/SubFormFieldsPerDocumentTextMerge.md b/sdks/java-v1/docs/SubFormFieldsPerDocumentTextMerge.md index a5fc080eb..e1876cce1 100644 --- a/sdks/java-v1/docs/SubFormFieldsPerDocumentTextMerge.md +++ b/sdks/java-v1/docs/SubFormFieldsPerDocumentTextMerge.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | | | `fontFamily` | [```FontFamilyEnum```](#FontFamilyEnum) | Font family for the field. | | | `fontSize` | ```Integer``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -28,12 +28,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/sdks/java-v1/docs/SubMergeField.md b/sdks/java-v1/docs/SubMergeField.md index f509e1203..66582350e 100644 --- a/sdks/java-v1/docs/SubMergeField.md +++ b/sdks/java-v1/docs/SubMergeField.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of the merge field. Must be unique. | | | `type`*_required_ | [```TypeEnum```](#TypeEnum) | The type of merge field. | | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | TEXT | "text" | | CHECKBOX | "checkbox" | diff --git a/sdks/java-v1/docs/SubOAuth.md b/sdks/java-v1/docs/SubOAuth.md index 23beca8ea..527d0be78 100644 --- a/sdks/java-v1/docs/SubOAuth.md +++ b/sdks/java-v1/docs/SubOAuth.md @@ -6,8 +6,8 @@ OAuth related parameters. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) | | | `scopes` | [```List<ScopesEnum>```](#List<ScopesEnum>) | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ## Enum: List<ScopesEnum> -Name | Value +| Name | Value | ---- | ----- | REQUEST_SIGNATURE | "request_signature" | | BASIC_ACCOUNT_INFO | "basic_account_info" | diff --git a/sdks/java-v1/docs/SubOptions.md b/sdks/java-v1/docs/SubOptions.md index 3ddab2e05..c36523a02 100644 --- a/sdks/java-v1/docs/SubOptions.md +++ b/sdks/java-v1/docs/SubOptions.md @@ -6,8 +6,8 @@ Additional options supported by API App. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `canInsertEverywhere` | ```Boolean``` | Determines if signers can use "Insert Everywhere" when signing a document. | | diff --git a/sdks/java-v1/docs/SubSignatureRequestGroupedSigners.md b/sdks/java-v1/docs/SubSignatureRequestGroupedSigners.md index d1845fbb2..80ace3400 100644 --- a/sdks/java-v1/docs/SubSignatureRequestGroupedSigners.md +++ b/sdks/java-v1/docs/SubSignatureRequestGroupedSigners.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `group`*_required_ | ```String``` | The name of the group. | | | `signers`*_required_ | [```List```](SubSignatureRequestSigner.md) | Signers belonging to this Group.

**NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. | | | `order` | ```Integer``` | The order the group is required to sign in. Use this instead of Signer-level `order`. | | diff --git a/sdks/java-v1/docs/SubSignatureRequestSigner.md b/sdks/java-v1/docs/SubSignatureRequestSigner.md index affc50498..109c422bc 100644 --- a/sdks/java-v1/docs/SubSignatureRequestSigner.md +++ b/sdks/java-v1/docs/SubSignatureRequestSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of the signer. | | | `emailAddress`*_required_ | ```String``` | The email address of the signer. | | | `order` | ```Integer``` | The order the signer is required to sign in. | | @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Enum: SmsPhoneNumberTypeEnum -Name | Value +| Name | Value | ---- | ----- | AUTHENTICATION | "authentication" | | DELIVERY | "delivery" | diff --git a/sdks/java-v1/docs/SubSignatureRequestTemplateSigner.md b/sdks/java-v1/docs/SubSignatureRequestTemplateSigner.md index 0db962b83..866b37355 100644 --- a/sdks/java-v1/docs/SubSignatureRequestTemplateSigner.md +++ b/sdks/java-v1/docs/SubSignatureRequestTemplateSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `role`*_required_ | ```String``` | Must match an existing role in chosen Template(s). It's case-sensitive. | | | `name`*_required_ | ```String``` | The name of the signer. | | | `emailAddress`*_required_ | ```String``` | The email address of the signer. | | @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Enum: SmsPhoneNumberTypeEnum -Name | Value +| Name | Value | ---- | ----- | AUTHENTICATION | "authentication" | | DELIVERY | "delivery" | diff --git a/sdks/java-v1/docs/SubSigningOptions.md b/sdks/java-v1/docs/SubSigningOptions.md index b4acf7f5f..bca116053 100644 --- a/sdks/java-v1/docs/SubSigningOptions.md +++ b/sdks/java-v1/docs/SubSigningOptions.md @@ -8,8 +8,8 @@ This allows the requester to specify the types allowed for creating a signature. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `defaultType`*_required_ | [```DefaultTypeEnum```](#DefaultTypeEnum) | The default type shown (limited to the listed types) | | | `draw` | ```Boolean``` | Allows drawing the signature | | | `phone` | ```Boolean``` | Allows using a smartphone to email the signature | | @@ -20,7 +20,7 @@ Name | Type | Description | Notes ## Enum: DefaultTypeEnum -Name | Value +| Name | Value | ---- | ----- | DRAW | "draw" | | PHONE | "phone" | diff --git a/sdks/java-v1/docs/SubTeamResponse.md b/sdks/java-v1/docs/SubTeamResponse.md index 2b6753033..df784d080 100644 --- a/sdks/java-v1/docs/SubTeamResponse.md +++ b/sdks/java-v1/docs/SubTeamResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `teamId` | ```String``` | The id of a team | | | `name` | ```String``` | The name of a team | | diff --git a/sdks/java-v1/docs/SubTemplateRole.md b/sdks/java-v1/docs/SubTemplateRole.md index 88784cd94..a1ee8e0ea 100644 --- a/sdks/java-v1/docs/SubTemplateRole.md +++ b/sdks/java-v1/docs/SubTemplateRole.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The role name of the signer that will be displayed when the template is used to create a signature request. | | | `order` | ```Integer``` | The order in which this signer role is required to sign. | | diff --git a/sdks/java-v1/docs/SubUnclaimedDraftSigner.md b/sdks/java-v1/docs/SubUnclaimedDraftSigner.md index 70eeb3b07..fec680ac2 100644 --- a/sdks/java-v1/docs/SubUnclaimedDraftSigner.md +++ b/sdks/java-v1/docs/SubUnclaimedDraftSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```String``` | The email address of the signer. | | | `name`*_required_ | ```String``` | The name of the signer. | | | `order` | ```Integer``` | The order the signer is required to sign in. | | diff --git a/sdks/java-v1/docs/SubUnclaimedDraftTemplateSigner.md b/sdks/java-v1/docs/SubUnclaimedDraftTemplateSigner.md index 5e164c44e..1c6547670 100644 --- a/sdks/java-v1/docs/SubUnclaimedDraftTemplateSigner.md +++ b/sdks/java-v1/docs/SubUnclaimedDraftTemplateSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `role`*_required_ | ```String``` | Must match an existing role in chosen Template(s). | | | `name`*_required_ | ```String``` | The name of the signer filling the role of `role`. | | | `emailAddress`*_required_ | ```String``` | The email address of the signer filling the role of `role`. | | diff --git a/sdks/java-v1/docs/SubWhiteLabelingOptions.md b/sdks/java-v1/docs/SubWhiteLabelingOptions.md index c3cb04589..0a5880da3 100644 --- a/sdks/java-v1/docs/SubWhiteLabelingOptions.md +++ b/sdks/java-v1/docs/SubWhiteLabelingOptions.md @@ -8,8 +8,8 @@ Take a look at our [white labeling guide](https://developers.hellosign.com/api/r ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `headerBackgroundColor` | ```String``` | | | | `legalVersion` | [```LegalVersionEnum```](#LegalVersionEnum) | | | | `linkColor` | ```String``` | | | @@ -30,7 +30,7 @@ Name | Type | Description | Notes ## Enum: LegalVersionEnum -Name | Value +| Name | Value | ---- | ----- | TERMS1 | "terms1" | | TERMS2 | "terms2" | diff --git a/sdks/java-v1/docs/TeamAddMemberRequest.md b/sdks/java-v1/docs/TeamAddMemberRequest.md index 062c8b861..122e45b31 100644 --- a/sdks/java-v1/docs/TeamAddMemberRequest.md +++ b/sdks/java-v1/docs/TeamAddMemberRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | `account_id` or `email_address` is required. If both are provided, the account id prevails.

Account id of the user to invite to your Team. | | | `emailAddress` | ```String``` | `account_id` or `email_address` is required, If both are provided, the account id prevails.

Email address of the user to invite to your Team. | | | `role` | [```RoleEnum```](#RoleEnum) | A role member will take in a new Team.

**NOTE:** This parameter is used only if `team_id` is provided. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: RoleEnum -Name | Value +| Name | Value | ---- | ----- | MEMBER | "Member" | | DEVELOPER | "Developer" | diff --git a/sdks/java-v1/docs/TeamApi.md b/sdks/java-v1/docs/TeamApi.md index 252559811..b35b40ea8 100644 --- a/sdks/java-v1/docs/TeamApi.md +++ b/sdks/java-v1/docs/TeamApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**teamAddMember**](TeamApi.md#teamAddMember) | **PUT** /team/add_member | Add User to Team [**teamCreate**](TeamApi.md#teamCreate) | **POST** /team/create | Create Team [**teamDelete**](TeamApi.md#teamDelete) | **DELETE** /team/destroy | Delete Team @@ -70,8 +70,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamAddMemberRequest** | [**TeamAddMemberRequest**](TeamAddMemberRequest.md)| | **teamId** | **String**| The id of the team. | [optional] @@ -146,8 +146,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamCreateRequest** | [**TeamCreateRequest**](TeamCreateRequest.md)| | ### Return type @@ -354,8 +354,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamId** | **String**| The id of the team. | [optional] ### Return type @@ -428,8 +428,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **emailAddress** | **String**| The email address for which to display the team invites. | [optional] ### Return type @@ -504,8 +504,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamId** | **String**| The id of the team that a member list is being requested from. | **page** | **Integer**| Which page number of the team member list to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -582,8 +582,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamRemoveMemberRequest** | [**TeamRemoveMemberRequest**](TeamRemoveMemberRequest.md)| | ### Return type @@ -658,8 +658,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamId** | **String**| The id of the parent Team. | **page** | **Integer**| Which page number of the SubTeam List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -735,8 +735,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamUpdateRequest** | [**TeamUpdateRequest**](TeamUpdateRequest.md)| | ### Return type diff --git a/sdks/java-v1/docs/TeamCreateRequest.md b/sdks/java-v1/docs/TeamCreateRequest.md index cb70adc3d..1a4861618 100644 --- a/sdks/java-v1/docs/TeamCreateRequest.md +++ b/sdks/java-v1/docs/TeamCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of your Team. | | diff --git a/sdks/java-v1/docs/TeamGetInfoResponse.md b/sdks/java-v1/docs/TeamGetInfoResponse.md index 3b6d3e350..1d2bc62a7 100644 --- a/sdks/java-v1/docs/TeamGetInfoResponse.md +++ b/sdks/java-v1/docs/TeamGetInfoResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `team` | [```TeamInfoResponse```](TeamInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `team`*_required_ | [```TeamInfoResponse```](TeamInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/TeamGetResponse.md b/sdks/java-v1/docs/TeamGetResponse.md index fe2d79fa2..690796e1f 100644 --- a/sdks/java-v1/docs/TeamGetResponse.md +++ b/sdks/java-v1/docs/TeamGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `team` | [```TeamResponse```](TeamResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `team`*_required_ | [```TeamResponse```](TeamResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/TeamInfoResponse.md b/sdks/java-v1/docs/TeamInfoResponse.md index aaf76ca89..a776d4e09 100644 --- a/sdks/java-v1/docs/TeamInfoResponse.md +++ b/sdks/java-v1/docs/TeamInfoResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `teamId` | ```String``` | The id of a team | | | `teamParent` | [```TeamParentResponse```](TeamParentResponse.md) | | | | `name` | ```String``` | The name of a team | | diff --git a/sdks/java-v1/docs/TeamInviteResponse.md b/sdks/java-v1/docs/TeamInviteResponse.md index 317bec3b0..c23aa4ed7 100644 --- a/sdks/java-v1/docs/TeamInviteResponse.md +++ b/sdks/java-v1/docs/TeamInviteResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress` | ```String``` | Email address of the user invited to this team. | | | `teamId` | ```String``` | Id of the team. | | | `role` | ```String``` | Role of the user invited to this team. | | diff --git a/sdks/java-v1/docs/TeamInvitesResponse.md b/sdks/java-v1/docs/TeamInvitesResponse.md index 5f0e66963..bdb648bb3 100644 --- a/sdks/java-v1/docs/TeamInvitesResponse.md +++ b/sdks/java-v1/docs/TeamInvitesResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `teamInvites` | [```List```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `teamInvites`*_required_ | [```List```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | | `warnings` | [```List```](WarningResponse.md) | | | diff --git a/sdks/java-v1/docs/TeamMemberResponse.md b/sdks/java-v1/docs/TeamMemberResponse.md index e35f8f660..eb42aa095 100644 --- a/sdks/java-v1/docs/TeamMemberResponse.md +++ b/sdks/java-v1/docs/TeamMemberResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | Account id of the team member. | | | `emailAddress` | ```String``` | Email address of the team member. | | | `role` | ```String``` | The specific role a member has on the team. | | diff --git a/sdks/java-v1/docs/TeamMembersResponse.md b/sdks/java-v1/docs/TeamMembersResponse.md index d3e5e6775..785318277 100644 --- a/sdks/java-v1/docs/TeamMembersResponse.md +++ b/sdks/java-v1/docs/TeamMembersResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `teamMembers` | [```List```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `teamMembers`*_required_ | [```List```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | | | diff --git a/sdks/java-v1/docs/TeamParentResponse.md b/sdks/java-v1/docs/TeamParentResponse.md index 1a0d49c49..c6ba18a98 100644 --- a/sdks/java-v1/docs/TeamParentResponse.md +++ b/sdks/java-v1/docs/TeamParentResponse.md @@ -6,8 +6,8 @@ Information about the parent team if a team has one, set to `null` otherwise. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `teamId` | ```String``` | The id of a team | | | `name` | ```String``` | The name of a team | | diff --git a/sdks/java-v1/docs/TeamRemoveMemberRequest.md b/sdks/java-v1/docs/TeamRemoveMemberRequest.md index 79d3a4c1b..46f48538a 100644 --- a/sdks/java-v1/docs/TeamRemoveMemberRequest.md +++ b/sdks/java-v1/docs/TeamRemoveMemberRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Account id to remove from your Team. | | | `emailAddress` | ```String``` | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Email address of the Account to remove from your Team. | | | `newOwnerEmailAddress` | ```String``` | The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account.

**NOTE:** Only available for Enterprise plans. | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Enum: NewRoleEnum -Name | Value +| Name | Value | ---- | ----- | MEMBER | "Member" | | DEVELOPER | "Developer" | diff --git a/sdks/java-v1/docs/TeamResponse.md b/sdks/java-v1/docs/TeamResponse.md index 26061033a..ca6344cfc 100644 --- a/sdks/java-v1/docs/TeamResponse.md +++ b/sdks/java-v1/docs/TeamResponse.md @@ -6,8 +6,8 @@ Contains information about your team and its members ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of your Team | | | `accounts` | [```List```](AccountResponse.md) | | | | `invitedAccounts` | [```List```](AccountResponse.md) | A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. | | diff --git a/sdks/java-v1/docs/TeamSubTeamsResponse.md b/sdks/java-v1/docs/TeamSubTeamsResponse.md index 1b618f8a7..636aa33eb 100644 --- a/sdks/java-v1/docs/TeamSubTeamsResponse.md +++ b/sdks/java-v1/docs/TeamSubTeamsResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `subTeams` | [```List```](SubTeamResponse.md) | Contains a list with sub teams. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `subTeams`*_required_ | [```List```](SubTeamResponse.md) | Contains a list with sub teams. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | | | diff --git a/sdks/java-v1/docs/TeamUpdateRequest.md b/sdks/java-v1/docs/TeamUpdateRequest.md index 545510d88..9df0fe1da 100644 --- a/sdks/java-v1/docs/TeamUpdateRequest.md +++ b/sdks/java-v1/docs/TeamUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of your Team. | | diff --git a/sdks/java-v1/docs/TemplateAddUserRequest.md b/sdks/java-v1/docs/TemplateAddUserRequest.md index 5415106a3..74966192b 100644 --- a/sdks/java-v1/docs/TemplateAddUserRequest.md +++ b/sdks/java-v1/docs/TemplateAddUserRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The id of the Account to give access to the Template.
**NOTE:** The account id prevails if email address is also provided. | | | `emailAddress` | ```String``` | The email address of the Account to give access to the Template.
**NOTE:** The account id prevails if it is also provided. | | | `skipNotification` | ```Boolean``` | If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. | | diff --git a/sdks/java-v1/docs/TemplateApi.md b/sdks/java-v1/docs/TemplateApi.md index 0a2a4480b..a3394d6a1 100644 --- a/sdks/java-v1/docs/TemplateApi.md +++ b/sdks/java-v1/docs/TemplateApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**templateAddUser**](TemplateApi.md#templateAddUser) | **POST** /template/add_user/{template_id} | Add User to Template [**templateCreate**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template [**templateCreateEmbeddedDraft**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft @@ -71,8 +71,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to give the Account access to. | **templateAddUserRequest** | [**TemplateAddUserRequest**](TemplateAddUserRequest.md)| | @@ -178,8 +178,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateCreateRequest** | [**TemplateCreateRequest**](TemplateCreateRequest.md)| | ### Return type @@ -284,8 +284,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateCreateEmbeddedDraftRequest** | [**TemplateCreateEmbeddedDraftRequest**](TemplateCreateEmbeddedDraftRequest.md)| | ### Return type @@ -356,8 +356,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to delete. | ### Return type @@ -433,8 +433,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template files to retrieve. | **fileType** | **String**| Set to `pdf` for a single merged document or `zip` for a collection of individual documents. | [optional] [enum: pdf, zip] @@ -510,8 +510,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template files to retrieve. | ### Return type @@ -586,8 +586,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template files to retrieve. | **forceDownload** | **Integer**| By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. | [optional] [default to 1] @@ -661,8 +661,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to retrieve. | ### Return type @@ -740,8 +740,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountId** | **String**| Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. | [optional] **page** | **Integer**| Which page number of the Template List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -820,8 +820,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to remove the Account's access to. | **templateRemoveUserRequest** | [**TemplateRemoveUserRequest**](TemplateRemoveUserRequest.md)| | @@ -911,8 +911,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The ID of the template whose files to update. | **templateUpdateFilesRequest** | [**TemplateUpdateFilesRequest**](TemplateUpdateFilesRequest.md)| | diff --git a/sdks/java-v1/docs/TemplateCreateEmbeddedDraftRequest.md b/sdks/java-v1/docs/TemplateCreateEmbeddedDraftRequest.md index be051c8ff..05f2497fc 100644 --- a/sdks/java-v1/docs/TemplateCreateEmbeddedDraftRequest.md +++ b/sdks/java-v1/docs/TemplateCreateEmbeddedDraftRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | diff --git a/sdks/java-v1/docs/TemplateCreateEmbeddedDraftResponse.md b/sdks/java-v1/docs/TemplateCreateEmbeddedDraftResponse.md index 2109e4f27..f25b48d33 100644 --- a/sdks/java-v1/docs/TemplateCreateEmbeddedDraftResponse.md +++ b/sdks/java-v1/docs/TemplateCreateEmbeddedDraftResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/TemplateCreateEmbeddedDraftResponseTemplate.md b/sdks/java-v1/docs/TemplateCreateEmbeddedDraftResponseTemplate.md index 7b7dc1e7b..770cce434 100644 --- a/sdks/java-v1/docs/TemplateCreateEmbeddedDraftResponseTemplate.md +++ b/sdks/java-v1/docs/TemplateCreateEmbeddedDraftResponseTemplate.md @@ -6,8 +6,8 @@ Template object with parameters: `template_id`, `edit_url`, `expires_at`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | | `editUrl` | ```String``` | Link to edit the template. | | | `expiresAt` | ```Integer``` | When the link expires. | | diff --git a/sdks/java-v1/docs/TemplateCreateRequest.md b/sdks/java-v1/docs/TemplateCreateRequest.md index 4d529fdb8..5f99510d9 100644 --- a/sdks/java-v1/docs/TemplateCreateRequest.md +++ b/sdks/java-v1/docs/TemplateCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `formFieldsPerDocument`*_required_ | [```List```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | | `signerRoles`*_required_ | [```List```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | diff --git a/sdks/java-v1/docs/TemplateCreateResponse.md b/sdks/java-v1/docs/TemplateCreateResponse.md index 6554466f2..3c7389668 100644 --- a/sdks/java-v1/docs/TemplateCreateResponse.md +++ b/sdks/java-v1/docs/TemplateCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/TemplateCreateResponseTemplate.md b/sdks/java-v1/docs/TemplateCreateResponseTemplate.md index ae09826fb..1dcd4bd79 100644 --- a/sdks/java-v1/docs/TemplateCreateResponseTemplate.md +++ b/sdks/java-v1/docs/TemplateCreateResponseTemplate.md @@ -6,8 +6,8 @@ Template object with parameters: `template_id`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | diff --git a/sdks/java-v1/docs/TemplateEditResponse.md b/sdks/java-v1/docs/TemplateEditResponse.md index fe7f90761..88d225e68 100644 --- a/sdks/java-v1/docs/TemplateEditResponse.md +++ b/sdks/java-v1/docs/TemplateEditResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `templateId` | ```String``` | The id of the Template. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templateId`*_required_ | ```String``` | The id of the Template. | | diff --git a/sdks/java-v1/docs/TemplateGetResponse.md b/sdks/java-v1/docs/TemplateGetResponse.md index 3e073bab8..2ee4867f0 100644 --- a/sdks/java-v1/docs/TemplateGetResponse.md +++ b/sdks/java-v1/docs/TemplateGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateResponse```](TemplateResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateResponse```](TemplateResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/TemplateListResponse.md b/sdks/java-v1/docs/TemplateListResponse.md index 83e54d785..92b720c58 100644 --- a/sdks/java-v1/docs/TemplateListResponse.md +++ b/sdks/java-v1/docs/TemplateListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `templates` | [```List```](TemplateResponse.md) | List of templates that the API caller has access to. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templates`*_required_ | [```List```](TemplateResponse.md) | List of templates that the API caller has access to. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/TemplateRemoveUserRequest.md b/sdks/java-v1/docs/TemplateRemoveUserRequest.md index c2697022a..72a3a585a 100644 --- a/sdks/java-v1/docs/TemplateRemoveUserRequest.md +++ b/sdks/java-v1/docs/TemplateRemoveUserRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | | | `emailAddress` | ```String``` | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | | diff --git a/sdks/java-v1/docs/TemplateResponse.md b/sdks/java-v1/docs/TemplateResponse.md index 7811ccc0c..078685ff1 100644 --- a/sdks/java-v1/docs/TemplateResponse.md +++ b/sdks/java-v1/docs/TemplateResponse.md @@ -6,8 +6,8 @@ Contains information about the templates you and your team have created. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | | `title` | ```String``` | The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | | | `message` | ```String``` | The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | | diff --git a/sdks/java-v1/docs/TemplateResponseAccount.md b/sdks/java-v1/docs/TemplateResponseAccount.md index bf956bf0e..10c996408 100644 --- a/sdks/java-v1/docs/TemplateResponseAccount.md +++ b/sdks/java-v1/docs/TemplateResponseAccount.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The id of the Account. | | | `emailAddress` | ```String``` | The email address associated with the Account. | | | `isLocked` | ```Boolean``` | Returns `true` if the user has been locked out of their account by a team admin. | | diff --git a/sdks/java-v1/docs/TemplateResponseAccountQuota.md b/sdks/java-v1/docs/TemplateResponseAccountQuota.md index 2ef4344da..ad94c2493 100644 --- a/sdks/java-v1/docs/TemplateResponseAccountQuota.md +++ b/sdks/java-v1/docs/TemplateResponseAccountQuota.md @@ -6,8 +6,8 @@ An array of the designated CC roles that must be specified when sending a Signat ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templatesLeft` | ```Integer``` | API templates remaining. | | | `apiSignatureRequestsLeft` | ```Integer``` | API signature requests remaining. | | | `documentsLeft` | ```Integer``` | Signature requests remaining. | | diff --git a/sdks/java-v1/docs/TemplateResponseCCRole.md b/sdks/java-v1/docs/TemplateResponseCCRole.md index 1701c9739..64069b826 100644 --- a/sdks/java-v1/docs/TemplateResponseCCRole.md +++ b/sdks/java-v1/docs/TemplateResponseCCRole.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of the Role. | | diff --git a/sdks/java-v1/docs/TemplateResponseDocument.md b/sdks/java-v1/docs/TemplateResponseDocument.md index e0a090d3b..65da85d42 100644 --- a/sdks/java-v1/docs/TemplateResponseDocument.md +++ b/sdks/java-v1/docs/TemplateResponseDocument.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | Name of the associated file. | | | `index` | ```Integer``` | Document ordering, the lowest index is displayed first and the highest last (0-based indexing). | | | `fieldGroups` | [```List```](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldBase.md b/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldBase.md index 33ba5cdce..edd461727 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldBase.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldBase.md @@ -6,8 +6,8 @@ An array of Form Field objects containing the name and type of each named field. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | | | | `apiId` | ```String``` | The unique ID for this field. | | | `name` | ```String``` | The name of the Custom Field. | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldCheckbox.md b/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldCheckbox.md index f69fa79e6..dbde79072 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldCheckbox.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentCustomFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldText.md b/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldText.md index 9fa8d7aac..ccaf19394 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldText.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentCustomFieldText.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentCustomFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | | | `avgTextLength` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `isMultiline` | ```Boolean``` | Whether this form field is multiline text. | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFieldGroup.md b/sdks/java-v1/docs/TemplateResponseDocumentFieldGroup.md index 568bd52ab..03b5ffbb8 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFieldGroup.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFieldGroup.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of the form field group. | | | `rule` | [```TemplateResponseDocumentFieldGroupRule```](TemplateResponseDocumentFieldGroupRule.md) | | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFieldGroupRule.md b/sdks/java-v1/docs/TemplateResponseDocumentFieldGroupRule.md index 48b234ac6..e0f4dcc8a 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFieldGroupRule.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFieldGroupRule.md @@ -6,8 +6,8 @@ The rule used to validate checkboxes in the form field group. See [checkbox fiel ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `requirement` | ```String``` | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | | | `groupLabel` | ```String``` | Name of the group | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldBase.md b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldBase.md index 00696c3d2..656070ad4 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldBase.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldBase.md @@ -6,8 +6,8 @@ An array of Form Field objects containing the name and type of each named field. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | | | | `apiId` | ```String``` | A unique id for the form field. | | | `name` | ```String``` | The name of the form field. | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldCheckbox.md b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldCheckbox.md index 95a9c47cd..83d36e0f1 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldCheckbox.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldDateSigned.md b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldDateSigned.md index 4aeb9b383..5ba66eff9 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldDateSigned.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldDateSigned.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldDropdown.md b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldDropdown.md index f4abfa605..b4f2030fc 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldDropdown.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldDropdown.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldHyperlink.md b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldHyperlink.md index c59fa688f..0cf89df5e 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldHyperlink.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldHyperlink.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | | `avgTextLength` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `isMultiline` | ```Boolean``` | Whether this form field is multiline text. | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldInitials.md b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldInitials.md index 487fde46b..707d67ee2 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldInitials.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldInitials.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldRadio.md b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldRadio.md index d08e6501d..b83d96d53 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldRadio.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldRadio.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldSignature.md b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldSignature.md index 08173e8a6..8be298793 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldSignature.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldSignature.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldText.md b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldText.md index a7eec6d4b..3581d3855 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentFormFieldText.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentFormFieldText.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | | `avgTextLength` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `isMultiline` | ```Boolean``` | Whether this form field is multiline text. | | @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Enum: ValidationTypeEnum -Name | Value +| Name | Value | ---- | ----- | NUMBERS_ONLY | "numbers_only" | | LETTERS_ONLY | "letters_only" | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldBase.md b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldBase.md index 18c56b865..4be3cf070 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldBase.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldBase.md @@ -6,8 +6,8 @@ An array describing static overlay fields. **NOTE:** Only available for certain ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | | | | `apiId` | ```String``` | A unique id for the static field. | | | `name` | ```String``` | The name of the static field. | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldCheckbox.md b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldCheckbox.md index d33f03d6c..6cd94853c 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldCheckbox.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldDateSigned.md b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldDateSigned.md index 5e0eaa675..d5c530d8b 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldDateSigned.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldDateSigned.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldDropdown.md b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldDropdown.md index bb9f131dc..53505315e 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldDropdown.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldDropdown.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldHyperlink.md b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldHyperlink.md index a38e229fb..930658b69 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldHyperlink.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldHyperlink.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldInitials.md b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldInitials.md index 202640121..67d755703 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldInitials.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldInitials.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldRadio.md b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldRadio.md index 7a140face..ed32ccca6 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldRadio.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldRadio.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldSignature.md b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldSignature.md index e9a037282..61f8902f8 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldSignature.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldSignature.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldText.md b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldText.md index 4135e5f7d..3dced017f 100644 --- a/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldText.md +++ b/sdks/java-v1/docs/TemplateResponseDocumentStaticFieldText.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v1/docs/TemplateResponseFieldAvgTextLength.md b/sdks/java-v1/docs/TemplateResponseFieldAvgTextLength.md index c1fda157a..bb66f3057 100644 --- a/sdks/java-v1/docs/TemplateResponseFieldAvgTextLength.md +++ b/sdks/java-v1/docs/TemplateResponseFieldAvgTextLength.md @@ -6,8 +6,8 @@ Average text length in this field. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `numLines` | ```Integer``` | Number of lines. | | | `numCharsPerLine` | ```Integer``` | Number of characters per line. | | diff --git a/sdks/java-v1/docs/TemplateResponseSignerRole.md b/sdks/java-v1/docs/TemplateResponseSignerRole.md index b95231dde..15b48cf17 100644 --- a/sdks/java-v1/docs/TemplateResponseSignerRole.md +++ b/sdks/java-v1/docs/TemplateResponseSignerRole.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of the Role. | | | `order` | ```Integer``` | If signer order is assigned this is the 0-based index for this role. | | diff --git a/sdks/java-v1/docs/TemplateUpdateFilesRequest.md b/sdks/java-v1/docs/TemplateUpdateFilesRequest.md index 2bebedb2e..8671b87f8 100644 --- a/sdks/java-v1/docs/TemplateUpdateFilesRequest.md +++ b/sdks/java-v1/docs/TemplateUpdateFilesRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId` | ```String``` | Client id of the app you're using to update this template. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to use for the template.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | diff --git a/sdks/java-v1/docs/TemplateUpdateFilesResponse.md b/sdks/java-v1/docs/TemplateUpdateFilesResponse.md index 127b29541..70930e1c8 100644 --- a/sdks/java-v1/docs/TemplateUpdateFilesResponse.md +++ b/sdks/java-v1/docs/TemplateUpdateFilesResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | diff --git a/sdks/java-v1/docs/TemplateUpdateFilesResponseTemplate.md b/sdks/java-v1/docs/TemplateUpdateFilesResponseTemplate.md index 9c198aaa7..6289a9953 100644 --- a/sdks/java-v1/docs/TemplateUpdateFilesResponseTemplate.md +++ b/sdks/java-v1/docs/TemplateUpdateFilesResponseTemplate.md @@ -6,8 +6,8 @@ Contains template id ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/UnclaimedDraftApi.md b/sdks/java-v1/docs/UnclaimedDraftApi.md index fbdf78216..4d6d12451 100644 --- a/sdks/java-v1/docs/UnclaimedDraftApi.md +++ b/sdks/java-v1/docs/UnclaimedDraftApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**unclaimedDraftCreate**](UnclaimedDraftApi.md#unclaimedDraftCreate) | **POST** /unclaimed_draft/create | Create Unclaimed Draft [**unclaimedDraftCreateEmbedded**](UnclaimedDraftApi.md#unclaimedDraftCreateEmbedded) | **POST** /unclaimed_draft/create_embedded | Create Embedded Unclaimed Draft [**unclaimedDraftCreateEmbeddedWithTemplate**](UnclaimedDraftApi.md#unclaimedDraftCreateEmbeddedWithTemplate) | **POST** /unclaimed_draft/create_embedded_with_template | Create Embedded Unclaimed Draft with Template @@ -95,8 +95,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **unclaimedDraftCreateRequest** | [**UnclaimedDraftCreateRequest**](UnclaimedDraftCreateRequest.md)| | ### Return type @@ -177,8 +177,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **unclaimedDraftCreateEmbeddedRequest** | [**UnclaimedDraftCreateEmbeddedRequest**](UnclaimedDraftCreateEmbeddedRequest.md)| | ### Return type @@ -270,8 +270,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **unclaimedDraftCreateEmbeddedWithTemplateRequest** | [**UnclaimedDraftCreateEmbeddedWithTemplateRequest**](UnclaimedDraftCreateEmbeddedWithTemplateRequest.md)| | ### Return type @@ -350,8 +350,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The ID of the signature request to edit and resend. | **unclaimedDraftEditAndResendRequest** | [**UnclaimedDraftEditAndResendRequest**](UnclaimedDraftEditAndResendRequest.md)| | diff --git a/sdks/java-v1/docs/UnclaimedDraftCreateEmbeddedRequest.md b/sdks/java-v1/docs/UnclaimedDraftCreateEmbeddedRequest.md index 60eebef2c..aab362d77 100644 --- a/sdks/java-v1/docs/UnclaimedDraftCreateEmbeddedRequest.md +++ b/sdks/java-v1/docs/UnclaimedDraftCreateEmbeddedRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `requesterEmailAddress`*_required_ | ```String``` | The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | @@ -49,7 +49,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | SEND_DOCUMENT | "send_document" | | REQUEST_SIGNATURE | "request_signature" | diff --git a/sdks/java-v1/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md b/sdks/java-v1/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md index 52b517517..03ad8b9e5 100644 --- a/sdks/java-v1/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +++ b/sdks/java-v1/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `requesterEmailAddress`*_required_ | ```String``` | The email address of the user that should be designated as the requester of this draft. | | | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | | diff --git a/sdks/java-v1/docs/UnclaimedDraftCreateRequest.md b/sdks/java-v1/docs/UnclaimedDraftCreateRequest.md index cd8249aa1..f23c6f4ba 100644 --- a/sdks/java-v1/docs/UnclaimedDraftCreateRequest.md +++ b/sdks/java-v1/docs/UnclaimedDraftCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | [```TypeEnum```](#TypeEnum) | The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | @@ -37,7 +37,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | SEND_DOCUMENT | "send_document" | | REQUEST_SIGNATURE | "request_signature" | diff --git a/sdks/java-v1/docs/UnclaimedDraftCreateResponse.md b/sdks/java-v1/docs/UnclaimedDraftCreateResponse.md index 65ed7f98e..d2d3a7c4a 100644 --- a/sdks/java-v1/docs/UnclaimedDraftCreateResponse.md +++ b/sdks/java-v1/docs/UnclaimedDraftCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `unclaimedDraft` | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `unclaimedDraft`*_required_ | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v1/docs/UnclaimedDraftEditAndResendRequest.md b/sdks/java-v1/docs/UnclaimedDraftEditAndResendRequest.md index daefa5a1e..8eb306a31 100644 --- a/sdks/java-v1/docs/UnclaimedDraftEditAndResendRequest.md +++ b/sdks/java-v1/docs/UnclaimedDraftEditAndResendRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `editorOptions` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `isForEmbeddedSigning` | ```Boolean``` | The request created from this draft will also be signable in embedded mode if set to `true`. | | diff --git a/sdks/java-v1/docs/UnclaimedDraftResponse.md b/sdks/java-v1/docs/UnclaimedDraftResponse.md index ab1858d8e..ab470a27d 100644 --- a/sdks/java-v1/docs/UnclaimedDraftResponse.md +++ b/sdks/java-v1/docs/UnclaimedDraftResponse.md @@ -6,8 +6,8 @@ A group of documents that a user can take ownership of via the claim URL. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signatureRequestId` | ```String``` | The ID of the signature request that is represented by this UnclaimedDraft. | | | `claimUrl` | ```String``` | The URL to be used to claim this UnclaimedDraft. | | | `signingRedirectUrl` | ```String``` | The URL you want signers redirected to after they successfully sign. | | diff --git a/sdks/java-v1/docs/WarningResponse.md b/sdks/java-v1/docs/WarningResponse.md index b041bb35c..50cad9b58 100644 --- a/sdks/java-v1/docs/WarningResponse.md +++ b/sdks/java-v1/docs/WarningResponse.md @@ -6,8 +6,8 @@ A list of warnings. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `warningMsg`*_required_ | ```String``` | Warning message | | | `warningName`*_required_ | ```String``` | Warning name | | diff --git a/sdks/java-v1/gradle.properties b/sdks/java-v1/gradle.properties index e1df21108..7e6977b54 100644 --- a/sdks/java-v1/gradle.properties +++ b/sdks/java-v1/gradle.properties @@ -6,7 +6,7 @@ #target = android GROUP=com.dropbox.sign POM_ARTIFACT_ID=dropbox-sign -VERSION_NAME=1.5-dev +VERSION_NAME=1.6-dev POM_NAME=Dropbox Sign Java SDK POM_DESCRIPTION=Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! diff --git a/sdks/java-v1/gradle/wrapper/gradle-wrapper.jar b/sdks/java-v1/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 7454180f2..000000000 Binary files a/sdks/java-v1/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/sdks/java-v1/gradle/wrapper/gradle-wrapper.properties b/sdks/java-v1/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 774fae876..000000000 --- a/sdks/java-v1/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/sdks/java-v1/gradlew b/sdks/java-v1/gradlew index 005bcde04..9d0ce634c 100755 --- a/sdks/java-v1/gradlew +++ b/sdks/java-v1/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi +fi else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/sdks/java-v1/gradlew.bat b/sdks/java-v1/gradlew.bat index 6a68175eb..25da30dbd 100644 --- a/sdks/java-v1/gradlew.bat +++ b/sdks/java-v1/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/sdks/java-v1/openapi-config.yaml b/sdks/java-v1/openapi-config.yaml index 1694a694f..6b69dab93 100644 --- a/sdks/java-v1/openapi-config.yaml +++ b/sdks/java-v1/openapi-config.yaml @@ -16,7 +16,7 @@ additionalProperties: groupId: com.dropbox.sign artifactId: dropbox-sign artifactName: Dropbox Sign Java SDK - artifactVersion: "1.5-dev" + artifactVersion: "1.6-dev" artifactUrl: https://github.com/hellosign/dropbox-sign-java artifactDescription: Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! scmConnection: scm:git:git://github.com/hellosign/dropbox-sign-java.git @@ -24,7 +24,7 @@ additionalProperties: scmUrl: https://github.com/hellosign/dropbox-sign-java licenseName: MIT License licenseUrl: https://www.opensource.org/licenses/mit-license.php - + useCustomTemplateCode: true files: EventCallbackHelper.mustache: templateType: SupportingFiles diff --git a/sdks/java-v1/pom.xml b/sdks/java-v1/pom.xml index 6a4d3d974..369f64ada 100644 --- a/sdks/java-v1/pom.xml +++ b/sdks/java-v1/pom.xml @@ -5,7 +5,7 @@ dropbox-sign jar dropbox-sign - 1.5-dev + 1.6-dev https://github.com/hellosign/dropbox-sign-java Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! @@ -58,12 +58,12 @@ maven-surefire-plugin 3.0.0-M5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -104,7 +104,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.2.2 @@ -118,7 +118,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -149,7 +149,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.10.1 1.8 1.8 @@ -165,7 +165,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.3.2 attach-javadocs @@ -250,7 +250,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 sign-artifacts @@ -267,12 +267,6 @@ - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - commons-codec commons-codec @@ -329,11 +323,6 @@ jackson-datatype-jsr310 ${jackson-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -347,8 +336,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -361,15 +350,13 @@ UTF-8 - 1.6.3 - 2.35 - 2.13.0 - 2.13.0 - 0.2.2 - 2.9.10 + 2.37 + 2.17.1 + 2.17.1 + 0.2.6 1.3.5 - 4.13.2 - 2.17.3 + 5.10.0 + 2.21.0 3.12.4 diff --git a/sdks/java-v1/run-build b/sdks/java-v1/run-build index 82ab396e1..1e1cfec3e 100755 --- a/sdks/java-v1/run-build +++ b/sdks/java-v1/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/v5.4.0/modules/openapi-generator/src/main/resources/Java +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/Java set -e @@ -9,7 +9,7 @@ WORKING_DIR="/app/java" docker run --rm \ -v "${DIR}/:/local" \ - openapitools/openapi-generator-cli:v5.3.0 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/ApiClient.java b/sdks/java-v1/src/main/java/com/dropbox/sign/ApiClient.java index 2dc3d7505..1fb48c412 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/ApiClient.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/ApiClient.java @@ -1,3 +1,16 @@ +/* + * 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; import javax.ws.rs.client.Client; @@ -35,6 +48,7 @@ import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -42,12 +56,15 @@ import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; -import org.threeten.bp.OffsetDateTime; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.time.OffsetDateTime; import java.net.URLEncoder; @@ -62,47 +79,53 @@ import com.dropbox.sign.auth.HttpBasicAuth; import com.dropbox.sign.auth.HttpBearerAuth; import com.dropbox.sign.auth.ApiKeyAuth; - import com.dropbox.sign.model.ErrorResponse; /** *

ApiClient class.

*/ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiClient extends JavaTimeFormatter { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "https://api.hellosign.com/v3"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "https://api.hellosign.com/v3", - "No description provided", - new HashMap() - ) + protected List servers = new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "https://api.hellosign.com/v3", + "No description provided", + new LinkedHashMap<>() + ) )); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ - put("OAuthApi.oauthTokenGenerate", new ArrayList(Arrays.asList( - new ServerConfiguration( - "https://app.hellosign.com", - "No description provided", - new HashMap() - ) + protected Map> operationServers; + + { + Map> operationServers = new HashMap<>(); + operationServers.put("OAuthApi.oauthTokenGenerate", new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "https://app.hellosign.com", + "No description provided", + new LinkedHashMap<>() + ) ))); - put("OAuthApi.oauthTokenRefresh", new ArrayList(Arrays.asList( - new ServerConfiguration( - "https://app.hellosign.com", - "No description provided", - new HashMap() - ) + operationServers.put("OAuthApi.oauthTokenRefresh", new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "https://app.hellosign.com", + "No description provided", + new LinkedHashMap<>() + ) ))); - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + this.operationServers = operationServers; + } + + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -136,10 +159,10 @@ public ApiClient(Map authMap) { this.dateFormat = new RFC3339DateFormat(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.5-dev/java"); + setUserAgent("OpenAPI-Generator/1.6-dev/java"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; if (authMap != null) { auth = authMap.get("api_key"); @@ -161,7 +184,7 @@ public ApiClient(Map authMap) { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap(); + authenticationLookup = new HashMap<>(); } /** @@ -186,7 +209,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -206,7 +229,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -226,7 +249,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -247,7 +270,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -268,7 +291,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -305,7 +328,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -321,7 +344,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -337,7 +360,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -352,11 +375,12 @@ public ApiClient setApiKey(String apiKey) { throw new RuntimeException("No API key authentication configured!"); } + /** * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -372,7 +396,7 @@ public ApiClient setBearerToken(String bearerToken) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -394,7 +418,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -406,7 +430,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -426,7 +450,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -448,7 +472,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -472,7 +496,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -494,7 +518,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -517,7 +541,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -538,7 +562,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -584,9 +608,9 @@ public String parameterToString(Object param) { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -607,14 +631,14 @@ public String parameterToString(Object param) { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; @@ -666,14 +690,13 @@ public List parameterToPairs(String collectionFormat, String name, Object * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -685,8 +708,8 @@ public boolean isJsonMime(String mime) { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -706,8 +729,8 @@ public String selectHeaderAccept(String[] accepts) { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -751,7 +774,17 @@ public Entity serialize(Object obj, Map formParams, String co File file = (File) param.getValue(); FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) .fileName(file.getName()).size(file.length()).build(); - multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); + + // Attempt to probe the content type for the file so that the form part is more correctly + // and precisely identified, but fall back to application/octet-stream if that fails. + MediaType type; + try { + type = MediaType.valueOf(Files.probeContentType(file.toPath())); + } catch (IOException | IllegalArgumentException e) { + type = MediaType.APPLICATION_OCTET_STREAM_TYPE; + } + + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type)); } else { FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); @@ -845,11 +878,6 @@ public T deserialize(Response response, GenericType returnType) throws Ap return file; } - String contentType = null; - List contentTypes = response.getHeaders().get("Content-Type"); - if (contentTypes != null && !contentTypes.isEmpty()) - contentType = String.valueOf(contentTypes.get(0)); - // read the entity stream multiple times response.bufferEntity(); @@ -951,14 +979,11 @@ public ApiResponse invokeAPI( boolean isBodyNullable) throws ApiException { - // Not using `.target(targetURL).path(path)` below, - // to support (constant) query string in `path`, e.g. "/posts?draft=1" String targetURL; - if (serverIndex != null && operationServers.containsKey(operation)) { - Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex; - Map variables = operationServerVariables.containsKey(operation) ? - operationServerVariables.get(operation) : serverVariables; - List serverConfigurations = operationServers.get(operation); + List serverConfigurations; + if (serverIndex != null && (serverConfigurations = operationServers.get(operation)) != null) { + int index = operationServerIndex.getOrDefault(operation, serverIndex).intValue(); + Map variables = operationServerVariables.getOrDefault(operation, serverVariables); if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( @@ -969,6 +994,8 @@ public ApiResponse invokeAPI( } else { targetURL = this.basePath + path; } + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" WebTarget target = httpClient.target(targetURL); if (queryParams != null) { @@ -979,11 +1006,10 @@ public ApiResponse invokeAPI( } } - Invocation.Builder invocationBuilder; + Invocation.Builder invocationBuilder = target.request(); + if (accept != null) { - invocationBuilder = target.request().accept(accept); - } else { - invocationBuilder = target.request(); + invocationBuilder = invocationBuilder.accept(accept); } for (Entry entry : cookieParams.entrySet()) { @@ -1006,15 +1032,17 @@ public ApiResponse invokeAPI( Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + null, + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1028,10 +1056,11 @@ public ApiResponse invokeAPI( try { response = sendRequest(method, invocationBuilder, entity); - int statusCode = response.getStatusInfo().getStatusCode(); + final int statusCode = response.getStatusInfo().getStatusCode(); + Map> responseHeaders = buildResponseHeaders(response); - if (response.getStatusInfo() == Status.NO_CONTENT) { + if (statusCode == Status.NO_CONTENT.getStatusCode()) { return new ApiResponse(statusCode, responseHeaders); } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { if (returnType == null) { @@ -1104,8 +1133,8 @@ protected Client buildHttpClient() { clientConfig = getDefaultClientConfig(); ClientBuilder clientBuilder = ClientBuilder.newBuilder(); - customizeClientBuilder(clientBuilder); clientBuilder = clientBuilder.withConfig(clientConfig); + customizeClientBuilder(clientBuilder); return clientBuilder.build(); } @@ -1192,10 +1221,10 @@ public void checkServerTrusted(X509Certificate[] certs, String authType) { * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/ApiException.java b/sdks/java-v1/src/main/java/com/dropbox/sign/ApiException.java index 6bb15f2d1..92ae80e8c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/ApiException.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/ApiException.java @@ -13,15 +13,17 @@ package com.dropbox.sign; -import com.dropbox.sign.model.ErrorResponse; import java.util.Map; import java.util.List; +import com.dropbox.sign.model.ErrorResponse; /** * API Exception */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/Configuration.java b/sdks/java-v1/src/main/java/com/dropbox/sign/Configuration.java index a7dda5bc8..4bcbe4013 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/Configuration.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/Configuration.java @@ -13,8 +13,10 @@ package com.dropbox.sign; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Configuration { + public static final String VERSION = "1.6-dev"; + private static ApiClient defaultApiClient = new ApiClient(); /** diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/CustomInstantDeserializer.java b/sdks/java-v1/src/main/java/com/dropbox/sign/CustomInstantDeserializer.java deleted file mode 100644 index a58fea422..000000000 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.dropbox.sign; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/EventCallbackHelper.java b/sdks/java-v1/src/main/java/com/dropbox/sign/EventCallbackHelper.java index 47f5a81d9..39eb4b7ae 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/EventCallbackHelper.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/EventCallbackHelper.java @@ -18,7 +18,7 @@ import org.apache.commons.codec.digest.HmacAlgorithms; import org.apache.commons.codec.digest.HmacUtils; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class EventCallbackHelper { public static final String EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback"; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/JSON.java b/sdks/java-v1/src/main/java/com/dropbox/sign/JSON.java index 49a25e1cb..638c43fb9 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/JSON.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/JSON.java @@ -1,11 +1,22 @@ +/* + * 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; -import org.threeten.bp.*; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import com.dropbox.sign.model.*; import java.text.DateFormat; @@ -16,26 +27,22 @@ import javax.ws.rs.core.GenericType; import javax.ws.rs.ext.ContextResolver; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class JSON implements ContextResolver { private ObjectMapper mapper; public JSON() { - mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - JsonMapper.builder().configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.setDateFormat(new RFC3339DateFormat()); - mapper.registerModule(new JavaTimeModule()); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + .build(); } /** @@ -68,7 +75,7 @@ public ObjectMapper getContext(Class type) { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -88,7 +95,7 @@ private static class ClassDiscriminatorMapping { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -182,9 +189,9 @@ public static boolean isInstanceOf(Class modelClass, Object inst, Set descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -196,12 +203,12 @@ public static boolean isInstanceOf(Class modelClass, Object inst, Set, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -221,7 +228,7 @@ public static void registerDiscriminator(Class modelClass, String discriminat * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/JavaTimeFormatter.java b/sdks/java-v1/src/main/java/com/dropbox/sign/JavaTimeFormatter.java index f39f99529..54585414e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/JavaTimeFormatter.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/JavaTimeFormatter.java @@ -12,15 +12,15 @@ package com.dropbox.sign; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/Pair.java b/sdks/java-v1/src/main/java/com/dropbox/sign/Pair.java index 2e0fd7295..93293ef4b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/Pair.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/Pair.java @@ -13,7 +13,7 @@ package com.dropbox.sign; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Pair { private String name = ""; private String value = ""; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/RFC3339DateFormat.java b/sdks/java-v1/src/main/java/com/dropbox/sign/RFC3339DateFormat.java index 6187eb387..6c3ae75b4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/RFC3339DateFormat.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/RFC3339DateFormat.java @@ -18,9 +18,11 @@ import java.text.FieldPosition; import java.text.ParsePosition; import java.util.Date; +import java.text.DecimalFormat; import java.util.GregorianCalendar; import java.util.TimeZone; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); @@ -31,6 +33,7 @@ public class RFC3339DateFormat extends DateFormat { public RFC3339DateFormat() { this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); } @Override @@ -52,4 +55,4 @@ public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fie public Object clone() { return super.clone(); } -} \ No newline at end of file +} diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/ServerConfiguration.java b/sdks/java-v1/src/main/java/com/dropbox/sign/ServerConfiguration.java index f275a1400..3d10c64a7 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/ServerConfiguration.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/ServerConfiguration.java @@ -1,3 +1,16 @@ +/* + * 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; import java.util.Map; @@ -5,6 +18,7 @@ /** * Representing a Server configuration. */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ServerConfiguration { public String URL; public String description; @@ -39,10 +53,10 @@ public String URL(Map variables) { if (variables != null && variables.containsKey(name)) { value = variables.get(name); if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/ServerVariable.java b/sdks/java-v1/src/main/java/com/dropbox/sign/ServerVariable.java index d38fd305e..39b085003 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/ServerVariable.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/ServerVariable.java @@ -1,3 +1,16 @@ +/* + * 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; import java.util.HashSet; @@ -5,6 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/StringUtil.java b/sdks/java-v1/src/main/java/com/dropbox/sign/StringUtil.java index 527d88a61..b71b4c2ec 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/StringUtil.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/AccountApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/AccountApi.java index 094c9e7ba..741724496 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/AccountApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/AccountApi.java @@ -18,10 +18,11 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class AccountApi { private ApiClient apiClient; @@ -84,47 +85,34 @@ public AccountCreateResponse accountCreate(AccountCreateRequest accountCreateReq */ public ApiResponse accountCreateWithHttpInfo(AccountCreateRequest accountCreateRequest) throws ApiException { - Object localVarPostBody = accountCreateRequest; - - // verify the required parameter 'accountCreateRequest' is set + // Check required parameters if (accountCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'accountCreateRequest' when calling accountCreate"); } - - // create path and map variables - String localVarPath = "/account/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = accountCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "AccountApi.accountCreate", + "/account/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : accountCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("AccountApi.accountCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Get Account @@ -200,44 +188,35 @@ public ApiResponse accountGetWithHttpInfo(String accountId) */ public ApiResponse accountGetWithHttpInfo(String accountId, String emailAddress) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/account"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "email_address", emailAddress)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "AccountApi.accountGet", + "/account", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("AccountApi.accountGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Update Account @@ -272,47 +251,34 @@ public AccountGetResponse accountUpdate(AccountUpdateRequest accountUpdateReques */ public ApiResponse accountUpdateWithHttpInfo(AccountUpdateRequest accountUpdateRequest) throws ApiException { - Object localVarPostBody = accountUpdateRequest; - - // verify the required parameter 'accountUpdateRequest' is set + // Check required parameters if (accountUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'accountUpdateRequest' when calling accountUpdate"); } - - // create path and map variables - String localVarPath = "/account"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = accountUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "AccountApi.accountUpdate", + "/account", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : accountUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("AccountApi.accountUpdate", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Verify Account @@ -347,46 +313,33 @@ public AccountVerifyResponse accountVerify(AccountVerifyRequest accountVerifyReq */ public ApiResponse accountVerifyWithHttpInfo(AccountVerifyRequest accountVerifyRequest) throws ApiException { - Object localVarPostBody = accountVerifyRequest; - - // verify the required parameter 'accountVerifyRequest' is set + // Check required parameters if (accountVerifyRequest == null) { throw new ApiException(400, "Missing the required parameter 'accountVerifyRequest' when calling accountVerify"); } - - // create path and map variables - String localVarPath = "/account/verify"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = accountVerifyRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "AccountApi.accountVerify", + "/account/verify", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : accountVerifyRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("AccountApi.accountVerify", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } } \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/ApiAppApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/ApiAppApi.java index b3431cb17..2ca807e04 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/ApiAppApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/ApiAppApi.java @@ -16,10 +16,11 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiAppApi { private ApiClient apiClient; @@ -82,47 +83,34 @@ public ApiAppGetResponse apiAppCreate(ApiAppCreateRequest apiAppCreateRequest) t */ public ApiResponse apiAppCreateWithHttpInfo(ApiAppCreateRequest apiAppCreateRequest) throws ApiException { - Object localVarPostBody = apiAppCreateRequest; - - // verify the required parameter 'apiAppCreateRequest' is set + // Check required parameters if (apiAppCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'apiAppCreateRequest' when calling apiAppCreate"); } - - // create path and map variables - String localVarPath = "/api_app"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = apiAppCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppCreate", + "/api_app", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : apiAppCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("ApiAppApi.apiAppCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Delete API App @@ -156,46 +144,37 @@ public void apiAppDelete(String clientId) throws ApiException { */ public ApiResponse apiAppDeleteWithHttpInfo(String clientId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'clientId' is set + // Check required parameters if (clientId == null) { throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppDelete"); } - - // create path and map variables - String localVarPath = "/api_app/{client_id}" - .replaceAll("\\{" + "client_id" + "\\}", apiClient.escapeString(clientId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + 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", "oauth2"}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppDelete", + localVarPath, + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("ApiAppApi.apiAppDelete", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); } /** * Get API App @@ -230,48 +209,38 @@ public ApiAppGetResponse apiAppGet(String clientId) throws ApiException { */ public ApiResponse apiAppGetWithHttpInfo(String clientId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'clientId' is set + // Check required parameters if (clientId == null) { throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppGet"); } - - // create path and map variables - String localVarPath = "/api_app/{client_id}" - .replaceAll("\\{" + "client_id" + "\\}", apiClient.escapeString(clientId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("ApiAppApi.apiAppGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * List API Apps @@ -353,44 +322,35 @@ public ApiResponse apiAppListWithHttpInfo(Integer page, Inte if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api_app/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppList", + "/api_app/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("ApiAppApi.apiAppList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Update API App @@ -427,52 +387,40 @@ public ApiAppGetResponse apiAppUpdate(String clientId, ApiAppUpdateRequest apiAp */ public ApiResponse apiAppUpdateWithHttpInfo(String clientId, ApiAppUpdateRequest apiAppUpdateRequest) throws ApiException { - Object localVarPostBody = apiAppUpdateRequest; - - // verify the required parameter 'clientId' is set + // Check required parameters if (clientId == null) { throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppUpdate"); } - - // verify the required parameter 'apiAppUpdateRequest' is set if (apiAppUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'apiAppUpdateRequest' when calling apiAppUpdate"); } - - // create path and map variables - String localVarPath = "/api_app/{client_id}" - .replaceAll("\\{" + "client_id" + "\\}", apiClient.escapeString(clientId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = apiAppUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppUpdate", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : apiAppUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("ApiAppApi.apiAppUpdate", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } } \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java index e2921ac55..56573277b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java @@ -14,10 +14,11 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class BulkSendJobApi { private ApiClient apiClient; @@ -129,50 +130,44 @@ public ApiResponse bulkSendJobGetWithHttpInfo(String bul if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // verify the required parameter 'bulkSendJobId' is set + // Check required parameters if (bulkSendJobId == null) { throw new ApiException(400, "Missing the required parameter 'bulkSendJobId' when calling bulkSendJobGet"); } - - // create path and map variables - String localVarPath = "/bulk_send_job/{bulk_send_job_id}" - .replaceAll("\\{" + "bulk_send_job_id" + "\\}", apiClient.escapeString(bulkSendJobId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/bulk_send_job/{bulk_send_job_id}" + .replaceAll("\\{bulk_send_job_id}", apiClient.escapeString(bulkSendJobId.toString())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "BulkSendJobApi.bulkSendJobGet", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("BulkSendJobApi.bulkSendJobGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * List Bulk Send Jobs @@ -254,43 +249,34 @@ public ApiResponse bulkSendJobListWithHttpInfo(Integer if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/bulk_send_job/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "BulkSendJobApi.bulkSendJobList", + "/bulk_send_job/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("BulkSendJobApi.bulkSendJobList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } } \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/EmbeddedApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/EmbeddedApi.java index f03333336..536cb7116 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/EmbeddedApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/EmbeddedApi.java @@ -15,10 +15,11 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class EmbeddedApi { private ApiClient apiClient; @@ -83,53 +84,41 @@ public EmbeddedEditUrlResponse embeddedEditUrl(String templateId, EmbeddedEditUr */ public ApiResponse embeddedEditUrlWithHttpInfo(String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { - Object localVarPostBody = embeddedEditUrlRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling embeddedEditUrl"); } - - // verify the required parameter 'embeddedEditUrlRequest' is set if (embeddedEditUrlRequest == null) { throw new ApiException(400, "Missing the required parameter 'embeddedEditUrlRequest' when calling embeddedEditUrl"); } - - // create path and map variables - String localVarPath = "/embedded/edit_url/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/embedded/edit_url/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = embeddedEditUrlRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "EmbeddedApi.embeddedEditUrl", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : embeddedEditUrlRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("EmbeddedApi.embeddedEditUrl", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Get Embedded Sign URL @@ -164,47 +153,37 @@ public EmbeddedSignUrlResponse embeddedSignUrl(String signatureId) throws ApiExc */ public ApiResponse embeddedSignUrlWithHttpInfo(String signatureId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureId' is set + // Check required parameters if (signatureId == null) { throw new ApiException(400, "Missing the required parameter 'signatureId' when calling embeddedSignUrl"); } - - // create path and map variables - String localVarPath = "/embedded/sign_url/{signature_id}" - .replaceAll("\\{" + "signature_id" + "\\}", apiClient.escapeString(signatureId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/embedded/sign_url/{signature_id}" + .replaceAll("\\{signature_id}", apiClient.escapeString(signatureId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "EmbeddedApi.embeddedSignUrl", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("EmbeddedApi.embeddedSignUrl", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } } \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxLineApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxLineApi.java new file mode 100644 index 000000000..8bc5356fa --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/FaxLineApi.java @@ -0,0 +1,668 @@ +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 javax.ws.rs.core.GenericType; + +import com.dropbox.sign.model.ErrorResponse; +import com.dropbox.sign.model.FaxLineAddUserRequest; +import com.dropbox.sign.model.FaxLineAreaCodeGetResponse; +import com.dropbox.sign.model.FaxLineCreateRequest; +import com.dropbox.sign.model.FaxLineDeleteRequest; +import com.dropbox.sign.model.FaxLineListResponse; +import com.dropbox.sign.model.FaxLineRemoveUserRequest; +import com.dropbox.sign.model.FaxLineResponse; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +public class FaxLineApi { + private ApiClient apiClient; + + public FaxLineApi() { + this(Configuration.getDefaultApiClient()); + } + + public FaxLineApi(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; + } + + /** + * Add Fax Line User + * Grants a user access to the specified Fax Line. + * @param faxLineAddUserRequest (required) + * @return FaxLineResponse + * @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 FaxLineResponse faxLineAddUser(FaxLineAddUserRequest faxLineAddUserRequest) throws ApiException { + return faxLineAddUserWithHttpInfo(faxLineAddUserRequest).getData(); + } + + + /** + * Add Fax Line User + * Grants a user access to the specified Fax Line. + * @param faxLineAddUserRequest (required) + * @return ApiResponse<FaxLineResponse> + * @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 faxLineAddUserWithHttpInfo(FaxLineAddUserRequest faxLineAddUserRequest) throws ApiException { + + // Check required parameters + if (faxLineAddUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineAddUserRequest' when calling faxLineAddUser"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineAddUserRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineAddUser", + "/fax_line/add_user", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : faxLineAddUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Get Available Fax Line Area Codes + * Returns a response with the area codes available for a given state/provice and city. + * @param country Filter area codes by country. (required) + * @param state Filter area codes by state. (optional) + * @param province Filter area codes by province. (optional) + * @param city Filter area codes by city. (optional) + * @return FaxLineAreaCodeGetResponse + * @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 FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state, String province, String city) throws ApiException { + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country) throws ApiException { + String state = null; + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country) throws ApiException { + String state = null; + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state) throws ApiException { + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country, String state) throws ApiException { + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state, String province) throws ApiException { + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country, String state, String province) throws ApiException { + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + + /** + * Get Available Fax Line Area Codes + * Returns a response with the area codes available for a given state/provice and city. + * @param country Filter area codes by country. (required) + * @param state Filter area codes by state. (optional) + * @param province Filter area codes by province. (optional) + * @param city Filter area codes by city. (optional) + * @return ApiResponse<FaxLineAreaCodeGetResponse> + * @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 faxLineAreaCodeGetWithHttpInfo(String country, String state, String province, String city) throws ApiException { + + // Check required parameters + if (country == null) { + throw new ApiException(400, "Missing the required parameter 'country' when calling faxLineAreaCodeGet"); + } + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "country", country) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "state", state)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "province", province)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "city", city)); + + 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( + "FaxLineApi.faxLineAreaCodeGet", + "/fax_line/area_codes", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Purchase Fax Line + * Purchases a new Fax Line. + * @param faxLineCreateRequest (required) + * @return FaxLineResponse + * @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 FaxLineResponse faxLineCreate(FaxLineCreateRequest faxLineCreateRequest) throws ApiException { + return faxLineCreateWithHttpInfo(faxLineCreateRequest).getData(); + } + + + /** + * Purchase Fax Line + * Purchases a new Fax Line. + * @param faxLineCreateRequest (required) + * @return ApiResponse<FaxLineResponse> + * @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 faxLineCreateWithHttpInfo(FaxLineCreateRequest faxLineCreateRequest) throws ApiException { + + // Check required parameters + if (faxLineCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineCreateRequest' when calling faxLineCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineCreate", + "/fax_line/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : faxLineCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Delete Fax Line + * Deletes the specified Fax Line from the subscription. + * @param faxLineDeleteRequest (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void faxLineDelete(FaxLineDeleteRequest faxLineDeleteRequest) throws ApiException { + faxLineDeleteWithHttpInfo(faxLineDeleteRequest); + } + + + /** + * Delete Fax Line + * Deletes the specified Fax Line from the subscription. + * @param faxLineDeleteRequest (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineDeleteWithHttpInfo(FaxLineDeleteRequest faxLineDeleteRequest) throws ApiException { + + // Check required parameters + if (faxLineDeleteRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineDeleteRequest' when calling faxLineDelete"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineDeleteRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineDelete", + "/fax_line", + "DELETE", + new ArrayList<>(), + isFileTypeFound ? null : faxLineDeleteRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + + } + /** + * Get Fax Line + * Returns the properties and settings of a Fax Line. + * @param number The Fax Line number. (required) + * @return FaxLineResponse + * @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 FaxLineResponse faxLineGet(String number) throws ApiException { + return faxLineGetWithHttpInfo(number).getData(); + } + + + /** + * Get Fax Line + * Returns the properties and settings of a Fax Line. + * @param number The Fax Line number. (required) + * @return ApiResponse<FaxLineResponse> + * @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 faxLineGetWithHttpInfo(String number) throws ApiException { + + // Check required parameters + if (number == null) { + throw new ApiException(400, "Missing the required parameter 'number' when calling faxLineGet"); + } + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "number", number) + ); + + 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( + "FaxLineApi.faxLineGet", + "/fax_line", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * List Fax Lines + * Returns the properties and settings of multiple Fax Lines. + * @param accountId Account ID (optional) + * @param page Page (optional, default to 1) + * @param pageSize Page size (optional, default to 20) + * @param showTeamLines Show team lines (optional) + * @return FaxLineListResponse + * @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 FaxLineListResponse faxLineList(String accountId, Integer page, Integer pageSize, Boolean showTeamLines) throws ApiException { + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId, Integer page, Integer pageSize) throws ApiException { + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page, Integer pageSize) throws ApiException { + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + + /** + * List Fax Lines + * Returns the properties and settings of multiple Fax Lines. + * @param accountId Account ID (optional) + * @param page Page (optional, default to 1) + * @param pageSize Page size (optional, default to 20) + * @param showTeamLines Show team lines (optional) + * @return ApiResponse<FaxLineListResponse> + * @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 faxLineListWithHttpInfo(String accountId, Integer page, Integer pageSize, Boolean showTeamLines) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "show_team_lines", showTeamLines)); + + 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( + "FaxLineApi.faxLineList", + "/fax_line/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } + /** + * Remove Fax Line Access + * Removes a user's access to the specified Fax Line. + * @param faxLineRemoveUserRequest (required) + * @return FaxLineResponse + * @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 FaxLineResponse faxLineRemoveUser(FaxLineRemoveUserRequest faxLineRemoveUserRequest) throws ApiException { + return faxLineRemoveUserWithHttpInfo(faxLineRemoveUserRequest).getData(); + } + + + /** + * Remove Fax Line Access + * Removes a user's access to the specified Fax Line. + * @param faxLineRemoveUserRequest (required) + * @return ApiResponse<FaxLineResponse> + * @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 faxLineRemoveUserWithHttpInfo(FaxLineRemoveUserRequest faxLineRemoveUserRequest) throws ApiException { + + // Check required parameters + if (faxLineRemoveUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineRemoveUserRequest' when calling faxLineRemoveUser"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineRemoveUserRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineRemoveUser", + "/fax_line/remove_user", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : faxLineRemoveUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + + } +} \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/OAuthApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/OAuthApi.java index f49cbdabe..be563cba1 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/OAuthApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/OAuthApi.java @@ -14,10 +14,11 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class OAuthApi { private ApiClient apiClient; @@ -78,47 +79,33 @@ public OAuthTokenResponse oauthTokenGenerate(OAuthTokenGenerateRequest oauthToke */ public ApiResponse oauthTokenGenerateWithHttpInfo(OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { - Object localVarPostBody = oauthTokenGenerateRequest; - - // verify the required parameter 'oauthTokenGenerateRequest' is set + // Check required parameters if (oauthTokenGenerateRequest == null) { throw new ApiException(400, "Missing the required parameter 'oauthTokenGenerateRequest' when calling oauthTokenGenerate"); } - - // create path and map variables - String localVarPath = "/oauth/token"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = oauthTokenGenerateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "OAuthApi.oauthTokenGenerate", + "/oauth/token", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : oauthTokenGenerateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + null, + localVarReturnType, + false + ); - return apiClient.invokeAPI("OAuthApi.oauthTokenGenerate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * OAuth Token Refresh @@ -151,46 +138,32 @@ public OAuthTokenResponse oauthTokenRefresh(OAuthTokenRefreshRequest oauthTokenR */ public ApiResponse oauthTokenRefreshWithHttpInfo(OAuthTokenRefreshRequest oauthTokenRefreshRequest) throws ApiException { - Object localVarPostBody = oauthTokenRefreshRequest; - - // verify the required parameter 'oauthTokenRefreshRequest' is set + // Check required parameters if (oauthTokenRefreshRequest == null) { throw new ApiException(400, "Missing the required parameter 'oauthTokenRefreshRequest' when calling oauthTokenRefresh"); } - - // create path and map variables - String localVarPath = "/oauth/token?refresh"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = oauthTokenRefreshRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "OAuthApi.oauthTokenRefresh", + "/oauth/token?refresh", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : oauthTokenRefreshRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + null, + localVarReturnType, + false + ); - return apiClient.invokeAPI("OAuthApi.oauthTokenRefresh", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } } \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/ReportApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/ReportApi.java index 070529054..b6fbf56b0 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/ReportApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/ReportApi.java @@ -14,10 +14,11 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ReportApi { private ApiClient apiClient; @@ -80,46 +81,33 @@ public ReportCreateResponse reportCreate(ReportCreateRequest reportCreateRequest */ public ApiResponse reportCreateWithHttpInfo(ReportCreateRequest reportCreateRequest) throws ApiException { - Object localVarPostBody = reportCreateRequest; - - // verify the required parameter 'reportCreateRequest' is set + // Check required parameters if (reportCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'reportCreateRequest' when calling reportCreate"); } - - // create path and map variables - String localVarPath = "/report/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = reportCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "ReportApi.reportCreate", + "/report/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : reportCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("ReportApi.reportCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } } \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java index 93ecaf819..7fc3cc692 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java @@ -26,10 +26,11 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class SignatureRequestApi { private ApiClient apiClient; @@ -92,47 +93,34 @@ public BulkSendJobSendResponse signatureRequestBulkCreateEmbeddedWithTemplate(Si */ public ApiResponse signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestBulkCreateEmbeddedWithTemplateRequest; - - // verify the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' is set + // Check required parameters if (signatureRequestBulkCreateEmbeddedWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' when calling signatureRequestBulkCreateEmbeddedWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/bulk_create_embedded_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestBulkCreateEmbeddedWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + 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( + "SignatureRequestApi.signatureRequestBulkCreateEmbeddedWithTemplate", + "/signature_request/bulk_create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestBulkCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestBulkCreateEmbeddedWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Bulk Send with Template @@ -167,47 +155,34 @@ public BulkSendJobSendResponse signatureRequestBulkSendWithTemplate(SignatureReq */ public ApiResponse signatureRequestBulkSendWithTemplateWithHttpInfo(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestBulkSendWithTemplateRequest; - - // verify the required parameter 'signatureRequestBulkSendWithTemplateRequest' is set + // Check required parameters if (signatureRequestBulkSendWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestBulkSendWithTemplateRequest' when calling signatureRequestBulkSendWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/bulk_send_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestBulkSendWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestBulkSendWithTemplate", + "/signature_request/bulk_send_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestBulkSendWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestBulkSendWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Cancel Incomplete Signature Request @@ -241,46 +216,37 @@ public void signatureRequestCancel(String signatureRequestId) throws ApiExceptio */ public ApiResponse signatureRequestCancelWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestCancel"); } - - // create path and map variables - String localVarPath = "/signature_request/cancel/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/cancel/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.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", "oauth2"}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCancel", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestCancel", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); } /** * Create Embedded Signature Request @@ -315,47 +281,34 @@ public SignatureRequestGetResponse signatureRequestCreateEmbedded(SignatureReque */ public ApiResponse signatureRequestCreateEmbeddedWithHttpInfo(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) throws ApiException { - Object localVarPostBody = signatureRequestCreateEmbeddedRequest; - - // verify the required parameter 'signatureRequestCreateEmbeddedRequest' is set + // Check required parameters if (signatureRequestCreateEmbeddedRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestCreateEmbeddedRequest' when calling signatureRequestCreateEmbedded"); } - - // create path and map variables - String localVarPath = "/signature_request/create_embedded"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestCreateEmbeddedRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCreateEmbedded", + "/signature_request/create_embedded", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestCreateEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestCreateEmbedded", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Create Embedded Signature Request with Template @@ -390,47 +343,34 @@ public SignatureRequestGetResponse signatureRequestCreateEmbeddedWithTemplate(Si */ public ApiResponse signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestCreateEmbeddedWithTemplateRequest; - - // verify the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' is set + // Check required parameters if (signatureRequestCreateEmbeddedWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' when calling signatureRequestCreateEmbeddedWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/create_embedded_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestCreateEmbeddedWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCreateEmbeddedWithTemplate", + "/signature_request/create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestCreateEmbeddedWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Download Files @@ -489,49 +429,43 @@ public ApiResponse signatureRequestFilesWithHttpInfo(String signatureReque if (fileType == null) { fileType = "pdf"; } - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFiles"); } - - // create path and map variables - String localVarPath = "/signature_request/files/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "file_type", fileType)); - - - - - final String[] localVarAccepts = { - "application/pdf", "application/zip", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/signature_request/files/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "file_type", fileType) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/zip", "application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFiles", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestFiles", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Download Files as Data Uri @@ -566,48 +500,38 @@ public FileResponseDataUri signatureRequestFilesAsDataUri(String signatureReques */ public ApiResponse signatureRequestFilesAsDataUriWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFilesAsDataUri"); } - - // create path and map variables - String localVarPath = "/signature_request/files_as_data_uri/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/files_as_data_uri/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFilesAsDataUri", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestFilesAsDataUri", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Download Files as File Url @@ -666,49 +590,43 @@ public ApiResponse signatureRequestFilesAsFileUrlWithHttpInfo(Stri if (forceDownload == null) { forceDownload = 1; } - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFilesAsFileUrl"); } - - // create path and map variables - String localVarPath = "/signature_request/files_as_file_url/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "force_download", forceDownload)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/signature_request/files_as_file_url/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "force_download", forceDownload) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFilesAsFileUrl", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestFilesAsFileUrl", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Get Signature Request @@ -743,48 +661,38 @@ public SignatureRequestGetResponse signatureRequestGet(String signatureRequestId */ public ApiResponse signatureRequestGetWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestGet"); } - - // create path and map variables - String localVarPath = "/signature_request/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * List Signature Requests @@ -916,46 +824,37 @@ public ApiResponse signatureRequestListWithHttpInf if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/signature_request/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestList", + "/signature_request/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Release On-Hold Signature Request @@ -990,48 +889,38 @@ public SignatureRequestGetResponse signatureRequestReleaseHold(String signatureR */ public ApiResponse signatureRequestReleaseHoldWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestReleaseHold"); } - - // create path and map variables - String localVarPath = "/signature_request/release_hold/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/release_hold/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestReleaseHold", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestReleaseHold", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Send Request Reminder @@ -1068,53 +957,41 @@ public SignatureRequestGetResponse signatureRequestRemind(String signatureReques */ public ApiResponse signatureRequestRemindWithHttpInfo(String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) throws ApiException { - Object localVarPostBody = signatureRequestRemindRequest; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestRemind"); } - - // verify the required parameter 'signatureRequestRemindRequest' is set if (signatureRequestRemindRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestRemindRequest' when calling signatureRequestRemind"); } - - // create path and map variables - String localVarPath = "/signature_request/remind/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/signature_request/remind/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestRemindRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestRemind", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestRemindRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestRemind", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Remove Signature Request Access @@ -1148,46 +1025,37 @@ public void signatureRequestRemove(String signatureRequestId) throws ApiExceptio */ public ApiResponse signatureRequestRemoveWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestRemove"); } - - // create path and map variables - String localVarPath = "/signature_request/remove/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/remove/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.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( + "SignatureRequestApi.signatureRequestRemove", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestRemove", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); } /** * Send Signature Request @@ -1222,47 +1090,34 @@ public SignatureRequestGetResponse signatureRequestSend(SignatureRequestSendRequ */ public ApiResponse signatureRequestSendWithHttpInfo(SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { - Object localVarPostBody = signatureRequestSendRequest; - - // verify the required parameter 'signatureRequestSendRequest' is set + // Check required parameters if (signatureRequestSendRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestSendRequest' when calling signatureRequestSend"); } - - // create path and map variables - String localVarPath = "/signature_request/send"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestSendRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestSend", + "/signature_request/send", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestSendRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestSend", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Send with Template @@ -1297,47 +1152,34 @@ public SignatureRequestGetResponse signatureRequestSendWithTemplate(SignatureReq */ public ApiResponse signatureRequestSendWithTemplateWithHttpInfo(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestSendWithTemplateRequest; - - // verify the required parameter 'signatureRequestSendWithTemplateRequest' is set + // Check required parameters if (signatureRequestSendWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestSendWithTemplateRequest' when calling signatureRequestSendWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/send_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestSendWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestSendWithTemplate", + "/signature_request/send_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestSendWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestSendWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Update Signature Request @@ -1374,52 +1216,40 @@ public SignatureRequestGetResponse signatureRequestUpdate(String signatureReques */ public ApiResponse signatureRequestUpdateWithHttpInfo(String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) throws ApiException { - Object localVarPostBody = signatureRequestUpdateRequest; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestUpdate"); } - - // verify the required parameter 'signatureRequestUpdateRequest' is set if (signatureRequestUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestUpdateRequest' when calling signatureRequestUpdate"); } - - // create path and map variables - String localVarPath = "/signature_request/update/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/signature_request/update/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestUpdate", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestUpdate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } } \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/TeamApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/TeamApi.java index 0ec4149c8..c894e070a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/TeamApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/TeamApi.java @@ -21,10 +21,11 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class TeamApi { private ApiClient apiClient; @@ -108,48 +109,39 @@ public ApiResponse teamAddMemberWithHttpInfo(TeamAddMemberReque */ public ApiResponse teamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest, String teamId) throws ApiException { - Object localVarPostBody = teamAddMemberRequest; - - // verify the required parameter 'teamAddMemberRequest' is set + // Check required parameters if (teamAddMemberRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamAddMemberRequest' when calling teamAddMember"); } - - // create path and map variables - String localVarPath = "/team/add_member"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "team_id", teamId)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "team_id", teamId) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamAddMemberRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamAddMember", + "/team/add_member", + "PUT", + localVarQueryParams, + isFileTypeFound ? null : teamAddMemberRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TeamApi.teamAddMember", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Create Team @@ -184,47 +176,34 @@ public TeamGetResponse teamCreate(TeamCreateRequest teamCreateRequest) throws Ap */ public ApiResponse teamCreateWithHttpInfo(TeamCreateRequest teamCreateRequest) throws ApiException { - Object localVarPostBody = teamCreateRequest; - - // verify the required parameter 'teamCreateRequest' is set + // Check required parameters if (teamCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamCreateRequest' when calling teamCreate"); } - - // create path and map variables - String localVarPath = "/team/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamCreate", + "/team/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : teamCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TeamApi.teamCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Delete Team @@ -256,40 +235,28 @@ public void teamDelete() throws ApiException { */ public ApiResponse teamDeleteWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team/destroy"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + 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", "oauth2"}; + return apiClient.invokeAPI( + "TeamApi.teamDelete", + "/team/destroy", + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("TeamApi.teamDelete", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); } /** * Get Team @@ -322,42 +289,29 @@ public TeamGetResponse teamGet() throws ApiException { */ public ApiResponse teamGetWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamGet", + "/team", + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TeamApi.teamGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Get Team Info @@ -411,43 +365,34 @@ public ApiResponse teamInfoWithHttpInfo() throws ApiExcepti */ public ApiResponse teamInfoWithHttpInfo(String teamId) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team/info"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "team_id", teamId)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "team_id", teamId) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamInfo", + "/team/info", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TeamApi.teamInfo", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * List Team Invites @@ -501,43 +446,34 @@ public ApiResponse teamInvitesWithHttpInfo() throws ApiExce */ public ApiResponse teamInvitesWithHttpInfo(String emailAddress) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team/invites"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "email_address", emailAddress)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "email_address", emailAddress) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamInvites", + "/team/invites", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TeamApi.teamInvites", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * List Team Members @@ -621,50 +557,44 @@ public ApiResponse teamMembersWithHttpInfo(String teamId, I if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // verify the required parameter 'teamId' is set + // Check required parameters if (teamId == null) { throw new ApiException(400, "Missing the required parameter 'teamId' when calling teamMembers"); } - - // create path and map variables - String localVarPath = "/team/members/{team_id}" - .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/team/members/{team_id}" + .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamMembers", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TeamApi.teamMembers", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Remove User from Team @@ -699,47 +629,34 @@ public TeamGetResponse teamRemoveMember(TeamRemoveMemberRequest teamRemoveMember */ public ApiResponse teamRemoveMemberWithHttpInfo(TeamRemoveMemberRequest teamRemoveMemberRequest) throws ApiException { - Object localVarPostBody = teamRemoveMemberRequest; - - // verify the required parameter 'teamRemoveMemberRequest' is set + // Check required parameters if (teamRemoveMemberRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamRemoveMemberRequest' when calling teamRemoveMember"); } - - // create path and map variables - String localVarPath = "/team/remove_member"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamRemoveMemberRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamRemoveMember", + "/team/remove_member", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : teamRemoveMemberRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TeamApi.teamRemoveMember", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * List Sub Teams @@ -823,50 +740,44 @@ public ApiResponse teamSubTeamsWithHttpInfo(String teamId, if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // verify the required parameter 'teamId' is set + // Check required parameters if (teamId == null) { throw new ApiException(400, "Missing the required parameter 'teamId' when calling teamSubTeams"); } - - // create path and map variables - String localVarPath = "/team/sub_teams/{team_id}" - .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/team/sub_teams/{team_id}" + .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamSubTeams", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TeamApi.teamSubTeams", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Update Team @@ -901,46 +812,33 @@ public TeamGetResponse teamUpdate(TeamUpdateRequest teamUpdateRequest) throws Ap */ public ApiResponse teamUpdateWithHttpInfo(TeamUpdateRequest teamUpdateRequest) throws ApiException { - Object localVarPostBody = teamUpdateRequest; - - // verify the required parameter 'teamUpdateRequest' is set + // Check required parameters if (teamUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamUpdateRequest' when calling teamUpdate"); } - - // create path and map variables - String localVarPath = "/team"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamUpdate", + "/team", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : teamUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TeamApi.teamUpdate", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } } \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java index cea05dec3..3779ff55b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/TemplateApi.java @@ -25,10 +25,11 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class TemplateApi { private ApiClient apiClient; @@ -93,53 +94,41 @@ public TemplateGetResponse templateAddUser(String templateId, TemplateAddUserReq */ public ApiResponse templateAddUserWithHttpInfo(String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { - Object localVarPostBody = templateAddUserRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateAddUser"); } - - // verify the required parameter 'templateAddUserRequest' is set if (templateAddUserRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateAddUserRequest' when calling templateAddUser"); } - - // create path and map variables - String localVarPath = "/template/add_user/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/template/add_user/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateAddUserRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateAddUser", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateAddUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TemplateApi.templateAddUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Create Template @@ -174,47 +163,34 @@ public TemplateCreateResponse templateCreate(TemplateCreateRequest templateCreat */ public ApiResponse templateCreateWithHttpInfo(TemplateCreateRequest templateCreateRequest) throws ApiException { - Object localVarPostBody = templateCreateRequest; - - // verify the required parameter 'templateCreateRequest' is set + // Check required parameters if (templateCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateCreateRequest' when calling templateCreate"); } - - // create path and map variables - String localVarPath = "/template/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateCreate", + "/template/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TemplateApi.templateCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Create Embedded Template Draft @@ -249,47 +225,34 @@ public TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraft(TemplateC */ public ApiResponse templateCreateEmbeddedDraftWithHttpInfo(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) throws ApiException { - Object localVarPostBody = templateCreateEmbeddedDraftRequest; - - // verify the required parameter 'templateCreateEmbeddedDraftRequest' is set + // Check required parameters if (templateCreateEmbeddedDraftRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateCreateEmbeddedDraftRequest' when calling templateCreateEmbeddedDraft"); } - - // create path and map variables - String localVarPath = "/template/create_embedded_draft"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateCreateEmbeddedDraftRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateCreateEmbeddedDraft", + "/template/create_embedded_draft", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateCreateEmbeddedDraftRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TemplateApi.templateCreateEmbeddedDraft", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Delete Template @@ -323,46 +286,37 @@ public void templateDelete(String templateId) throws ApiException { */ public ApiResponse templateDeleteWithHttpInfo(String templateId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateDelete"); } - - // create path and map variables - String localVarPath = "/template/delete/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/template/delete/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.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", "oauth2"}; + return apiClient.invokeAPI( + "TemplateApi.templateDelete", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("TemplateApi.templateDelete", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); } /** * Get Template Files @@ -418,49 +372,43 @@ public ApiResponse templateFilesWithHttpInfo(String templateId) throws Api */ public ApiResponse templateFilesWithHttpInfo(String templateId, String fileType) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFiles"); } - - // create path and map variables - String localVarPath = "/template/files/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "file_type", fileType)); - - - - - final String[] localVarAccepts = { - "application/pdf", "application/zip", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/template/files/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "file_type", fileType) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/zip", "application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateFiles", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TemplateApi.templateFiles", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Get Template Files as Data Uri @@ -495,48 +443,38 @@ public FileResponseDataUri templateFilesAsDataUri(String templateId) throws ApiE */ public ApiResponse templateFilesAsDataUriWithHttpInfo(String templateId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFilesAsDataUri"); } - - // create path and map variables - String localVarPath = "/template/files_as_data_uri/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/template/files_as_data_uri/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateFilesAsDataUri", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TemplateApi.templateFilesAsDataUri", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Get Template Files as File Url @@ -595,49 +533,43 @@ public ApiResponse templateFilesAsFileUrlWithHttpInfo(String templ if (forceDownload == null) { forceDownload = 1; } - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFilesAsFileUrl"); } - - // create path and map variables - String localVarPath = "/template/files_as_file_url/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "force_download", forceDownload)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/template/files_as_file_url/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "force_download", forceDownload) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateFilesAsFileUrl", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TemplateApi.templateFilesAsFileUrl", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Get Template @@ -672,48 +604,38 @@ public TemplateGetResponse templateGet(String templateId) throws ApiException { */ public ApiResponse templateGetWithHttpInfo(String templateId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateGet"); } - - // create path and map variables - String localVarPath = "/template/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/template/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TemplateApi.templateGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * List Templates @@ -845,46 +767,37 @@ public ApiResponse templateListWithHttpInfo(String account if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/template/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateList", + "/template/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TemplateApi.templateList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Remove User from Template @@ -921,53 +834,41 @@ public TemplateGetResponse templateRemoveUser(String templateId, TemplateRemoveU */ public ApiResponse templateRemoveUserWithHttpInfo(String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) throws ApiException { - Object localVarPostBody = templateRemoveUserRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateRemoveUser"); } - - // verify the required parameter 'templateRemoveUserRequest' is set if (templateRemoveUserRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateRemoveUserRequest' when calling templateRemoveUser"); } - - // create path and map variables - String localVarPath = "/template/remove_user/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/template/remove_user/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateRemoveUserRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateRemoveUser", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateRemoveUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TemplateApi.templateRemoveUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Update Template Files @@ -1004,52 +905,40 @@ public TemplateUpdateFilesResponse templateUpdateFiles(String templateId, Templa */ public ApiResponse templateUpdateFilesWithHttpInfo(String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) throws ApiException { - Object localVarPostBody = templateUpdateFilesRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateUpdateFiles"); } - - // verify the required parameter 'templateUpdateFilesRequest' is set if (templateUpdateFilesRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateUpdateFilesRequest' when calling templateUpdateFiles"); } - - // create path and map variables - String localVarPath = "/template/update_files/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + // Path parameters + String localVarPath = "/template/update_files/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateUpdateFilesRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateUpdateFiles", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateUpdateFilesRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("TemplateApi.templateUpdateFiles", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } } \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java b/sdks/java-v1/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java index 67e922c3d..7d842006f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java @@ -17,10 +17,11 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class UnclaimedDraftApi { private ApiClient apiClient; @@ -83,47 +84,34 @@ public UnclaimedDraftCreateResponse unclaimedDraftCreate(UnclaimedDraftCreateReq */ public ApiResponse unclaimedDraftCreateWithHttpInfo(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftCreateRequest; - - // verify the required parameter 'unclaimedDraftCreateRequest' is set + // Check required parameters if (unclaimedDraftCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateRequest' when calling unclaimedDraftCreate"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreate", + "/unclaimed_draft/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Create Embedded Unclaimed Draft @@ -158,47 +146,34 @@ public UnclaimedDraftCreateResponse unclaimedDraftCreateEmbedded(UnclaimedDraftC */ public ApiResponse unclaimedDraftCreateEmbeddedWithHttpInfo(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftCreateEmbeddedRequest; - - // verify the required parameter 'unclaimedDraftCreateEmbeddedRequest' is set + // Check required parameters if (unclaimedDraftCreateEmbeddedRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateEmbeddedRequest' when calling unclaimedDraftCreateEmbedded"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/create_embedded"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftCreateEmbeddedRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreateEmbedded", + "/unclaimed_draft/create_embedded", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftCreateEmbedded", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Create Embedded Unclaimed Draft with Template @@ -233,47 +208,34 @@ public UnclaimedDraftCreateResponse unclaimedDraftCreateEmbeddedWithTemplate(Unc */ public ApiResponse unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftCreateEmbeddedWithTemplateRequest; - - // verify the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' is set + // Check required parameters if (unclaimedDraftCreateEmbeddedWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' when calling unclaimedDraftCreateEmbeddedWithTemplate"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/create_embedded_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftCreateEmbeddedWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreateEmbeddedWithTemplate", + "/unclaimed_draft/create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftCreateEmbeddedWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } /** * Edit and Resend Unclaimed Draft @@ -310,52 +272,40 @@ public UnclaimedDraftCreateResponse unclaimedDraftEditAndResend(String signature */ public ApiResponse unclaimedDraftEditAndResendWithHttpInfo(String signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftEditAndResendRequest; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling unclaimedDraftEditAndResend"); } - - // verify the required parameter 'unclaimedDraftEditAndResendRequest' is set if (unclaimedDraftEditAndResendRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftEditAndResendRequest' when calling unclaimedDraftEditAndResend"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/edit_and_resend/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/unclaimed_draft/edit_and_resend/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftEditAndResendRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftEditAndResend", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftEditAndResendRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftEditAndResend", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); } } \ No newline at end of file diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java index 198eb9494..912c6219f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java index 4bc93a20e..e6da24f0e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java @@ -23,8 +23,7 @@ import java.util.Map; import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java index 91e53cad2..1212c2130 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java index 36e3d7507..7c7b3b962 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java @@ -24,7 +24,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -46,7 +46,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java index 052a33eef..e214889e4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,13 +33,13 @@ * AccountCreateRequest */ @JsonPropertyOrder({ - AccountCreateRequest.JSON_PROPERTY_EMAIL_ADDRESS, - AccountCreateRequest.JSON_PROPERTY_CLIENT_ID, - AccountCreateRequest.JSON_PROPERTY_CLIENT_SECRET, - AccountCreateRequest.JSON_PROPERTY_LOCALE + AccountCreateRequest.JSON_PROPERTY_EMAIL_ADDRESS, + AccountCreateRequest.JSON_PROPERTY_CLIENT_ID, + AccountCreateRequest.JSON_PROPERTY_CLIENT_SECRET, + AccountCreateRequest.JSON_PROPERTY_LOCALE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountCreateRequest { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -78,12 +76,11 @@ public AccountCreateRequest emailAddress(String emailAddress) { return this; } - /** + /** * The email address which will be associated with the new Account. * @return emailAddress - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address which will be associated with the new Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -104,12 +101,11 @@ public AccountCreateRequest clientId(String clientId) { return this; } - /** + /** * Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) * @return clientId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization)") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,12 +126,11 @@ public AccountCreateRequest clientSecret(String clientSecret) { return this; } - /** + /** * Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) * @return clientSecret - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization)") @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +151,11 @@ public AccountCreateRequest locale(String locale) { return this; } - /** + /** * The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. * @return locale - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") @JsonProperty(JSON_PROPERTY_LOCALE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java index 88654d7e5..173433d67 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.AccountResponse; @@ -25,14 +24,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,12 +38,12 @@ * AccountCreateResponse */ @JsonPropertyOrder({ - AccountCreateResponse.JSON_PROPERTY_ACCOUNT, - AccountCreateResponse.JSON_PROPERTY_OAUTH_DATA, - AccountCreateResponse.JSON_PROPERTY_WARNINGS + AccountCreateResponse.JSON_PROPERTY_ACCOUNT, + AccountCreateResponse.JSON_PROPERTY_OAUTH_DATA, + AccountCreateResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountCreateResponse { public static final String JSON_PROPERTY_ACCOUNT = "account"; private AccountResponse account; @@ -79,14 +77,13 @@ public AccountCreateResponse account(AccountResponse account) { return this; } - /** + /** * Get account * @return account - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public AccountResponse getAccount() { return account; @@ -94,7 +91,7 @@ public AccountResponse getAccount() { @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setAccount(AccountResponse account) { this.account = account; } @@ -105,12 +102,11 @@ public AccountCreateResponse oauthData(OAuthTokenResponse oauthData) { return this; } - /** + /** * Get oauthData * @return oauthData - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +135,11 @@ public AccountCreateResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountGetResponse.java index 15f1e3ea5..b64211590 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountGetResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.AccountResponse; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * AccountGetResponse */ @JsonPropertyOrder({ - AccountGetResponse.JSON_PROPERTY_ACCOUNT, - AccountGetResponse.JSON_PROPERTY_WARNINGS + AccountGetResponse.JSON_PROPERTY_ACCOUNT, + AccountGetResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountGetResponse { public static final String JSON_PROPERTY_ACCOUNT = "account"; private AccountResponse account; @@ -74,14 +72,13 @@ public AccountGetResponse account(AccountResponse account) { return this; } - /** + /** * Get account * @return account - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public AccountResponse getAccount() { return account; @@ -89,7 +86,7 @@ public AccountResponse getAccount() { @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setAccount(AccountResponse account) { this.account = account; } @@ -108,12 +105,11 @@ public AccountGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponse.java index 65f2550ab..6c1e562fc 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.AccountResponseQuotas; @@ -24,12 +23,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -37,20 +35,20 @@ * AccountResponse */ @JsonPropertyOrder({ - AccountResponse.JSON_PROPERTY_ACCOUNT_ID, - AccountResponse.JSON_PROPERTY_EMAIL_ADDRESS, - AccountResponse.JSON_PROPERTY_IS_LOCKED, - AccountResponse.JSON_PROPERTY_IS_PAID_HS, - AccountResponse.JSON_PROPERTY_IS_PAID_HF, - AccountResponse.JSON_PROPERTY_QUOTAS, - AccountResponse.JSON_PROPERTY_CALLBACK_URL, - AccountResponse.JSON_PROPERTY_ROLE_CODE, - AccountResponse.JSON_PROPERTY_TEAM_ID, - AccountResponse.JSON_PROPERTY_LOCALE, - AccountResponse.JSON_PROPERTY_USAGE + AccountResponse.JSON_PROPERTY_ACCOUNT_ID, + AccountResponse.JSON_PROPERTY_EMAIL_ADDRESS, + AccountResponse.JSON_PROPERTY_IS_LOCKED, + AccountResponse.JSON_PROPERTY_IS_PAID_HS, + AccountResponse.JSON_PROPERTY_IS_PAID_HF, + AccountResponse.JSON_PROPERTY_QUOTAS, + AccountResponse.JSON_PROPERTY_CALLBACK_URL, + AccountResponse.JSON_PROPERTY_ROLE_CODE, + AccountResponse.JSON_PROPERTY_TEAM_ID, + AccountResponse.JSON_PROPERTY_LOCALE, + AccountResponse.JSON_PROPERTY_USAGE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountResponse { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -108,12 +106,11 @@ public AccountResponse accountId(String accountId) { return this; } - /** + /** * The ID of the Account * @return accountId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The ID of the Account") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +131,11 @@ public AccountResponse emailAddress(String emailAddress) { return this; } - /** + /** * The email address associated with the Account. * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email address associated with the Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +156,11 @@ public AccountResponse isLocked(Boolean isLocked) { return this; } - /** + /** * Returns `true` if the user has been locked out of their account by a team admin. * @return isLocked - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has been locked out of their account by a team admin.") @JsonProperty(JSON_PROPERTY_IS_LOCKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,12 +181,11 @@ public AccountResponse isPaidHs(Boolean isPaidHs) { return this; } - /** + /** * Returns `true` if the user has a paid Dropbox Sign account. * @return isPaidHs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid Dropbox Sign account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -212,12 +206,11 @@ public AccountResponse isPaidHf(Boolean isPaidHf) { return this; } - /** + /** * Returns `true` if the user has a paid HelloFax account. * @return isPaidHf - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid HelloFax account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HF) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -238,12 +231,11 @@ public AccountResponse quotas(AccountResponseQuotas quotas) { return this; } - /** + /** * Get quotas * @return quotas - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_QUOTAS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -264,12 +256,11 @@ public AccountResponse callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL that Dropbox Sign events will `POST` to. * @return callbackUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL that Dropbox Sign events will `POST` to.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -290,12 +281,11 @@ public AccountResponse roleCode(String roleCode) { return this; } - /** + /** * The membership role for the team. * @return roleCode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The membership role for the team.") @JsonProperty(JSON_PROPERTY_ROLE_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -316,12 +306,11 @@ public AccountResponse teamId(String teamId) { return this; } - /** + /** * The id of the team account belongs to. * @return teamId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the team account belongs to.") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -342,12 +331,11 @@ public AccountResponse locale(String locale) { return this; } - /** + /** * The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. * @return locale - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") @JsonProperty(JSON_PROPERTY_LOCALE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -368,12 +356,11 @@ public AccountResponse usage(AccountResponseUsage usage) { return this; } - /** + /** * Get usage * @return usage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_USAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java index e0ca922ba..85ee5e873 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,29 +21,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Details concerning remaining monthly quotas. */ -@ApiModel(description = "Details concerning remaining monthly quotas.") @JsonPropertyOrder({ - AccountResponseQuotas.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, - AccountResponseQuotas.JSON_PROPERTY_DOCUMENTS_LEFT, - AccountResponseQuotas.JSON_PROPERTY_TEMPLATES_TOTAL, - AccountResponseQuotas.JSON_PROPERTY_TEMPLATES_LEFT, - AccountResponseQuotas.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT, - AccountResponseQuotas.JSON_PROPERTY_NUM_FAX_PAGES_LEFT + AccountResponseQuotas.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, + AccountResponseQuotas.JSON_PROPERTY_DOCUMENTS_LEFT, + AccountResponseQuotas.JSON_PROPERTY_TEMPLATES_TOTAL, + AccountResponseQuotas.JSON_PROPERTY_TEMPLATES_LEFT, + AccountResponseQuotas.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT, + AccountResponseQuotas.JSON_PROPERTY_NUM_FAX_PAGES_LEFT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountResponseQuotas { public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = "api_signature_requests_left"; private Integer apiSignatureRequestsLeft; @@ -87,12 +84,11 @@ public AccountResponseQuotas apiSignatureRequestsLeft(Integer apiSignatureReques return this; } - /** + /** * API signature requests remaining. * @return apiSignatureRequestsLeft - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "API signature requests remaining.") @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,12 +109,11 @@ public AccountResponseQuotas documentsLeft(Integer documentsLeft) { return this; } - /** + /** * Signature requests remaining. * @return documentsLeft - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Signature requests remaining.") @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +134,11 @@ public AccountResponseQuotas templatesTotal(Integer templatesTotal) { return this; } - /** + /** * Total API templates allowed. * @return templatesTotal - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Total API templates allowed.") @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +159,11 @@ public AccountResponseQuotas templatesLeft(Integer templatesLeft) { return this; } - /** + /** * API templates remaining. * @return templatesLeft - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "API templates remaining.") @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +184,11 @@ public AccountResponseQuotas smsVerificationsLeft(Integer smsVerificationsLeft) return this; } - /** + /** * SMS verifications remaining. * @return smsVerificationsLeft - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "SMS verifications remaining.") @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +209,11 @@ public AccountResponseQuotas numFaxPagesLeft(Integer numFaxPagesLeft) { return this; } - /** + /** * Number of fax pages left * @return numFaxPagesLeft - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Number of fax pages left") @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java index 6de334090..1d87ae14a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,24 +21,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Details concerning monthly usage */ -@ApiModel(description = "Details concerning monthly usage") @JsonPropertyOrder({ - AccountResponseUsage.JSON_PROPERTY_FAX_PAGES_SENT + AccountResponseUsage.JSON_PROPERTY_FAX_PAGES_SENT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountResponseUsage { public static final String JSON_PROPERTY_FAX_PAGES_SENT = "fax_pages_sent"; private Integer faxPagesSent; @@ -67,12 +64,11 @@ public AccountResponseUsage faxPagesSent(Integer faxPagesSent) { return this; } - /** + /** * Number of fax pages sent * @return faxPagesSent - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Number of fax pages sent") @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java index e3c9b13e6..79d8c759c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,12 +33,12 @@ * AccountUpdateRequest */ @JsonPropertyOrder({ - AccountUpdateRequest.JSON_PROPERTY_ACCOUNT_ID, - AccountUpdateRequest.JSON_PROPERTY_CALLBACK_URL, - AccountUpdateRequest.JSON_PROPERTY_LOCALE + AccountUpdateRequest.JSON_PROPERTY_ACCOUNT_ID, + AccountUpdateRequest.JSON_PROPERTY_CALLBACK_URL, + AccountUpdateRequest.JSON_PROPERTY_LOCALE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountUpdateRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -74,12 +72,11 @@ public AccountUpdateRequest accountId(String accountId) { return this; } - /** + /** * The ID of the Account * @return accountId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The ID of the Account") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,12 +97,11 @@ public AccountUpdateRequest callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL that Dropbox Sign should POST events to. * @return callbackUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL that Dropbox Sign should POST events to.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,12 +122,11 @@ public AccountUpdateRequest locale(String locale) { return this; } - /** + /** * The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. * @return locale - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") @JsonProperty(JSON_PROPERTY_LOCALE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java index 0c2e630a0..4d9d2069d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,10 +33,10 @@ * AccountVerifyRequest */ @JsonPropertyOrder({ - AccountVerifyRequest.JSON_PROPERTY_EMAIL_ADDRESS + AccountVerifyRequest.JSON_PROPERTY_EMAIL_ADDRESS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountVerifyRequest { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -66,12 +64,11 @@ public AccountVerifyRequest emailAddress(String emailAddress) { return this; } - /** + /** * Email address to run the verification for. * @return emailAddress - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Email address to run the verification for.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java index 1fd35eabf..5b32e1d1b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.AccountVerifyResponseAccount; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * AccountVerifyResponse */ @JsonPropertyOrder({ - AccountVerifyResponse.JSON_PROPERTY_ACCOUNT, - AccountVerifyResponse.JSON_PROPERTY_WARNINGS + AccountVerifyResponse.JSON_PROPERTY_ACCOUNT, + AccountVerifyResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountVerifyResponse { public static final String JSON_PROPERTY_ACCOUNT = "account"; private AccountVerifyResponseAccount account; @@ -74,12 +72,11 @@ public AccountVerifyResponse account(AccountVerifyResponseAccount account) { return this; } - /** + /** * Get account * @return account - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +105,11 @@ public AccountVerifyResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java index 6b8cd0f5f..5da20c9c0 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,10 +33,10 @@ * AccountVerifyResponseAccount */ @JsonPropertyOrder({ - AccountVerifyResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS + AccountVerifyResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountVerifyResponseAccount { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -66,12 +64,11 @@ public AccountVerifyResponseAccount emailAddress(String emailAddress) { return this; } - /** + /** * The email address associated with the Account. * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email address associated with the Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java index c8eb8678a..04a26e038 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubOAuth; @@ -25,15 +24,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -41,16 +39,16 @@ * ApiAppCreateRequest */ @JsonPropertyOrder({ - ApiAppCreateRequest.JSON_PROPERTY_DOMAINS, - ApiAppCreateRequest.JSON_PROPERTY_NAME, - ApiAppCreateRequest.JSON_PROPERTY_CALLBACK_URL, - ApiAppCreateRequest.JSON_PROPERTY_CUSTOM_LOGO_FILE, - ApiAppCreateRequest.JSON_PROPERTY_OAUTH, - ApiAppCreateRequest.JSON_PROPERTY_OPTIONS, - ApiAppCreateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS + ApiAppCreateRequest.JSON_PROPERTY_DOMAINS, + ApiAppCreateRequest.JSON_PROPERTY_NAME, + ApiAppCreateRequest.JSON_PROPERTY_CALLBACK_URL, + ApiAppCreateRequest.JSON_PROPERTY_CUSTOM_LOGO_FILE, + ApiAppCreateRequest.JSON_PROPERTY_OAUTH, + ApiAppCreateRequest.JSON_PROPERTY_OPTIONS, + ApiAppCreateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppCreateRequest { public static final String JSON_PROPERTY_DOMAINS = "domains"; private List domains = new ArrayList<>(); @@ -97,16 +95,18 @@ public ApiAppCreateRequest domains(List domains) { } public ApiAppCreateRequest addDomainsItem(String domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } this.domains.add(domainsItem); return this; } - /** + /** * The domain names the ApiApp will be associated with. * @return domains - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The domain names the ApiApp will be associated with.") @JsonProperty(JSON_PROPERTY_DOMAINS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -127,12 +127,11 @@ public ApiAppCreateRequest name(String name) { return this; } - /** + /** * The name you want to assign to the ApiApp. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name you want to assign to the ApiApp.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -153,12 +152,11 @@ public ApiAppCreateRequest callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL at which the ApiApp should receive event callbacks. * @return callbackUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL at which the ApiApp should receive event callbacks.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -179,12 +177,11 @@ public ApiAppCreateRequest customLogoFile(File customLogoFile) { return this; } - /** + /** * An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) * @return customLogoFile - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)") @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -205,12 +202,11 @@ public ApiAppCreateRequest oauth(SubOAuth oauth) { return this; } - /** + /** * Get oauth * @return oauth - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -231,12 +227,11 @@ public ApiAppCreateRequest options(SubOptions options) { return this; } - /** + /** * Get options * @return options - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -257,12 +252,11 @@ public ApiAppCreateRequest whiteLabelingOptions(SubWhiteLabelingOptions whiteLab return this; } - /** + /** * Get whiteLabelingOptions * @return whiteLabelingOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java index 6d31593a2..0b9eb3f54 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.ApiAppResponse; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * ApiAppGetResponse */ @JsonPropertyOrder({ - ApiAppGetResponse.JSON_PROPERTY_API_APP, - ApiAppGetResponse.JSON_PROPERTY_WARNINGS + ApiAppGetResponse.JSON_PROPERTY_API_APP, + ApiAppGetResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppGetResponse { public static final String JSON_PROPERTY_API_APP = "api_app"; private ApiAppResponse apiApp; @@ -74,14 +72,13 @@ public ApiAppGetResponse apiApp(ApiAppResponse apiApp) { return this; } - /** + /** * Get apiApp * @return apiApp - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_API_APP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ApiAppResponse getApiApp() { return apiApp; @@ -89,7 +86,7 @@ public ApiAppResponse getApiApp() { @JsonProperty(JSON_PROPERTY_API_APP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setApiApp(ApiAppResponse apiApp) { this.apiApp = apiApp; } @@ -108,12 +105,11 @@ public ApiAppGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java index 298fc09dd..7078480b2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.ApiAppResponse; @@ -25,14 +24,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,15 +38,15 @@ * ApiAppListResponse */ @JsonPropertyOrder({ - ApiAppListResponse.JSON_PROPERTY_API_APPS, - ApiAppListResponse.JSON_PROPERTY_LIST_INFO, - ApiAppListResponse.JSON_PROPERTY_WARNINGS + ApiAppListResponse.JSON_PROPERTY_API_APPS, + ApiAppListResponse.JSON_PROPERTY_LIST_INFO, + ApiAppListResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppListResponse { public static final String JSON_PROPERTY_API_APPS = "api_apps"; - private List apiApps = null; + private List apiApps = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; @@ -87,14 +85,13 @@ public ApiAppListResponse addApiAppsItem(ApiAppResponse apiAppsItem) { return this; } - /** + /** * Contains information about API Apps. * @return apiApps - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Contains information about API Apps.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_API_APPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getApiApps() { return apiApps; @@ -102,7 +99,7 @@ public List getApiApps() { @JsonProperty(JSON_PROPERTY_API_APPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setApiApps(List apiApps) { this.apiApps = apiApps; } @@ -113,14 +110,13 @@ public ApiAppListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public ApiAppListResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponse.java index fe2cafff6..6679f9f8a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.ApiAppResponseOAuth; @@ -26,35 +25,33 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about an API App. */ -@ApiModel(description = "Contains information about an API App.") @JsonPropertyOrder({ - ApiAppResponse.JSON_PROPERTY_CALLBACK_URL, - ApiAppResponse.JSON_PROPERTY_CLIENT_ID, - ApiAppResponse.JSON_PROPERTY_CREATED_AT, - ApiAppResponse.JSON_PROPERTY_DOMAINS, - ApiAppResponse.JSON_PROPERTY_NAME, - ApiAppResponse.JSON_PROPERTY_IS_APPROVED, - ApiAppResponse.JSON_PROPERTY_OAUTH, - ApiAppResponse.JSON_PROPERTY_OPTIONS, - ApiAppResponse.JSON_PROPERTY_OWNER_ACCOUNT, - ApiAppResponse.JSON_PROPERTY_WHITE_LABELING_OPTIONS + ApiAppResponse.JSON_PROPERTY_CALLBACK_URL, + ApiAppResponse.JSON_PROPERTY_CLIENT_ID, + ApiAppResponse.JSON_PROPERTY_CREATED_AT, + ApiAppResponse.JSON_PROPERTY_DOMAINS, + ApiAppResponse.JSON_PROPERTY_NAME, + ApiAppResponse.JSON_PROPERTY_IS_APPROVED, + ApiAppResponse.JSON_PROPERTY_OAUTH, + ApiAppResponse.JSON_PROPERTY_OPTIONS, + ApiAppResponse.JSON_PROPERTY_OWNER_ACCOUNT, + ApiAppResponse.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponse { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -109,12 +106,11 @@ public ApiAppResponse callbackUrl(String callbackUrl) { return this; } - /** + /** * The app's callback URL (for events) * @return callbackUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The app's callback URL (for events)") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,12 +131,11 @@ public ApiAppResponse clientId(String clientId) { return this; } - /** + /** * The app's client id * @return clientId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The app's client id") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,12 +156,11 @@ public ApiAppResponse createdAt(Integer createdAt) { return this; } - /** + /** * The time that the app was created * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The time that the app was created") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -195,12 +189,11 @@ public ApiAppResponse addDomainsItem(String domainsItem) { return this; } - /** + /** * The domain name(s) associated with the app * @return domains - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The domain name(s) associated with the app") @JsonProperty(JSON_PROPERTY_DOMAINS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -221,12 +214,11 @@ public ApiAppResponse name(String name) { return this; } - /** + /** * The name of the app * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the app") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,12 +239,11 @@ public ApiAppResponse isApproved(Boolean isApproved) { return this; } - /** + /** * Boolean to indicate if the app has been approved * @return isApproved - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate if the app has been approved") @JsonProperty(JSON_PROPERTY_IS_APPROVED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -273,12 +264,11 @@ public ApiAppResponse oauth(ApiAppResponseOAuth oauth) { return this; } - /** + /** * Get oauth * @return oauth - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,12 +289,11 @@ public ApiAppResponse options(ApiAppResponseOptions options) { return this; } - /** + /** * Get options * @return options - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -325,12 +314,11 @@ public ApiAppResponse ownerAccount(ApiAppResponseOwnerAccount ownerAccount) { return this; } - /** + /** * Get ownerAccount * @return ownerAccount - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -351,12 +339,11 @@ public ApiAppResponse whiteLabelingOptions(ApiAppResponseWhiteLabelingOptions wh return this; } - /** + /** * Get whiteLabelingOptions * @return whiteLabelingOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java index 12fdc779c..d4fd6b797 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,29 +21,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An object describing the app's OAuth properties, or null if OAuth is not configured for the app. */ -@ApiModel(description = "An object describing the app's OAuth properties, or null if OAuth is not configured for the app.") @JsonPropertyOrder({ - ApiAppResponseOAuth.JSON_PROPERTY_CALLBACK_URL, - ApiAppResponseOAuth.JSON_PROPERTY_SECRET, - ApiAppResponseOAuth.JSON_PROPERTY_SCOPES, - ApiAppResponseOAuth.JSON_PROPERTY_CHARGES_USERS + ApiAppResponseOAuth.JSON_PROPERTY_CALLBACK_URL, + ApiAppResponseOAuth.JSON_PROPERTY_SECRET, + ApiAppResponseOAuth.JSON_PROPERTY_SCOPES, + ApiAppResponseOAuth.JSON_PROPERTY_CHARGES_USERS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseOAuth { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -81,12 +78,11 @@ public ApiAppResponseOAuth callbackUrl(String callbackUrl) { return this; } - /** + /** * The app's OAuth callback URL. * @return callbackUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The app's OAuth callback URL.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,12 +103,11 @@ public ApiAppResponseOAuth secret(String secret) { return this; } - /** + /** * The app's OAuth secret, or null if the app does not belong to user. * @return secret - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The app's OAuth secret, or null if the app does not belong to user.") @JsonProperty(JSON_PROPERTY_SECRET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -141,12 +136,11 @@ public ApiAppResponseOAuth addScopesItem(String scopesItem) { return this; } - /** + /** * Array of OAuth scopes used by the app. * @return scopes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Array of OAuth scopes used by the app.") @JsonProperty(JSON_PROPERTY_SCOPES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -167,12 +161,11 @@ public ApiAppResponseOAuth chargesUsers(Boolean chargesUsers) { return this; } - /** + /** * Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. * @return chargesUsers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests.") @JsonProperty(JSON_PROPERTY_CHARGES_USERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java index ff0d62a30..33a7c70ef 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,24 +21,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An object with options that override account settings. */ -@ApiModel(description = "An object with options that override account settings.") @JsonPropertyOrder({ - ApiAppResponseOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE + ApiAppResponseOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseOptions { public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; private Boolean canInsertEverywhere; @@ -67,12 +64,11 @@ public ApiAppResponseOptions canInsertEverywhere(Boolean canInsertEverywhere) { return this; } - /** + /** * Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document * @return canInsertEverywhere - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document") @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java index e2fd1a921..a1e52ba70 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,25 +21,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An object describing the app's owner */ -@ApiModel(description = "An object describing the app's owner") @JsonPropertyOrder({ - ApiAppResponseOwnerAccount.JSON_PROPERTY_ACCOUNT_ID, - ApiAppResponseOwnerAccount.JSON_PROPERTY_EMAIL_ADDRESS + ApiAppResponseOwnerAccount.JSON_PROPERTY_ACCOUNT_ID, + ApiAppResponseOwnerAccount.JSON_PROPERTY_EMAIL_ADDRESS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseOwnerAccount { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -71,12 +68,11 @@ public ApiAppResponseOwnerAccount accountId(String accountId) { return this; } - /** + /** * The owner account's ID * @return accountId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The owner account's ID") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public ApiAppResponseOwnerAccount emailAddress(String emailAddress) { return this; } - /** + /** * The owner account's email address * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The owner account's email address") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java index 9fca8882d..f8dabea30 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,37 +21,35 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An object with options to customize the app's signer page */ -@ApiModel(description = "An object with options to customize the app's signer page") @JsonPropertyOrder({ - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_LINK_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PAGE_BACKGROUND_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR1, - ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2 + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_LINK_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PAGE_BACKGROUND_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR1, + ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2 }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseWhiteLabelingOptions { public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; private String headerBackgroundColor; @@ -119,12 +116,11 @@ public ApiAppResponseWhiteLabelingOptions headerBackgroundColor(String headerBac return this; } - /** + /** * Get headerBackgroundColor * @return headerBackgroundColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -145,12 +141,11 @@ public ApiAppResponseWhiteLabelingOptions legalVersion(String legalVersion) { return this; } - /** + /** * Get legalVersion * @return legalVersion - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -171,12 +166,11 @@ public ApiAppResponseWhiteLabelingOptions linkColor(String linkColor) { return this; } - /** + /** * Get linkColor * @return linkColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LINK_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -197,12 +191,11 @@ public ApiAppResponseWhiteLabelingOptions pageBackgroundColor(String pageBackgro return this; } - /** + /** * Get pageBackgroundColor * @return pageBackgroundColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,12 +216,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonColor(String primaryButto return this; } - /** + /** * Get primaryButtonColor * @return primaryButtonColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,12 +241,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonColorHover(String primary return this; } - /** + /** * Get primaryButtonColorHover * @return primaryButtonColorHover - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -275,12 +266,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonTextColor(String primaryB return this; } - /** + /** * Get primaryButtonTextColor * @return primaryButtonTextColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -301,12 +291,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonTextColorHover(String pri return this; } - /** + /** * Get primaryButtonTextColorHover * @return primaryButtonTextColorHover - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -327,12 +316,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonColor(String secondaryB return this; } - /** + /** * Get secondaryButtonColor * @return secondaryButtonColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -353,12 +341,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonColorHover(String secon return this; } - /** + /** * Get secondaryButtonColorHover * @return secondaryButtonColorHover - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -379,12 +366,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColor(String second return this; } - /** + /** * Get secondaryButtonTextColor * @return secondaryButtonTextColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -405,12 +391,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColorHover(String s return this; } - /** + /** * Get secondaryButtonTextColorHover * @return secondaryButtonTextColorHover - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -431,12 +416,11 @@ public ApiAppResponseWhiteLabelingOptions textColor1(String textColor1) { return this; } - /** + /** * Get textColor1 * @return textColor1 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -457,12 +441,11 @@ public ApiAppResponseWhiteLabelingOptions textColor2(String textColor2) { return this; } - /** + /** * Get textColor2 * @return textColor2 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java index 9e725c046..930edc34e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubOAuth; @@ -25,15 +24,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -41,16 +39,16 @@ * ApiAppUpdateRequest */ @JsonPropertyOrder({ - ApiAppUpdateRequest.JSON_PROPERTY_CALLBACK_URL, - ApiAppUpdateRequest.JSON_PROPERTY_CUSTOM_LOGO_FILE, - ApiAppUpdateRequest.JSON_PROPERTY_DOMAINS, - ApiAppUpdateRequest.JSON_PROPERTY_NAME, - ApiAppUpdateRequest.JSON_PROPERTY_OAUTH, - ApiAppUpdateRequest.JSON_PROPERTY_OPTIONS, - ApiAppUpdateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS + ApiAppUpdateRequest.JSON_PROPERTY_CALLBACK_URL, + ApiAppUpdateRequest.JSON_PROPERTY_CUSTOM_LOGO_FILE, + ApiAppUpdateRequest.JSON_PROPERTY_DOMAINS, + ApiAppUpdateRequest.JSON_PROPERTY_NAME, + ApiAppUpdateRequest.JSON_PROPERTY_OAUTH, + ApiAppUpdateRequest.JSON_PROPERTY_OPTIONS, + ApiAppUpdateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppUpdateRequest { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -96,12 +94,11 @@ public ApiAppUpdateRequest callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL at which the API App should receive event callbacks. * @return callbackUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL at which the API App should receive event callbacks.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -122,12 +119,11 @@ public ApiAppUpdateRequest customLogoFile(File customLogoFile) { return this; } - /** + /** * An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) * @return customLogoFile - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)") @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +152,11 @@ public ApiAppUpdateRequest addDomainsItem(String domainsItem) { return this; } - /** + /** * The domain names the ApiApp will be associated with. * @return domains - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The domain names the ApiApp will be associated with.") @JsonProperty(JSON_PROPERTY_DOMAINS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -182,12 +177,11 @@ public ApiAppUpdateRequest name(String name) { return this; } - /** + /** * The name you want to assign to the ApiApp. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name you want to assign to the ApiApp.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -208,12 +202,11 @@ public ApiAppUpdateRequest oauth(SubOAuth oauth) { return this; } - /** + /** * Get oauth * @return oauth - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,12 +227,11 @@ public ApiAppUpdateRequest options(SubOptions options) { return this; } - /** + /** * Get options * @return options - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -260,12 +252,11 @@ public ApiAppUpdateRequest whiteLabelingOptions(SubWhiteLabelingOptions whiteLab return this; } - /** + /** * Get whiteLabelingOptions * @return whiteLabelingOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java index 0b616901c..74f1294b6 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.BulkSendJobGetResponseSignatureRequests; @@ -26,14 +25,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -41,13 +39,13 @@ * BulkSendJobGetResponse */ @JsonPropertyOrder({ - BulkSendJobGetResponse.JSON_PROPERTY_BULK_SEND_JOB, - BulkSendJobGetResponse.JSON_PROPERTY_LIST_INFO, - BulkSendJobGetResponse.JSON_PROPERTY_SIGNATURE_REQUESTS, - BulkSendJobGetResponse.JSON_PROPERTY_WARNINGS + BulkSendJobGetResponse.JSON_PROPERTY_BULK_SEND_JOB, + BulkSendJobGetResponse.JSON_PROPERTY_LIST_INFO, + BulkSendJobGetResponse.JSON_PROPERTY_SIGNATURE_REQUESTS, + BulkSendJobGetResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobGetResponse { public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; private BulkSendJobResponse bulkSendJob; @@ -56,7 +54,7 @@ public class BulkSendJobGetResponse { private ListInfoResponse listInfo; public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; - private List signatureRequests = null; + private List signatureRequests = new ArrayList<>(); public static final String JSON_PROPERTY_WARNINGS = "warnings"; private List warnings = null; @@ -84,14 +82,13 @@ public BulkSendJobGetResponse bulkSendJob(BulkSendJobResponse bulkSendJob) { return this; } - /** + /** * Get bulkSendJob * @return bulkSendJob - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public BulkSendJobResponse getBulkSendJob() { return bulkSendJob; @@ -99,7 +96,7 @@ public BulkSendJobResponse getBulkSendJob() { @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBulkSendJob(BulkSendJobResponse bulkSendJob) { this.bulkSendJob = bulkSendJob; } @@ -110,14 +107,13 @@ public BulkSendJobGetResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -125,7 +121,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -144,14 +140,13 @@ public BulkSendJobGetResponse addSignatureRequestsItem(BulkSendJobGetResponseSig return this; } - /** + /** * Contains information about the Signature Requests sent in bulk. * @return signatureRequests - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Contains information about the Signature Requests sent in bulk.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getSignatureRequests() { return signatureRequests; @@ -159,7 +154,7 @@ public List getSignatureRequests() { @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSignatureRequests(List signatureRequests) { this.signatureRequests = signatureRequests; } @@ -178,12 +173,11 @@ public BulkSendJobGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java index 3fec005ba..45342c7c1 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java @@ -14,10 +14,8 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; -import com.dropbox.sign.model.SignatureRequestResponse; import com.dropbox.sign.model.SignatureRequestResponseAttachment; import com.dropbox.sign.model.SignatureRequestResponseCustomFieldBase; import com.dropbox.sign.model.SignatureRequestResponseDataBase; @@ -27,14 +25,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,34 +39,34 @@ * BulkSendJobGetResponseSignatureRequests */ @JsonPropertyOrder({ - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TEST_MODE, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNATURE_REQUEST_ID, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TITLE, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_ORIGINAL_TITLE, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SUBJECT, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_MESSAGE, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_METADATA, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CREATED_AT, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_EXPIRES_AT, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_IS_COMPLETE, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_IS_DECLINED, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_HAS_ERROR, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_FILES_URL, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNING_URL, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_DETAILS_URL, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNING_REDIRECT_URL, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_FINAL_COPY_URI, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TEMPLATE_IDS, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CUSTOM_FIELDS, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_ATTACHMENTS, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_RESPONSE_DATA, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNATURES, - BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_BULK_SEND_JOB_ID + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TEST_MODE, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNATURE_REQUEST_ID, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TITLE, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_ORIGINAL_TITLE, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SUBJECT, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_MESSAGE, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_METADATA, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CREATED_AT, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_EXPIRES_AT, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_IS_COMPLETE, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_IS_DECLINED, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_HAS_ERROR, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_FILES_URL, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNING_URL, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_DETAILS_URL, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNING_REDIRECT_URL, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_FINAL_COPY_URI, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_TEMPLATE_IDS, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_CUSTOM_FIELDS, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_ATTACHMENTS, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_RESPONSE_DATA, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNATURES, + BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_BULK_SEND_JOB_ID }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobGetResponseSignatureRequests { public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; private Boolean testMode = false; @@ -169,12 +166,11 @@ public BulkSendJobGetResponseSignatureRequests testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -195,12 +191,11 @@ public BulkSendJobGetResponseSignatureRequests signatureRequestId(String signatu return this; } - /** + /** * The id of the SignatureRequest. * @return signatureRequestId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -221,12 +216,11 @@ public BulkSendJobGetResponseSignatureRequests requesterEmailAddress(String requ return this; } - /** + /** * The email address of the initiator of the SignatureRequest. * @return requesterEmailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email address of the initiator of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,12 +241,11 @@ public BulkSendJobGetResponseSignatureRequests title(String title) { return this; } - /** + /** * The title the specified Account uses for the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title the specified Account uses for the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -273,12 +266,11 @@ public BulkSendJobGetResponseSignatureRequests originalTitle(String originalTitl return this; } - /** + /** * Default Label for account. * @return originalTitle - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Default Label for account.") @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,12 +291,11 @@ public BulkSendJobGetResponseSignatureRequests subject(String subject) { return this; } - /** + /** * The subject in the email that was initially sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -325,12 +316,11 @@ public BulkSendJobGetResponseSignatureRequests message(String message) { return this; } - /** + /** * The custom message in the email that was initially sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -351,12 +341,11 @@ public BulkSendJobGetResponseSignatureRequests metadata(Object metadata) { return this; } - /** + /** * The metadata attached to the signature request. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The metadata attached to the signature request.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -377,12 +366,11 @@ public BulkSendJobGetResponseSignatureRequests createdAt(Integer createdAt) { return this; } - /** + /** * Time the signature request was created. * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Time the signature request was created.") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -403,12 +391,11 @@ public BulkSendJobGetResponseSignatureRequests expiresAt(Integer expiresAt) { return this; } - /** + /** * The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -429,12 +416,11 @@ public BulkSendJobGetResponseSignatureRequests isComplete(Boolean isComplete) { return this; } - /** + /** * Whether or not the SignatureRequest has been fully executed by all signers. * @return isComplete - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been fully executed by all signers.") @JsonProperty(JSON_PROPERTY_IS_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -455,12 +441,11 @@ public BulkSendJobGetResponseSignatureRequests isDeclined(Boolean isDeclined) { return this; } - /** + /** * Whether or not the SignatureRequest has been declined by a signer. * @return isDeclined - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been declined by a signer.") @JsonProperty(JSON_PROPERTY_IS_DECLINED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -481,12 +466,11 @@ public BulkSendJobGetResponseSignatureRequests hasError(Boolean hasError) { return this; } - /** + /** * Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). * @return hasError - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).") @JsonProperty(JSON_PROPERTY_HAS_ERROR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -507,12 +491,11 @@ public BulkSendJobGetResponseSignatureRequests filesUrl(String filesUrl) { return this; } - /** + /** * The URL where a copy of the request's documents can be downloaded. * @return filesUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL where a copy of the request's documents can be downloaded.") @JsonProperty(JSON_PROPERTY_FILES_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -533,12 +516,11 @@ public BulkSendJobGetResponseSignatureRequests signingUrl(String signingUrl) { return this; } - /** + /** * The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. * @return signingUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.") @JsonProperty(JSON_PROPERTY_SIGNING_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -559,12 +541,11 @@ public BulkSendJobGetResponseSignatureRequests detailsUrl(String detailsUrl) { return this; } - /** + /** * The URL where the requester and the signers can view the current status of the SignatureRequest. * @return detailsUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL where the requester and the signers can view the current status of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_DETAILS_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -593,12 +574,11 @@ public BulkSendJobGetResponseSignatureRequests addCcEmailAddressesItem(String cc return this; } - /** + /** * A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. * @return ccEmailAddresses - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -619,12 +599,11 @@ public BulkSendJobGetResponseSignatureRequests signingRedirectUrl(String signing return this; } - /** + /** * The URL you want the signer redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want the signer redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -645,12 +624,11 @@ public BulkSendJobGetResponseSignatureRequests finalCopyUri(String finalCopyUri) return this; } - /** + /** * The path where the completed document can be downloaded * @return finalCopyUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The path where the completed document can be downloaded") @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -679,12 +657,11 @@ public BulkSendJobGetResponseSignatureRequests addTemplateIdsItem(String templat return this; } - /** + /** * Templates IDs used in this SignatureRequest (if any). * @return templateIds - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Templates IDs used in this SignatureRequest (if any).") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -713,12 +690,11 @@ public BulkSendJobGetResponseSignatureRequests addCustomFieldsItem(SignatureRequ return this; } - /** + /** * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -747,12 +723,11 @@ public BulkSendJobGetResponseSignatureRequests addAttachmentsItem(SignatureReque return this; } - /** + /** * Signer attachments. * @return attachments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Signer attachments.") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -781,12 +756,11 @@ public BulkSendJobGetResponseSignatureRequests addResponseDataItem(SignatureRequ return this; } - /** + /** * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. * @return responseData - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -815,12 +789,11 @@ public BulkSendJobGetResponseSignatureRequests addSignaturesItem(SignatureReques return this; } - /** + /** * An array of signature objects, 1 for each signer. * @return signatures - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of signature objects, 1 for each signer.") @JsonProperty(JSON_PROPERTY_SIGNATURES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -841,12 +814,11 @@ public BulkSendJobGetResponseSignatureRequests bulkSendJobId(String bulkSendJobI return this; } - /** + /** * The id of the BulkSendJob. * @return bulkSendJobId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the BulkSendJob.") @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java index 2b7264589..0e973842f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.BulkSendJobResponse; @@ -25,14 +24,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,15 +38,15 @@ * BulkSendJobListResponse */ @JsonPropertyOrder({ - BulkSendJobListResponse.JSON_PROPERTY_BULK_SEND_JOBS, - BulkSendJobListResponse.JSON_PROPERTY_LIST_INFO, - BulkSendJobListResponse.JSON_PROPERTY_WARNINGS + BulkSendJobListResponse.JSON_PROPERTY_BULK_SEND_JOBS, + BulkSendJobListResponse.JSON_PROPERTY_LIST_INFO, + BulkSendJobListResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobListResponse { public static final String JSON_PROPERTY_BULK_SEND_JOBS = "bulk_send_jobs"; - private List bulkSendJobs = null; + private List bulkSendJobs = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; @@ -87,14 +85,13 @@ public BulkSendJobListResponse addBulkSendJobsItem(BulkSendJobResponse bulkSendJ return this; } - /** + /** * Contains a list of BulkSendJobs that the API caller has access to. * @return bulkSendJobs - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Contains a list of BulkSendJobs that the API caller has access to.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getBulkSendJobs() { return bulkSendJobs; @@ -102,7 +99,7 @@ public List getBulkSendJobs() { @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBulkSendJobs(List bulkSendJobs) { this.bulkSendJobs = bulkSendJobs; } @@ -113,14 +110,13 @@ public BulkSendJobListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public BulkSendJobListResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java index 903dfd421..613a26951 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,27 +21,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. */ -@ApiModel(description = "Contains information about the BulkSendJob such as when it was created and how many signature requests are queued.") @JsonPropertyOrder({ - BulkSendJobResponse.JSON_PROPERTY_BULK_SEND_JOB_ID, - BulkSendJobResponse.JSON_PROPERTY_TOTAL, - BulkSendJobResponse.JSON_PROPERTY_IS_CREATOR, - BulkSendJobResponse.JSON_PROPERTY_CREATED_AT + BulkSendJobResponse.JSON_PROPERTY_BULK_SEND_JOB_ID, + BulkSendJobResponse.JSON_PROPERTY_TOTAL, + BulkSendJobResponse.JSON_PROPERTY_IS_CREATOR, + BulkSendJobResponse.JSON_PROPERTY_CREATED_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobResponse { public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; private String bulkSendJobId; @@ -79,12 +76,11 @@ public BulkSendJobResponse bulkSendJobId(String bulkSendJobId) { return this; } - /** + /** * The id of the BulkSendJob. * @return bulkSendJobId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the BulkSendJob.") @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public BulkSendJobResponse total(Integer total) { return this; } - /** + /** * The total amount of Signature Requests queued for sending. * @return total - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The total amount of Signature Requests queued for sending.") @JsonProperty(JSON_PROPERTY_TOTAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public BulkSendJobResponse isCreator(Boolean isCreator) { return this; } - /** + /** * True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. * @return isCreator - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member.") @JsonProperty(JSON_PROPERTY_IS_CREATOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public BulkSendJobResponse createdAt(Integer createdAt) { return this; } - /** + /** * Time that the BulkSendJob was created. * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Time that the BulkSendJob was created.") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java index 0ba1ab480..400e70cbb 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.BulkSendJobResponse; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * BulkSendJobSendResponse */ @JsonPropertyOrder({ - BulkSendJobSendResponse.JSON_PROPERTY_BULK_SEND_JOB, - BulkSendJobSendResponse.JSON_PROPERTY_WARNINGS + BulkSendJobSendResponse.JSON_PROPERTY_BULK_SEND_JOB, + BulkSendJobSendResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobSendResponse { public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; private BulkSendJobResponse bulkSendJob; @@ -74,14 +72,13 @@ public BulkSendJobSendResponse bulkSendJob(BulkSendJobResponse bulkSendJob) { return this; } - /** + /** * Get bulkSendJob * @return bulkSendJob - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public BulkSendJobResponse getBulkSendJob() { return bulkSendJob; @@ -89,7 +86,7 @@ public BulkSendJobResponse getBulkSendJob() { @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBulkSendJob(BulkSendJobResponse bulkSendJob) { this.bulkSendJob = bulkSendJob; } @@ -108,12 +105,11 @@ public BulkSendJobSendResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java index 3dcc8fbfe..4ae041322 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubEditorOptions; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,19 +37,19 @@ * EmbeddedEditUrlRequest */ @JsonPropertyOrder({ - EmbeddedEditUrlRequest.JSON_PROPERTY_ALLOW_EDIT_CCS, - EmbeddedEditUrlRequest.JSON_PROPERTY_CC_ROLES, - EmbeddedEditUrlRequest.JSON_PROPERTY_EDITOR_OPTIONS, - EmbeddedEditUrlRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, - EmbeddedEditUrlRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, - EmbeddedEditUrlRequest.JSON_PROPERTY_MERGE_FIELDS, - EmbeddedEditUrlRequest.JSON_PROPERTY_PREVIEW_ONLY, - EmbeddedEditUrlRequest.JSON_PROPERTY_SHOW_PREVIEW, - EmbeddedEditUrlRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - EmbeddedEditUrlRequest.JSON_PROPERTY_TEST_MODE + EmbeddedEditUrlRequest.JSON_PROPERTY_ALLOW_EDIT_CCS, + EmbeddedEditUrlRequest.JSON_PROPERTY_CC_ROLES, + EmbeddedEditUrlRequest.JSON_PROPERTY_EDITOR_OPTIONS, + EmbeddedEditUrlRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, + EmbeddedEditUrlRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, + EmbeddedEditUrlRequest.JSON_PROPERTY_MERGE_FIELDS, + EmbeddedEditUrlRequest.JSON_PROPERTY_PREVIEW_ONLY, + EmbeddedEditUrlRequest.JSON_PROPERTY_SHOW_PREVIEW, + EmbeddedEditUrlRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + EmbeddedEditUrlRequest.JSON_PROPERTY_TEST_MODE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedEditUrlRequest { public static final String JSON_PROPERTY_ALLOW_EDIT_CCS = "allow_edit_ccs"; private Boolean allowEditCcs = false; @@ -106,12 +104,11 @@ public EmbeddedEditUrlRequest allowEditCcs(Boolean allowEditCcs) { return this; } - /** + /** * This allows the requester to enable/disable to add or change CC roles when editing the template. * @return allowEditCcs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable/disable to add or change CC roles when editing the template.") @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -140,12 +137,11 @@ public EmbeddedEditUrlRequest addCcRolesItem(String ccRolesItem) { return this; } - /** + /** * The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. * @return ccRoles - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request.") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,12 +162,11 @@ public EmbeddedEditUrlRequest editorOptions(SubEditorOptions editorOptions) { return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -192,12 +187,11 @@ public EmbeddedEditUrlRequest forceSignerRoles(Boolean forceSignerRoles) { return this; } - /** + /** * Provide users the ability to review/edit the template signer roles. * @return forceSignerRoles - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template signer roles.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -218,12 +212,11 @@ public EmbeddedEditUrlRequest forceSubjectMessage(Boolean forceSubjectMessage) { return this; } - /** + /** * Provide users the ability to review/edit the template subject and message. * @return forceSubjectMessage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -252,12 +245,11 @@ public EmbeddedEditUrlRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) return this; } - /** + /** * Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`. * @return mergeFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`.") @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -278,12 +270,11 @@ public EmbeddedEditUrlRequest previewOnly(Boolean previewOnly) { return this; } - /** + /** * This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set). * @return previewOnly - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set).") @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -304,12 +295,11 @@ public EmbeddedEditUrlRequest showPreview(Boolean showPreview) { return this; } - /** + /** * This allows the requester to enable the editor/preview experience. * @return showPreview - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the editor/preview experience.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -330,12 +320,11 @@ public EmbeddedEditUrlRequest showProgressStepper(Boolean showProgressStepper) { return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -356,12 +345,11 @@ public EmbeddedEditUrlRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java index 807a3d173..81fb83378 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.EmbeddedEditUrlResponseEmbedded; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * EmbeddedEditUrlResponse */ @JsonPropertyOrder({ - EmbeddedEditUrlResponse.JSON_PROPERTY_EMBEDDED, - EmbeddedEditUrlResponse.JSON_PROPERTY_WARNINGS + EmbeddedEditUrlResponse.JSON_PROPERTY_EMBEDDED, + EmbeddedEditUrlResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedEditUrlResponse { public static final String JSON_PROPERTY_EMBEDDED = "embedded"; private EmbeddedEditUrlResponseEmbedded embedded; @@ -74,14 +72,13 @@ public EmbeddedEditUrlResponse embedded(EmbeddedEditUrlResponseEmbedded embedded return this; } - /** + /** * Get embedded * @return embedded - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public EmbeddedEditUrlResponseEmbedded getEmbedded() { return embedded; @@ -89,7 +86,7 @@ public EmbeddedEditUrlResponseEmbedded getEmbedded() { @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setEmbedded(EmbeddedEditUrlResponseEmbedded embedded) { this.embedded = embedded; } @@ -108,12 +105,11 @@ public EmbeddedEditUrlResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java index d586310ba..a2fe58d5c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,25 +21,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An embedded template object. */ -@ApiModel(description = "An embedded template object.") @JsonPropertyOrder({ - EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EDIT_URL, - EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT + EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EDIT_URL, + EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedEditUrlResponseEmbedded { public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; private String editUrl; @@ -71,12 +68,11 @@ public EmbeddedEditUrlResponseEmbedded editUrl(String editUrl) { return this; } - /** + /** * A template url that can be opened in an iFrame. * @return editUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A template url that can be opened in an iFrame.") @JsonProperty(JSON_PROPERTY_EDIT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public EmbeddedEditUrlResponseEmbedded expiresAt(Integer expiresAt) { return this; } - /** + /** * The specific time that the the `edit_url` link expires, in epoch. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The specific time that the the `edit_url` link expires, in epoch.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java index 92ed198eb..94e251272 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.EmbeddedSignUrlResponseEmbedded; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * EmbeddedSignUrlResponse */ @JsonPropertyOrder({ - EmbeddedSignUrlResponse.JSON_PROPERTY_EMBEDDED, - EmbeddedSignUrlResponse.JSON_PROPERTY_WARNINGS + EmbeddedSignUrlResponse.JSON_PROPERTY_EMBEDDED, + EmbeddedSignUrlResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedSignUrlResponse { public static final String JSON_PROPERTY_EMBEDDED = "embedded"; private EmbeddedSignUrlResponseEmbedded embedded; @@ -74,14 +72,13 @@ public EmbeddedSignUrlResponse embedded(EmbeddedSignUrlResponseEmbedded embedded return this; } - /** + /** * Get embedded * @return embedded - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public EmbeddedSignUrlResponseEmbedded getEmbedded() { return embedded; @@ -89,7 +86,7 @@ public EmbeddedSignUrlResponseEmbedded getEmbedded() { @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setEmbedded(EmbeddedSignUrlResponseEmbedded embedded) { this.embedded = embedded; } @@ -108,12 +105,11 @@ public EmbeddedSignUrlResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java index 61995444a..1d2140ebb 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,25 +21,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An object that contains necessary information to set up embedded signing. */ -@ApiModel(description = "An object that contains necessary information to set up embedded signing.") @JsonPropertyOrder({ - EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_SIGN_URL, - EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT + EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_SIGN_URL, + EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedSignUrlResponseEmbedded { public static final String JSON_PROPERTY_SIGN_URL = "sign_url"; private String signUrl; @@ -71,12 +68,11 @@ public EmbeddedSignUrlResponseEmbedded signUrl(String signUrl) { return this; } - /** + /** * A signature url that can be opened in an iFrame. * @return signUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A signature url that can be opened in an iFrame.") @JsonProperty(JSON_PROPERTY_SIGN_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public EmbeddedSignUrlResponseEmbedded expiresAt(Integer expiresAt) { return this; } - /** + /** * The specific time that the the `sign_url` link expires, in epoch. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The specific time that the the `sign_url` link expires, in epoch.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponse.java index 6093ed08c..ea1255d8d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.ErrorResponseError; @@ -23,12 +22,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -36,10 +34,10 @@ * ErrorResponse */ @JsonPropertyOrder({ - ErrorResponse.JSON_PROPERTY_ERROR + ErrorResponse.JSON_PROPERTY_ERROR }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorResponse { public static final String JSON_PROPERTY_ERROR = "error"; private ErrorResponseError error; @@ -67,12 +65,11 @@ public ErrorResponse error(ErrorResponseError error) { return this; } - /** + /** * Get error * @return error - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_ERROR) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponseError.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponseError.java index c38cda38d..d7f9af4c0 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponseError.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ErrorResponseError.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,26 +21,24 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about an error that occurred. */ -@ApiModel(description = "Contains information about an error that occurred.") @JsonPropertyOrder({ - ErrorResponseError.JSON_PROPERTY_ERROR_MSG, - ErrorResponseError.JSON_PROPERTY_ERROR_NAME, - ErrorResponseError.JSON_PROPERTY_ERROR_PATH + ErrorResponseError.JSON_PROPERTY_ERROR_MSG, + ErrorResponseError.JSON_PROPERTY_ERROR_NAME, + ErrorResponseError.JSON_PROPERTY_ERROR_PATH }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorResponseError { public static final String JSON_PROPERTY_ERROR_MSG = "error_msg"; private String errorMsg; @@ -75,12 +72,11 @@ public ErrorResponseError errorMsg(String errorMsg) { return this; } - /** + /** * Message describing an error. * @return errorMsg - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Message describing an error.") @JsonProperty(JSON_PROPERTY_ERROR_MSG) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -101,12 +97,11 @@ public ErrorResponseError errorName(String errorName) { return this; } - /** + /** * Name of the error. * @return errorName - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the error.") @JsonProperty(JSON_PROPERTY_ERROR_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -127,12 +122,11 @@ public ErrorResponseError errorPath(String errorPath) { return this; } - /** + /** * Path at which an error occurred. * @return errorPath - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Path at which an error occurred.") @JsonProperty(JSON_PROPERTY_ERROR_PATH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java index c15deefed..791194fb9 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.AccountResponse; @@ -26,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -39,13 +37,13 @@ * EventCallbackRequest */ @JsonPropertyOrder({ - EventCallbackRequest.JSON_PROPERTY_EVENT, - EventCallbackRequest.JSON_PROPERTY_ACCOUNT, - EventCallbackRequest.JSON_PROPERTY_SIGNATURE_REQUEST, - EventCallbackRequest.JSON_PROPERTY_TEMPLATE + EventCallbackRequest.JSON_PROPERTY_EVENT, + EventCallbackRequest.JSON_PROPERTY_ACCOUNT, + EventCallbackRequest.JSON_PROPERTY_SIGNATURE_REQUEST, + EventCallbackRequest.JSON_PROPERTY_TEMPLATE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EventCallbackRequest { public static final String JSON_PROPERTY_EVENT = "event"; private EventCallbackRequestEvent event; @@ -82,12 +80,11 @@ public EventCallbackRequest event(EventCallbackRequestEvent event) { return this; } - /** + /** * Get event * @return event - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_EVENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +105,11 @@ public EventCallbackRequest account(AccountResponse account) { return this; } - /** + /** * Get account * @return account - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +130,11 @@ public EventCallbackRequest signatureRequest(SignatureRequestResponse signatureR return this; } - /** + /** * Get signatureRequest * @return signatureRequest - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +155,11 @@ public EventCallbackRequest template(TemplateResponse template) { return this; } - /** + /** * Get template * @return template - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEMPLATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java index 9b1cc253e..38e621d5d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.EventCallbackRequestEventMetadata; @@ -23,27 +22,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Basic information about the event that occurred. */ -@ApiModel(description = "Basic information about the event that occurred.") @JsonPropertyOrder({ - EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TIME, - EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TYPE, - EventCallbackRequestEvent.JSON_PROPERTY_EVENT_HASH, - EventCallbackRequestEvent.JSON_PROPERTY_EVENT_METADATA + EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TIME, + EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TYPE, + EventCallbackRequestEvent.JSON_PROPERTY_EVENT_HASH, + EventCallbackRequestEvent.JSON_PROPERTY_EVENT_METADATA }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EventCallbackRequestEvent { public static final String JSON_PROPERTY_EVENT_TIME = "event_time"; private String eventTime; @@ -157,12 +154,11 @@ public EventCallbackRequestEvent eventTime(String eventTime) { return this; } - /** + /** * Time the event was created (using Unix time). * @return eventTime - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Time the event was created (using Unix time).") @JsonProperty(JSON_PROPERTY_EVENT_TIME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -183,12 +179,11 @@ public EventCallbackRequestEvent eventType(EventTypeEnum eventType) { return this; } - /** + /** * Type of callback event that was triggered. * @return eventType - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Type of callback event that was triggered.") @JsonProperty(JSON_PROPERTY_EVENT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,12 +204,11 @@ public EventCallbackRequestEvent eventHash(String eventHash) { return this; } - /** + /** * Generated hash used to verify source of event data. * @return eventHash - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Generated hash used to verify source of event data.") @JsonProperty(JSON_PROPERTY_EVENT_HASH) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -235,12 +229,11 @@ public EventCallbackRequestEvent eventMetadata(EventCallbackRequestEventMetadata return this; } - /** + /** * Get eventMetadata * @return eventMetadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EVENT_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java index 947b495ce..d6a0d30fb 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,27 +21,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Specific metadata about the event. */ -@ApiModel(description = "Specific metadata about the event.") @JsonPropertyOrder({ - EventCallbackRequestEventMetadata.JSON_PROPERTY_RELATED_SIGNATURE_ID, - EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID, - EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_APP_ID, - EventCallbackRequestEventMetadata.JSON_PROPERTY_EVENT_MESSAGE + EventCallbackRequestEventMetadata.JSON_PROPERTY_RELATED_SIGNATURE_ID, + EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID, + EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_APP_ID, + EventCallbackRequestEventMetadata.JSON_PROPERTY_EVENT_MESSAGE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EventCallbackRequestEventMetadata { public static final String JSON_PROPERTY_RELATED_SIGNATURE_ID = "related_signature_id"; private String relatedSignatureId; @@ -79,12 +76,11 @@ public EventCallbackRequestEventMetadata relatedSignatureId(String relatedSignat return this; } - /** + /** * Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. * @return relatedSignatureId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events.") @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public EventCallbackRequestEventMetadata reportedForAccountId(String reportedFor return this; } - /** + /** * Account ID the event was reported for. * @return reportedForAccountId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Account ID the event was reported for.") @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public EventCallbackRequestEventMetadata reportedForAppId(String reportedForAppI return this; } - /** + /** * App ID the event was reported for. * @return reportedForAppId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "App ID the event was reported for.") @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public EventCallbackRequestEventMetadata eventMessage(String eventMessage) { return this; } - /** + /** * Message about a declined or failed (due to error) signature flow. * @return eventMessage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Message about a declined or failed (due to error) signature flow.") @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java new file mode 100644 index 000000000..d81de23de --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java @@ -0,0 +1,278 @@ +/* + * 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; +/** + * FaxLineAddUserRequest + */ +@JsonPropertyOrder({ + FaxLineAddUserRequest.JSON_PROPERTY_NUMBER, + FaxLineAddUserRequest.JSON_PROPERTY_ACCOUNT_ID, + FaxLineAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineAddUserRequest { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public FaxLineAddUserRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineAddUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineAddUserRequest.class); + } + + static public FaxLineAddUserRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineAddUserRequest.class + ); + } + + public FaxLineAddUserRequest number(String number) { + this.number = number; + return this; + } + + /** + * The Fax Line number. + * @return number + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(String number) { + this.number = number; + } + + + public FaxLineAddUserRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Account ID + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public FaxLineAddUserRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this FaxLineAddUserRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineAddUserRequest faxLineAddUserRequest = (FaxLineAddUserRequest) o; + return Objects.equals(this.number, faxLineAddUserRequest.number) && + Objects.equals(this.accountId, faxLineAddUserRequest.accountId) && + Objects.equals(this.emailAddress, faxLineAddUserRequest.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(number, accountId, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineAddUserRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } + + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } + } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } + + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } + } + } 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/FaxLineAreaCodeGetCountryEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java new file mode 100644 index 000000000..d6ef80861 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java @@ -0,0 +1,65 @@ +/* + * 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.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FaxLineAreaCodeGetCountryEnum + */ +public enum FaxLineAreaCodeGetCountryEnum { + + CA("CA"), + + US("US"), + + UK("UK"); + + private String value; + + FaxLineAreaCodeGetCountryEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetCountryEnum fromValue(String value) { + for (FaxLineAreaCodeGetCountryEnum b : FaxLineAreaCodeGetCountryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java new file mode 100644 index 000000000..3c0b91340 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java @@ -0,0 +1,85 @@ +/* + * 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.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FaxLineAreaCodeGetProvinceEnum + */ +public enum FaxLineAreaCodeGetProvinceEnum { + + AB("AB"), + + BC("BC"), + + MB("MB"), + + NB("NB"), + + NL("NL"), + + NT("NT"), + + NS("NS"), + + NU("NU"), + + ON("ON"), + + PE("PE"), + + QC("QC"), + + SK("SK"), + + YT("YT"); + + private String value; + + FaxLineAreaCodeGetProvinceEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetProvinceEnum fromValue(String value) { + for (FaxLineAreaCodeGetProvinceEnum b : FaxLineAreaCodeGetProvinceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java new file mode 100644 index 000000000..08c418a96 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java @@ -0,0 +1,188 @@ +/* + * 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.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; +/** + * FaxLineAreaCodeGetResponse + */ +@JsonPropertyOrder({ + FaxLineAreaCodeGetResponse.JSON_PROPERTY_AREA_CODES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineAreaCodeGetResponse { + public static final String JSON_PROPERTY_AREA_CODES = "area_codes"; + private List areaCodes = new ArrayList<>(); + + public FaxLineAreaCodeGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineAreaCodeGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineAreaCodeGetResponse.class); + } + + static public FaxLineAreaCodeGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineAreaCodeGetResponse.class + ); + } + + public FaxLineAreaCodeGetResponse areaCodes(List areaCodes) { + this.areaCodes = areaCodes; + return this; + } + + public FaxLineAreaCodeGetResponse addAreaCodesItem(Integer areaCodesItem) { + if (this.areaCodes == null) { + this.areaCodes = new ArrayList<>(); + } + this.areaCodes.add(areaCodesItem); + return this; + } + + /** + * Get areaCodes + * @return areaCodes + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AREA_CODES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getAreaCodes() { + return areaCodes; + } + + + @JsonProperty(JSON_PROPERTY_AREA_CODES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAreaCodes(List areaCodes) { + this.areaCodes = areaCodes; + } + + + /** + * Return true if this FaxLineAreaCodeGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineAreaCodeGetResponse faxLineAreaCodeGetResponse = (FaxLineAreaCodeGetResponse) o; + return Objects.equals(this.areaCodes, faxLineAreaCodeGetResponse.areaCodes); + } + + @Override + public int hashCode() { + return Objects.hash(areaCodes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineAreaCodeGetResponse {\n"); + sb.append(" areaCodes: ").append(toIndentedString(areaCodes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (areaCodes != null) { + if (isFileTypeOrListOfFiles(areaCodes)) { + fileTypeFound = true; + } + + if (areaCodes.getClass().equals(java.io.File.class) || + areaCodes.getClass().equals(Integer.class) || + areaCodes.getClass().equals(String.class) || + areaCodes.getClass().isEnum()) { + map.put("area_codes", areaCodes); + } else if (isListOfFile(areaCodes)) { + for(int i = 0; i< getListSize(areaCodes); i++) { + map.put("area_codes[" + i + "]", getFromList(areaCodes, i)); + } + } + else { + map.put("area_codes", JSON.getDefault().getMapper().writeValueAsString(areaCodes)); + } + } + } 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/FaxLineAreaCodeGetStateEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java new file mode 100644 index 000000000..c0e5ae4d7 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java @@ -0,0 +1,161 @@ +/* + * 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.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FaxLineAreaCodeGetStateEnum + */ +public enum FaxLineAreaCodeGetStateEnum { + + AK("AK"), + + AL("AL"), + + AR("AR"), + + AZ("AZ"), + + CA("CA"), + + CO("CO"), + + CT("CT"), + + DC("DC"), + + DE("DE"), + + FL("FL"), + + GA("GA"), + + HI("HI"), + + IA("IA"), + + ID("ID"), + + IL("IL"), + + IN("IN"), + + KS("KS"), + + KY("KY"), + + LA("LA"), + + MA("MA"), + + MD("MD"), + + ME("ME"), + + MI("MI"), + + MN("MN"), + + MO("MO"), + + MS("MS"), + + MT("MT"), + + NC("NC"), + + ND("ND"), + + NE("NE"), + + NH("NH"), + + NJ("NJ"), + + NM("NM"), + + NV("NV"), + + NY("NY"), + + OH("OH"), + + OK("OK"), + + OR("OR"), + + PA("PA"), + + RI("RI"), + + SC("SC"), + + SD("SD"), + + TN("TN"), + + TX("TX"), + + UT("UT"), + + VA("VA"), + + VT("VT"), + + WA("WA"), + + WI("WI"), + + WV("WV"), + + WY("WY"); + + private String value; + + FaxLineAreaCodeGetStateEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetStateEnum fromValue(String value) { + for (FaxLineAreaCodeGetStateEnum b : FaxLineAreaCodeGetStateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java new file mode 100644 index 000000000..fc864b037 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java @@ -0,0 +1,365 @@ +/* + * 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; +/** + * FaxLineCreateRequest + */ +@JsonPropertyOrder({ + FaxLineCreateRequest.JSON_PROPERTY_AREA_CODE, + FaxLineCreateRequest.JSON_PROPERTY_COUNTRY, + FaxLineCreateRequest.JSON_PROPERTY_CITY, + FaxLineCreateRequest.JSON_PROPERTY_ACCOUNT_ID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineCreateRequest { + public static final String JSON_PROPERTY_AREA_CODE = "area_code"; + private Integer areaCode; + + /** + * Country + */ + public enum CountryEnum { + CA("CA"), + + US("US"), + + UK("UK"); + + private String value; + + CountryEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CountryEnum fromValue(String value) { + for (CountryEnum b : CountryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_COUNTRY = "country"; + private CountryEnum country; + + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public FaxLineCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineCreateRequest.class); + } + + static public FaxLineCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineCreateRequest.class + ); + } + + public FaxLineCreateRequest areaCode(Integer areaCode) { + this.areaCode = areaCode; + return this; + } + + /** + * Area code + * @return areaCode + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AREA_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getAreaCode() { + return areaCode; + } + + + @JsonProperty(JSON_PROPERTY_AREA_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAreaCode(Integer areaCode) { + this.areaCode = areaCode; + } + + + public FaxLineCreateRequest country(CountryEnum country) { + this.country = country; + return this; + } + + /** + * Country + * @return country + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CountryEnum getCountry() { + return country; + } + + + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCountry(CountryEnum country) { + this.country = country; + } + + + public FaxLineCreateRequest city(String city) { + this.city = city; + return this; + } + + /** + * City + * @return city + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCity() { + return city; + } + + + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCity(String city) { + this.city = city; + } + + + public FaxLineCreateRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Account ID + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + /** + * Return true if this FaxLineCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineCreateRequest faxLineCreateRequest = (FaxLineCreateRequest) o; + return Objects.equals(this.areaCode, faxLineCreateRequest.areaCode) && + Objects.equals(this.country, faxLineCreateRequest.country) && + Objects.equals(this.city, faxLineCreateRequest.city) && + Objects.equals(this.accountId, faxLineCreateRequest.accountId); + } + + @Override + public int hashCode() { + return Objects.hash(areaCode, country, city, accountId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineCreateRequest {\n"); + sb.append(" areaCode: ").append(toIndentedString(areaCode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (areaCode != null) { + if (isFileTypeOrListOfFiles(areaCode)) { + fileTypeFound = true; + } + + if (areaCode.getClass().equals(java.io.File.class) || + areaCode.getClass().equals(Integer.class) || + areaCode.getClass().equals(String.class) || + areaCode.getClass().isEnum()) { + map.put("area_code", areaCode); + } else if (isListOfFile(areaCode)) { + for(int i = 0; i< getListSize(areaCode); i++) { + map.put("area_code[" + i + "]", getFromList(areaCode, i)); + } + } + else { + map.put("area_code", JSON.getDefault().getMapper().writeValueAsString(areaCode)); + } + } + if (country != null) { + if (isFileTypeOrListOfFiles(country)) { + fileTypeFound = true; + } + + if (country.getClass().equals(java.io.File.class) || + country.getClass().equals(Integer.class) || + country.getClass().equals(String.class) || + country.getClass().isEnum()) { + map.put("country", country); + } else if (isListOfFile(country)) { + for(int i = 0; i< getListSize(country); i++) { + map.put("country[" + i + "]", getFromList(country, i)); + } + } + else { + map.put("country", JSON.getDefault().getMapper().writeValueAsString(country)); + } + } + if (city != null) { + if (isFileTypeOrListOfFiles(city)) { + fileTypeFound = true; + } + + if (city.getClass().equals(java.io.File.class) || + city.getClass().equals(Integer.class) || + city.getClass().equals(String.class) || + city.getClass().isEnum()) { + map.put("city", city); + } else if (isListOfFile(city)) { + for(int i = 0; i< getListSize(city); i++) { + map.put("city[" + i + "]", getFromList(city, i)); + } + } + else { + map.put("city", JSON.getDefault().getMapper().writeValueAsString(city)); + } + } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } + + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } + } + } 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/FaxLineDeleteRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java new file mode 100644 index 000000000..46946fd6d --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java @@ -0,0 +1,178 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineDeleteRequest + */ +@JsonPropertyOrder({ + FaxLineDeleteRequest.JSON_PROPERTY_NUMBER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineDeleteRequest { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public FaxLineDeleteRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineDeleteRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineDeleteRequest.class); + } + + static public FaxLineDeleteRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineDeleteRequest.class + ); + } + + public FaxLineDeleteRequest number(String number) { + this.number = number; + return this; + } + + /** + * The Fax Line number. + * @return number + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(String number) { + this.number = number; + } + + + /** + * Return true if this FaxLineDeleteRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineDeleteRequest faxLineDeleteRequest = (FaxLineDeleteRequest) o; + return Objects.equals(this.number, faxLineDeleteRequest.number); + } + + @Override + public int hashCode() { + return Objects.hash(number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineDeleteRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + } 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/FaxLineListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java new file mode 100644 index 000000000..a6dddb789 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java @@ -0,0 +1,291 @@ +/* + * 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.FaxLineResponseFaxLine; +import com.dropbox.sign.model.ListInfoResponse; +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; +/** + * FaxLineListResponse + */ +@JsonPropertyOrder({ + FaxLineListResponse.JSON_PROPERTY_LIST_INFO, + FaxLineListResponse.JSON_PROPERTY_FAX_LINES, + FaxLineListResponse.JSON_PROPERTY_WARNINGS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineListResponse { + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_FAX_LINES = "fax_lines"; + private List faxLines = new ArrayList<>(); + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private WarningResponse warnings; + + public FaxLineListResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineListResponse.class); + } + + static public FaxLineListResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineListResponse.class + ); + } + + public FaxLineListResponse 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; + } + + + public FaxLineListResponse faxLines(List faxLines) { + this.faxLines = faxLines; + return this; + } + + public FaxLineListResponse addFaxLinesItem(FaxLineResponseFaxLine faxLinesItem) { + if (this.faxLines == null) { + this.faxLines = new ArrayList<>(); + } + this.faxLines.add(faxLinesItem); + return this; + } + + /** + * Get faxLines + * @return faxLines + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_LINES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getFaxLines() { + return faxLines; + } + + + @JsonProperty(JSON_PROPERTY_FAX_LINES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxLines(List faxLines) { + this.faxLines = faxLines; + } + + + public FaxLineListResponse warnings(WarningResponse warnings) { + this.warnings = warnings; + return this; + } + + /** + * Get warnings + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WarningResponse getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(WarningResponse warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxLineListResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineListResponse faxLineListResponse = (FaxLineListResponse) o; + return Objects.equals(this.listInfo, faxLineListResponse.listInfo) && + Objects.equals(this.faxLines, faxLineListResponse.faxLines) && + Objects.equals(this.warnings, faxLineListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(listInfo, faxLines, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineListResponse {\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" faxLines: ").append(toIndentedString(faxLines)).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 (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)); + } + } + if (faxLines != null) { + if (isFileTypeOrListOfFiles(faxLines)) { + fileTypeFound = true; + } + + if (faxLines.getClass().equals(java.io.File.class) || + faxLines.getClass().equals(Integer.class) || + faxLines.getClass().equals(String.class) || + faxLines.getClass().isEnum()) { + map.put("fax_lines", faxLines); + } else if (isListOfFile(faxLines)) { + for(int i = 0; i< getListSize(faxLines); i++) { + map.put("fax_lines[" + i + "]", getFromList(faxLines, i)); + } + } + else { + map.put("fax_lines", JSON.getDefault().getMapper().writeValueAsString(faxLines)); + } + } + 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/FaxLineRemoveUserRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java new file mode 100644 index 000000000..426d991f2 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java @@ -0,0 +1,278 @@ +/* + * 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; +/** + * FaxLineRemoveUserRequest + */ +@JsonPropertyOrder({ + FaxLineRemoveUserRequest.JSON_PROPERTY_NUMBER, + FaxLineRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, + FaxLineRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineRemoveUserRequest { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public FaxLineRemoveUserRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineRemoveUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineRemoveUserRequest.class); + } + + static public FaxLineRemoveUserRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineRemoveUserRequest.class + ); + } + + public FaxLineRemoveUserRequest number(String number) { + this.number = number; + return this; + } + + /** + * The Fax Line number. + * @return number + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(String number) { + this.number = number; + } + + + public FaxLineRemoveUserRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Account ID + * @return accountId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public FaxLineRemoveUserRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address + * @return emailAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this FaxLineRemoveUserRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineRemoveUserRequest faxLineRemoveUserRequest = (FaxLineRemoveUserRequest) o; + return Objects.equals(this.number, faxLineRemoveUserRequest.number) && + Objects.equals(this.accountId, faxLineRemoveUserRequest.accountId) && + Objects.equals(this.emailAddress, faxLineRemoveUserRequest.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(number, accountId, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineRemoveUserRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } + + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } + } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } + + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } + } + } 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/FaxLineResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponse.java new file mode 100644 index 000000000..8e9f3d967 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponse.java @@ -0,0 +1,230 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.FaxLineResponseFaxLine; +import com.dropbox.sign.model.WarningResponse; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineResponse + */ +@JsonPropertyOrder({ + FaxLineResponse.JSON_PROPERTY_FAX_LINE, + FaxLineResponse.JSON_PROPERTY_WARNINGS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineResponse { + public static final String JSON_PROPERTY_FAX_LINE = "fax_line"; + private FaxLineResponseFaxLine faxLine; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private WarningResponse warnings; + + public FaxLineResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineResponse.class); + } + + static public FaxLineResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineResponse.class + ); + } + + public FaxLineResponse faxLine(FaxLineResponseFaxLine faxLine) { + this.faxLine = faxLine; + return this; + } + + /** + * Get faxLine + * @return faxLine + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public FaxLineResponseFaxLine getFaxLine() { + return faxLine; + } + + + @JsonProperty(JSON_PROPERTY_FAX_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxLine(FaxLineResponseFaxLine faxLine) { + this.faxLine = faxLine; + } + + + public FaxLineResponse warnings(WarningResponse warnings) { + this.warnings = warnings; + return this; + } + + /** + * Get warnings + * @return warnings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WarningResponse getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(WarningResponse warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxLineResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineResponse faxLineResponse = (FaxLineResponse) o; + return Objects.equals(this.faxLine, faxLineResponse.faxLine) && + Objects.equals(this.warnings, faxLineResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(faxLine, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineResponse {\n"); + sb.append(" faxLine: ").append(toIndentedString(faxLine)).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 (faxLine != null) { + if (isFileTypeOrListOfFiles(faxLine)) { + fileTypeFound = true; + } + + if (faxLine.getClass().equals(java.io.File.class) || + faxLine.getClass().equals(Integer.class) || + faxLine.getClass().equals(String.class) || + faxLine.getClass().isEnum()) { + map.put("fax_line", faxLine); + } else if (isListOfFile(faxLine)) { + for(int i = 0; i< getListSize(faxLine); i++) { + map.put("fax_line[" + i + "]", getFromList(faxLine, i)); + } + } + else { + map.put("fax_line", JSON.getDefault().getMapper().writeValueAsString(faxLine)); + } + } + 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/FaxLineResponseFaxLine.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java new file mode 100644 index 000000000..f721698c9 --- /dev/null +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java @@ -0,0 +1,339 @@ +/* + * 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.AccountResponse; +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; +/** + * FaxLineResponseFaxLine + */ +@JsonPropertyOrder({ + FaxLineResponseFaxLine.JSON_PROPERTY_NUMBER, + FaxLineResponseFaxLine.JSON_PROPERTY_CREATED_AT, + FaxLineResponseFaxLine.JSON_PROPERTY_UPDATED_AT, + FaxLineResponseFaxLine.JSON_PROPERTY_ACCOUNTS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineResponseFaxLine { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Integer updatedAt; + + public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; + private List accounts = null; + + public FaxLineResponseFaxLine() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineResponseFaxLine init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineResponseFaxLine.class); + } + + static public FaxLineResponseFaxLine init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineResponseFaxLine.class + ); + } + + public FaxLineResponseFaxLine number(String number) { + this.number = number; + return this; + } + + /** + * Number + * @return number + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(String number) { + this.number = number; + } + + + public FaxLineResponseFaxLine createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Created at + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + + public FaxLineResponseFaxLine updatedAt(Integer updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Updated at + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Integer updatedAt) { + this.updatedAt = updatedAt; + } + + + public FaxLineResponseFaxLine accounts(List accounts) { + this.accounts = accounts; + return this; + } + + public FaxLineResponseFaxLine addAccountsItem(AccountResponse accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); + } + this.accounts.add(accountsItem); + return this; + } + + /** + * Get accounts + * @return accounts + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAccounts() { + return accounts; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccounts(List accounts) { + this.accounts = accounts; + } + + + /** + * Return true if this FaxLineResponseFaxLine object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineResponseFaxLine faxLineResponseFaxLine = (FaxLineResponseFaxLine) o; + return Objects.equals(this.number, faxLineResponseFaxLine.number) && + Objects.equals(this.createdAt, faxLineResponseFaxLine.createdAt) && + Objects.equals(this.updatedAt, faxLineResponseFaxLine.updatedAt) && + Objects.equals(this.accounts, faxLineResponseFaxLine.accounts); + } + + @Override + public int hashCode() { + return Objects.hash(number, createdAt, updatedAt, accounts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineResponseFaxLine {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + 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 (updatedAt != null) { + if (isFileTypeOrListOfFiles(updatedAt)) { + fileTypeFound = true; + } + + if (updatedAt.getClass().equals(java.io.File.class) || + updatedAt.getClass().equals(Integer.class) || + updatedAt.getClass().equals(String.class) || + updatedAt.getClass().isEnum()) { + map.put("updated_at", updatedAt); + } else if (isListOfFile(updatedAt)) { + for(int i = 0; i< getListSize(updatedAt); i++) { + map.put("updated_at[" + i + "]", getFromList(updatedAt, i)); + } + } + else { + map.put("updated_at", JSON.getDefault().getMapper().writeValueAsString(updatedAt)); + } + } + if (accounts != null) { + if (isFileTypeOrListOfFiles(accounts)) { + fileTypeFound = true; + } + + if (accounts.getClass().equals(java.io.File.class) || + accounts.getClass().equals(Integer.class) || + accounts.getClass().equals(String.class) || + accounts.getClass().isEnum()) { + map.put("accounts", accounts); + } else if (isListOfFile(accounts)) { + for(int i = 0; i< getListSize(accounts); i++) { + map.put("accounts[" + i + "]", getFromList(accounts, i)); + } + } + else { + map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); + } + } + } 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/FileResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponse.java index e80e3459b..fb2604862 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,11 +33,11 @@ * FileResponse */ @JsonPropertyOrder({ - FileResponse.JSON_PROPERTY_FILE_URL, - FileResponse.JSON_PROPERTY_EXPIRES_AT + FileResponse.JSON_PROPERTY_FILE_URL, + FileResponse.JSON_PROPERTY_EXPIRES_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileResponse { public static final String JSON_PROPERTY_FILE_URL = "file_url"; private String fileUrl; @@ -70,14 +68,13 @@ public FileResponse fileUrl(String fileUrl) { return this; } - /** + /** * URL to the file. * @return fileUrl - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "URL to the file.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FILE_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getFileUrl() { return fileUrl; @@ -85,7 +82,7 @@ public String getFileUrl() { @JsonProperty(JSON_PROPERTY_FILE_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } @@ -96,14 +93,13 @@ public FileResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * When the link expires. * @return expiresAt - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "When the link expires.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public Integer getExpiresAt() { return expiresAt; @@ -111,7 +107,7 @@ public Integer getExpiresAt() { @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setExpiresAt(Integer expiresAt) { this.expiresAt = expiresAt; } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java index 90688a10a..0a82c3f91 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,10 +33,10 @@ * FileResponseDataUri */ @JsonPropertyOrder({ - FileResponseDataUri.JSON_PROPERTY_DATA_URI + FileResponseDataUri.JSON_PROPERTY_DATA_URI }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileResponseDataUri { public static final String JSON_PROPERTY_DATA_URI = "data_uri"; private String dataUri; @@ -66,14 +64,13 @@ public FileResponseDataUri dataUri(String dataUri) { return this; } - /** + /** * File as base64 encoded string. * @return dataUri - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "File as base64 encoded string.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATA_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getDataUri() { return dataUri; @@ -81,7 +78,7 @@ public String getDataUri() { @JsonProperty(JSON_PROPERTY_DATA_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setDataUri(String dataUri) { this.dataUri = dataUri; } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ListInfoResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ListInfoResponse.java index 45f99caee..05a6ad005 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ListInfoResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ListInfoResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,27 +21,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Contains pagination information about the data returned. */ -@ApiModel(description = "Contains pagination information about the data returned.") @JsonPropertyOrder({ - ListInfoResponse.JSON_PROPERTY_NUM_PAGES, - ListInfoResponse.JSON_PROPERTY_NUM_RESULTS, - ListInfoResponse.JSON_PROPERTY_PAGE, - ListInfoResponse.JSON_PROPERTY_PAGE_SIZE + ListInfoResponse.JSON_PROPERTY_NUM_PAGES, + ListInfoResponse.JSON_PROPERTY_NUM_RESULTS, + ListInfoResponse.JSON_PROPERTY_PAGE, + ListInfoResponse.JSON_PROPERTY_PAGE_SIZE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ListInfoResponse { public static final String JSON_PROPERTY_NUM_PAGES = "num_pages"; private Integer numPages; @@ -79,12 +76,11 @@ public ListInfoResponse numPages(Integer numPages) { return this; } - /** + /** * Total number of pages available. * @return numPages - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Total number of pages available.") @JsonProperty(JSON_PROPERTY_NUM_PAGES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public ListInfoResponse numResults(Integer numResults) { return this; } - /** + /** * Total number of objects available. * @return numResults - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Total number of objects available.") @JsonProperty(JSON_PROPERTY_NUM_RESULTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public ListInfoResponse page(Integer page) { return this; } - /** + /** * Number of the page being returned. * @return page - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Number of the page being returned.") @JsonProperty(JSON_PROPERTY_PAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public ListInfoResponse pageSize(Integer pageSize) { return this; } - /** + /** * Objects returned per page. * @return pageSize - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Objects returned per page.") @JsonProperty(JSON_PROPERTY_PAGE_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java index faa0f45c9..abb0f748c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,14 +33,14 @@ * OAuthTokenGenerateRequest */ @JsonPropertyOrder({ - OAuthTokenGenerateRequest.JSON_PROPERTY_CLIENT_ID, - OAuthTokenGenerateRequest.JSON_PROPERTY_CLIENT_SECRET, - OAuthTokenGenerateRequest.JSON_PROPERTY_CODE, - OAuthTokenGenerateRequest.JSON_PROPERTY_GRANT_TYPE, - OAuthTokenGenerateRequest.JSON_PROPERTY_STATE + OAuthTokenGenerateRequest.JSON_PROPERTY_CLIENT_ID, + OAuthTokenGenerateRequest.JSON_PROPERTY_CLIENT_SECRET, + OAuthTokenGenerateRequest.JSON_PROPERTY_CODE, + OAuthTokenGenerateRequest.JSON_PROPERTY_GRANT_TYPE, + OAuthTokenGenerateRequest.JSON_PROPERTY_STATE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OAuthTokenGenerateRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -82,12 +80,11 @@ public OAuthTokenGenerateRequest clientId(String clientId) { return this; } - /** + /** * The client id of the app requesting authorization. * @return clientId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The client id of the app requesting authorization.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +105,11 @@ public OAuthTokenGenerateRequest clientSecret(String clientSecret) { return this; } - /** + /** * The secret token of your app. * @return clientSecret - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The secret token of your app.") @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -134,12 +130,11 @@ public OAuthTokenGenerateRequest code(String code) { return this; } - /** + /** * The code passed to your callback when the user granted access. * @return code - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The code passed to your callback when the user granted access.") @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -160,12 +155,11 @@ public OAuthTokenGenerateRequest grantType(String grantType) { return this; } - /** + /** * When generating a new token use `authorization_code`. * @return grantType - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When generating a new token use `authorization_code`.") @JsonProperty(JSON_PROPERTY_GRANT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -186,12 +180,11 @@ public OAuthTokenGenerateRequest state(String state) { return this; } - /** + /** * Same as the state you specified earlier. * @return state - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Same as the state you specified earlier.") @JsonProperty(JSON_PROPERTY_STATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java index c1fbe8a91..4e9e19835 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,11 +33,11 @@ * OAuthTokenRefreshRequest */ @JsonPropertyOrder({ - OAuthTokenRefreshRequest.JSON_PROPERTY_GRANT_TYPE, - OAuthTokenRefreshRequest.JSON_PROPERTY_REFRESH_TOKEN + OAuthTokenRefreshRequest.JSON_PROPERTY_GRANT_TYPE, + OAuthTokenRefreshRequest.JSON_PROPERTY_REFRESH_TOKEN }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OAuthTokenRefreshRequest { public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; private String grantType = "refresh_token"; @@ -70,12 +68,11 @@ public OAuthTokenRefreshRequest grantType(String grantType) { return this; } - /** + /** * When refreshing an existing token use `refresh_token`. * @return grantType - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "When refreshing an existing token use `refresh_token`.") @JsonProperty(JSON_PROPERTY_GRANT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public OAuthTokenRefreshRequest refreshToken(String refreshToken) { return this; } - /** + /** * The token provided when you got the expired access token. * @return refreshToken - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The token provided when you got the expired access token.") @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java index b953df991..7ec43ce83 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,14 +33,14 @@ * OAuthTokenResponse */ @JsonPropertyOrder({ - OAuthTokenResponse.JSON_PROPERTY_ACCESS_TOKEN, - OAuthTokenResponse.JSON_PROPERTY_TOKEN_TYPE, - OAuthTokenResponse.JSON_PROPERTY_REFRESH_TOKEN, - OAuthTokenResponse.JSON_PROPERTY_EXPIRES_IN, - OAuthTokenResponse.JSON_PROPERTY_STATE + OAuthTokenResponse.JSON_PROPERTY_ACCESS_TOKEN, + OAuthTokenResponse.JSON_PROPERTY_TOKEN_TYPE, + OAuthTokenResponse.JSON_PROPERTY_REFRESH_TOKEN, + OAuthTokenResponse.JSON_PROPERTY_EXPIRES_IN, + OAuthTokenResponse.JSON_PROPERTY_STATE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OAuthTokenResponse { public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; private String accessToken; @@ -82,12 +80,11 @@ public OAuthTokenResponse accessToken(String accessToken) { return this; } - /** + /** * Get accessToken * @return accessToken - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +105,11 @@ public OAuthTokenResponse tokenType(String tokenType) { return this; } - /** + /** * Get tokenType * @return tokenType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +130,11 @@ public OAuthTokenResponse refreshToken(String refreshToken) { return this; } - /** + /** * Get refreshToken * @return refreshToken - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +155,11 @@ public OAuthTokenResponse expiresIn(Integer expiresIn) { return this; } - /** + /** * Number of seconds until the `access_token` expires. Uses epoch time. * @return expiresIn - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Number of seconds until the `access_token` expires. Uses epoch time.") @JsonProperty(JSON_PROPERTY_EXPIRES_IN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,12 +180,11 @@ public OAuthTokenResponse state(String state) { return this; } - /** + /** * Get state * @return state - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_STATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java index eea03a055..f156dfb0a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,14 +21,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -37,12 +35,12 @@ * ReportCreateRequest */ @JsonPropertyOrder({ - ReportCreateRequest.JSON_PROPERTY_END_DATE, - ReportCreateRequest.JSON_PROPERTY_REPORT_TYPE, - ReportCreateRequest.JSON_PROPERTY_START_DATE + ReportCreateRequest.JSON_PROPERTY_END_DATE, + ReportCreateRequest.JSON_PROPERTY_REPORT_TYPE, + ReportCreateRequest.JSON_PROPERTY_START_DATE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReportCreateRequest { public static final String JSON_PROPERTY_END_DATE = "end_date"; private String endDate; @@ -111,12 +109,11 @@ public ReportCreateRequest endDate(String endDate) { return this; } - /** + /** * The (inclusive) end date for the report data in `MM/DD/YYYY` format. * @return endDate - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The (inclusive) end date for the report data in `MM/DD/YYYY` format.") @JsonProperty(JSON_PROPERTY_END_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -138,16 +135,18 @@ public ReportCreateRequest reportType(List reportType) { } public ReportCreateRequest addReportTypeItem(ReportTypeEnum reportTypeItem) { + if (this.reportType == null) { + this.reportType = new ArrayList<>(); + } this.reportType.add(reportTypeItem); return this; } - /** + /** * The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). * @return reportType - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).") @JsonProperty(JSON_PROPERTY_REPORT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -168,12 +167,11 @@ public ReportCreateRequest startDate(String startDate) { return this; } - /** + /** * The (inclusive) start date for the report data in `MM/DD/YYYY` format. * @return startDate - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The (inclusive) start date for the report data in `MM/DD/YYYY` format.") @JsonProperty(JSON_PROPERTY_START_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java index 75b103062..21c5aa410 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.ReportResponse; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * ReportCreateResponse */ @JsonPropertyOrder({ - ReportCreateResponse.JSON_PROPERTY_REPORT, - ReportCreateResponse.JSON_PROPERTY_WARNINGS + ReportCreateResponse.JSON_PROPERTY_REPORT, + ReportCreateResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReportCreateResponse { public static final String JSON_PROPERTY_REPORT = "report"; private ReportResponse report; @@ -74,14 +72,13 @@ public ReportCreateResponse report(ReportResponse report) { return this; } - /** + /** * Get report * @return report - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_REPORT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ReportResponse getReport() { return report; @@ -89,7 +86,7 @@ public ReportResponse getReport() { @JsonProperty(JSON_PROPERTY_REPORT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setReport(ReportResponse report) { this.report = report; } @@ -108,12 +105,11 @@ public ReportCreateResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportResponse.java index a8195c381..7952227a5 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/ReportResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,29 +21,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about the report request. */ -@ApiModel(description = "Contains information about the report request.") @JsonPropertyOrder({ - ReportResponse.JSON_PROPERTY_SUCCESS, - ReportResponse.JSON_PROPERTY_START_DATE, - ReportResponse.JSON_PROPERTY_END_DATE, - ReportResponse.JSON_PROPERTY_REPORT_TYPE + ReportResponse.JSON_PROPERTY_SUCCESS, + ReportResponse.JSON_PROPERTY_START_DATE, + ReportResponse.JSON_PROPERTY_END_DATE, + ReportResponse.JSON_PROPERTY_REPORT_TYPE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReportResponse { public static final String JSON_PROPERTY_SUCCESS = "success"; private String success; @@ -116,12 +113,11 @@ public ReportResponse success(String success) { return this; } - /** + /** * A message indicating the requested operation's success * @return success - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A message indicating the requested operation's success") @JsonProperty(JSON_PROPERTY_SUCCESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,12 +138,11 @@ public ReportResponse startDate(String startDate) { return this; } - /** + /** * The (inclusive) start date for the report data in MM/DD/YYYY format. * @return startDate - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The (inclusive) start date for the report data in MM/DD/YYYY format.") @JsonProperty(JSON_PROPERTY_START_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,12 +163,11 @@ public ReportResponse endDate(String endDate) { return this; } - /** + /** * The (inclusive) end date for the report data in MM/DD/YYYY format. * @return endDate - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The (inclusive) end date for the report data in MM/DD/YYYY format.") @JsonProperty(JSON_PROPERTY_END_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -202,12 +196,11 @@ public ReportResponse addReportTypeItem(ReportTypeEnum reportTypeItem) { return this; } - /** + /** * The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). * @return reportType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).") @JsonProperty(JSON_PROPERTY_REPORT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java index 3afb30567..5a27c1f97 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubBulkSignerList; @@ -25,17 +24,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -43,22 +41,22 @@ * SignatureRequestBulkCreateEmbeddedWithTemplateRequest */ @JsonPropertyOrder({ - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNER_FILE, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNER_LIST, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNER_FILE, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNER_LIST, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -123,16 +121,18 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest templateIds(List(); + } this.templateIds.add(templateIdsItem); return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -153,12 +153,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest clientId(String cli return this; } - /** + /** * Client id of the app you're using to create this embedded signature request. Used for security purposes. * @return clientId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this embedded signature request. Used for security purposes.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -179,12 +178,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerFile(File sig return this; } - /** + /** * `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` * @return signerFile - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "`signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```") @JsonProperty(JSON_PROPERTY_SIGNER_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -213,12 +211,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addSignerListItem(S return this; } - /** + /** * `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. * @return signerList - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.") @JsonProperty(JSON_PROPERTY_SIGNER_LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -239,12 +236,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest allowDecline(Boolea return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -273,12 +269,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCcsItem(SubCC cc return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -307,12 +302,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCustomFieldsItem return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -333,12 +327,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest message(String mess return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -367,12 +360,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest putMetadataItem(Str return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -393,12 +385,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signingRedirectUrl( return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -419,12 +410,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest subject(String subj return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -445,12 +435,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest testMode(Boolean te return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -471,12 +460,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest title(String title) return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java index 35530d539..73ed9899b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubBulkSignerList; @@ -25,17 +24,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -43,22 +41,22 @@ * SignatureRequestBulkSendWithTemplateRequest */ @JsonPropertyOrder({ - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNER_FILE, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNER_LIST, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CCS, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_METADATA, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNER_FILE, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNER_LIST, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TITLE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestBulkSendWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -123,16 +121,18 @@ public SignatureRequestBulkSendWithTemplateRequest templateIds(List temp } public SignatureRequestBulkSendWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } this.templateIds.add(templateIdsItem); return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -153,12 +153,11 @@ public SignatureRequestBulkSendWithTemplateRequest signerFile(File signerFile) { return this; } - /** + /** * `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` * @return signerFile - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "`signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```") @JsonProperty(JSON_PROPERTY_SIGNER_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -187,12 +186,11 @@ public SignatureRequestBulkSendWithTemplateRequest addSignerListItem(SubBulkSign return this; } - /** + /** * `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. * @return signerList - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.") @JsonProperty(JSON_PROPERTY_SIGNER_LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -213,12 +211,11 @@ public SignatureRequestBulkSendWithTemplateRequest allowDecline(Boolean allowDec return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,12 +244,11 @@ public SignatureRequestBulkSendWithTemplateRequest addCcsItem(SubCC ccsItem) { return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -273,12 +269,11 @@ public SignatureRequestBulkSendWithTemplateRequest clientId(String clientId) { return this; } - /** + /** * The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -307,12 +302,11 @@ public SignatureRequestBulkSendWithTemplateRequest addCustomFieldsItem(SubCustom return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -333,12 +327,11 @@ public SignatureRequestBulkSendWithTemplateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -367,12 +360,11 @@ public SignatureRequestBulkSendWithTemplateRequest putMetadataItem(String key, O return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -393,12 +385,11 @@ public SignatureRequestBulkSendWithTemplateRequest signingRedirectUrl(String sig return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -419,12 +410,11 @@ public SignatureRequestBulkSendWithTemplateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -445,12 +435,11 @@ public SignatureRequestBulkSendWithTemplateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -471,12 +460,11 @@ public SignatureRequestBulkSendWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java index 99cf20d73..db7b7d5d0 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubAttachment; @@ -31,17 +30,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -49,33 +47,33 @@ * SignatureRequestCreateEmbeddedRequest */ @JsonPropertyOrder({ - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FILES, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_GROUPED_SIGNERS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_METADATA, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_TITLE, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, - SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FILES, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_GROUPED_SIGNERS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_METADATA, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_TITLE, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestCreateEmbeddedRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -172,12 +170,11 @@ public SignatureRequestCreateEmbeddedRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to create this embedded signature request. Used for security purposes. * @return clientId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this embedded signature request. Used for security purposes.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -206,12 +203,11 @@ public SignatureRequestCreateEmbeddedRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -240,12 +236,11 @@ public SignatureRequestCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -274,12 +269,11 @@ public SignatureRequestCreateEmbeddedRequest addSignersItem(SubSignatureRequestS return this; } - /** + /** * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return signers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -308,12 +302,11 @@ public SignatureRequestCreateEmbeddedRequest addGroupedSignersItem(SubSignatureR return this; } - /** + /** * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return groupedSigners - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -334,12 +327,11 @@ public SignatureRequestCreateEmbeddedRequest allowDecline(Boolean allowDecline) return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -360,12 +352,11 @@ public SignatureRequestCreateEmbeddedRequest allowReassign(Boolean allowReassign return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. * @return allowReassign - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -394,12 +385,11 @@ public SignatureRequestCreateEmbeddedRequest addAttachmentsItem(SubAttachment at return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -428,12 +418,11 @@ public SignatureRequestCreateEmbeddedRequest addCcEmailAddressesItem(String ccEm return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -462,12 +451,11 @@ public SignatureRequestCreateEmbeddedRequest addCustomFieldsItem(SubCustomField return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -488,12 +476,11 @@ public SignatureRequestCreateEmbeddedRequest fieldOptions(SubFieldOptions fieldO return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -522,12 +509,11 @@ public SignatureRequestCreateEmbeddedRequest addFormFieldGroupsItem(SubFormField return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -556,12 +542,11 @@ public SignatureRequestCreateEmbeddedRequest addFormFieldRulesItem(SubFormFieldR return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -590,12 +575,11 @@ public SignatureRequestCreateEmbeddedRequest addFormFieldsPerDocumentItem(SubFor return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -616,12 +600,11 @@ public SignatureRequestCreateEmbeddedRequest hideTextTags(Boolean hideTextTags) return this; } - /** + /** * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. * @return hideTextTags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -642,12 +625,11 @@ public SignatureRequestCreateEmbeddedRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -676,12 +658,11 @@ public SignatureRequestCreateEmbeddedRequest putMetadataItem(String key, Object return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -702,12 +683,11 @@ public SignatureRequestCreateEmbeddedRequest signingOptions(SubSigningOptions si return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -728,12 +708,11 @@ public SignatureRequestCreateEmbeddedRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -754,12 +733,11 @@ public SignatureRequestCreateEmbeddedRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -780,12 +758,11 @@ public SignatureRequestCreateEmbeddedRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -806,12 +783,11 @@ public SignatureRequestCreateEmbeddedRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. * @return useTextTags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -832,12 +808,11 @@ public SignatureRequestCreateEmbeddedRequest populateAutoFillFields(Boolean popu return this; } - /** + /** * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. * @return populateAutoFillFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -858,12 +833,11 @@ public SignatureRequestCreateEmbeddedRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java index 7c90fd8f6..f43cbef5c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubCC; @@ -26,17 +25,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -44,24 +42,24 @@ * SignatureRequestCreateEmbeddedWithTemplateRequest */ @JsonPropertyOrder({ - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, - SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, + SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestCreateEmbeddedWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -132,16 +130,18 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest templateIds(List(); + } this.templateIds.add(templateIdsItem); return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -162,12 +162,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest clientId(String clientI return this; } - /** + /** * Client id of the app you're using to create this embedded signature request. Used for security purposes. * @return clientId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this embedded signature request. Used for security purposes.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -189,16 +188,18 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest signers(List(); + } this.signers.add(signersItem); return this; } - /** + /** * Add Signers to your Templated-based Signature Request. * @return signers - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Add Signers to your Templated-based Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -219,12 +220,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest allowDecline(Boolean al return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -253,12 +253,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsIte return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -287,12 +286,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addCustomFieldsItem(Sub return this; } - /** + /** * An array defining values and options for custom fields. Required when a custom field exists in the Template. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array defining values and options for custom fields. Required when a custom field exists in the Template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -321,12 +319,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addFilesItem(File files return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -355,12 +352,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addFileUrlsItem(String return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -381,12 +377,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest message(String message) return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -415,12 +410,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest putMetadataItem(String return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -441,12 +435,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest signingOptions(SubSigni return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -467,12 +460,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest subject(String subject) return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -493,12 +485,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest testMode(Boolean testMo return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -519,12 +510,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -545,12 +535,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest populateAutoFillFields( return this; } - /** + /** * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. * @return populateAutoFillFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java index b1bd94f33..1813af9c0 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponse; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * SignatureRequestGetResponse */ @JsonPropertyOrder({ - SignatureRequestGetResponse.JSON_PROPERTY_SIGNATURE_REQUEST, - SignatureRequestGetResponse.JSON_PROPERTY_WARNINGS + SignatureRequestGetResponse.JSON_PROPERTY_SIGNATURE_REQUEST, + SignatureRequestGetResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestGetResponse { public static final String JSON_PROPERTY_SIGNATURE_REQUEST = "signature_request"; private SignatureRequestResponse signatureRequest; @@ -74,14 +72,13 @@ public SignatureRequestGetResponse signatureRequest(SignatureRequestResponse sig return this; } - /** + /** * Get signatureRequest * @return signatureRequest - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public SignatureRequestResponse getSignatureRequest() { return signatureRequest; @@ -89,7 +86,7 @@ public SignatureRequestResponse getSignatureRequest() { @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSignatureRequest(SignatureRequestResponse signatureRequest) { this.signatureRequest = signatureRequest; } @@ -108,12 +105,11 @@ public SignatureRequestGetResponse addWarningsItem(WarningResponse warningsItem) return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java index fc43bf180..de380ad57 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.ListInfoResponse; @@ -25,14 +24,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,15 +38,15 @@ * SignatureRequestListResponse */ @JsonPropertyOrder({ - SignatureRequestListResponse.JSON_PROPERTY_SIGNATURE_REQUESTS, - SignatureRequestListResponse.JSON_PROPERTY_LIST_INFO, - SignatureRequestListResponse.JSON_PROPERTY_WARNINGS + SignatureRequestListResponse.JSON_PROPERTY_SIGNATURE_REQUESTS, + SignatureRequestListResponse.JSON_PROPERTY_LIST_INFO, + SignatureRequestListResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestListResponse { public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; - private List signatureRequests = null; + private List signatureRequests = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; @@ -87,14 +85,13 @@ public SignatureRequestListResponse addSignatureRequestsItem(SignatureRequestRes return this; } - /** + /** * Contains information about signature requests. * @return signatureRequests - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Contains information about signature requests.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getSignatureRequests() { return signatureRequests; @@ -102,7 +99,7 @@ public List getSignatureRequests() { @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSignatureRequests(List signatureRequests) { this.signatureRequests = signatureRequests; } @@ -113,14 +110,13 @@ public SignatureRequestListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public SignatureRequestListResponse addWarningsItem(WarningResponse warningsItem return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java index f7a730f56..b300412aa 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,11 +33,11 @@ * SignatureRequestRemindRequest */ @JsonPropertyOrder({ - SignatureRequestRemindRequest.JSON_PROPERTY_EMAIL_ADDRESS, - SignatureRequestRemindRequest.JSON_PROPERTY_NAME + SignatureRequestRemindRequest.JSON_PROPERTY_EMAIL_ADDRESS, + SignatureRequestRemindRequest.JSON_PROPERTY_NAME }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestRemindRequest { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -70,12 +68,11 @@ public SignatureRequestRemindRequest emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer to send a reminder to. * @return emailAddress - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer to send a reminder to.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public SignatureRequestRemindRequest name(String name) { return this; } - /** + /** * The name of the signer to send a reminder to. Include if two or more signers share an email address. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the signer to send a reminder to. Include if two or more signers share an email address.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java index fd7de675b..da6e7230c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseAttachment; @@ -26,50 +25,48 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about a signature request. */ -@ApiModel(description = "Contains information about a signature request.") @JsonPropertyOrder({ - SignatureRequestResponse.JSON_PROPERTY_TEST_MODE, - SignatureRequestResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, - SignatureRequestResponse.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, - SignatureRequestResponse.JSON_PROPERTY_TITLE, - SignatureRequestResponse.JSON_PROPERTY_ORIGINAL_TITLE, - SignatureRequestResponse.JSON_PROPERTY_SUBJECT, - SignatureRequestResponse.JSON_PROPERTY_MESSAGE, - SignatureRequestResponse.JSON_PROPERTY_METADATA, - SignatureRequestResponse.JSON_PROPERTY_CREATED_AT, - SignatureRequestResponse.JSON_PROPERTY_EXPIRES_AT, - SignatureRequestResponse.JSON_PROPERTY_IS_COMPLETE, - SignatureRequestResponse.JSON_PROPERTY_IS_DECLINED, - SignatureRequestResponse.JSON_PROPERTY_HAS_ERROR, - SignatureRequestResponse.JSON_PROPERTY_FILES_URL, - SignatureRequestResponse.JSON_PROPERTY_SIGNING_URL, - SignatureRequestResponse.JSON_PROPERTY_DETAILS_URL, - SignatureRequestResponse.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - SignatureRequestResponse.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestResponse.JSON_PROPERTY_FINAL_COPY_URI, - SignatureRequestResponse.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestResponse.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestResponse.JSON_PROPERTY_ATTACHMENTS, - SignatureRequestResponse.JSON_PROPERTY_RESPONSE_DATA, - SignatureRequestResponse.JSON_PROPERTY_SIGNATURES, - SignatureRequestResponse.JSON_PROPERTY_BULK_SEND_JOB_ID + SignatureRequestResponse.JSON_PROPERTY_TEST_MODE, + SignatureRequestResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, + SignatureRequestResponse.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, + SignatureRequestResponse.JSON_PROPERTY_TITLE, + SignatureRequestResponse.JSON_PROPERTY_ORIGINAL_TITLE, + SignatureRequestResponse.JSON_PROPERTY_SUBJECT, + SignatureRequestResponse.JSON_PROPERTY_MESSAGE, + SignatureRequestResponse.JSON_PROPERTY_METADATA, + SignatureRequestResponse.JSON_PROPERTY_CREATED_AT, + SignatureRequestResponse.JSON_PROPERTY_EXPIRES_AT, + SignatureRequestResponse.JSON_PROPERTY_IS_COMPLETE, + SignatureRequestResponse.JSON_PROPERTY_IS_DECLINED, + SignatureRequestResponse.JSON_PROPERTY_HAS_ERROR, + SignatureRequestResponse.JSON_PROPERTY_FILES_URL, + SignatureRequestResponse.JSON_PROPERTY_SIGNING_URL, + SignatureRequestResponse.JSON_PROPERTY_DETAILS_URL, + SignatureRequestResponse.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestResponse.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestResponse.JSON_PROPERTY_FINAL_COPY_URI, + SignatureRequestResponse.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestResponse.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestResponse.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestResponse.JSON_PROPERTY_RESPONSE_DATA, + SignatureRequestResponse.JSON_PROPERTY_SIGNATURES, + SignatureRequestResponse.JSON_PROPERTY_BULK_SEND_JOB_ID }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestResponse { public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; private Boolean testMode = false; @@ -169,12 +166,11 @@ public SignatureRequestResponse testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -195,12 +191,11 @@ public SignatureRequestResponse signatureRequestId(String signatureRequestId) { return this; } - /** + /** * The id of the SignatureRequest. * @return signatureRequestId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -221,12 +216,11 @@ public SignatureRequestResponse requesterEmailAddress(String requesterEmailAddre return this; } - /** + /** * The email address of the initiator of the SignatureRequest. * @return requesterEmailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email address of the initiator of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,12 +241,11 @@ public SignatureRequestResponse title(String title) { return this; } - /** + /** * The title the specified Account uses for the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title the specified Account uses for the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -273,12 +266,11 @@ public SignatureRequestResponse originalTitle(String originalTitle) { return this; } - /** + /** * Default Label for account. * @return originalTitle - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Default Label for account.") @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,12 +291,11 @@ public SignatureRequestResponse subject(String subject) { return this; } - /** + /** * The subject in the email that was initially sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -325,12 +316,11 @@ public SignatureRequestResponse message(String message) { return this; } - /** + /** * The custom message in the email that was initially sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -351,12 +341,11 @@ public SignatureRequestResponse metadata(Object metadata) { return this; } - /** + /** * The metadata attached to the signature request. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The metadata attached to the signature request.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -377,12 +366,11 @@ public SignatureRequestResponse createdAt(Integer createdAt) { return this; } - /** + /** * Time the signature request was created. * @return createdAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Time the signature request was created.") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -403,12 +391,11 @@ public SignatureRequestResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -429,12 +416,11 @@ public SignatureRequestResponse isComplete(Boolean isComplete) { return this; } - /** + /** * Whether or not the SignatureRequest has been fully executed by all signers. * @return isComplete - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been fully executed by all signers.") @JsonProperty(JSON_PROPERTY_IS_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -455,12 +441,11 @@ public SignatureRequestResponse isDeclined(Boolean isDeclined) { return this; } - /** + /** * Whether or not the SignatureRequest has been declined by a signer. * @return isDeclined - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been declined by a signer.") @JsonProperty(JSON_PROPERTY_IS_DECLINED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -481,12 +466,11 @@ public SignatureRequestResponse hasError(Boolean hasError) { return this; } - /** + /** * Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). * @return hasError - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).") @JsonProperty(JSON_PROPERTY_HAS_ERROR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -507,12 +491,11 @@ public SignatureRequestResponse filesUrl(String filesUrl) { return this; } - /** + /** * The URL where a copy of the request's documents can be downloaded. * @return filesUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL where a copy of the request's documents can be downloaded.") @JsonProperty(JSON_PROPERTY_FILES_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -533,12 +516,11 @@ public SignatureRequestResponse signingUrl(String signingUrl) { return this; } - /** + /** * The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. * @return signingUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.") @JsonProperty(JSON_PROPERTY_SIGNING_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -559,12 +541,11 @@ public SignatureRequestResponse detailsUrl(String detailsUrl) { return this; } - /** + /** * The URL where the requester and the signers can view the current status of the SignatureRequest. * @return detailsUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL where the requester and the signers can view the current status of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_DETAILS_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -593,12 +574,11 @@ public SignatureRequestResponse addCcEmailAddressesItem(String ccEmailAddressesI return this; } - /** + /** * A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. * @return ccEmailAddresses - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -619,12 +599,11 @@ public SignatureRequestResponse signingRedirectUrl(String signingRedirectUrl) { return this; } - /** + /** * The URL you want the signer redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want the signer redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -645,12 +624,11 @@ public SignatureRequestResponse finalCopyUri(String finalCopyUri) { return this; } - /** + /** * The path where the completed document can be downloaded * @return finalCopyUri - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The path where the completed document can be downloaded") @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -679,12 +657,11 @@ public SignatureRequestResponse addTemplateIdsItem(String templateIdsItem) { return this; } - /** + /** * Templates IDs used in this SignatureRequest (if any). * @return templateIds - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Templates IDs used in this SignatureRequest (if any).") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -713,12 +690,11 @@ public SignatureRequestResponse addCustomFieldsItem(SignatureRequestResponseCust return this; } - /** + /** * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -747,12 +723,11 @@ public SignatureRequestResponse addAttachmentsItem(SignatureRequestResponseAttac return this; } - /** + /** * Signer attachments. * @return attachments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Signer attachments.") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -781,12 +756,11 @@ public SignatureRequestResponse addResponseDataItem(SignatureRequestResponseData return this; } - /** + /** * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. * @return responseData - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -815,12 +789,11 @@ public SignatureRequestResponse addSignaturesItem(SignatureRequestResponseSignat return this; } - /** + /** * An array of signature objects, 1 for each signer. * @return signatures - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of signature objects, 1 for each signer.") @JsonProperty(JSON_PROPERTY_SIGNATURES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -841,12 +814,11 @@ public SignatureRequestResponse bulkSendJobId(String bulkSendJobId) { return this; } - /** + /** * The ID of the Bulk Send job which sent the signature request, if applicable. * @return bulkSendJobId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The ID of the Bulk Send job which sent the signature request, if applicable.") @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java index e90f50370..323073247 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,29 +21,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Signer attachments. */ -@ApiModel(description = "Signer attachments.") @JsonPropertyOrder({ - SignatureRequestResponseAttachment.JSON_PROPERTY_ID, - SignatureRequestResponseAttachment.JSON_PROPERTY_SIGNER, - SignatureRequestResponseAttachment.JSON_PROPERTY_NAME, - SignatureRequestResponseAttachment.JSON_PROPERTY_REQUIRED, - SignatureRequestResponseAttachment.JSON_PROPERTY_INSTRUCTIONS, - SignatureRequestResponseAttachment.JSON_PROPERTY_UPLOADED_AT + SignatureRequestResponseAttachment.JSON_PROPERTY_ID, + SignatureRequestResponseAttachment.JSON_PROPERTY_SIGNER, + SignatureRequestResponseAttachment.JSON_PROPERTY_NAME, + SignatureRequestResponseAttachment.JSON_PROPERTY_REQUIRED, + SignatureRequestResponseAttachment.JSON_PROPERTY_INSTRUCTIONS, + SignatureRequestResponseAttachment.JSON_PROPERTY_UPLOADED_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestResponseAttachment { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -87,12 +84,11 @@ public SignatureRequestResponseAttachment id(String id) { return this; } - /** + /** * The unique ID for this attachment. * @return id - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique ID for this attachment.") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -112,13 +108,16 @@ public SignatureRequestResponseAttachment signer(String signer) { this.signer = signer; return this; } + public SignatureRequestResponseAttachment signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } - /** + /** * The Signer this attachment is assigned to. * @return signer - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Signer this attachment is assigned to.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -133,18 +132,21 @@ public void setSigner(String signer) { this.signer = signer; } + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + public SignatureRequestResponseAttachment name(String name) { this.name = name; return this; } - /** + /** * The name of this attachment. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of this attachment.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -165,12 +167,11 @@ public SignatureRequestResponseAttachment required(Boolean required) { return this; } - /** + /** * A boolean value denoting if this attachment is required. * @return required - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A boolean value denoting if this attachment is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,12 +192,11 @@ public SignatureRequestResponseAttachment instructions(String instructions) { return this; } - /** + /** * Instructions for Signer. * @return instructions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Instructions for Signer.") @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +217,11 @@ public SignatureRequestResponseAttachment uploadedAt(Integer uploadedAt) { return this; } - /** + /** * Timestamp when attachment was uploaded by Signer. * @return uploadedAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Timestamp when attachment was uploaded by Signer.") @JsonProperty(JSON_PROPERTY_UPLOADED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java index 1d8f7d138..fcde00fc8 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java @@ -14,11 +14,9 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; -import com.dropbox.sign.model.SignatureRequestResponseCustomFieldCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseCustomFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,32 +24,31 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` */ -@ApiModel(description = "An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") @JsonPropertyOrder({ - SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_TYPE, - SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_NAME, - SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_REQUIRED, - SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_API_ID, - SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_EDITOR + SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_TYPE, + SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_NAME, + SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_REQUIRED, + SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_API_ID, + SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_EDITOR }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldCheckbox.class, name = "SignatureRequestResponseCustomFieldCheckbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldText.class, name = "SignatureRequestResponseCustomFieldText"), @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldCheckbox.class, name = "checkbox"), @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldText.class, name = "text"), }) @@ -95,12 +92,11 @@ public SignatureRequestResponseCustomFieldBase type(String type) { return this; } - /** + /** * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -121,12 +117,11 @@ public SignatureRequestResponseCustomFieldBase name(String name) { return this; } - /** + /** * The name of the Custom Field. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Custom Field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -147,12 +142,11 @@ public SignatureRequestResponseCustomFieldBase required(Boolean required) { return this; } - /** + /** * A boolean value denoting if this field is required. * @return required - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A boolean value denoting if this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,12 +167,11 @@ public SignatureRequestResponseCustomFieldBase apiId(String apiId) { return this; } - /** + /** * The unique ID for this field. * @return apiId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The unique ID for this field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +192,11 @@ public SignatureRequestResponseCustomFieldBase editor(String editor) { return this; } - /** + /** * The name of the Role that is able to edit this field. * @return editor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the Role that is able to edit this field.") @JsonProperty(JSON_PROPERTY_EDITOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -394,15 +386,13 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("SignatureRequestResponseCustomFieldCheckbox", SignatureRequestResponseCustomFieldCheckbox.class); - mappings.put("SignatureRequestResponseCustomFieldText", SignatureRequestResponseCustomFieldText.class); - mappings.put("checkbox", SignatureRequestResponseCustomFieldCheckbox.class); - mappings.put("text", SignatureRequestResponseCustomFieldText.class); - mappings.put("SignatureRequestResponseCustomFieldBase", SignatureRequestResponseCustomFieldBase.class); - JSON.registerDiscriminator(SignatureRequestResponseCustomFieldBase.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", SignatureRequestResponseCustomFieldCheckbox.class); + mappings.put("text", SignatureRequestResponseCustomFieldText.class); + mappings.put("SignatureRequestResponseCustomFieldBase", SignatureRequestResponseCustomFieldBase.class); + JSON.registerDiscriminator(SignatureRequestResponseCustomFieldBase.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java index 0fcc3a1be..e4eb1e398 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java @@ -14,12 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseCustomFieldBase; -import com.dropbox.sign.model.SignatureRequestResponseCustomFieldCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseCustomFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -27,30 +25,27 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SignatureRequestResponseCustomFieldBase`. */ -@ApiModel(description = "This class extends `SignatureRequestResponseCustomFieldBase`.") @JsonPropertyOrder({ - SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_TYPE, - SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_VALUE + SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_TYPE, + SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldText.class, name = "text"), -}) public class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestResponseCustomFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -82,12 +77,11 @@ public SignatureRequestResponseCustomFieldCheckbox type(String type) { return this; } - /** + /** * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +102,11 @@ public SignatureRequestResponseCustomFieldCheckbox value(Boolean value) { return this; } - /** + /** * A true/false for checkbox fields * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A true/false for checkbox fields") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -243,13 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseCustomFieldCheckbox.class); - mappings.put("text", SignatureRequestResponseCustomFieldText.class); - mappings.put("SignatureRequestResponseCustomFieldCheckbox", SignatureRequestResponseCustomFieldCheckbox.class); - JSON.registerDiscriminator(SignatureRequestResponseCustomFieldCheckbox.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseCustomFieldCheckbox", SignatureRequestResponseCustomFieldCheckbox.class); + JSON.registerDiscriminator(SignatureRequestResponseCustomFieldCheckbox.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java index 21a0f2389..f4284d634 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java @@ -14,12 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseCustomFieldBase; -import com.dropbox.sign.model.SignatureRequestResponseCustomFieldCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseCustomFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -27,30 +25,27 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SignatureRequestResponseCustomFieldBase`. */ -@ApiModel(description = "This class extends `SignatureRequestResponseCustomFieldBase`.") @JsonPropertyOrder({ - SignatureRequestResponseCustomFieldText.JSON_PROPERTY_TYPE, - SignatureRequestResponseCustomFieldText.JSON_PROPERTY_VALUE + SignatureRequestResponseCustomFieldText.JSON_PROPERTY_TYPE, + SignatureRequestResponseCustomFieldText.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldText.class, name = "text"), -}) public class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCustomFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -82,12 +77,11 @@ public SignatureRequestResponseCustomFieldText type(String type) { return this; } - /** + /** * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +102,11 @@ public SignatureRequestResponseCustomFieldText value(String value) { return this; } - /** + /** * A text string for text fields * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A text string for text fields") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -243,13 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseCustomFieldCheckbox.class); - mappings.put("text", SignatureRequestResponseCustomFieldText.class); - mappings.put("SignatureRequestResponseCustomFieldText", SignatureRequestResponseCustomFieldText.class); - JSON.registerDiscriminator(SignatureRequestResponseCustomFieldText.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseCustomFieldText", SignatureRequestResponseCustomFieldText.class); + JSON.registerDiscriminator(SignatureRequestResponseCustomFieldText.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java index bb241561c..c4ae5b305 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java @@ -14,13 +14,12 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; 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.JSON; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java index a2f354f2c..c1a23eb4c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java @@ -14,18 +14,9 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckboxMerge; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDateSigned; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDropdown; -import com.dropbox.sign.model.SignatureRequestResponseDataValueInitials; -import com.dropbox.sign.model.SignatureRequestResponseDataValueRadio; -import com.dropbox.sign.model.SignatureRequestResponseDataValueSignature; -import com.dropbox.sign.model.SignatureRequestResponseDataValueText; -import com.dropbox.sign.model.SignatureRequestResponseDataValueTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,39 +24,31 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. */ -@ApiModel(description = "An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") @JsonPropertyOrder({ - SignatureRequestResponseDataBase.JSON_PROPERTY_API_ID, - SignatureRequestResponseDataBase.JSON_PROPERTY_SIGNATURE_ID, - SignatureRequestResponseDataBase.JSON_PROPERTY_NAME, - SignatureRequestResponseDataBase.JSON_PROPERTY_REQUIRED, - SignatureRequestResponseDataBase.JSON_PROPERTY_TYPE + SignatureRequestResponseDataBase.JSON_PROPERTY_API_ID, + SignatureRequestResponseDataBase.JSON_PROPERTY_SIGNATURE_ID, + SignatureRequestResponseDataBase.JSON_PROPERTY_NAME, + SignatureRequestResponseDataBase.JSON_PROPERTY_REQUIRED, + SignatureRequestResponseDataBase.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "SignatureRequestResponseDataValueCheckbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "SignatureRequestResponseDataValueCheckboxMerge"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "SignatureRequestResponseDataValueDateSigned"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "SignatureRequestResponseDataValueDropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "SignatureRequestResponseDataValueInitials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "SignatureRequestResponseDataValueRadio"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "SignatureRequestResponseDataValueSignature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "SignatureRequestResponseDataValueText"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "SignatureRequestResponseDataValueTextMerge"), @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), @@ -116,12 +99,11 @@ public SignatureRequestResponseDataBase apiId(String apiId) { return this; } - /** + /** * The unique ID for this field. * @return apiId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The unique ID for this field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,12 +124,11 @@ public SignatureRequestResponseDataBase signatureId(String signatureId) { return this; } - /** + /** * The ID of the signature to which this response is linked. * @return signatureId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The ID of the signature to which this response is linked.") @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,12 +149,11 @@ public SignatureRequestResponseDataBase name(String name) { return this; } - /** + /** * The name of the form field. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the form field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -194,12 +174,11 @@ public SignatureRequestResponseDataBase required(Boolean required) { return this; } - /** + /** * A boolean value denoting if this field is required. * @return required - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A boolean value denoting if this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -220,12 +199,11 @@ public SignatureRequestResponseDataBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -415,29 +393,20 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("SignatureRequestResponseDataValueCheckbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("SignatureRequestResponseDataValueCheckboxMerge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("SignatureRequestResponseDataValueDateSigned", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("SignatureRequestResponseDataValueDropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("SignatureRequestResponseDataValueInitials", SignatureRequestResponseDataValueInitials.class); - mappings.put("SignatureRequestResponseDataValueRadio", SignatureRequestResponseDataValueRadio.class); - mappings.put("SignatureRequestResponseDataValueSignature", SignatureRequestResponseDataValueSignature.class); - mappings.put("SignatureRequestResponseDataValueText", SignatureRequestResponseDataValueText.class); - mappings.put("SignatureRequestResponseDataValueTextMerge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataBase", SignatureRequestResponseDataBase.class); - JSON.registerDiscriminator(SignatureRequestResponseDataBase.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); + mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); + mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); + mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); + mappings.put("initials", SignatureRequestResponseDataValueInitials.class); + mappings.put("radio", SignatureRequestResponseDataValueRadio.class); + mappings.put("signature", SignatureRequestResponseDataValueSignature.class); + mappings.put("text", SignatureRequestResponseDataValueText.class); + mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); + mappings.put("SignatureRequestResponseDataBase", SignatureRequestResponseDataBase.class); + JSON.registerDiscriminator(SignatureRequestResponseDataBase.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java index e7c32b981..b2e629584 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java @@ -14,13 +14,12 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; 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.JSON; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java index f524a6b03..ef3a930f4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java @@ -14,19 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckboxMerge; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDateSigned; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDropdown; -import com.dropbox.sign.model.SignatureRequestResponseDataValueInitials; -import com.dropbox.sign.model.SignatureRequestResponseDataValueRadio; -import com.dropbox.sign.model.SignatureRequestResponseDataValueSignature; -import com.dropbox.sign.model.SignatureRequestResponseDataValueText; -import com.dropbox.sign.model.SignatureRequestResponseDataValueTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -47,23 +37,15 @@ * SignatureRequestResponseDataValueCheckbox */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "text-merge"), -}) public class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -95,12 +77,11 @@ public SignatureRequestResponseDataValueCheckbox type(String type) { return this; } - /** + /** * A yes/no checkbox * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A yes/no checkbox") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +102,11 @@ public SignatureRequestResponseDataValueCheckbox value(Boolean value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,20 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataValueCheckbox", SignatureRequestResponseDataValueCheckbox.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueCheckbox.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueCheckbox", SignatureRequestResponseDataValueCheckbox.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueCheckbox.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java index 18ba380b1..7fafbf24a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java @@ -14,19 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckboxMerge; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDateSigned; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDropdown; -import com.dropbox.sign.model.SignatureRequestResponseDataValueInitials; -import com.dropbox.sign.model.SignatureRequestResponseDataValueRadio; -import com.dropbox.sign.model.SignatureRequestResponseDataValueSignature; -import com.dropbox.sign.model.SignatureRequestResponseDataValueText; -import com.dropbox.sign.model.SignatureRequestResponseDataValueTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -47,23 +37,15 @@ * SignatureRequestResponseDataValueCheckboxMerge */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "text-merge"), -}) public class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -95,12 +77,11 @@ public SignatureRequestResponseDataValueCheckboxMerge type(String type) { return this; } - /** + /** * A checkbox field that has default value set by the api * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A checkbox field that has default value set by the api") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +102,11 @@ public SignatureRequestResponseDataValueCheckboxMerge value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,20 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataValueCheckboxMerge", SignatureRequestResponseDataValueCheckboxMerge.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueCheckboxMerge.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueCheckboxMerge", SignatureRequestResponseDataValueCheckboxMerge.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueCheckboxMerge.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java index 466f0fedc..bbd474ab2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java @@ -14,19 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckboxMerge; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDateSigned; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDropdown; -import com.dropbox.sign.model.SignatureRequestResponseDataValueInitials; -import com.dropbox.sign.model.SignatureRequestResponseDataValueRadio; -import com.dropbox.sign.model.SignatureRequestResponseDataValueSignature; -import com.dropbox.sign.model.SignatureRequestResponseDataValueText; -import com.dropbox.sign.model.SignatureRequestResponseDataValueTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -47,23 +37,15 @@ * SignatureRequestResponseDataValueDateSigned */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "text-merge"), -}) public class SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -95,12 +77,11 @@ public SignatureRequestResponseDataValueDateSigned type(String type) { return this; } - /** + /** * A date * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A date") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +102,11 @@ public SignatureRequestResponseDataValueDateSigned value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,20 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataValueDateSigned", SignatureRequestResponseDataValueDateSigned.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueDateSigned.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueDateSigned", SignatureRequestResponseDataValueDateSigned.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueDateSigned.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java index 4f26d9bf9..f8cf79d19 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java @@ -14,19 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckboxMerge; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDateSigned; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDropdown; -import com.dropbox.sign.model.SignatureRequestResponseDataValueInitials; -import com.dropbox.sign.model.SignatureRequestResponseDataValueRadio; -import com.dropbox.sign.model.SignatureRequestResponseDataValueSignature; -import com.dropbox.sign.model.SignatureRequestResponseDataValueText; -import com.dropbox.sign.model.SignatureRequestResponseDataValueTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -47,23 +37,15 @@ * SignatureRequestResponseDataValueDropdown */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "text-merge"), -}) public class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -95,12 +77,11 @@ public SignatureRequestResponseDataValueDropdown type(String type) { return this; } - /** + /** * An input field for dropdowns * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An input field for dropdowns") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +102,11 @@ public SignatureRequestResponseDataValueDropdown value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,20 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataValueDropdown", SignatureRequestResponseDataValueDropdown.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueDropdown.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueDropdown", SignatureRequestResponseDataValueDropdown.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueDropdown.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java index be73734d2..9fca40916 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java @@ -14,19 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckboxMerge; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDateSigned; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDropdown; -import com.dropbox.sign.model.SignatureRequestResponseDataValueInitials; -import com.dropbox.sign.model.SignatureRequestResponseDataValueRadio; -import com.dropbox.sign.model.SignatureRequestResponseDataValueSignature; -import com.dropbox.sign.model.SignatureRequestResponseDataValueText; -import com.dropbox.sign.model.SignatureRequestResponseDataValueTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -47,23 +37,15 @@ * SignatureRequestResponseDataValueInitials */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueInitials.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueInitials.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueInitials.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueInitials.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "text-merge"), -}) public class SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -95,12 +77,11 @@ public SignatureRequestResponseDataValueInitials type(String type) { return this; } - /** + /** * An input field for initials * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An input field for initials") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +102,11 @@ public SignatureRequestResponseDataValueInitials value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,20 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataValueInitials", SignatureRequestResponseDataValueInitials.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueInitials.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueInitials", SignatureRequestResponseDataValueInitials.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueInitials.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java index a7b76b69e..e5bce3dc6 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java @@ -14,19 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckboxMerge; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDateSigned; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDropdown; -import com.dropbox.sign.model.SignatureRequestResponseDataValueInitials; -import com.dropbox.sign.model.SignatureRequestResponseDataValueRadio; -import com.dropbox.sign.model.SignatureRequestResponseDataValueSignature; -import com.dropbox.sign.model.SignatureRequestResponseDataValueText; -import com.dropbox.sign.model.SignatureRequestResponseDataValueTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -47,23 +37,15 @@ * SignatureRequestResponseDataValueRadio */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueRadio.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueRadio.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueRadio.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueRadio.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "text-merge"), -}) public class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -95,12 +77,11 @@ public SignatureRequestResponseDataValueRadio type(String type) { return this; } - /** + /** * An input field for radios * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An input field for radios") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +102,11 @@ public SignatureRequestResponseDataValueRadio value(Boolean value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,20 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataValueRadio", SignatureRequestResponseDataValueRadio.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueRadio.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueRadio", SignatureRequestResponseDataValueRadio.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueRadio.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java index 7510c3f3f..228d80081 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java @@ -14,19 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckboxMerge; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDateSigned; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDropdown; -import com.dropbox.sign.model.SignatureRequestResponseDataValueInitials; -import com.dropbox.sign.model.SignatureRequestResponseDataValueRadio; -import com.dropbox.sign.model.SignatureRequestResponseDataValueSignature; -import com.dropbox.sign.model.SignatureRequestResponseDataValueText; -import com.dropbox.sign.model.SignatureRequestResponseDataValueTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -47,23 +37,15 @@ * SignatureRequestResponseDataValueSignature */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueSignature.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueSignature.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueSignature.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueSignature.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "text-merge"), -}) public class SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -95,12 +77,11 @@ public SignatureRequestResponseDataValueSignature type(String type) { return this; } - /** + /** * A signature input field * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A signature input field") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +102,11 @@ public SignatureRequestResponseDataValueSignature value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,20 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataValueSignature", SignatureRequestResponseDataValueSignature.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueSignature.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueSignature", SignatureRequestResponseDataValueSignature.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueSignature.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java index e9d28a0d4..fa152163b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java @@ -14,19 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckboxMerge; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDateSigned; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDropdown; -import com.dropbox.sign.model.SignatureRequestResponseDataValueInitials; -import com.dropbox.sign.model.SignatureRequestResponseDataValueRadio; -import com.dropbox.sign.model.SignatureRequestResponseDataValueSignature; -import com.dropbox.sign.model.SignatureRequestResponseDataValueText; -import com.dropbox.sign.model.SignatureRequestResponseDataValueTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -47,23 +37,15 @@ * SignatureRequestResponseDataValueText */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueText.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueText.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueText.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueText.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "text-merge"), -}) public class SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -95,12 +77,11 @@ public SignatureRequestResponseDataValueText type(String type) { return this; } - /** + /** * A text input field * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A text input field") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +102,11 @@ public SignatureRequestResponseDataValueText value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,20 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataValueText", SignatureRequestResponseDataValueText.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueText.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueText", SignatureRequestResponseDataValueText.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueText.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java index e73bb3238..9ba65785c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java @@ -14,19 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckbox; -import com.dropbox.sign.model.SignatureRequestResponseDataValueCheckboxMerge; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDateSigned; -import com.dropbox.sign.model.SignatureRequestResponseDataValueDropdown; -import com.dropbox.sign.model.SignatureRequestResponseDataValueInitials; -import com.dropbox.sign.model.SignatureRequestResponseDataValueRadio; -import com.dropbox.sign.model.SignatureRequestResponseDataValueSignature; -import com.dropbox.sign.model.SignatureRequestResponseDataValueText; -import com.dropbox.sign.model.SignatureRequestResponseDataValueTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,12 +25,11 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -47,23 +37,15 @@ * SignatureRequestResponseDataValueTextMerge */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueText.class, name = "text"), - @JsonSubTypes.Type(value = SignatureRequestResponseDataValueTextMerge.class, name = "text-merge"), -}) public class SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -95,12 +77,11 @@ public SignatureRequestResponseDataValueTextMerge type(String type) { return this; } - /** + /** * A text field that has default text set by the api * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A text field that has default text set by the api") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +102,11 @@ public SignatureRequestResponseDataValueTextMerge value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,20 +236,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SignatureRequestResponseDataValueCheckbox.class); - mappings.put("checkbox-merge", SignatureRequestResponseDataValueCheckboxMerge.class); - mappings.put("date_signed", SignatureRequestResponseDataValueDateSigned.class); - mappings.put("dropdown", SignatureRequestResponseDataValueDropdown.class); - mappings.put("initials", SignatureRequestResponseDataValueInitials.class); - mappings.put("radio", SignatureRequestResponseDataValueRadio.class); - mappings.put("signature", SignatureRequestResponseDataValueSignature.class); - mappings.put("text", SignatureRequestResponseDataValueText.class); - mappings.put("text-merge", SignatureRequestResponseDataValueTextMerge.class); - mappings.put("SignatureRequestResponseDataValueTextMerge", SignatureRequestResponseDataValueTextMerge.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueTextMerge.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SignatureRequestResponseDataValueTextMerge", SignatureRequestResponseDataValueTextMerge.class); + JSON.registerDiscriminator(SignatureRequestResponseDataValueTextMerge.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java index 40781d9bb..ea70c951e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,42 +21,40 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An array of signature objects, 1 for each signer. */ -@ApiModel(description = "An array of signature objects, 1 for each signer.") @JsonPropertyOrder({ - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNATURE_ID, - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_GROUP_GUID, - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_EMAIL_ADDRESS, - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_NAME, - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_ROLE, - SignatureRequestResponseSignatures.JSON_PROPERTY_ORDER, - SignatureRequestResponseSignatures.JSON_PROPERTY_STATUS_CODE, - SignatureRequestResponseSignatures.JSON_PROPERTY_DECLINE_REASON, - SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNED_AT, - SignatureRequestResponseSignatures.JSON_PROPERTY_LAST_VIEWED_AT, - SignatureRequestResponseSignatures.JSON_PROPERTY_LAST_REMINDED_AT, - SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_PIN, - SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_SMS_AUTH, - SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_SMS_DELIVERY, - SignatureRequestResponseSignatures.JSON_PROPERTY_SMS_PHONE_NUMBER, - SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNED_BY, - SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNMENT_REASON, - SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNED_FROM, - SignatureRequestResponseSignatures.JSON_PROPERTY_ERROR + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNATURE_ID, + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_GROUP_GUID, + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_EMAIL_ADDRESS, + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_NAME, + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_ROLE, + SignatureRequestResponseSignatures.JSON_PROPERTY_ORDER, + SignatureRequestResponseSignatures.JSON_PROPERTY_STATUS_CODE, + SignatureRequestResponseSignatures.JSON_PROPERTY_DECLINE_REASON, + SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNED_AT, + SignatureRequestResponseSignatures.JSON_PROPERTY_LAST_VIEWED_AT, + SignatureRequestResponseSignatures.JSON_PROPERTY_LAST_REMINDED_AT, + SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_PIN, + SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_SMS_AUTH, + SignatureRequestResponseSignatures.JSON_PROPERTY_HAS_SMS_DELIVERY, + SignatureRequestResponseSignatures.JSON_PROPERTY_SMS_PHONE_NUMBER, + SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNED_BY, + SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNMENT_REASON, + SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNED_FROM, + SignatureRequestResponseSignatures.JSON_PROPERTY_ERROR }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestResponseSignatures { public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; private String signatureId; @@ -139,12 +136,11 @@ public SignatureRequestResponseSignatures signatureId(String signatureId) { return this; } - /** + /** * Signature identifier. * @return signatureId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Signature identifier.") @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +161,11 @@ public SignatureRequestResponseSignatures signerGroupGuid(String signerGroupGuid return this; } - /** + /** * Signer Group GUID * @return signerGroupGuid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Signer Group GUID") @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +186,11 @@ public SignatureRequestResponseSignatures signerEmailAddress(String signerEmailA return this; } - /** + /** * The email address of the signer. * @return signerEmailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +211,11 @@ public SignatureRequestResponseSignatures signerName(String signerName) { return this; } - /** + /** * The name of the signer. * @return signerName - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_SIGNER_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -243,12 +236,11 @@ public SignatureRequestResponseSignatures signerRole(String signerRole) { return this; } - /** + /** * The role of the signer. * @return signerRole - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The role of the signer.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -269,12 +261,11 @@ public SignatureRequestResponseSignatures order(Integer order) { return this; } - /** + /** * If signer order is assigned this is the 0-based index for this signer. * @return order - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If signer order is assigned this is the 0-based index for this signer.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -295,12 +286,11 @@ public SignatureRequestResponseSignatures statusCode(String statusCode) { return this; } - /** + /** * The current status of the signature. eg: awaiting_signature, signed, declined. * @return statusCode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The current status of the signature. eg: awaiting_signature, signed, declined.") @JsonProperty(JSON_PROPERTY_STATUS_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -321,12 +311,11 @@ public SignatureRequestResponseSignatures declineReason(String declineReason) { return this; } - /** + /** * The reason provided by the signer for declining the request. * @return declineReason - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The reason provided by the signer for declining the request.") @JsonProperty(JSON_PROPERTY_DECLINE_REASON) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -347,12 +336,11 @@ public SignatureRequestResponseSignatures signedAt(Integer signedAt) { return this; } - /** + /** * Time that the document was signed or null. * @return signedAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Time that the document was signed or null.") @JsonProperty(JSON_PROPERTY_SIGNED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -373,12 +361,11 @@ public SignatureRequestResponseSignatures lastViewedAt(Integer lastViewedAt) { return this; } - /** + /** * The time that the document was last viewed by this signer or null. * @return lastViewedAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The time that the document was last viewed by this signer or null.") @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -399,12 +386,11 @@ public SignatureRequestResponseSignatures lastRemindedAt(Integer lastRemindedAt) return this; } - /** + /** * The time the last reminder email was sent to the signer or null. * @return lastRemindedAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The time the last reminder email was sent to the signer or null.") @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -425,12 +411,11 @@ public SignatureRequestResponseSignatures hasPin(Boolean hasPin) { return this; } - /** + /** * Boolean to indicate whether this signature requires a PIN to access. * @return hasPin - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate whether this signature requires a PIN to access.") @JsonProperty(JSON_PROPERTY_HAS_PIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -451,12 +436,11 @@ public SignatureRequestResponseSignatures hasSmsAuth(Boolean hasSmsAuth) { return this; } - /** + /** * Boolean to indicate whether this signature has SMS authentication enabled. * @return hasSmsAuth - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate whether this signature has SMS authentication enabled.") @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -477,12 +461,11 @@ public SignatureRequestResponseSignatures hasSmsDelivery(Boolean hasSmsDelivery) return this; } - /** + /** * Boolean to indicate whether this signature has SMS delivery enabled. * @return hasSmsDelivery - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate whether this signature has SMS delivery enabled.") @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -503,12 +486,11 @@ public SignatureRequestResponseSignatures smsPhoneNumber(String smsPhoneNumber) return this; } - /** + /** * The SMS phone number used for authentication or signature request delivery. * @return smsPhoneNumber - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The SMS phone number used for authentication or signature request delivery.") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -529,12 +511,11 @@ public SignatureRequestResponseSignatures reassignedBy(String reassignedBy) { return this; } - /** + /** * Email address of original signer who reassigned to this signer. * @return reassignedBy - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Email address of original signer who reassigned to this signer.") @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -555,12 +536,11 @@ public SignatureRequestResponseSignatures reassignmentReason(String reassignment return this; } - /** + /** * Reason provided by original signer who reassigned to this signer. * @return reassignmentReason - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Reason provided by original signer who reassigned to this signer.") @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -581,12 +561,11 @@ public SignatureRequestResponseSignatures reassignedFrom(String reassignedFrom) return this; } - /** + /** * Previous signature identifier. * @return reassignedFrom - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Previous signature identifier.") @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -607,12 +586,11 @@ public SignatureRequestResponseSignatures error(String error) { return this; } - /** + /** * Error message pertaining to this signer, or null. * @return error - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Error message pertaining to this signer, or null.") @JsonProperty(JSON_PROPERTY_ERROR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java index 3b1a43d4f..db6fcd48f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubAttachment; @@ -31,17 +30,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -49,35 +47,35 @@ * SignatureRequestSendRequest */ @JsonPropertyOrder({ - SignatureRequestSendRequest.JSON_PROPERTY_FILES, - SignatureRequestSendRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestSendRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestSendRequest.JSON_PROPERTY_GROUPED_SIGNERS, - SignatureRequestSendRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestSendRequest.JSON_PROPERTY_ALLOW_REASSIGN, - SignatureRequestSendRequest.JSON_PROPERTY_ATTACHMENTS, - SignatureRequestSendRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - SignatureRequestSendRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestSendRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestSendRequest.JSON_PROPERTY_FIELD_OPTIONS, - SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELD_RULES, - SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - SignatureRequestSendRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, - SignatureRequestSendRequest.JSON_PROPERTY_IS_QUALIFIED_SIGNATURE, - SignatureRequestSendRequest.JSON_PROPERTY_IS_EID, - SignatureRequestSendRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestSendRequest.JSON_PROPERTY_METADATA, - SignatureRequestSendRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestSendRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestSendRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestSendRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestSendRequest.JSON_PROPERTY_TITLE, - SignatureRequestSendRequest.JSON_PROPERTY_USE_TEXT_TAGS, - SignatureRequestSendRequest.JSON_PROPERTY_EXPIRES_AT + SignatureRequestSendRequest.JSON_PROPERTY_FILES, + SignatureRequestSendRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestSendRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestSendRequest.JSON_PROPERTY_GROUPED_SIGNERS, + SignatureRequestSendRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestSendRequest.JSON_PROPERTY_ALLOW_REASSIGN, + SignatureRequestSendRequest.JSON_PROPERTY_ATTACHMENTS, + SignatureRequestSendRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + SignatureRequestSendRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestSendRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestSendRequest.JSON_PROPERTY_FIELD_OPTIONS, + SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELD_RULES, + SignatureRequestSendRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + SignatureRequestSendRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + SignatureRequestSendRequest.JSON_PROPERTY_IS_QUALIFIED_SIGNATURE, + SignatureRequestSendRequest.JSON_PROPERTY_IS_EID, + SignatureRequestSendRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestSendRequest.JSON_PROPERTY_METADATA, + SignatureRequestSendRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestSendRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestSendRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestSendRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestSendRequest.JSON_PROPERTY_TITLE, + SignatureRequestSendRequest.JSON_PROPERTY_USE_TEXT_TAGS, + SignatureRequestSendRequest.JSON_PROPERTY_EXPIRES_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestSendRequest { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; @@ -125,6 +123,7 @@ public class SignatureRequestSendRequest { private Boolean hideTextTags = false; public static final String JSON_PROPERTY_IS_QUALIFIED_SIGNATURE = "is_qualified_signature"; + @Deprecated private Boolean isQualifiedSignature = false; public static final String JSON_PROPERTY_IS_EID = "is_eid"; @@ -188,12 +187,11 @@ public SignatureRequestSendRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -222,12 +220,11 @@ public SignatureRequestSendRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,12 +253,11 @@ public SignatureRequestSendRequest addSignersItem(SubSignatureRequestSigner sign return this; } - /** + /** * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return signers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -290,12 +286,11 @@ public SignatureRequestSendRequest addGroupedSignersItem(SubSignatureRequestGrou return this; } - /** + /** * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return groupedSigners - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -316,12 +311,11 @@ public SignatureRequestSendRequest allowDecline(Boolean allowDecline) { return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -342,12 +336,11 @@ public SignatureRequestSendRequest allowReassign(Boolean allowReassign) { return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. * @return allowReassign - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,12 +369,11 @@ public SignatureRequestSendRequest addAttachmentsItem(SubAttachment attachmentsI return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -410,12 +402,11 @@ public SignatureRequestSendRequest addCcEmailAddressesItem(String ccEmailAddress return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -436,12 +427,11 @@ public SignatureRequestSendRequest clientId(String clientId) { return this; } - /** + /** * The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -470,12 +460,11 @@ public SignatureRequestSendRequest addCustomFieldsItem(SubCustomField customFiel return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -496,12 +485,11 @@ public SignatureRequestSendRequest fieldOptions(SubFieldOptions fieldOptions) { return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -530,12 +518,11 @@ public SignatureRequestSendRequest addFormFieldGroupsItem(SubFormFieldGroup form return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -564,12 +551,11 @@ public SignatureRequestSendRequest addFormFieldRulesItem(SubFormFieldRule formFi return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -598,12 +584,11 @@ public SignatureRequestSendRequest addFormFieldsPerDocumentItem(SubFormFieldsPer return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -624,12 +609,11 @@ public SignatureRequestSendRequest hideTextTags(Boolean hideTextTags) { return this; } - /** + /** * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. * @return hideTextTags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -645,19 +629,19 @@ public void setHideTextTags(Boolean hideTextTags) { } + @Deprecated public SignatureRequestSendRequest isQualifiedSignature(Boolean isQualifiedSignature) { this.isQualifiedSignature = isQualifiedSignature; return this; } - /** + /** * Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br> **NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. * @return isQualifiedSignature * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -666,6 +650,7 @@ public Boolean getIsQualifiedSignature() { } + @Deprecated @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIsQualifiedSignature(Boolean isQualifiedSignature) { @@ -678,12 +663,11 @@ public SignatureRequestSendRequest isEid(Boolean isEid) { return this; } - /** + /** * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. * @return isEid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_EID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -704,12 +688,11 @@ public SignatureRequestSendRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -738,12 +721,11 @@ public SignatureRequestSendRequest putMetadataItem(String key, Object metadataIt return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -764,12 +746,11 @@ public SignatureRequestSendRequest signingOptions(SubSigningOptions signingOptio return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -790,12 +771,11 @@ public SignatureRequestSendRequest signingRedirectUrl(String signingRedirectUrl) return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -816,12 +796,11 @@ public SignatureRequestSendRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -842,12 +821,11 @@ public SignatureRequestSendRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -868,12 +846,11 @@ public SignatureRequestSendRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -894,12 +871,11 @@ public SignatureRequestSendRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. * @return useTextTags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -920,12 +896,11 @@ public SignatureRequestSendRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java index 922b07eb4..a95c44e33 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubCC; @@ -26,44 +25,43 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** - * SignatureRequestSendWithTemplateRequest + * */ @JsonPropertyOrder({ - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNERS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CCS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_FILES, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_FILE_URLS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_IS_QUALIFIED_SIGNATURE, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_IS_EID, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_MESSAGE, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_METADATA, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TITLE + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNERS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CCS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_FILES, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_IS_QUALIFIED_SIGNATURE, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_IS_EID, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_MESSAGE, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_METADATA, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SUBJECT, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TITLE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestSendWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -90,6 +88,7 @@ public class SignatureRequestSendWithTemplateRequest { private List fileUrls = null; public static final String JSON_PROPERTY_IS_QUALIFIED_SIGNATURE = "is_qualified_signature"; + @Deprecated private Boolean isQualifiedSignature = false; public static final String JSON_PROPERTY_IS_EID = "is_eid"; @@ -140,16 +139,18 @@ public SignatureRequestSendWithTemplateRequest templateIds(List template } public SignatureRequestSendWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } this.templateIds.add(templateIdsItem); return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -171,16 +172,18 @@ public SignatureRequestSendWithTemplateRequest signers(List(); + } this.signers.add(signersItem); return this; } - /** + /** * Add Signers to your Templated-based Signature Request. * @return signers - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Add Signers to your Templated-based Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -201,12 +204,11 @@ public SignatureRequestSendWithTemplateRequest allowDecline(Boolean allowDecline return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -235,12 +237,11 @@ public SignatureRequestSendWithTemplateRequest addCcsItem(SubCC ccsItem) { return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -261,12 +262,11 @@ public SignatureRequestSendWithTemplateRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -295,12 +295,11 @@ public SignatureRequestSendWithTemplateRequest addCustomFieldsItem(SubCustomFiel return this; } - /** + /** * An array defining values and options for custom fields. Required when a custom field exists in the Template. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array defining values and options for custom fields. Required when a custom field exists in the Template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -329,12 +328,11 @@ public SignatureRequestSendWithTemplateRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -363,12 +361,11 @@ public SignatureRequestSendWithTemplateRequest addFileUrlsItem(String fileUrlsIt return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -384,19 +381,19 @@ public void setFileUrls(List fileUrls) { } + @Deprecated public SignatureRequestSendWithTemplateRequest isQualifiedSignature(Boolean isQualifiedSignature) { this.isQualifiedSignature = isQualifiedSignature; return this; } - /** + /** * Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br> **NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. * @return isQualifiedSignature * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -405,6 +402,7 @@ public Boolean getIsQualifiedSignature() { } + @Deprecated @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIsQualifiedSignature(Boolean isQualifiedSignature) { @@ -417,12 +415,11 @@ public SignatureRequestSendWithTemplateRequest isEid(Boolean isEid) { return this; } - /** + /** * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. * @return isEid - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_EID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -443,12 +440,11 @@ public SignatureRequestSendWithTemplateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -477,12 +473,11 @@ public SignatureRequestSendWithTemplateRequest putMetadataItem(String key, Objec return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -503,12 +498,11 @@ public SignatureRequestSendWithTemplateRequest signingOptions(SubSigningOptions return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -529,12 +523,11 @@ public SignatureRequestSendWithTemplateRequest signingRedirectUrl(String signing return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -555,12 +548,11 @@ public SignatureRequestSendWithTemplateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -581,12 +573,11 @@ public SignatureRequestSendWithTemplateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -607,12 +598,11 @@ public SignatureRequestSendWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java index eeaa3b36f..00e0068ea 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,13 +33,13 @@ * SignatureRequestUpdateRequest */ @JsonPropertyOrder({ - SignatureRequestUpdateRequest.JSON_PROPERTY_SIGNATURE_ID, - SignatureRequestUpdateRequest.JSON_PROPERTY_EMAIL_ADDRESS, - SignatureRequestUpdateRequest.JSON_PROPERTY_NAME, - SignatureRequestUpdateRequest.JSON_PROPERTY_EXPIRES_AT + SignatureRequestUpdateRequest.JSON_PROPERTY_SIGNATURE_ID, + SignatureRequestUpdateRequest.JSON_PROPERTY_EMAIL_ADDRESS, + SignatureRequestUpdateRequest.JSON_PROPERTY_NAME, + SignatureRequestUpdateRequest.JSON_PROPERTY_EXPIRES_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestUpdateRequest { public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; private String signatureId; @@ -78,12 +76,11 @@ public SignatureRequestUpdateRequest signatureId(String signatureId) { return this; } - /** + /** * The signature ID for the recipient. * @return signatureId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The signature ID for the recipient.") @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -104,12 +101,11 @@ public SignatureRequestUpdateRequest emailAddress(String emailAddress) { return this; } - /** + /** * The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided. * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,12 +126,11 @@ public SignatureRequestUpdateRequest name(String name) { return this; } - /** + /** * The new name for the recipient. **NOTE:** Optional if `email_address` is provided. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The new name for the recipient. **NOTE:** Optional if `email_address` is provided.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +151,11 @@ public SignatureRequestUpdateRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubAttachment.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubAttachment.java index bb7ccbd8f..f8ed3c50b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubAttachment.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubAttachment.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,13 +33,13 @@ * SubAttachment */ @JsonPropertyOrder({ - SubAttachment.JSON_PROPERTY_NAME, - SubAttachment.JSON_PROPERTY_SIGNER_INDEX, - SubAttachment.JSON_PROPERTY_INSTRUCTIONS, - SubAttachment.JSON_PROPERTY_REQUIRED + SubAttachment.JSON_PROPERTY_NAME, + SubAttachment.JSON_PROPERTY_SIGNER_INDEX, + SubAttachment.JSON_PROPERTY_INSTRUCTIONS, + SubAttachment.JSON_PROPERTY_REQUIRED }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubAttachment { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -78,12 +76,11 @@ public SubAttachment name(String name) { return this; } - /** + /** * The name of attachment. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of attachment.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -104,12 +101,11 @@ public SubAttachment signerIndex(Integer signerIndex) { return this; } - /** + /** * The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. * @return signerIndex - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment.") @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -130,12 +126,11 @@ public SubAttachment instructions(String instructions) { return this; } - /** + /** * The instructions for uploading the attachment. * @return instructions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The instructions for uploading the attachment.") @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +151,11 @@ public SubAttachment required(Boolean required) { return this; } - /** + /** * Determines if the attachment must be uploaded. * @return required - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Determines if the attachment must be uploaded.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java index 74b5efae0..a5eefbaf2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubBulkSignerListCustomField; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * SubBulkSignerList */ @JsonPropertyOrder({ - SubBulkSignerList.JSON_PROPERTY_CUSTOM_FIELDS, - SubBulkSignerList.JSON_PROPERTY_SIGNERS + SubBulkSignerList.JSON_PROPERTY_CUSTOM_FIELDS, + SubBulkSignerList.JSON_PROPERTY_SIGNERS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubBulkSignerList { public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; private List customFields = null; @@ -82,12 +80,11 @@ public SubBulkSignerList addCustomFieldsItem(SubBulkSignerListCustomField custom return this; } - /** + /** * An array of custom field values. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of custom field values.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,12 +113,11 @@ public SubBulkSignerList addSignersItem(SubSignatureRequestTemplateSigner signer return this; } - /** + /** * Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value. * @return signers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java index 2440f62c0..1ec209361 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,11 +33,11 @@ * SubBulkSignerListCustomField */ @JsonPropertyOrder({ - SubBulkSignerListCustomField.JSON_PROPERTY_NAME, - SubBulkSignerListCustomField.JSON_PROPERTY_VALUE + SubBulkSignerListCustomField.JSON_PROPERTY_NAME, + SubBulkSignerListCustomField.JSON_PROPERTY_VALUE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubBulkSignerListCustomField { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -70,12 +68,11 @@ public SubBulkSignerListCustomField name(String name) { return this; } - /** + /** * The name of the custom field. Must be the field's `name` or `api_id`. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the custom field. Must be the field's `name` or `api_id`.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public SubBulkSignerListCustomField value(String value) { return this; } - /** + /** * The value of the custom field. * @return value - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The value of the custom field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCC.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCC.java index f354e2d82..a78f7c251 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCC.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCC.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,11 +33,11 @@ * SubCC */ @JsonPropertyOrder({ - SubCC.JSON_PROPERTY_ROLE, - SubCC.JSON_PROPERTY_EMAIL_ADDRESS + SubCC.JSON_PROPERTY_ROLE, + SubCC.JSON_PROPERTY_EMAIL_ADDRESS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubCC { public static final String JSON_PROPERTY_ROLE = "role"; private String role; @@ -70,12 +68,11 @@ public SubCC role(String role) { return this; } - /** + /** * Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. * @return role - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public SubCC emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the CC recipient. * @return emailAddress - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the CC recipient.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCustomField.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCustomField.java index 41a8ddb9c..322ceda3d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCustomField.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubCustomField.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,27 +21,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. */ -@ApiModel(description = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonPropertyOrder({ - SubCustomField.JSON_PROPERTY_NAME, - SubCustomField.JSON_PROPERTY_EDITOR, - SubCustomField.JSON_PROPERTY_REQUIRED, - SubCustomField.JSON_PROPERTY_VALUE + SubCustomField.JSON_PROPERTY_NAME, + SubCustomField.JSON_PROPERTY_EDITOR, + SubCustomField.JSON_PROPERTY_REQUIRED, + SubCustomField.JSON_PROPERTY_VALUE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubCustomField { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -79,12 +76,11 @@ public SubCustomField name(String name) { return this; } - /** + /** * The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -105,12 +101,11 @@ public SubCustomField editor(String editor) { return this; } - /** + /** * Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. * @return editor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable.") @JsonProperty(JSON_PROPERTY_EDITOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public SubCustomField required(Boolean required) { return this; } - /** + /** * Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. * @return required - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public SubCustomField value(String value) { return this; } - /** + /** * The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing. * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorOptions.java index f6783dd7f..f31089041 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubEditorOptions.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,25 +21,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This allows the requester to specify editor options when a preparing a document */ -@ApiModel(description = "This allows the requester to specify editor options when a preparing a document") @JsonPropertyOrder({ - SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_SIGNERS, - SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS + SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_SIGNERS, + SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubEditorOptions { public static final String JSON_PROPERTY_ALLOW_EDIT_SIGNERS = "allow_edit_signers"; private Boolean allowEditSigners = false; @@ -71,12 +68,11 @@ public SubEditorOptions allowEditSigners(Boolean allowEditSigners) { return this; } - /** + /** * Allows requesters to edit the list of signers * @return allowEditSigners - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows requesters to edit the list of signers") @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public SubEditorOptions allowEditDocuments(Boolean allowEditDocuments) { return this; } - /** + /** * Allows requesters to edit documents, including delete and add * @return allowEditDocuments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows requesters to edit documents, including delete and add") @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFieldOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFieldOptions.java index 79c09b2db..0d41133cb 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFieldOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFieldOptions.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,24 +21,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This allows the requester to specify field options for a signature request. */ -@ApiModel(description = "This allows the requester to specify field options for a signature request.") @JsonPropertyOrder({ - SubFieldOptions.JSON_PROPERTY_DATE_FORMAT + SubFieldOptions.JSON_PROPERTY_DATE_FORMAT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFieldOptions { /** * Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. @@ -110,12 +107,11 @@ public SubFieldOptions dateFormat(DateFormatEnum dateFormat) { return this; } - /** + /** * Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. * @return dateFormat - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher.") @JsonProperty(JSON_PROPERTY_DATE_FORMAT) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java index 9a143ff98..a061d9cc8 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,12 +33,12 @@ * SubFormFieldGroup */ @JsonPropertyOrder({ - SubFormFieldGroup.JSON_PROPERTY_GROUP_ID, - SubFormFieldGroup.JSON_PROPERTY_GROUP_LABEL, - SubFormFieldGroup.JSON_PROPERTY_REQUIREMENT + SubFormFieldGroup.JSON_PROPERTY_GROUP_ID, + SubFormFieldGroup.JSON_PROPERTY_GROUP_LABEL, + SubFormFieldGroup.JSON_PROPERTY_REQUIREMENT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldGroup { public static final String JSON_PROPERTY_GROUP_ID = "group_id"; private String groupId; @@ -74,12 +72,11 @@ public SubFormFieldGroup groupId(String groupId) { return this; } - /** + /** * ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. * @return groupId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_GROUP_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,12 +97,11 @@ public SubFormFieldGroup groupLabel(String groupLabel) { return this; } - /** + /** * Name of the group * @return groupLabel - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the group") @JsonProperty(JSON_PROPERTY_GROUP_LABEL) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -126,12 +122,11 @@ public SubFormFieldGroup requirement(String requirement) { return this; } - /** + /** * Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. * @return requirement - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.") @JsonProperty(JSON_PROPERTY_REQUIREMENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java index b70229f98..5b3be6a62 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldRuleAction; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,13 +37,13 @@ * SubFormFieldRule */ @JsonPropertyOrder({ - SubFormFieldRule.JSON_PROPERTY_ID, - SubFormFieldRule.JSON_PROPERTY_TRIGGER_OPERATOR, - SubFormFieldRule.JSON_PROPERTY_TRIGGERS, - SubFormFieldRule.JSON_PROPERTY_ACTIONS + SubFormFieldRule.JSON_PROPERTY_ID, + SubFormFieldRule.JSON_PROPERTY_TRIGGER_OPERATOR, + SubFormFieldRule.JSON_PROPERTY_TRIGGERS, + SubFormFieldRule.JSON_PROPERTY_ACTIONS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldRule { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -82,12 +80,11 @@ public SubFormFieldRule id(String id) { return this; } - /** + /** * Must be unique across all defined rules. * @return id - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must be unique across all defined rules.") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +105,11 @@ public SubFormFieldRule triggerOperator(String triggerOperator) { return this; } - /** + /** * Currently only `AND` is supported. Support for `OR` is being worked on. * @return triggerOperator - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Currently only `AND` is supported. Support for `OR` is being worked on.") @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -135,16 +131,18 @@ public SubFormFieldRule triggers(List triggers) { } public SubFormFieldRule addTriggersItem(SubFormFieldRuleTrigger triggersItem) { + if (this.triggers == null) { + this.triggers = new ArrayList<>(); + } this.triggers.add(triggersItem); return this; } - /** + /** * An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. * @return triggers - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed.") @JsonProperty(JSON_PROPERTY_TRIGGERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -166,16 +164,18 @@ public SubFormFieldRule actions(List actions) { } public SubFormFieldRule addActionsItem(SubFormFieldRuleAction actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } this.actions.add(actionsItem); return this; } - /** + /** * An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule. * @return actions - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule.") @JsonProperty(JSON_PROPERTY_ACTIONS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java index fd67b1200..23ba0712d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,13 +33,13 @@ * SubFormFieldRuleAction */ @JsonPropertyOrder({ - SubFormFieldRuleAction.JSON_PROPERTY_HIDDEN, - SubFormFieldRuleAction.JSON_PROPERTY_TYPE, - SubFormFieldRuleAction.JSON_PROPERTY_FIELD_ID, - SubFormFieldRuleAction.JSON_PROPERTY_GROUP_ID + SubFormFieldRuleAction.JSON_PROPERTY_HIDDEN, + SubFormFieldRuleAction.JSON_PROPERTY_TYPE, + SubFormFieldRuleAction.JSON_PROPERTY_FIELD_ID, + SubFormFieldRuleAction.JSON_PROPERTY_GROUP_ID }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldRuleAction { public static final String JSON_PROPERTY_HIDDEN = "hidden"; private Boolean hidden; @@ -113,12 +111,11 @@ public SubFormFieldRuleAction hidden(Boolean hidden) { return this; } - /** + /** * `true` to hide the target field when rule is satisfied, otherwise `false`. * @return hidden - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "`true` to hide the target field when rule is satisfied, otherwise `false`.") @JsonProperty(JSON_PROPERTY_HIDDEN) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -139,12 +136,11 @@ public SubFormFieldRuleAction type(TypeEnum type) { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -165,12 +161,11 @@ public SubFormFieldRuleAction fieldId(String fieldId) { return this; } - /** + /** * **field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer. * @return fieldId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "**field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer.") @JsonProperty(JSON_PROPERTY_FIELD_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +186,11 @@ public SubFormFieldRuleAction groupId(String groupId) { return this; } - /** + /** * **group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer. * @return groupId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "**group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer.") @JsonProperty(JSON_PROPERTY_GROUP_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java index ff5b37f95..048ffe28d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,14 +21,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -37,13 +35,13 @@ * SubFormFieldRuleTrigger */ @JsonPropertyOrder({ - SubFormFieldRuleTrigger.JSON_PROPERTY_ID, - SubFormFieldRuleTrigger.JSON_PROPERTY_OPERATOR, - SubFormFieldRuleTrigger.JSON_PROPERTY_VALUE, - SubFormFieldRuleTrigger.JSON_PROPERTY_VALUES + SubFormFieldRuleTrigger.JSON_PROPERTY_ID, + SubFormFieldRuleTrigger.JSON_PROPERTY_OPERATOR, + SubFormFieldRuleTrigger.JSON_PROPERTY_VALUE, + SubFormFieldRuleTrigger.JSON_PROPERTY_VALUES }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldRuleTrigger { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -121,12 +119,11 @@ public SubFormFieldRuleTrigger id(String id) { return this; } - /** + /** * Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. * @return id - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer.") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -147,12 +144,11 @@ public SubFormFieldRuleTrigger operator(OperatorEnum operator) { return this; } - /** + /** * Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value * @return operator - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value") @JsonProperty(JSON_PROPERTY_OPERATOR) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -173,12 +169,11 @@ public SubFormFieldRuleTrigger value(String value) { return this; } - /** + /** * **value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` * @return value - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "**value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1`") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -207,12 +202,11 @@ public SubFormFieldRuleTrigger addValuesItem(String valuesItem) { return this; } - /** + /** * **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none` * @return values - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "**values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`") @JsonProperty(JSON_PROPERTY_VALUES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java index 8b0e92a1c..052f989e5 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java @@ -14,19 +14,9 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,46 +24,37 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` */ -@ApiModel(description = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonPropertyOrder({ - SubFormFieldsPerDocumentBase.JSON_PROPERTY_DOCUMENT_INDEX, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_API_ID, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_HEIGHT, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_REQUIRED, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_SIGNER, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_WIDTH, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_X, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_Y, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_NAME, - SubFormFieldsPerDocumentBase.JSON_PROPERTY_PAGE + SubFormFieldsPerDocumentBase.JSON_PROPERTY_DOCUMENT_INDEX, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_API_ID, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_HEIGHT, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_REQUIRED, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_SIGNER, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_WIDTH, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_X, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_Y, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_NAME, + SubFormFieldsPerDocumentBase.JSON_PROPERTY_PAGE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "SubFormFieldsPerDocumentCheckbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "SubFormFieldsPerDocumentCheckboxMerge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "SubFormFieldsPerDocumentDateSigned"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "SubFormFieldsPerDocumentDropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "SubFormFieldsPerDocumentHyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "SubFormFieldsPerDocumentInitials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "SubFormFieldsPerDocumentRadio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "SubFormFieldsPerDocumentSignature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "SubFormFieldsPerDocumentText"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "SubFormFieldsPerDocumentTextMerge"), @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), @@ -143,12 +124,11 @@ public SubFormFieldsPerDocumentBase documentIndex(Integer documentIndex) { return this; } - /** + /** * Represents the integer index of the `file` or `file_url` document the field should be attached to. * @return documentIndex - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Represents the integer index of the `file` or `file_url` document the field should be attached to.") @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -169,12 +149,11 @@ public SubFormFieldsPerDocumentBase apiId(String apiId) { return this; } - /** + /** * An identifier for the field that is unique across all documents in the request. * @return apiId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An identifier for the field that is unique across all documents in the request.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -195,12 +174,11 @@ public SubFormFieldsPerDocumentBase height(Integer height) { return this; } - /** + /** * Size of the field in pixels. * @return height - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Size of the field in pixels.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -221,12 +199,11 @@ public SubFormFieldsPerDocumentBase required(Boolean required) { return this; } - /** + /** * Whether this field is required. * @return required - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -251,12 +228,11 @@ public SubFormFieldsPerDocumentBase signer(Integer signer) { return this; } - /** + /** * Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. * @return signer - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -281,12 +257,11 @@ public SubFormFieldsPerDocumentBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -307,12 +282,11 @@ public SubFormFieldsPerDocumentBase width(Integer width) { return this; } - /** + /** * Size of the field in pixels. * @return width - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Size of the field in pixels.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -333,12 +307,11 @@ public SubFormFieldsPerDocumentBase x(Integer x) { return this; } - /** + /** * Location coordinates of the field in pixels. * @return x - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Location coordinates of the field in pixels.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -359,12 +332,11 @@ public SubFormFieldsPerDocumentBase y(Integer y) { return this; } - /** + /** * Location coordinates of the field in pixels. * @return y - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Location coordinates of the field in pixels.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -385,12 +357,11 @@ public SubFormFieldsPerDocumentBase name(String name) { return this; } - /** + /** * Display name for the field. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Display name for the field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -411,12 +382,11 @@ public SubFormFieldsPerDocumentBase page(Integer page) { return this; } - /** + /** * Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. * @return page - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.") @JsonProperty(JSON_PROPERTY_PAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -732,31 +702,21 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("SubFormFieldsPerDocumentCheckbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("SubFormFieldsPerDocumentCheckboxMerge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("SubFormFieldsPerDocumentDateSigned", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("SubFormFieldsPerDocumentDropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("SubFormFieldsPerDocumentHyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("SubFormFieldsPerDocumentInitials", SubFormFieldsPerDocumentInitials.class); - mappings.put("SubFormFieldsPerDocumentRadio", SubFormFieldsPerDocumentRadio.class); - mappings.put("SubFormFieldsPerDocumentSignature", SubFormFieldsPerDocumentSignature.class); - mappings.put("SubFormFieldsPerDocumentText", SubFormFieldsPerDocumentText.class); - mappings.put("SubFormFieldsPerDocumentTextMerge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentBase", SubFormFieldsPerDocumentBase.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentBase.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); + mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); + mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); + mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); + mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); + mappings.put("initials", SubFormFieldsPerDocumentInitials.class); + mappings.put("radio", SubFormFieldsPerDocumentRadio.class); + mappings.put("signature", SubFormFieldsPerDocumentSignature.class); + mappings.put("text", SubFormFieldsPerDocumentText.class); + mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); + mappings.put("SubFormFieldsPerDocumentBase", SubFormFieldsPerDocumentBase.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentBase.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java index 95b36e96d..0a1ab01ed 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java @@ -14,20 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -35,39 +25,28 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ - SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_IS_CHECKED, - SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_GROUP + SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_IS_CHECKED, + SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), -}) public class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -102,12 +81,11 @@ public SubFormFieldsPerDocumentCheckbox type(String type) { return this; } - /** + /** * A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -128,12 +106,11 @@ public SubFormFieldsPerDocumentCheckbox isChecked(Boolean isChecked) { return this; } - /** + /** * `true` for checking the checkbox field by default, otherwise `false`. * @return isChecked - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "`true` for checking the checkbox field by default, otherwise `false`.") @JsonProperty(JSON_PROPERTY_IS_CHECKED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -154,12 +131,11 @@ public SubFormFieldsPerDocumentCheckbox group(String group) { return this; } - /** + /** * String referencing group defined in `form_field_groups` parameter. * @return group - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "String referencing group defined in `form_field_groups` parameter.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -310,21 +286,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentCheckbox", SubFormFieldsPerDocumentCheckbox.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentCheckbox.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentCheckbox", SubFormFieldsPerDocumentCheckbox.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentCheckbox.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java index dd54d5906..1c10aa63b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java @@ -14,20 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -35,37 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ - SubFormFieldsPerDocumentCheckboxMerge.JSON_PROPERTY_TYPE + SubFormFieldsPerDocumentCheckboxMerge.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), -}) public class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -94,12 +73,11 @@ public SubFormFieldsPerDocumentCheckboxMerge type(String type) { return this; } - /** + /** * A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -208,21 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentCheckboxMerge", SubFormFieldsPerDocumentCheckboxMerge.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentCheckboxMerge.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentCheckboxMerge", SubFormFieldsPerDocumentCheckboxMerge.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentCheckboxMerge.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java index abec112a7..f6b0fbbe4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java @@ -14,20 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -35,39 +25,28 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ - SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_FAMILY, - SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_SIZE + SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_FAMILY, + SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), -}) public class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -97,17 +76,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -165,12 +144,11 @@ public SubFormFieldsPerDocumentDateSigned type(String type) { return this; } - /** + /** * A date. Use the `SubFormFieldsPerDocumentDateSigned` class. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A date. Use the `SubFormFieldsPerDocumentDateSigned` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,12 +169,11 @@ public SubFormFieldsPerDocumentDateSigned fontFamily(FontFamilyEnum fontFamily) return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +194,11 @@ public SubFormFieldsPerDocumentDateSigned fontSize(Integer fontSize) { return this; } - /** + /** * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. * @return fontSize - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -373,21 +349,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentDateSigned", SubFormFieldsPerDocumentDateSigned.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentDateSigned.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentDateSigned", SubFormFieldsPerDocumentDateSigned.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentDateSigned.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java index 2e3f897cf..cd8dce017 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java @@ -14,20 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -35,43 +25,32 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ - SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_OPTIONS, - SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_CONTENT, - SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_FAMILY, - SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_SIZE + SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_OPTIONS, + SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_CONTENT, + SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_FAMILY, + SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), -}) public class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -107,17 +86,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -175,12 +154,11 @@ public SubFormFieldsPerDocumentDropdown type(String type) { return this; } - /** + /** * An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -202,16 +180,18 @@ public SubFormFieldsPerDocumentDropdown options(List options) { } public SubFormFieldsPerDocumentDropdown addOptionsItem(String optionsItem) { + if (this.options == null) { + this.options = new ArrayList<>(); + } this.options.add(optionsItem); return this; } - /** + /** * Array of string values representing dropdown values. * @return options - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Array of string values representing dropdown values.") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -232,12 +212,11 @@ public SubFormFieldsPerDocumentDropdown content(String content) { return this; } - /** + /** * Selected value in `options` array. Value must exist in array. * @return content - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Selected value in `options` array. Value must exist in array.") @JsonProperty(JSON_PROPERTY_CONTENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -258,12 +237,11 @@ public SubFormFieldsPerDocumentDropdown fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -284,12 +262,11 @@ public SubFormFieldsPerDocumentDropdown fontSize(Integer fontSize) { return this; } - /** + /** * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. * @return fontSize - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -482,21 +459,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentDropdown", SubFormFieldsPerDocumentDropdown.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentDropdown.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentDropdown", SubFormFieldsPerDocumentDropdown.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentDropdown.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java index cedbbd86e..f557d5af4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java @@ -14,13 +14,12 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; 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.JSON; import com.fasterxml.jackson.annotation.JsonCreator; @@ -51,17 +50,17 @@ public enum SubFormFieldsPerDocumentFontEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java index 705eb23bb..1bbea8716 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java @@ -14,20 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -35,41 +25,30 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ - SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_CONTENT, - SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_CONTENT_URL, - SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_FAMILY, - SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_SIZE + SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_CONTENT, + SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_CONTENT_URL, + SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_FAMILY, + SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), -}) public class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -105,17 +84,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -173,12 +152,11 @@ public SubFormFieldsPerDocumentHyperlink type(String type) { return this; } - /** + /** * A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -199,12 +177,11 @@ public SubFormFieldsPerDocumentHyperlink content(String content) { return this; } - /** + /** * Link Text. * @return content - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Link Text.") @JsonProperty(JSON_PROPERTY_CONTENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -225,12 +202,11 @@ public SubFormFieldsPerDocumentHyperlink contentUrl(String contentUrl) { return this; } - /** + /** * Link URL. * @return contentUrl - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Link URL.") @JsonProperty(JSON_PROPERTY_CONTENT_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -251,12 +227,11 @@ public SubFormFieldsPerDocumentHyperlink fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -277,12 +252,11 @@ public SubFormFieldsPerDocumentHyperlink fontSize(Integer fontSize) { return this; } - /** + /** * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. * @return fontSize - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -475,21 +449,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentHyperlink", SubFormFieldsPerDocumentHyperlink.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentHyperlink.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentHyperlink", SubFormFieldsPerDocumentHyperlink.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentHyperlink.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java index a08bac260..7075f8b48 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java @@ -14,20 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -35,37 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ - SubFormFieldsPerDocumentInitials.JSON_PROPERTY_TYPE + SubFormFieldsPerDocumentInitials.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), -}) public class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -94,12 +73,11 @@ public SubFormFieldsPerDocumentInitials type(String type) { return this; } - /** + /** * An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -208,21 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentInitials", SubFormFieldsPerDocumentInitials.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentInitials.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentInitials", SubFormFieldsPerDocumentInitials.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentInitials.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java index 0d52b3dce..4991e525d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java @@ -14,20 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -35,39 +25,28 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ - SubFormFieldsPerDocumentRadio.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentRadio.JSON_PROPERTY_GROUP, - SubFormFieldsPerDocumentRadio.JSON_PROPERTY_IS_CHECKED + SubFormFieldsPerDocumentRadio.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentRadio.JSON_PROPERTY_GROUP, + SubFormFieldsPerDocumentRadio.JSON_PROPERTY_IS_CHECKED }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), -}) public class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -102,12 +81,11 @@ public SubFormFieldsPerDocumentRadio type(String type) { return this; } - /** + /** * An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -128,12 +106,11 @@ public SubFormFieldsPerDocumentRadio group(String group) { return this; } - /** + /** * String referencing group defined in `form_field_groups` parameter. * @return group - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "String referencing group defined in `form_field_groups` parameter.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -154,12 +131,11 @@ public SubFormFieldsPerDocumentRadio isChecked(Boolean isChecked) { return this; } - /** + /** * `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. * @return isChecked - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "`true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`.") @JsonProperty(JSON_PROPERTY_IS_CHECKED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -310,21 +286,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentRadio", SubFormFieldsPerDocumentRadio.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentRadio.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentRadio", SubFormFieldsPerDocumentRadio.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentRadio.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java index 6b566fd9a..c6867bd4d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java @@ -14,20 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -35,37 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ - SubFormFieldsPerDocumentSignature.JSON_PROPERTY_TYPE + SubFormFieldsPerDocumentSignature.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), -}) public class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -94,12 +73,11 @@ public SubFormFieldsPerDocumentSignature type(String type) { return this; } - /** + /** * A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A signature input field. Use the `SubFormFieldsPerDocumentSignature` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -208,21 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentSignature", SubFormFieldsPerDocumentSignature.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentSignature.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentSignature", SubFormFieldsPerDocumentSignature.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentSignature.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java index 6cbcfd4d3..d2b5eedb3 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java @@ -14,20 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -35,47 +25,36 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ - SubFormFieldsPerDocumentText.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentText.JSON_PROPERTY_PLACEHOLDER, - SubFormFieldsPerDocumentText.JSON_PROPERTY_AUTO_FILL_TYPE, - SubFormFieldsPerDocumentText.JSON_PROPERTY_LINK_ID, - SubFormFieldsPerDocumentText.JSON_PROPERTY_MASKED, - SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_TYPE, - SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX, - SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL, - SubFormFieldsPerDocumentText.JSON_PROPERTY_CONTENT, - SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_FAMILY, - SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_SIZE + SubFormFieldsPerDocumentText.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentText.JSON_PROPERTY_PLACEHOLDER, + SubFormFieldsPerDocumentText.JSON_PROPERTY_AUTO_FILL_TYPE, + SubFormFieldsPerDocumentText.JSON_PROPERTY_LINK_ID, + SubFormFieldsPerDocumentText.JSON_PROPERTY_MASKED, + SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_TYPE, + SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX, + SubFormFieldsPerDocumentText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL, + SubFormFieldsPerDocumentText.JSON_PROPERTY_CONTENT, + SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_FAMILY, + SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), -}) public class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -180,17 +159,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -248,12 +227,11 @@ public SubFormFieldsPerDocumentText type(String type) { return this; } - /** + /** * A text input field. Use the `SubFormFieldsPerDocumentText` class. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A text input field. Use the `SubFormFieldsPerDocumentText` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -274,12 +252,11 @@ public SubFormFieldsPerDocumentText placeholder(String placeholder) { return this; } - /** + /** * Placeholder value for text field. * @return placeholder - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Placeholder value for text field.") @JsonProperty(JSON_PROPERTY_PLACEHOLDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -300,12 +277,11 @@ public SubFormFieldsPerDocumentText autoFillType(String autoFillType) { return this; } - /** + /** * Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. * @return autoFillType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values.") @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -326,12 +302,11 @@ public SubFormFieldsPerDocumentText linkId(String linkId) { return this; } - /** + /** * Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. * @return linkId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields.") @JsonProperty(JSON_PROPERTY_LINK_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -352,12 +327,11 @@ public SubFormFieldsPerDocumentText masked(Boolean masked) { return this; } - /** + /** * Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`. * @return masked - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`.") @JsonProperty(JSON_PROPERTY_MASKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -378,12 +352,11 @@ public SubFormFieldsPerDocumentText validationType(ValidationTypeEnum validation return this; } - /** + /** * Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value. * @return validationType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value.") @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -404,12 +377,11 @@ public SubFormFieldsPerDocumentText validationCustomRegex(String validationCusto return this; } - /** + /** * Get validationCustomRegex * @return validationCustomRegex - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -430,12 +402,11 @@ public SubFormFieldsPerDocumentText validationCustomRegexFormatLabel(String vali return this; } - /** + /** * Get validationCustomRegexFormatLabel * @return validationCustomRegexFormatLabel - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -456,12 +427,11 @@ public SubFormFieldsPerDocumentText content(String content) { return this; } - /** + /** * Content of a `me_now` text field * @return content - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Content of a `me_now` text field") @JsonProperty(JSON_PROPERTY_CONTENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -482,12 +452,11 @@ public SubFormFieldsPerDocumentText fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -508,12 +477,11 @@ public SubFormFieldsPerDocumentText fontSize(Integer fontSize) { return this; } - /** + /** * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. * @return fontSize - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -832,21 +800,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentText", SubFormFieldsPerDocumentText.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentText.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentText", SubFormFieldsPerDocumentText.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentText.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java index 548f33c69..a023b646c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java @@ -14,20 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckbox; -import com.dropbox.sign.model.SubFormFieldsPerDocumentCheckboxMerge; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDateSigned; -import com.dropbox.sign.model.SubFormFieldsPerDocumentDropdown; -import com.dropbox.sign.model.SubFormFieldsPerDocumentHyperlink; -import com.dropbox.sign.model.SubFormFieldsPerDocumentInitials; -import com.dropbox.sign.model.SubFormFieldsPerDocumentRadio; -import com.dropbox.sign.model.SubFormFieldsPerDocumentSignature; -import com.dropbox.sign.model.SubFormFieldsPerDocumentText; -import com.dropbox.sign.model.SubFormFieldsPerDocumentTextMerge; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -35,39 +25,28 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ - SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_TYPE, - SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_FAMILY, - SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_SIZE + SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_TYPE, + SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_FAMILY, + SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckboxMerge.class, name = "checkbox-merge"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentInitials.class, name = "initials"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentRadio.class, name = "radio"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentSignature.class, name = "signature"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentText.class, name = "text"), - @JsonSubTypes.Type(value = SubFormFieldsPerDocumentTextMerge.class, name = "text-merge"), -}) public class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -97,17 +76,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -165,12 +144,11 @@ public SubFormFieldsPerDocumentTextMerge type(String type) { return this; } - /** + /** * A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,12 +169,11 @@ public SubFormFieldsPerDocumentTextMerge fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +194,11 @@ public SubFormFieldsPerDocumentTextMerge fontSize(Integer fontSize) { return this; } - /** + /** * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. * @return fontSize - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -373,21 +349,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", SubFormFieldsPerDocumentCheckbox.class); - mappings.put("checkbox-merge", SubFormFieldsPerDocumentCheckboxMerge.class); - mappings.put("date_signed", SubFormFieldsPerDocumentDateSigned.class); - mappings.put("dropdown", SubFormFieldsPerDocumentDropdown.class); - mappings.put("hyperlink", SubFormFieldsPerDocumentHyperlink.class); - mappings.put("initials", SubFormFieldsPerDocumentInitials.class); - mappings.put("radio", SubFormFieldsPerDocumentRadio.class); - mappings.put("signature", SubFormFieldsPerDocumentSignature.class); - mappings.put("text", SubFormFieldsPerDocumentText.class); - mappings.put("text-merge", SubFormFieldsPerDocumentTextMerge.class); - mappings.put("SubFormFieldsPerDocumentTextMerge", SubFormFieldsPerDocumentTextMerge.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentTextMerge.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentTextMerge", SubFormFieldsPerDocumentTextMerge.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentTextMerge.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java index 1fc0ee40a..2b9d9c00b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java @@ -14,13 +14,12 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; 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.JSON; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubMergeField.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubMergeField.java index df1dcca7f..2ff60aca2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubMergeField.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubMergeField.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,11 +33,11 @@ * SubMergeField */ @JsonPropertyOrder({ - SubMergeField.JSON_PROPERTY_NAME, - SubMergeField.JSON_PROPERTY_TYPE + SubMergeField.JSON_PROPERTY_NAME, + SubMergeField.JSON_PROPERTY_TYPE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubMergeField { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -105,12 +103,11 @@ public SubMergeField name(String name) { return this; } - /** + /** * The name of the merge field. Must be unique. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the merge field. Must be unique.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -131,12 +128,11 @@ public SubMergeField type(TypeEnum type) { return this; } - /** + /** * The type of merge field. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of merge field.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOAuth.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOAuth.java index d5e37c4e1..b598b7195 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOAuth.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOAuth.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,27 +21,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * OAuth related parameters. */ -@ApiModel(description = "OAuth related parameters.") @JsonPropertyOrder({ - SubOAuth.JSON_PROPERTY_CALLBACK_URL, - SubOAuth.JSON_PROPERTY_SCOPES + SubOAuth.JSON_PROPERTY_CALLBACK_URL, + SubOAuth.JSON_PROPERTY_SCOPES }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubOAuth { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -120,12 +117,11 @@ public SubOAuth callbackUrl(String callbackUrl) { return this; } - /** + /** * The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) * @return callbackUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided)") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,12 +150,11 @@ public SubOAuth addScopesItem(ScopesEnum scopesItem) { return this; } - /** + /** * A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). * @return scopes - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided).") @JsonProperty(JSON_PROPERTY_SCOPES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOptions.java index b5c9e9b15..d0908c7c4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubOptions.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,24 +21,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Additional options supported by API App. */ -@ApiModel(description = "Additional options supported by API App.") @JsonPropertyOrder({ - SubOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE + SubOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubOptions { public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; private Boolean canInsertEverywhere = false; @@ -67,12 +64,11 @@ public SubOptions canInsertEverywhere(Boolean canInsertEverywhere) { return this; } - /** + /** * Determines if signers can use \"Insert Everywhere\" when signing a document. * @return canInsertEverywhere - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Determines if signers can use \"Insert Everywhere\" when signing a document.") @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java index 12194c90d..5d7a97889 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubSignatureRequestSigner; @@ -23,14 +22,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,12 +36,12 @@ * SubSignatureRequestGroupedSigners */ @JsonPropertyOrder({ - SubSignatureRequestGroupedSigners.JSON_PROPERTY_GROUP, - SubSignatureRequestGroupedSigners.JSON_PROPERTY_SIGNERS, - SubSignatureRequestGroupedSigners.JSON_PROPERTY_ORDER + SubSignatureRequestGroupedSigners.JSON_PROPERTY_GROUP, + SubSignatureRequestGroupedSigners.JSON_PROPERTY_SIGNERS, + SubSignatureRequestGroupedSigners.JSON_PROPERTY_ORDER }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSignatureRequestGroupedSigners { public static final String JSON_PROPERTY_GROUP = "group"; private String group; @@ -77,12 +75,11 @@ public SubSignatureRequestGroupedSigners group(String group) { return this; } - /** + /** * The name of the group. * @return group - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the group.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -104,16 +101,18 @@ public SubSignatureRequestGroupedSigners signers(List } public SubSignatureRequestGroupedSigners addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } this.signers.add(signersItem); return this; } - /** + /** * Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. * @return signers - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -134,12 +133,11 @@ public SubSignatureRequestGroupedSigners order(Integer order) { return this; } - /** + /** * The order the group is required to sign in. Use this instead of Signer-level `order`. * @return order - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The order the group is required to sign in. Use this instead of Signer-level `order`.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java index 660f31204..9fba0ef8a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,15 +33,15 @@ * SubSignatureRequestSigner */ @JsonPropertyOrder({ - SubSignatureRequestSigner.JSON_PROPERTY_NAME, - SubSignatureRequestSigner.JSON_PROPERTY_EMAIL_ADDRESS, - SubSignatureRequestSigner.JSON_PROPERTY_ORDER, - SubSignatureRequestSigner.JSON_PROPERTY_PIN, - SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, - SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE + SubSignatureRequestSigner.JSON_PROPERTY_NAME, + SubSignatureRequestSigner.JSON_PROPERTY_EMAIL_ADDRESS, + SubSignatureRequestSigner.JSON_PROPERTY_ORDER, + SubSignatureRequestSigner.JSON_PROPERTY_PIN, + SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, + SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSignatureRequestSigner { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -121,12 +119,11 @@ public SubSignatureRequestSigner name(String name) { return this; } - /** + /** * The name of the signer. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -147,12 +144,11 @@ public SubSignatureRequestSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer. * @return emailAddress - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -173,12 +169,11 @@ public SubSignatureRequestSigner order(Integer order) { return this; } - /** + /** * The order the signer is required to sign in. * @return order - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The order the signer is required to sign in.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +194,11 @@ public SubSignatureRequestSigner pin(String pin) { return this; } - /** + /** * The 4- to 12-character access code that will secure this signer's signature page. * @return pin - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The 4- to 12-character access code that will secure this signer's signature page.") @JsonProperty(JSON_PROPERTY_PIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +219,11 @@ public SubSignatureRequestSigner smsPhoneNumber(String smsPhoneNumber) { return this; } - /** + /** * An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. * @return smsPhoneNumber - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,12 +244,11 @@ public SubSignatureRequestSigner smsPhoneNumberType(SmsPhoneNumberTypeEnum smsPh return this; } - /** + /** * Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). * @return smsPhoneNumberType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java index 86a6bcb21..71fbf6d9e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,15 +33,15 @@ * SubSignatureRequestTemplateSigner */ @JsonPropertyOrder({ - SubSignatureRequestTemplateSigner.JSON_PROPERTY_ROLE, - SubSignatureRequestTemplateSigner.JSON_PROPERTY_NAME, - SubSignatureRequestTemplateSigner.JSON_PROPERTY_EMAIL_ADDRESS, - SubSignatureRequestTemplateSigner.JSON_PROPERTY_PIN, - SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, - SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE + SubSignatureRequestTemplateSigner.JSON_PROPERTY_ROLE, + SubSignatureRequestTemplateSigner.JSON_PROPERTY_NAME, + SubSignatureRequestTemplateSigner.JSON_PROPERTY_EMAIL_ADDRESS, + SubSignatureRequestTemplateSigner.JSON_PROPERTY_PIN, + SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, + SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSignatureRequestTemplateSigner { public static final String JSON_PROPERTY_ROLE = "role"; private String role; @@ -121,12 +119,11 @@ public SubSignatureRequestTemplateSigner role(String role) { return this; } - /** + /** * Must match an existing role in chosen Template(s). It's case-sensitive. * @return role - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must match an existing role in chosen Template(s). It's case-sensitive.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -147,12 +144,11 @@ public SubSignatureRequestTemplateSigner name(String name) { return this; } - /** + /** * The name of the signer. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -173,12 +169,11 @@ public SubSignatureRequestTemplateSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer. * @return emailAddress - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -199,12 +194,11 @@ public SubSignatureRequestTemplateSigner pin(String pin) { return this; } - /** + /** * The 4- to 12-character access code that will secure this signer's signature page. * @return pin - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The 4- to 12-character access code that will secure this signer's signature page.") @JsonProperty(JSON_PROPERTY_PIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +219,11 @@ public SubSignatureRequestTemplateSigner smsPhoneNumber(String smsPhoneNumber) { return this; } - /** + /** * An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. * @return smsPhoneNumber - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,12 +244,11 @@ public SubSignatureRequestTemplateSigner smsPhoneNumberType(SmsPhoneNumberTypeEn return this; } - /** + /** * Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). * @return smsPhoneNumberType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSigningOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSigningOptions.java index d33c7101b..6429cf67b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSigningOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubSigningOptions.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,28 +21,26 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings. */ -@ApiModel(description = "This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings.") @JsonPropertyOrder({ - SubSigningOptions.JSON_PROPERTY_DEFAULT_TYPE, - SubSigningOptions.JSON_PROPERTY_DRAW, - SubSigningOptions.JSON_PROPERTY_PHONE, - SubSigningOptions.JSON_PROPERTY_TYPE, - SubSigningOptions.JSON_PROPERTY_UPLOAD + SubSigningOptions.JSON_PROPERTY_DEFAULT_TYPE, + SubSigningOptions.JSON_PROPERTY_DRAW, + SubSigningOptions.JSON_PROPERTY_PHONE, + SubSigningOptions.JSON_PROPERTY_TYPE, + SubSigningOptions.JSON_PROPERTY_UPLOAD }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSigningOptions { /** * The default type shown (limited to the listed types) @@ -122,12 +119,11 @@ public SubSigningOptions defaultType(DefaultTypeEnum defaultType) { return this; } - /** + /** * The default type shown (limited to the listed types) * @return defaultType - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The default type shown (limited to the listed types)") @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -148,12 +144,11 @@ public SubSigningOptions draw(Boolean draw) { return this; } - /** + /** * Allows drawing the signature * @return draw - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows drawing the signature") @JsonProperty(JSON_PROPERTY_DRAW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -174,12 +169,11 @@ public SubSigningOptions phone(Boolean phone) { return this; } - /** + /** * Allows using a smartphone to email the signature * @return phone - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows using a smartphone to email the signature") @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -200,12 +194,11 @@ public SubSigningOptions type(Boolean type) { return this; } - /** + /** * Allows typing the signature * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows typing the signature") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,12 +219,11 @@ public SubSigningOptions upload(Boolean upload) { return this; } - /** + /** * Allows uploading the signature * @return upload - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows uploading the signature") @JsonProperty(JSON_PROPERTY_UPLOAD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTeamResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTeamResponse.java index cb25a43e5..1b14dd342 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTeamResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTeamResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,11 +33,11 @@ * SubTeamResponse */ @JsonPropertyOrder({ - SubTeamResponse.JSON_PROPERTY_TEAM_ID, - SubTeamResponse.JSON_PROPERTY_NAME + SubTeamResponse.JSON_PROPERTY_TEAM_ID, + SubTeamResponse.JSON_PROPERTY_NAME }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubTeamResponse { public static final String JSON_PROPERTY_TEAM_ID = "team_id"; private String teamId; @@ -70,12 +68,11 @@ public SubTeamResponse teamId(String teamId) { return this; } - /** + /** * The id of a team * @return teamId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of a team") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public SubTeamResponse name(String name) { return this; } - /** + /** * The name of a team * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of a team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTemplateRole.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTemplateRole.java index 49b4bc9f4..0e38d6f6d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTemplateRole.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubTemplateRole.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,11 +33,11 @@ * SubTemplateRole */ @JsonPropertyOrder({ - SubTemplateRole.JSON_PROPERTY_NAME, - SubTemplateRole.JSON_PROPERTY_ORDER + SubTemplateRole.JSON_PROPERTY_NAME, + SubTemplateRole.JSON_PROPERTY_ORDER }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubTemplateRole { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -70,12 +68,11 @@ public SubTemplateRole name(String name) { return this; } - /** + /** * The role name of the signer that will be displayed when the template is used to create a signature request. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The role name of the signer that will be displayed when the template is used to create a signature request.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public SubTemplateRole order(Integer order) { return this; } - /** + /** * The order in which this signer role is required to sign. * @return order - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The order in which this signer role is required to sign.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java index 8c427157f..bea1438b4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,12 +33,12 @@ * SubUnclaimedDraftSigner */ @JsonPropertyOrder({ - SubUnclaimedDraftSigner.JSON_PROPERTY_EMAIL_ADDRESS, - SubUnclaimedDraftSigner.JSON_PROPERTY_NAME, - SubUnclaimedDraftSigner.JSON_PROPERTY_ORDER + SubUnclaimedDraftSigner.JSON_PROPERTY_EMAIL_ADDRESS, + SubUnclaimedDraftSigner.JSON_PROPERTY_NAME, + SubUnclaimedDraftSigner.JSON_PROPERTY_ORDER }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubUnclaimedDraftSigner { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -74,12 +72,11 @@ public SubUnclaimedDraftSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer. * @return emailAddress - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,12 +97,11 @@ public SubUnclaimedDraftSigner name(String name) { return this; } - /** + /** * The name of the signer. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -126,12 +122,11 @@ public SubUnclaimedDraftSigner order(Integer order) { return this; } - /** + /** * The order the signer is required to sign in. * @return order - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The order the signer is required to sign in.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java index 14b3fc607..67b1ca0dc 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,12 +33,12 @@ * SubUnclaimedDraftTemplateSigner */ @JsonPropertyOrder({ - SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_ROLE, - SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_NAME, - SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_EMAIL_ADDRESS + SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_ROLE, + SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_NAME, + SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_EMAIL_ADDRESS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubUnclaimedDraftTemplateSigner { public static final String JSON_PROPERTY_ROLE = "role"; private String role; @@ -74,12 +72,11 @@ public SubUnclaimedDraftTemplateSigner role(String role) { return this; } - /** + /** * Must match an existing role in chosen Template(s). * @return role - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must match an existing role in chosen Template(s).") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,12 +97,11 @@ public SubUnclaimedDraftTemplateSigner name(String name) { return this; } - /** + /** * The name of the signer filling the role of `role`. * @return name - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer filling the role of `role`.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -126,12 +122,11 @@ public SubUnclaimedDraftTemplateSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer filling the role of `role`. * @return emailAddress - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer filling the role of `role`.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java index 8e731300f..3679ee8b3 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,38 +21,36 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. */ -@ApiModel(description = "An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more.") @JsonPropertyOrder({ - SubWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, - SubWhiteLabelingOptions.JSON_PROPERTY_LINK_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_PAGE_BACKGROUND_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER, - SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER, - SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER, - SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR, - SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER, - SubWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR1, - SubWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2, - SubWhiteLabelingOptions.JSON_PROPERTY_RESET_TO_DEFAULT + SubWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, + SubWhiteLabelingOptions.JSON_PROPERTY_LINK_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_PAGE_BACKGROUND_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER, + SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER, + SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER, + SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR, + SubWhiteLabelingOptions.JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER, + SubWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR1, + SubWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2, + SubWhiteLabelingOptions.JSON_PROPERTY_RESET_TO_DEFAULT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubWhiteLabelingOptions { public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; private String headerBackgroundColor = "#1A1A1A"; @@ -158,12 +155,11 @@ public SubWhiteLabelingOptions headerBackgroundColor(String headerBackgroundColo return this; } - /** + /** * Get headerBackgroundColor * @return headerBackgroundColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,12 +180,11 @@ public SubWhiteLabelingOptions legalVersion(LegalVersionEnum legalVersion) { return this; } - /** + /** * Get legalVersion * @return legalVersion - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,12 +205,11 @@ public SubWhiteLabelingOptions linkColor(String linkColor) { return this; } - /** + /** * Get linkColor * @return linkColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LINK_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -236,12 +230,11 @@ public SubWhiteLabelingOptions pageBackgroundColor(String pageBackgroundColor) { return this; } - /** + /** * Get pageBackgroundColor * @return pageBackgroundColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -262,12 +255,11 @@ public SubWhiteLabelingOptions primaryButtonColor(String primaryButtonColor) { return this; } - /** + /** * Get primaryButtonColor * @return primaryButtonColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -288,12 +280,11 @@ public SubWhiteLabelingOptions primaryButtonColorHover(String primaryButtonColor return this; } - /** + /** * Get primaryButtonColorHover * @return primaryButtonColorHover - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -314,12 +305,11 @@ public SubWhiteLabelingOptions primaryButtonTextColor(String primaryButtonTextCo return this; } - /** + /** * Get primaryButtonTextColor * @return primaryButtonTextColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -340,12 +330,11 @@ public SubWhiteLabelingOptions primaryButtonTextColorHover(String primaryButtonT return this; } - /** + /** * Get primaryButtonTextColorHover * @return primaryButtonTextColorHover - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -366,12 +355,11 @@ public SubWhiteLabelingOptions secondaryButtonColor(String secondaryButtonColor) return this; } - /** + /** * Get secondaryButtonColor * @return secondaryButtonColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -392,12 +380,11 @@ public SubWhiteLabelingOptions secondaryButtonColorHover(String secondaryButtonC return this; } - /** + /** * Get secondaryButtonColorHover * @return secondaryButtonColorHover - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -418,12 +405,11 @@ public SubWhiteLabelingOptions secondaryButtonTextColor(String secondaryButtonTe return this; } - /** + /** * Get secondaryButtonTextColor * @return secondaryButtonTextColor - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,12 +430,11 @@ public SubWhiteLabelingOptions secondaryButtonTextColorHover(String secondaryBut return this; } - /** + /** * Get secondaryButtonTextColorHover * @return secondaryButtonTextColorHover - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -470,12 +455,11 @@ public SubWhiteLabelingOptions textColor1(String textColor1) { return this; } - /** + /** * Get textColor1 * @return textColor1 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -496,12 +480,11 @@ public SubWhiteLabelingOptions textColor2(String textColor2) { return this; } - /** + /** * Get textColor2 * @return textColor2 - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -522,12 +505,11 @@ public SubWhiteLabelingOptions resetToDefault(Boolean resetToDefault) { return this; } - /** + /** * Resets white labeling options to defaults. Only useful when updating an API App. * @return resetToDefault - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Resets white labeling options to defaults. Only useful when updating an API App.") @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java index cc20f9387..8c2b5bdb6 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,12 +33,12 @@ * TeamAddMemberRequest */ @JsonPropertyOrder({ - TeamAddMemberRequest.JSON_PROPERTY_ACCOUNT_ID, - TeamAddMemberRequest.JSON_PROPERTY_EMAIL_ADDRESS, - TeamAddMemberRequest.JSON_PROPERTY_ROLE + TeamAddMemberRequest.JSON_PROPERTY_ACCOUNT_ID, + TeamAddMemberRequest.JSON_PROPERTY_EMAIL_ADDRESS, + TeamAddMemberRequest.JSON_PROPERTY_ROLE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamAddMemberRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -113,12 +111,11 @@ public TeamAddMemberRequest accountId(String accountId) { return this; } - /** + /** * `account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team. * @return accountId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "`account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +136,11 @@ public TeamAddMemberRequest emailAddress(String emailAddress) { return this; } - /** + /** * `account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team. * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "`account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +161,11 @@ public TeamAddMemberRequest role(RoleEnum role) { return this; } - /** + /** * A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided. * @return role - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java index 52933d369..5c8d5841b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,10 +33,10 @@ * TeamCreateRequest */ @JsonPropertyOrder({ - TeamCreateRequest.JSON_PROPERTY_NAME + TeamCreateRequest.JSON_PROPERTY_NAME }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamCreateRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name = "Untitled Team"; @@ -66,12 +64,11 @@ public TeamCreateRequest name(String name) { return this; } - /** + /** * The name of your Team. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of your Team.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java index 0571c5f58..25ce08711 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TeamInfoResponse; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * TeamGetInfoResponse */ @JsonPropertyOrder({ - TeamGetInfoResponse.JSON_PROPERTY_TEAM, - TeamGetInfoResponse.JSON_PROPERTY_WARNINGS + TeamGetInfoResponse.JSON_PROPERTY_TEAM, + TeamGetInfoResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamGetInfoResponse { public static final String JSON_PROPERTY_TEAM = "team"; private TeamInfoResponse team; @@ -74,14 +72,13 @@ public TeamGetInfoResponse team(TeamInfoResponse team) { return this; } - /** + /** * Get team * @return team - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TeamInfoResponse getTeam() { return team; @@ -89,7 +86,7 @@ public TeamInfoResponse getTeam() { @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeam(TeamInfoResponse team) { this.team = team; } @@ -108,12 +105,11 @@ public TeamGetInfoResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetResponse.java index 2e6be0210..f862702b2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamGetResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TeamResponse; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * TeamGetResponse */ @JsonPropertyOrder({ - TeamGetResponse.JSON_PROPERTY_TEAM, - TeamGetResponse.JSON_PROPERTY_WARNINGS + TeamGetResponse.JSON_PROPERTY_TEAM, + TeamGetResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamGetResponse { public static final String JSON_PROPERTY_TEAM = "team"; private TeamResponse team; @@ -74,14 +72,13 @@ public TeamGetResponse team(TeamResponse team) { return this; } - /** + /** * Get team * @return team - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TeamResponse getTeam() { return team; @@ -89,7 +86,7 @@ public TeamResponse getTeam() { @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeam(TeamResponse team) { this.team = team; } @@ -108,12 +105,11 @@ public TeamGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java index 11bd7e2f9..8dad2c1f8 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TeamParentResponse; @@ -23,12 +22,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -36,14 +34,14 @@ * TeamInfoResponse */ @JsonPropertyOrder({ - TeamInfoResponse.JSON_PROPERTY_TEAM_ID, - TeamInfoResponse.JSON_PROPERTY_TEAM_PARENT, - TeamInfoResponse.JSON_PROPERTY_NAME, - TeamInfoResponse.JSON_PROPERTY_NUM_MEMBERS, - TeamInfoResponse.JSON_PROPERTY_NUM_SUB_TEAMS + TeamInfoResponse.JSON_PROPERTY_TEAM_ID, + TeamInfoResponse.JSON_PROPERTY_TEAM_PARENT, + TeamInfoResponse.JSON_PROPERTY_NAME, + TeamInfoResponse.JSON_PROPERTY_NUM_MEMBERS, + TeamInfoResponse.JSON_PROPERTY_NUM_SUB_TEAMS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamInfoResponse { public static final String JSON_PROPERTY_TEAM_ID = "team_id"; private String teamId; @@ -83,12 +81,11 @@ public TeamInfoResponse teamId(String teamId) { return this; } - /** + /** * The id of a team * @return teamId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of a team") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -109,12 +106,11 @@ public TeamInfoResponse teamParent(TeamParentResponse teamParent) { return this; } - /** + /** * Get teamParent * @return teamParent - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEAM_PARENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,12 +131,11 @@ public TeamInfoResponse name(String name) { return this; } - /** + /** * The name of a team * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of a team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,12 +156,11 @@ public TeamInfoResponse numMembers(Integer numMembers) { return this; } - /** + /** * Number of members within a team * @return numMembers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Number of members within a team") @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -187,12 +181,11 @@ public TeamInfoResponse numSubTeams(Integer numSubTeams) { return this; } - /** + /** * Number of sub teams within a team * @return numSubTeams - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Number of sub teams within a team") @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java index dddf3b211..d59d63033 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,15 +33,15 @@ * TeamInviteResponse */ @JsonPropertyOrder({ - TeamInviteResponse.JSON_PROPERTY_EMAIL_ADDRESS, - TeamInviteResponse.JSON_PROPERTY_TEAM_ID, - TeamInviteResponse.JSON_PROPERTY_ROLE, - TeamInviteResponse.JSON_PROPERTY_SENT_AT, - TeamInviteResponse.JSON_PROPERTY_REDEEMED_AT, - TeamInviteResponse.JSON_PROPERTY_EXPIRES_AT + TeamInviteResponse.JSON_PROPERTY_EMAIL_ADDRESS, + TeamInviteResponse.JSON_PROPERTY_TEAM_ID, + TeamInviteResponse.JSON_PROPERTY_ROLE, + TeamInviteResponse.JSON_PROPERTY_SENT_AT, + TeamInviteResponse.JSON_PROPERTY_REDEEMED_AT, + TeamInviteResponse.JSON_PROPERTY_EXPIRES_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamInviteResponse { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -86,12 +84,11 @@ public TeamInviteResponse emailAddress(String emailAddress) { return this; } - /** + /** * Email address of the user invited to this team. * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Email address of the user invited to this team.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -112,12 +109,11 @@ public TeamInviteResponse teamId(String teamId) { return this; } - /** + /** * Id of the team. * @return teamId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Id of the team.") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,12 +134,11 @@ public TeamInviteResponse role(String role) { return this; } - /** + /** * Role of the user invited to this team. * @return role - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Role of the user invited to this team.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -164,12 +159,11 @@ public TeamInviteResponse sentAt(Integer sentAt) { return this; } - /** + /** * Timestamp when the invitation was sent. * @return sentAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Timestamp when the invitation was sent.") @JsonProperty(JSON_PROPERTY_SENT_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,12 +184,11 @@ public TeamInviteResponse redeemedAt(Integer redeemedAt) { return this; } - /** + /** * Timestamp when the invitation was redeemed. * @return redeemedAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Timestamp when the invitation was redeemed.") @JsonProperty(JSON_PROPERTY_REDEEMED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -216,12 +209,11 @@ public TeamInviteResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * Timestamp when the invitation is expiring. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Timestamp when the invitation is expiring.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java index de9ed95ea..17d025b31 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TeamInviteResponse; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,14 +37,14 @@ * TeamInvitesResponse */ @JsonPropertyOrder({ - TeamInvitesResponse.JSON_PROPERTY_TEAM_INVITES, - TeamInvitesResponse.JSON_PROPERTY_WARNINGS + TeamInvitesResponse.JSON_PROPERTY_TEAM_INVITES, + TeamInvitesResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamInvitesResponse { public static final String JSON_PROPERTY_TEAM_INVITES = "team_invites"; - private List teamInvites = null; + private List teamInvites = new ArrayList<>(); public static final String JSON_PROPERTY_WARNINGS = "warnings"; private List warnings = null; @@ -82,14 +80,13 @@ public TeamInvitesResponse addTeamInvitesItem(TeamInviteResponse teamInvitesItem return this; } - /** + /** * Contains a list of team invites and their roles. * @return teamInvites - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Contains a list of team invites and their roles.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM_INVITES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTeamInvites() { return teamInvites; @@ -97,7 +94,7 @@ public List getTeamInvites() { @JsonProperty(JSON_PROPERTY_TEAM_INVITES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeamInvites(List teamInvites) { this.teamInvites = teamInvites; } @@ -116,12 +113,11 @@ public TeamInvitesResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * Get warnings * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java index 688aa0105..b7740897b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,12 +33,12 @@ * TeamMemberResponse */ @JsonPropertyOrder({ - TeamMemberResponse.JSON_PROPERTY_ACCOUNT_ID, - TeamMemberResponse.JSON_PROPERTY_EMAIL_ADDRESS, - TeamMemberResponse.JSON_PROPERTY_ROLE + TeamMemberResponse.JSON_PROPERTY_ACCOUNT_ID, + TeamMemberResponse.JSON_PROPERTY_EMAIL_ADDRESS, + TeamMemberResponse.JSON_PROPERTY_ROLE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamMemberResponse { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -74,12 +72,11 @@ public TeamMemberResponse accountId(String accountId) { return this; } - /** + /** * Account id of the team member. * @return accountId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Account id of the team member.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,12 +97,11 @@ public TeamMemberResponse emailAddress(String emailAddress) { return this; } - /** + /** * Email address of the team member. * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Email address of the team member.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,12 +122,11 @@ public TeamMemberResponse role(String role) { return this; } - /** + /** * The specific role a member has on the team. * @return role - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The specific role a member has on the team.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java index 7ca364147..299e8a914 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.ListInfoResponse; @@ -25,14 +24,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,15 +38,15 @@ * TeamMembersResponse */ @JsonPropertyOrder({ - TeamMembersResponse.JSON_PROPERTY_TEAM_MEMBERS, - TeamMembersResponse.JSON_PROPERTY_LIST_INFO, - TeamMembersResponse.JSON_PROPERTY_WARNINGS + TeamMembersResponse.JSON_PROPERTY_TEAM_MEMBERS, + TeamMembersResponse.JSON_PROPERTY_LIST_INFO, + TeamMembersResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamMembersResponse { public static final String JSON_PROPERTY_TEAM_MEMBERS = "team_members"; - private List teamMembers = null; + private List teamMembers = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; @@ -87,14 +85,13 @@ public TeamMembersResponse addTeamMembersItem(TeamMemberResponse teamMembersItem return this; } - /** + /** * Contains a list of team members and their roles for a specific team. * @return teamMembers - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Contains a list of team members and their roles for a specific team.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTeamMembers() { return teamMembers; @@ -102,7 +99,7 @@ public List getTeamMembers() { @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeamMembers(List teamMembers) { this.teamMembers = teamMembers; } @@ -113,14 +110,13 @@ public TeamMembersResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public TeamMembersResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * Get warnings * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamParentResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamParentResponse.java index 0d2f94366..180e3bb47 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamParentResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamParentResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,25 +21,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Information about the parent team if a team has one, set to `null` otherwise. */ -@ApiModel(description = "Information about the parent team if a team has one, set to `null` otherwise.") @JsonPropertyOrder({ - TeamParentResponse.JSON_PROPERTY_TEAM_ID, - TeamParentResponse.JSON_PROPERTY_NAME + TeamParentResponse.JSON_PROPERTY_TEAM_ID, + TeamParentResponse.JSON_PROPERTY_NAME }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamParentResponse { public static final String JSON_PROPERTY_TEAM_ID = "team_id"; private String teamId; @@ -71,12 +68,11 @@ public TeamParentResponse teamId(String teamId) { return this; } - /** + /** * The id of a team * @return teamId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of a team") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public TeamParentResponse name(String name) { return this; } - /** + /** * The name of a team * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of a team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java index 71bbe5485..fd82206e4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,14 +33,14 @@ * TeamRemoveMemberRequest */ @JsonPropertyOrder({ - TeamRemoveMemberRequest.JSON_PROPERTY_ACCOUNT_ID, - TeamRemoveMemberRequest.JSON_PROPERTY_EMAIL_ADDRESS, - TeamRemoveMemberRequest.JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS, - TeamRemoveMemberRequest.JSON_PROPERTY_NEW_TEAM_ID, - TeamRemoveMemberRequest.JSON_PROPERTY_NEW_ROLE + TeamRemoveMemberRequest.JSON_PROPERTY_ACCOUNT_ID, + TeamRemoveMemberRequest.JSON_PROPERTY_EMAIL_ADDRESS, + TeamRemoveMemberRequest.JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS, + TeamRemoveMemberRequest.JSON_PROPERTY_NEW_TEAM_ID, + TeamRemoveMemberRequest.JSON_PROPERTY_NEW_ROLE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamRemoveMemberRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -121,12 +119,11 @@ public TeamRemoveMemberRequest accountId(String accountId) { return this; } - /** + /** * **account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team. * @return accountId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "**account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,12 +144,11 @@ public TeamRemoveMemberRequest emailAddress(String emailAddress) { return this; } - /** + /** * **account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team. * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "**account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,12 +169,11 @@ public TeamRemoveMemberRequest newOwnerEmailAddress(String newOwnerEmailAddress) return this; } - /** + /** * The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans. * @return newOwnerEmailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans.") @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +194,11 @@ public TeamRemoveMemberRequest newTeamId(String newTeamId) { return this; } - /** + /** * Id of the new Team. * @return newTeamId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Id of the new Team.") @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +219,11 @@ public TeamRemoveMemberRequest newRole(NewRoleEnum newRole) { return this; } - /** + /** * A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided. * @return newRole - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided.") @JsonProperty(JSON_PROPERTY_NEW_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamResponse.java index d56d12734..06dc6b3c3 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.AccountResponse; @@ -23,29 +22,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about your team and its members */ -@ApiModel(description = "Contains information about your team and its members") @JsonPropertyOrder({ - TeamResponse.JSON_PROPERTY_NAME, - TeamResponse.JSON_PROPERTY_ACCOUNTS, - TeamResponse.JSON_PROPERTY_INVITED_ACCOUNTS, - TeamResponse.JSON_PROPERTY_INVITED_EMAILS + TeamResponse.JSON_PROPERTY_NAME, + TeamResponse.JSON_PROPERTY_ACCOUNTS, + TeamResponse.JSON_PROPERTY_INVITED_ACCOUNTS, + TeamResponse.JSON_PROPERTY_INVITED_EMAILS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamResponse { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -82,12 +79,11 @@ public TeamResponse name(String name) { return this; } - /** + /** * The name of your Team * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of your Team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,12 +112,11 @@ public TeamResponse addAccountsItem(AccountResponse accountsItem) { return this; } - /** + /** * Get accounts * @return accounts - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCOUNTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -150,12 +145,11 @@ public TeamResponse addInvitedAccountsItem(AccountResponse invitedAccountsItem) return this; } - /** + /** * A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. * @return invitedAccounts - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`.") @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,12 +178,11 @@ public TeamResponse addInvitedEmailsItem(String invitedEmailsItem) { return this; } - /** + /** * A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. * @return invitedEmails - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account.") @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java index 4e273a747..f103f5f85 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.ListInfoResponse; @@ -25,14 +24,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,15 +38,15 @@ * TeamSubTeamsResponse */ @JsonPropertyOrder({ - TeamSubTeamsResponse.JSON_PROPERTY_SUB_TEAMS, - TeamSubTeamsResponse.JSON_PROPERTY_LIST_INFO, - TeamSubTeamsResponse.JSON_PROPERTY_WARNINGS + TeamSubTeamsResponse.JSON_PROPERTY_SUB_TEAMS, + TeamSubTeamsResponse.JSON_PROPERTY_LIST_INFO, + TeamSubTeamsResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamSubTeamsResponse { public static final String JSON_PROPERTY_SUB_TEAMS = "sub_teams"; - private List subTeams = null; + private List subTeams = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; @@ -87,14 +85,13 @@ public TeamSubTeamsResponse addSubTeamsItem(SubTeamResponse subTeamsItem) { return this; } - /** + /** * Contains a list with sub teams. * @return subTeams - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Contains a list with sub teams.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getSubTeams() { return subTeams; @@ -102,7 +99,7 @@ public List getSubTeams() { @JsonProperty(JSON_PROPERTY_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSubTeams(List subTeams) { this.subTeams = subTeams; } @@ -113,14 +110,13 @@ public TeamSubTeamsResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public TeamSubTeamsResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * Get warnings * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java index 1e6bb12e6..b9388bd38 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,10 +33,10 @@ * TeamUpdateRequest */ @JsonPropertyOrder({ - TeamUpdateRequest.JSON_PROPERTY_NAME + TeamUpdateRequest.JSON_PROPERTY_NAME }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamUpdateRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -66,12 +64,11 @@ public TeamUpdateRequest name(String name) { return this; } - /** + /** * The name of your Team. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of your Team.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java index 6fb1ae4d6..e7dd65c64 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,12 +33,12 @@ * TemplateAddUserRequest */ @JsonPropertyOrder({ - TemplateAddUserRequest.JSON_PROPERTY_ACCOUNT_ID, - TemplateAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS, - TemplateAddUserRequest.JSON_PROPERTY_SKIP_NOTIFICATION + TemplateAddUserRequest.JSON_PROPERTY_ACCOUNT_ID, + TemplateAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS, + TemplateAddUserRequest.JSON_PROPERTY_SKIP_NOTIFICATION }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateAddUserRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -74,12 +72,11 @@ public TemplateAddUserRequest accountId(String accountId) { return this; } - /** + /** * The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided. * @return accountId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,12 +97,11 @@ public TemplateAddUserRequest emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided. * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,12 +122,11 @@ public TemplateAddUserRequest skipNotification(Boolean skipNotification) { return this; } - /** + /** * If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. * @return skipNotification - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java index 370bf6fb5..902ec6fe1 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubAttachment; @@ -30,17 +29,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -48,34 +46,34 @@ * TemplateCreateEmbeddedDraftRequest */ @JsonPropertyOrder({ - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_CLIENT_ID, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FILES, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FILE_URLS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ALLOW_CCS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ALLOW_REASSIGN, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ATTACHMENTS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_CC_ROLES, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_EDITOR_OPTIONS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FIELD_OPTIONS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELD_RULES, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_MERGE_FIELDS, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_MESSAGE, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_METADATA, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SHOW_PREVIEW, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SIGNER_ROLES, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SKIP_ME_NOW, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SUBJECT, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_TEST_MODE, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_TITLE, - TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_CLIENT_ID, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FILES, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FILE_URLS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ALLOW_CCS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ALLOW_REASSIGN, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_ATTACHMENTS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_CC_ROLES, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_EDITOR_OPTIONS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FIELD_OPTIONS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELD_RULES, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_MERGE_FIELDS, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_MESSAGE, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_METADATA, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SHOW_PREVIEW, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SIGNER_ROLES, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SKIP_ME_NOW, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_SUBJECT, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_TEST_MODE, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_TITLE, + TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateEmbeddedDraftRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -175,12 +173,11 @@ public TemplateCreateEmbeddedDraftRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,12 +206,11 @@ public TemplateCreateEmbeddedDraftRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -243,12 +239,11 @@ public TemplateCreateEmbeddedDraftRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -269,12 +264,11 @@ public TemplateCreateEmbeddedDraftRequest allowCcs(Boolean allowCcs) { return this; } - /** + /** * This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. * @return allowCcs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template.") @JsonProperty(JSON_PROPERTY_ALLOW_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -295,12 +289,11 @@ public TemplateCreateEmbeddedDraftRequest allowReassign(Boolean allowReassign) { return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. * @return allowReassign - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -329,12 +322,11 @@ public TemplateCreateEmbeddedDraftRequest addAttachmentsItem(SubAttachment attac return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -363,12 +355,11 @@ public TemplateCreateEmbeddedDraftRequest addCcRolesItem(String ccRolesItem) { return this; } - /** + /** * The CC roles that must be assigned when using the template to send a signature request * @return ccRoles - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The CC roles that must be assigned when using the template to send a signature request") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -389,12 +380,11 @@ public TemplateCreateEmbeddedDraftRequest editorOptions(SubEditorOptions editorO return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -415,12 +405,11 @@ public TemplateCreateEmbeddedDraftRequest fieldOptions(SubFieldOptions fieldOpti return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -441,12 +430,11 @@ public TemplateCreateEmbeddedDraftRequest forceSignerRoles(Boolean forceSignerRo return this; } - /** + /** * Provide users the ability to review/edit the template signer roles. * @return forceSignerRoles - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template signer roles.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -467,12 +455,11 @@ public TemplateCreateEmbeddedDraftRequest forceSubjectMessage(Boolean forceSubje return this; } - /** + /** * Provide users the ability to review/edit the template subject and message. * @return forceSubjectMessage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -501,12 +488,11 @@ public TemplateCreateEmbeddedDraftRequest addFormFieldGroupsItem(SubFormFieldGro return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -535,12 +521,11 @@ public TemplateCreateEmbeddedDraftRequest addFormFieldRulesItem(SubFormFieldRule return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -569,12 +554,11 @@ public TemplateCreateEmbeddedDraftRequest addFormFieldsPerDocumentItem(SubFormFi return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -603,12 +587,11 @@ public TemplateCreateEmbeddedDraftRequest addMergeFieldsItem(SubMergeField merge return this; } - /** + /** * Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. * @return mergeFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.") @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -629,12 +612,11 @@ public TemplateCreateEmbeddedDraftRequest message(String message) { return this; } - /** + /** * The default template email message. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The default template email message.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -663,12 +645,11 @@ public TemplateCreateEmbeddedDraftRequest putMetadataItem(String key, Object met return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -689,12 +670,11 @@ public TemplateCreateEmbeddedDraftRequest showPreview(Boolean showPreview) { return this; } - /** + /** * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. * @return showPreview - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -715,12 +695,11 @@ public TemplateCreateEmbeddedDraftRequest showProgressStepper(Boolean showProgre return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -749,12 +728,11 @@ public TemplateCreateEmbeddedDraftRequest addSignerRolesItem(SubTemplateRole sig return this; } - /** + /** * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * @return signerRoles - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -775,12 +753,11 @@ public TemplateCreateEmbeddedDraftRequest skipMeNow(Boolean skipMeNow) { return this; } - /** + /** * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. * @return skipMeNow - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -801,12 +778,11 @@ public TemplateCreateEmbeddedDraftRequest subject(String subject) { return this; } - /** + /** * The template title (alias). * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The template title (alias).") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -827,12 +803,11 @@ public TemplateCreateEmbeddedDraftRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -853,12 +828,11 @@ public TemplateCreateEmbeddedDraftRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -879,12 +853,11 @@ public TemplateCreateEmbeddedDraftRequest usePreexistingFields(Boolean usePreexi return this; } - /** + /** * Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). * @return usePreexistingFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java index 598f69064..a0f7bbabb 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateCreateEmbeddedDraftResponseTemplate; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * TemplateCreateEmbeddedDraftResponse */ @JsonPropertyOrder({ - TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_TEMPLATE, - TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_WARNINGS + TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_TEMPLATE, + TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateEmbeddedDraftResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateCreateEmbeddedDraftResponseTemplate template; @@ -74,14 +72,13 @@ public TemplateCreateEmbeddedDraftResponse template(TemplateCreateEmbeddedDraftR return this; } - /** + /** * Get template * @return template - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateCreateEmbeddedDraftResponseTemplate getTemplate() { return template; @@ -89,7 +86,7 @@ public TemplateCreateEmbeddedDraftResponseTemplate getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateCreateEmbeddedDraftResponseTemplate template) { this.template = template; } @@ -108,12 +105,11 @@ public TemplateCreateEmbeddedDraftResponse addWarningsItem(WarningResponse warni return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java index 7748d6468..819f1d355 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.WarningResponse; @@ -23,29 +22,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Template object with parameters: `template_id`, `edit_url`, `expires_at`. */ -@ApiModel(description = "Template object with parameters: `template_id`, `edit_url`, `expires_at`.") @JsonPropertyOrder({ - TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, - TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EDIT_URL, - TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EXPIRES_AT, - TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_WARNINGS + TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, + TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EDIT_URL, + TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EXPIRES_AT, + TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateEmbeddedDraftResponseTemplate { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -57,6 +54,7 @@ public class TemplateCreateEmbeddedDraftResponseTemplate { private Integer expiresAt; public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @Deprecated private List warnings = null; public TemplateCreateEmbeddedDraftResponseTemplate() { @@ -82,12 +80,11 @@ public TemplateCreateEmbeddedDraftResponseTemplate templateId(String templateId) return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +105,11 @@ public TemplateCreateEmbeddedDraftResponseTemplate editUrl(String editUrl) { return this; } - /** + /** * Link to edit the template. * @return editUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Link to edit the template.") @JsonProperty(JSON_PROPERTY_EDIT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +130,11 @@ public TemplateCreateEmbeddedDraftResponseTemplate expiresAt(Integer expiresAt) return this; } - /** + /** * When the link expires. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When the link expires.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -155,6 +150,7 @@ public void setExpiresAt(Integer expiresAt) { } + @Deprecated public TemplateCreateEmbeddedDraftResponseTemplate warnings(List warnings) { this.warnings = warnings; return this; @@ -168,14 +164,13 @@ public TemplateCreateEmbeddedDraftResponseTemplate addWarningsItem(WarningRespon return this; } - /** + /** * A list of warnings. * @return warnings * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,6 +179,7 @@ public List getWarnings() { } + @Deprecated @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWarnings(List warnings) { diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java index 935511b9e..54f9e4976 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubAttachment; @@ -29,17 +28,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -47,27 +45,27 @@ * TemplateCreateRequest */ @JsonPropertyOrder({ - TemplateCreateRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - TemplateCreateRequest.JSON_PROPERTY_SIGNER_ROLES, - TemplateCreateRequest.JSON_PROPERTY_FILES, - TemplateCreateRequest.JSON_PROPERTY_FILE_URLS, - TemplateCreateRequest.JSON_PROPERTY_ALLOW_REASSIGN, - TemplateCreateRequest.JSON_PROPERTY_ATTACHMENTS, - TemplateCreateRequest.JSON_PROPERTY_CC_ROLES, - TemplateCreateRequest.JSON_PROPERTY_CLIENT_ID, - TemplateCreateRequest.JSON_PROPERTY_FIELD_OPTIONS, - TemplateCreateRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - TemplateCreateRequest.JSON_PROPERTY_FORM_FIELD_RULES, - TemplateCreateRequest.JSON_PROPERTY_MERGE_FIELDS, - TemplateCreateRequest.JSON_PROPERTY_MESSAGE, - TemplateCreateRequest.JSON_PROPERTY_METADATA, - TemplateCreateRequest.JSON_PROPERTY_SUBJECT, - TemplateCreateRequest.JSON_PROPERTY_TEST_MODE, - TemplateCreateRequest.JSON_PROPERTY_TITLE, - TemplateCreateRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS + TemplateCreateRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + TemplateCreateRequest.JSON_PROPERTY_SIGNER_ROLES, + TemplateCreateRequest.JSON_PROPERTY_FILES, + TemplateCreateRequest.JSON_PROPERTY_FILE_URLS, + TemplateCreateRequest.JSON_PROPERTY_ALLOW_REASSIGN, + TemplateCreateRequest.JSON_PROPERTY_ATTACHMENTS, + TemplateCreateRequest.JSON_PROPERTY_CC_ROLES, + TemplateCreateRequest.JSON_PROPERTY_CLIENT_ID, + TemplateCreateRequest.JSON_PROPERTY_FIELD_OPTIONS, + TemplateCreateRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + TemplateCreateRequest.JSON_PROPERTY_FORM_FIELD_RULES, + TemplateCreateRequest.JSON_PROPERTY_MERGE_FIELDS, + TemplateCreateRequest.JSON_PROPERTY_MESSAGE, + TemplateCreateRequest.JSON_PROPERTY_METADATA, + TemplateCreateRequest.JSON_PROPERTY_SUBJECT, + TemplateCreateRequest.JSON_PROPERTY_TEST_MODE, + TemplateCreateRequest.JSON_PROPERTY_TITLE, + TemplateCreateRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateRequest { public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; private List formFieldsPerDocument = new ArrayList<>(); @@ -147,16 +145,18 @@ public TemplateCreateRequest formFieldsPerDocument(List(); + } this.formFieldsPerDocument.add(formFieldsPerDocumentItem); return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -178,16 +178,18 @@ public TemplateCreateRequest signerRoles(List signerRoles) { } public TemplateCreateRequest addSignerRolesItem(SubTemplateRole signerRolesItem) { + if (this.signerRoles == null) { + this.signerRoles = new ArrayList<>(); + } this.signerRoles.add(signerRolesItem); return this; } - /** + /** * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * @return signerRoles - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -216,12 +218,11 @@ public TemplateCreateRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,12 +251,11 @@ public TemplateCreateRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -276,12 +276,11 @@ public TemplateCreateRequest allowReassign(Boolean allowReassign) { return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. * @return allowReassign - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -310,12 +309,11 @@ public TemplateCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -344,12 +342,11 @@ public TemplateCreateRequest addCcRolesItem(String ccRolesItem) { return this; } - /** + /** * The CC roles that must be assigned when using the template to send a signature request * @return ccRoles - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The CC roles that must be assigned when using the template to send a signature request") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -370,12 +367,11 @@ public TemplateCreateRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -396,12 +392,11 @@ public TemplateCreateRequest fieldOptions(SubFieldOptions fieldOptions) { return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -430,12 +425,11 @@ public TemplateCreateRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldG return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -464,12 +458,11 @@ public TemplateCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRul return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -498,12 +491,11 @@ public TemplateCreateRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { return this; } - /** + /** * Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. * @return mergeFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.") @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -524,12 +516,11 @@ public TemplateCreateRequest message(String message) { return this; } - /** + /** * The default template email message. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The default template email message.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -558,12 +549,11 @@ public TemplateCreateRequest putMetadataItem(String key, Object metadataItem) { return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -584,12 +574,11 @@ public TemplateCreateRequest subject(String subject) { return this; } - /** + /** * The template title (alias). * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The template title (alias).") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -610,12 +599,11 @@ public TemplateCreateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -636,12 +624,11 @@ public TemplateCreateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -662,12 +649,11 @@ public TemplateCreateRequest usePreexistingFields(Boolean usePreexistingFields) return this; } - /** + /** * Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). * @return usePreexistingFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java index f743b6c64..5c5148710 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateCreateResponseTemplate; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * TemplateCreateResponse */ @JsonPropertyOrder({ - TemplateCreateResponse.JSON_PROPERTY_TEMPLATE, - TemplateCreateResponse.JSON_PROPERTY_WARNINGS + TemplateCreateResponse.JSON_PROPERTY_TEMPLATE, + TemplateCreateResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateCreateResponseTemplate template; @@ -74,14 +72,13 @@ public TemplateCreateResponse template(TemplateCreateResponseTemplate template) return this; } - /** + /** * Get template * @return template - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateCreateResponseTemplate getTemplate() { return template; @@ -89,7 +86,7 @@ public TemplateCreateResponseTemplate getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateCreateResponseTemplate template) { this.template = template; } @@ -108,12 +105,11 @@ public TemplateCreateResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java index a4eb864a8..7f8e5a569 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,24 +21,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Template object with parameters: `template_id`. */ -@ApiModel(description = "Template object with parameters: `template_id`.") @JsonPropertyOrder({ - TemplateCreateResponseTemplate.JSON_PROPERTY_TEMPLATE_ID + TemplateCreateResponseTemplate.JSON_PROPERTY_TEMPLATE_ID }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateResponseTemplate { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -67,12 +64,11 @@ public TemplateCreateResponseTemplate templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java index 2f119160b..6924483b4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,10 +33,10 @@ * TemplateEditResponse */ @JsonPropertyOrder({ - TemplateEditResponse.JSON_PROPERTY_TEMPLATE_ID + TemplateEditResponse.JSON_PROPERTY_TEMPLATE_ID }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateEditResponse { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -66,14 +64,13 @@ public TemplateEditResponse templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTemplateId() { return templateId; @@ -81,7 +78,7 @@ public String getTemplateId() { @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplateId(String templateId) { this.templateId = templateId; } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java index 61d365180..a5d346789 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponse; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * TemplateGetResponse */ @JsonPropertyOrder({ - TemplateGetResponse.JSON_PROPERTY_TEMPLATE, - TemplateGetResponse.JSON_PROPERTY_WARNINGS + TemplateGetResponse.JSON_PROPERTY_TEMPLATE, + TemplateGetResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateGetResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateResponse template; @@ -74,14 +72,13 @@ public TemplateGetResponse template(TemplateResponse template) { return this; } - /** + /** * Get template * @return template - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateResponse getTemplate() { return template; @@ -89,7 +86,7 @@ public TemplateResponse getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateResponse template) { this.template = template; } @@ -108,12 +105,11 @@ public TemplateGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateListResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateListResponse.java index 6da50b1d4..3af113e69 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateListResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateListResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.ListInfoResponse; @@ -25,14 +24,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,15 +38,15 @@ * TemplateListResponse */ @JsonPropertyOrder({ - TemplateListResponse.JSON_PROPERTY_TEMPLATES, - TemplateListResponse.JSON_PROPERTY_LIST_INFO, - TemplateListResponse.JSON_PROPERTY_WARNINGS + TemplateListResponse.JSON_PROPERTY_TEMPLATES, + TemplateListResponse.JSON_PROPERTY_LIST_INFO, + TemplateListResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateListResponse { public static final String JSON_PROPERTY_TEMPLATES = "templates"; - private List templates = null; + private List templates = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; @@ -87,14 +85,13 @@ public TemplateListResponse addTemplatesItem(TemplateResponse templatesItem) { return this; } - /** + /** * List of templates that the API caller has access to. * @return templates - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "List of templates that the API caller has access to.") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTemplates() { return templates; @@ -102,7 +99,7 @@ public List getTemplates() { @JsonProperty(JSON_PROPERTY_TEMPLATES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplates(List templates) { this.templates = templates; } @@ -113,14 +110,13 @@ public TemplateListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public TemplateListResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java index 64e82f1b3..76894efba 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,11 +33,11 @@ * TemplateRemoveUserRequest */ @JsonPropertyOrder({ - TemplateRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, - TemplateRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS + TemplateRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, + TemplateRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateRemoveUserRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -70,12 +68,11 @@ public TemplateRemoveUserRequest accountId(String accountId) { return this; } - /** + /** * The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. * @return accountId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public TemplateRemoveUserRequest emailAddress(String emailAddress) { return this; } - /** + /** * The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponse.java index 6513c7674..5a89f48a4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseAccount; @@ -28,40 +27,38 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about the templates you and your team have created. */ -@ApiModel(description = "Contains information about the templates you and your team have created.") @JsonPropertyOrder({ - TemplateResponse.JSON_PROPERTY_TEMPLATE_ID, - TemplateResponse.JSON_PROPERTY_TITLE, - TemplateResponse.JSON_PROPERTY_MESSAGE, - TemplateResponse.JSON_PROPERTY_UPDATED_AT, - TemplateResponse.JSON_PROPERTY_IS_EMBEDDED, - TemplateResponse.JSON_PROPERTY_IS_CREATOR, - TemplateResponse.JSON_PROPERTY_CAN_EDIT, - TemplateResponse.JSON_PROPERTY_IS_LOCKED, - TemplateResponse.JSON_PROPERTY_METADATA, - TemplateResponse.JSON_PROPERTY_SIGNER_ROLES, - TemplateResponse.JSON_PROPERTY_CC_ROLES, - TemplateResponse.JSON_PROPERTY_DOCUMENTS, - TemplateResponse.JSON_PROPERTY_CUSTOM_FIELDS, - TemplateResponse.JSON_PROPERTY_NAMED_FORM_FIELDS, - TemplateResponse.JSON_PROPERTY_ACCOUNTS + TemplateResponse.JSON_PROPERTY_TEMPLATE_ID, + TemplateResponse.JSON_PROPERTY_TITLE, + TemplateResponse.JSON_PROPERTY_MESSAGE, + TemplateResponse.JSON_PROPERTY_UPDATED_AT, + TemplateResponse.JSON_PROPERTY_IS_EMBEDDED, + TemplateResponse.JSON_PROPERTY_IS_CREATOR, + TemplateResponse.JSON_PROPERTY_CAN_EDIT, + TemplateResponse.JSON_PROPERTY_IS_LOCKED, + TemplateResponse.JSON_PROPERTY_METADATA, + TemplateResponse.JSON_PROPERTY_SIGNER_ROLES, + TemplateResponse.JSON_PROPERTY_CC_ROLES, + TemplateResponse.JSON_PROPERTY_DOCUMENTS, + TemplateResponse.JSON_PROPERTY_CUSTOM_FIELDS, + TemplateResponse.JSON_PROPERTY_NAMED_FORM_FIELDS, + TemplateResponse.JSON_PROPERTY_ACCOUNTS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponse { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -100,9 +97,11 @@ public class TemplateResponse { private List documents = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + @Deprecated private List customFields = null; public static final String JSON_PROPERTY_NAMED_FORM_FIELDS = "named_form_fields"; + @Deprecated private List namedFormFields = null; public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; @@ -131,12 +130,11 @@ public TemplateResponse templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +155,11 @@ public TemplateResponse title(String title) { return this; } - /** + /** * The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -183,12 +180,11 @@ public TemplateResponse message(String message) { return this; } - /** + /** * The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -209,12 +205,11 @@ public TemplateResponse updatedAt(Integer updatedAt) { return this; } - /** + /** * Time the template was last updated. * @return updatedAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Time the template was last updated.") @JsonProperty(JSON_PROPERTY_UPDATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -235,12 +230,11 @@ public TemplateResponse isEmbedded(Boolean isEmbedded) { return this; } - /** + /** * `true` if this template was created using an embedded flow, `false` if it was created on our website. * @return isEmbedded - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "`true` if this template was created using an embedded flow, `false` if it was created on our website.") @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -261,12 +255,11 @@ public TemplateResponse isCreator(Boolean isCreator) { return this; } - /** + /** * `true` if you are the owner of this template, `false` if it's been shared with you by a team member. * @return isCreator - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "`true` if you are the owner of this template, `false` if it's been shared with you by a team member.") @JsonProperty(JSON_PROPERTY_IS_CREATOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -287,12 +280,11 @@ public TemplateResponse canEdit(Boolean canEdit) { return this; } - /** + /** * Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). * @return canEdit - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Indicates whether edit rights have been granted to you by the owner (always `true` if that's you).") @JsonProperty(JSON_PROPERTY_CAN_EDIT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -313,12 +305,11 @@ public TemplateResponse isLocked(Boolean isLocked) { return this; } - /** + /** * Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. * @return isLocked - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests.") @JsonProperty(JSON_PROPERTY_IS_LOCKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -339,12 +330,11 @@ public TemplateResponse metadata(Object metadata) { return this; } - /** + /** * The metadata attached to the template. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The metadata attached to the template.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -373,12 +363,11 @@ public TemplateResponse addSignerRolesItem(TemplateResponseSignerRole signerRole return this; } - /** + /** * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * @return signerRoles - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -407,12 +396,11 @@ public TemplateResponse addCcRolesItem(TemplateResponseCCRole ccRolesItem) { return this; } - /** + /** * An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. * @return ccRoles - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -441,12 +429,11 @@ public TemplateResponse addDocumentsItem(TemplateResponseDocument documentsItem) return this; } - /** + /** * An array describing each document associated with this Template. Includes form field data for each document. * @return documents - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array describing each document associated with this Template. Includes form field data for each document.") @JsonProperty(JSON_PROPERTY_DOCUMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -462,6 +449,7 @@ public void setDocuments(List documents) { } + @Deprecated public TemplateResponse customFields(List customFields) { this.customFields = customFields; return this; @@ -475,14 +463,13 @@ public TemplateResponse addCustomFieldsItem(TemplateResponseDocumentCustomFieldB return this; } - /** + /** * Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. * @return customFields * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable - @ApiModelProperty(value = "Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -491,6 +478,7 @@ public List getCustomFields() { } + @Deprecated @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomFields(List customFields) { @@ -498,6 +486,7 @@ public void setCustomFields(List custom } + @Deprecated public TemplateResponse namedFormFields(List namedFormFields) { this.namedFormFields = namedFormFields; return this; @@ -511,14 +500,13 @@ public TemplateResponse addNamedFormFieldsItem(TemplateResponseDocumentFormField return this; } - /** + /** * Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. * @return namedFormFields * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable - @ApiModelProperty(value = "Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.") @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -527,6 +515,7 @@ public List getNamedFormFields() { } + @Deprecated @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNamedFormFields(List namedFormFields) { @@ -547,12 +536,11 @@ public TemplateResponse addAccountsItem(TemplateResponseAccount accountsItem) { return this; } - /** + /** * An array of the Accounts that can use this Template. * @return accounts - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of the Accounts that can use this Template.") @JsonProperty(JSON_PROPERTY_ACCOUNTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java index fd5d762f4..ec5f7a9e0 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseAccountQuota; @@ -23,12 +22,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -36,15 +34,15 @@ * TemplateResponseAccount */ @JsonPropertyOrder({ - TemplateResponseAccount.JSON_PROPERTY_ACCOUNT_ID, - TemplateResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS, - TemplateResponseAccount.JSON_PROPERTY_IS_LOCKED, - TemplateResponseAccount.JSON_PROPERTY_IS_PAID_HS, - TemplateResponseAccount.JSON_PROPERTY_IS_PAID_HF, - TemplateResponseAccount.JSON_PROPERTY_QUOTAS + TemplateResponseAccount.JSON_PROPERTY_ACCOUNT_ID, + TemplateResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS, + TemplateResponseAccount.JSON_PROPERTY_IS_LOCKED, + TemplateResponseAccount.JSON_PROPERTY_IS_PAID_HS, + TemplateResponseAccount.JSON_PROPERTY_IS_PAID_HF, + TemplateResponseAccount.JSON_PROPERTY_QUOTAS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseAccount { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -87,12 +85,11 @@ public TemplateResponseAccount accountId(String accountId) { return this; } - /** + /** * The id of the Account. * @return accountId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the Account.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,12 +110,11 @@ public TemplateResponseAccount emailAddress(String emailAddress) { return this; } - /** + /** * The email address associated with the Account. * @return emailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email address associated with the Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +135,11 @@ public TemplateResponseAccount isLocked(Boolean isLocked) { return this; } - /** + /** * Returns `true` if the user has been locked out of their account by a team admin. * @return isLocked - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has been locked out of their account by a team admin.") @JsonProperty(JSON_PROPERTY_IS_LOCKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +160,11 @@ public TemplateResponseAccount isPaidHs(Boolean isPaidHs) { return this; } - /** + /** * Returns `true` if the user has a paid Dropbox Sign account. * @return isPaidHs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid Dropbox Sign account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +185,11 @@ public TemplateResponseAccount isPaidHf(Boolean isPaidHf) { return this; } - /** + /** * Returns `true` if the user has a paid HelloFax account. * @return isPaidHf - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid HelloFax account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HF) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +210,11 @@ public TemplateResponseAccount quotas(TemplateResponseAccountQuota quotas) { return this; } - /** + /** * Get quotas * @return quotas - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_QUOTAS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java index 1da4984d4..95b805c95 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,27 +21,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. */ -@ApiModel(description = "An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.") @JsonPropertyOrder({ - TemplateResponseAccountQuota.JSON_PROPERTY_TEMPLATES_LEFT, - TemplateResponseAccountQuota.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, - TemplateResponseAccountQuota.JSON_PROPERTY_DOCUMENTS_LEFT, - TemplateResponseAccountQuota.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT + TemplateResponseAccountQuota.JSON_PROPERTY_TEMPLATES_LEFT, + TemplateResponseAccountQuota.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, + TemplateResponseAccountQuota.JSON_PROPERTY_DOCUMENTS_LEFT, + TemplateResponseAccountQuota.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseAccountQuota { public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; private Integer templatesLeft; @@ -79,12 +76,11 @@ public TemplateResponseAccountQuota templatesLeft(Integer templatesLeft) { return this; } - /** + /** * API templates remaining. * @return templatesLeft - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "API templates remaining.") @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public TemplateResponseAccountQuota apiSignatureRequestsLeft(Integer apiSignatur return this; } - /** + /** * API signature requests remaining. * @return apiSignatureRequestsLeft - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "API signature requests remaining.") @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public TemplateResponseAccountQuota documentsLeft(Integer documentsLeft) { return this; } - /** + /** * Signature requests remaining. * @return documentsLeft - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Signature requests remaining.") @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public TemplateResponseAccountQuota smsVerificationsLeft(Integer smsVerification return this; } - /** + /** * SMS verifications remaining. * @return smsVerificationsLeft - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "SMS verifications remaining.") @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java index 003372c02..0c70b1182 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,10 +33,10 @@ * TemplateResponseCCRole */ @JsonPropertyOrder({ - TemplateResponseCCRole.JSON_PROPERTY_NAME + TemplateResponseCCRole.JSON_PROPERTY_NAME }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseCCRole { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -66,12 +64,11 @@ public TemplateResponseCCRole name(String name) { return this; } - /** + /** * The name of the Role. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the Role.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java index 111dc57d8..74b232d16 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldBase; @@ -26,14 +25,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -41,15 +39,15 @@ * TemplateResponseDocument */ @JsonPropertyOrder({ - TemplateResponseDocument.JSON_PROPERTY_NAME, - TemplateResponseDocument.JSON_PROPERTY_INDEX, - TemplateResponseDocument.JSON_PROPERTY_FIELD_GROUPS, - TemplateResponseDocument.JSON_PROPERTY_FORM_FIELDS, - TemplateResponseDocument.JSON_PROPERTY_CUSTOM_FIELDS, - TemplateResponseDocument.JSON_PROPERTY_STATIC_FIELDS + TemplateResponseDocument.JSON_PROPERTY_NAME, + TemplateResponseDocument.JSON_PROPERTY_INDEX, + TemplateResponseDocument.JSON_PROPERTY_FIELD_GROUPS, + TemplateResponseDocument.JSON_PROPERTY_FORM_FIELDS, + TemplateResponseDocument.JSON_PROPERTY_CUSTOM_FIELDS, + TemplateResponseDocument.JSON_PROPERTY_STATIC_FIELDS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseDocument { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -92,12 +90,11 @@ public TemplateResponseDocument name(String name) { return this; } - /** + /** * Name of the associated file. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Name of the associated file.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,12 +115,11 @@ public TemplateResponseDocument index(Integer index) { return this; } - /** + /** * Document ordering, the lowest index is displayed first and the highest last (0-based indexing). * @return index - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Document ordering, the lowest index is displayed first and the highest last (0-based indexing).") @JsonProperty(JSON_PROPERTY_INDEX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -152,12 +148,11 @@ public TemplateResponseDocument addFieldGroupsItem(TemplateResponseDocumentField return this; } - /** + /** * An array of Form Field Group objects. * @return fieldGroups - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of Form Field Group objects.") @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,12 +181,11 @@ public TemplateResponseDocument addFormFieldsItem(TemplateResponseDocumentFormFi return this; } - /** + /** * An array of Form Field objects containing the name and type of each named field. * @return formFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of Form Field objects containing the name and type of each named field.") @JsonProperty(JSON_PROPERTY_FORM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -220,12 +214,11 @@ public TemplateResponseDocument addCustomFieldsItem(TemplateResponseDocumentCust return this; } - /** + /** * An array of Form Field objects containing the name and type of each named field. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of Form Field objects containing the name and type of each named field.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -254,12 +247,11 @@ public TemplateResponseDocument addStaticFieldsItem(TemplateResponseDocumentStat return this; } - /** + /** * An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. * @return staticFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.") @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java index d10fe4f53..b9300c57f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java @@ -14,11 +14,9 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; -import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,37 +24,36 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An array of Form Field objects containing the name and type of each named field. */ -@ApiModel(description = "An array of Form Field objects containing the name and type of each named field.") @JsonPropertyOrder({ - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_TYPE, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_API_ID, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_NAME, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_SIGNER, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_X, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_Y, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_WIDTH, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_HEIGHT, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_REQUIRED, - TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_GROUP + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_TYPE, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_API_ID, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_NAME, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_SIGNER, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_X, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_Y, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_WIDTH, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_HEIGHT, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_REQUIRED, + TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldCheckbox.class, name = "TemplateResponseDocumentCustomFieldCheckbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldText.class, name = "TemplateResponseDocumentCustomFieldText"), @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldCheckbox.class, name = "checkbox"), @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldText.class, name = "text"), }) @@ -115,12 +112,11 @@ public TemplateResponseDocumentCustomFieldBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -141,12 +137,11 @@ public TemplateResponseDocumentCustomFieldBase apiId(String apiId) { return this; } - /** + /** * The unique ID for this field. * @return apiId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The unique ID for this field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -167,12 +162,11 @@ public TemplateResponseDocumentCustomFieldBase name(String name) { return this; } - /** + /** * The name of the Custom Field. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the Custom Field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -192,13 +186,16 @@ public TemplateResponseDocumentCustomFieldBase signer(String signer) { this.signer = signer; return this; } + public TemplateResponseDocumentCustomFieldBase signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } - /** + /** * The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). * @return signer - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -213,18 +210,21 @@ public void setSigner(String signer) { this.signer = signer; } + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + public TemplateResponseDocumentCustomFieldBase x(Integer x) { this.x = x; return this; } - /** + /** * The horizontal offset in pixels for this form field. * @return x - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The horizontal offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -245,12 +245,11 @@ public TemplateResponseDocumentCustomFieldBase y(Integer y) { return this; } - /** + /** * The vertical offset in pixels for this form field. * @return y - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The vertical offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -271,12 +270,11 @@ public TemplateResponseDocumentCustomFieldBase width(Integer width) { return this; } - /** + /** * The width in pixels of this form field. * @return width - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The width in pixels of this form field.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -297,12 +295,11 @@ public TemplateResponseDocumentCustomFieldBase height(Integer height) { return this; } - /** + /** * The height in pixels of this form field. * @return height - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The height in pixels of this form field.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -323,12 +320,11 @@ public TemplateResponseDocumentCustomFieldBase required(Boolean required) { return this; } - /** + /** * Boolean showing whether or not this field is required. * @return required - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Boolean showing whether or not this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -349,12 +345,11 @@ public TemplateResponseDocumentCustomFieldBase group(String group) { return this; } - /** + /** * The name of the group this field is in. If this field is not a group, this defaults to `null`. * @return group - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the group this field is in. If this field is not a group, this defaults to `null`.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -649,15 +644,13 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("TemplateResponseDocumentCustomFieldCheckbox", TemplateResponseDocumentCustomFieldCheckbox.class); - mappings.put("TemplateResponseDocumentCustomFieldText", TemplateResponseDocumentCustomFieldText.class); - mappings.put("checkbox", TemplateResponseDocumentCustomFieldCheckbox.class); - mappings.put("text", TemplateResponseDocumentCustomFieldText.class); - mappings.put("TemplateResponseDocumentCustomFieldBase", TemplateResponseDocumentCustomFieldBase.class); - JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldBase.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", TemplateResponseDocumentCustomFieldCheckbox.class); + mappings.put("text", TemplateResponseDocumentCustomFieldText.class); + mappings.put("TemplateResponseDocumentCustomFieldBase", TemplateResponseDocumentCustomFieldBase.class); + JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldBase.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java index 93a503af8..e61e8fb58 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java @@ -14,12 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -27,29 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentCustomFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentCustomFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentCustomFieldCheckbox.JSON_PROPERTY_TYPE + TemplateResponseDocumentCustomFieldCheckbox.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldText.class, name = "text"), -}) public class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocumentCustomFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -78,12 +73,11 @@ public TemplateResponseDocumentCustomFieldCheckbox type(String type) { return this; } - /** + /** * The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -192,13 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentCustomFieldCheckbox.class); - mappings.put("text", TemplateResponseDocumentCustomFieldText.class); - mappings.put("TemplateResponseDocumentCustomFieldCheckbox", TemplateResponseDocumentCustomFieldCheckbox.class); - JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldCheckbox.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentCustomFieldCheckbox", TemplateResponseDocumentCustomFieldCheckbox.class); + JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldCheckbox.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java index 31e92fdd7..74091e304 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java @@ -14,13 +14,11 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldText; import com.dropbox.sign.model.TemplateResponseFieldAvgTextLength; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -28,33 +26,30 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentCustomFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentCustomFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_TYPE, - TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, - TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_IS_MULTILINE, - TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, - TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_FONT_FAMILY + TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_TYPE, + TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, + TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_IS_MULTILINE, + TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, + TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_FONT_FAMILY }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldText.class, name = "text"), -}) public class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCustomFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -95,12 +90,11 @@ public TemplateResponseDocumentCustomFieldText type(String type) { return this; } - /** + /** * The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -121,12 +115,11 @@ public TemplateResponseDocumentCustomFieldText avgTextLength(TemplateResponseFie return this; } - /** + /** * Get avgTextLength * @return avgTextLength - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,12 +140,11 @@ public TemplateResponseDocumentCustomFieldText isMultiline(Boolean isMultiline) return this; } - /** + /** * Whether this form field is multiline text. * @return isMultiline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this form field is multiline text.") @JsonProperty(JSON_PROPERTY_IS_MULTILINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,12 +165,11 @@ public TemplateResponseDocumentCustomFieldText originalFontSize(Integer original return this; } - /** + /** * Original font size used in this form field's text. * @return originalFontSize - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Original font size used in this form field's text.") @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +190,11 @@ public TemplateResponseDocumentCustomFieldText fontFamily(String fontFamily) { return this; } - /** + /** * Font family used in this form field's text. * @return fontFamily - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Font family used in this form field's text.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -397,13 +387,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentCustomFieldCheckbox.class); - mappings.put("text", TemplateResponseDocumentCustomFieldText.class); - mappings.put("TemplateResponseDocumentCustomFieldText", TemplateResponseDocumentCustomFieldText.class); - JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldText.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentCustomFieldText", TemplateResponseDocumentCustomFieldText.class); + JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldText.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java index 30db5044a..4f3c61f1a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentFieldGroupRule; @@ -23,12 +22,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -36,11 +34,11 @@ * TemplateResponseDocumentFieldGroup */ @JsonPropertyOrder({ - TemplateResponseDocumentFieldGroup.JSON_PROPERTY_NAME, - TemplateResponseDocumentFieldGroup.JSON_PROPERTY_RULE + TemplateResponseDocumentFieldGroup.JSON_PROPERTY_NAME, + TemplateResponseDocumentFieldGroup.JSON_PROPERTY_RULE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseDocumentFieldGroup { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -71,12 +69,11 @@ public TemplateResponseDocumentFieldGroup name(String name) { return this; } - /** + /** * The name of the form field group. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the form field group.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +94,11 @@ public TemplateResponseDocumentFieldGroup rule(TemplateResponseDocumentFieldGrou return this; } - /** + /** * Get rule * @return rule - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_RULE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java index 571bfe375..7fa068893 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,25 +21,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping). */ -@ApiModel(description = "The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping).") @JsonPropertyOrder({ - TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_REQUIREMENT, - TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_GROUP_LABEL + TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_REQUIREMENT, + TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_GROUP_LABEL }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseDocumentFieldGroupRule { public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; private String requirement; @@ -71,12 +68,11 @@ public TemplateResponseDocumentFieldGroupRule requirement(String requirement) { return this; } - /** + /** * Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. * @return requirement - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.") @JsonProperty(JSON_PROPERTY_REQUIREMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public TemplateResponseDocumentFieldGroupRule groupLabel(String groupLabel) { return this; } - /** + /** * Name of the group * @return groupLabel - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Name of the group") @JsonProperty(JSON_PROPERTY_GROUP_LABEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java index cfeac3389..775126f33 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java @@ -14,17 +14,9 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -32,43 +24,36 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An array of Form Field objects containing the name and type of each named field. */ -@ApiModel(description = "An array of Form Field objects containing the name and type of each named field.") @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_API_ID, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_NAME, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_SIGNER, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_X, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_Y, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_WIDTH, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_HEIGHT, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_REQUIRED, - TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_GROUP + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_API_ID, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_NAME, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_SIGNER, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_X, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_Y, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_WIDTH, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_HEIGHT, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_REQUIRED, + TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "TemplateResponseDocumentFormFieldCheckbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "TemplateResponseDocumentFormFieldDateSigned"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "TemplateResponseDocumentFormFieldDropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldHyperlink.class, name = "TemplateResponseDocumentFormFieldHyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "TemplateResponseDocumentFormFieldInitials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "TemplateResponseDocumentFormFieldRadio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldSignature.class, name = "TemplateResponseDocumentFormFieldSignature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "TemplateResponseDocumentFormFieldText"), @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "date_signed"), @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), @@ -133,12 +118,11 @@ public TemplateResponseDocumentFormFieldBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -159,12 +143,11 @@ public TemplateResponseDocumentFormFieldBase apiId(String apiId) { return this; } - /** + /** * A unique id for the form field. * @return apiId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A unique id for the form field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -185,12 +168,11 @@ public TemplateResponseDocumentFormFieldBase name(String name) { return this; } - /** + /** * The name of the form field. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the form field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,13 +192,16 @@ public TemplateResponseDocumentFormFieldBase signer(String signer) { this.signer = signer; return this; } + public TemplateResponseDocumentFormFieldBase signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } - /** + /** * The signer of the Form Field. * @return signer - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The signer of the Form Field.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -231,18 +216,21 @@ public void setSigner(String signer) { this.signer = signer; } + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + public TemplateResponseDocumentFormFieldBase x(Integer x) { this.x = x; return this; } - /** + /** * The horizontal offset in pixels for this form field. * @return x - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The horizontal offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -263,12 +251,11 @@ public TemplateResponseDocumentFormFieldBase y(Integer y) { return this; } - /** + /** * The vertical offset in pixels for this form field. * @return y - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The vertical offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -289,12 +276,11 @@ public TemplateResponseDocumentFormFieldBase width(Integer width) { return this; } - /** + /** * The width in pixels of this form field. * @return width - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The width in pixels of this form field.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -315,12 +301,11 @@ public TemplateResponseDocumentFormFieldBase height(Integer height) { return this; } - /** + /** * The height in pixels of this form field. * @return height - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The height in pixels of this form field.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -341,12 +326,11 @@ public TemplateResponseDocumentFormFieldBase required(Boolean required) { return this; } - /** + /** * Boolean showing whether or not this field is required. * @return required - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Boolean showing whether or not this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -367,12 +351,11 @@ public TemplateResponseDocumentFormFieldBase group(String group) { return this; } - /** + /** * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. * @return group - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -667,27 +650,19 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("TemplateResponseDocumentFormFieldCheckbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("TemplateResponseDocumentFormFieldDateSigned", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("TemplateResponseDocumentFormFieldDropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("TemplateResponseDocumentFormFieldHyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("TemplateResponseDocumentFormFieldInitials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("TemplateResponseDocumentFormFieldRadio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("TemplateResponseDocumentFormFieldSignature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("TemplateResponseDocumentFormFieldText", TemplateResponseDocumentFormFieldText.class); - mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("text", TemplateResponseDocumentFormFieldText.class); - mappings.put("TemplateResponseDocumentFormFieldBase", TemplateResponseDocumentFormFieldBase.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldBase.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); + mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); + mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); + mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); + mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); + mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); + mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); + mappings.put("text", TemplateResponseDocumentFormFieldText.class); + mappings.put("TemplateResponseDocumentFormFieldBase", TemplateResponseDocumentFormFieldBase.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldBase.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java index 8f9cd0c27..dab3147c2 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldCheckbox.JSON_PROPERTY_TYPE + TemplateResponseDocumentFormFieldCheckbox.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "text"), -}) public class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocumentFormFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentFormFieldCheckbox type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("text", TemplateResponseDocumentFormFieldText.class); - mappings.put("TemplateResponseDocumentFormFieldCheckbox", TemplateResponseDocumentFormFieldCheckbox.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldCheckbox.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldCheckbox", TemplateResponseDocumentFormFieldCheckbox.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldCheckbox.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java index b9701bc31..630282e77 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldDateSigned.JSON_PROPERTY_TYPE + TemplateResponseDocumentFormFieldDateSigned.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "text"), -}) public class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocumentFormFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentFormFieldDateSigned type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("text", TemplateResponseDocumentFormFieldText.class); - mappings.put("TemplateResponseDocumentFormFieldDateSigned", TemplateResponseDocumentFormFieldDateSigned.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldDateSigned.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldDateSigned", TemplateResponseDocumentFormFieldDateSigned.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldDateSigned.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java index cbede2850..ffbf252db 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_TYPE + TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "text"), -}) public class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocumentFormFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentFormFieldDropdown type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("text", TemplateResponseDocumentFormFieldText.class); - mappings.put("TemplateResponseDocumentFormFieldDropdown", TemplateResponseDocumentFormFieldDropdown.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldDropdown.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldDropdown", TemplateResponseDocumentFormFieldDropdown.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldDropdown.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java index 6628e4244..72024c7b1 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java @@ -14,19 +14,11 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldText; import com.dropbox.sign.model.TemplateResponseFieldAvgTextLength; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,39 +26,30 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_AVG_TEXT_LENGTH, - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_IS_MULTILINE, - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_ORIGINAL_FONT_SIZE, - TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_FONT_FAMILY + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_AVG_TEXT_LENGTH, + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_IS_MULTILINE, + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_ORIGINAL_FONT_SIZE, + TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_FONT_FAMILY }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "text"), -}) public class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumentFormFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -107,12 +90,11 @@ public TemplateResponseDocumentFormFieldHyperlink type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -133,12 +115,11 @@ public TemplateResponseDocumentFormFieldHyperlink avgTextLength(TemplateResponse return this; } - /** + /** * Get avgTextLength * @return avgTextLength - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -159,12 +140,11 @@ public TemplateResponseDocumentFormFieldHyperlink isMultiline(Boolean isMultilin return this; } - /** + /** * Whether this form field is multiline text. * @return isMultiline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this form field is multiline text.") @JsonProperty(JSON_PROPERTY_IS_MULTILINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -185,12 +165,11 @@ public TemplateResponseDocumentFormFieldHyperlink originalFontSize(Integer origi return this; } - /** + /** * Original font size used in this form field's text. * @return originalFontSize - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Original font size used in this form field's text.") @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -211,12 +190,11 @@ public TemplateResponseDocumentFormFieldHyperlink fontFamily(String fontFamily) return this; } - /** + /** * Font family used in this form field's text. * @return fontFamily - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Font family used in this form field's text.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -409,19 +387,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("text", TemplateResponseDocumentFormFieldText.class); - mappings.put("TemplateResponseDocumentFormFieldHyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldHyperlink.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldHyperlink", TemplateResponseDocumentFormFieldHyperlink.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldHyperlink.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java index 7c11dfceb..53bcf1b36 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldInitials.JSON_PROPERTY_TYPE + TemplateResponseDocumentFormFieldInitials.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "text"), -}) public class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocumentFormFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentFormFieldInitials type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("text", TemplateResponseDocumentFormFieldText.class); - mappings.put("TemplateResponseDocumentFormFieldInitials", TemplateResponseDocumentFormFieldInitials.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldInitials.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldInitials", TemplateResponseDocumentFormFieldInitials.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldInitials.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java index 778c8ffe5..245c6d844 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldRadio.JSON_PROPERTY_TYPE + TemplateResponseDocumentFormFieldRadio.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "text"), -}) public class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFormFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentFormFieldRadio type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("text", TemplateResponseDocumentFormFieldText.class); - mappings.put("TemplateResponseDocumentFormFieldRadio", TemplateResponseDocumentFormFieldRadio.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldRadio.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldRadio", TemplateResponseDocumentFormFieldRadio.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldRadio.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java index 49bcfe578..8b3f3fd9b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldSignature.JSON_PROPERTY_TYPE + TemplateResponseDocumentFormFieldSignature.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "text"), -}) public class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumentFormFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentFormFieldSignature type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("text", TemplateResponseDocumentFormFieldText.class); - mappings.put("TemplateResponseDocumentFormFieldSignature", TemplateResponseDocumentFormFieldSignature.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldSignature.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldSignature", TemplateResponseDocumentFormFieldSignature.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldSignature.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java index 8f3265166..b58e6f669 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java @@ -14,19 +14,11 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldText; import com.dropbox.sign.model.TemplateResponseFieldAvgTextLength; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,40 +26,31 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_TYPE, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_IS_MULTILINE, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_FONT_FAMILY, - TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_TYPE + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_TYPE, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_IS_MULTILINE, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_FONT_FAMILY, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldText.class, name = "text"), -}) public class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentFormFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -162,12 +145,11 @@ public TemplateResponseDocumentFormFieldText type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -188,12 +170,11 @@ public TemplateResponseDocumentFormFieldText avgTextLength(TemplateResponseField return this; } - /** + /** * Get avgTextLength * @return avgTextLength - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -214,12 +195,11 @@ public TemplateResponseDocumentFormFieldText isMultiline(Boolean isMultiline) { return this; } - /** + /** * Whether this form field is multiline text. * @return isMultiline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this form field is multiline text.") @JsonProperty(JSON_PROPERTY_IS_MULTILINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -240,12 +220,11 @@ public TemplateResponseDocumentFormFieldText originalFontSize(Integer originalFo return this; } - /** + /** * Original font size used in this form field's text. * @return originalFontSize - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Original font size used in this form field's text.") @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -266,12 +245,11 @@ public TemplateResponseDocumentFormFieldText fontFamily(String fontFamily) { return this; } - /** + /** * Font family used in this form field's text. * @return fontFamily - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Font family used in this form field's text.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -292,12 +270,11 @@ public TemplateResponseDocumentFormFieldText validationType(ValidationTypeEnum v return this; } - /** + /** * Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. * @return validationType - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.") @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -511,19 +488,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentFormFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentFormFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentFormFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentFormFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentFormFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentFormFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentFormFieldSignature.class); - mappings.put("text", TemplateResponseDocumentFormFieldText.class); - mappings.put("TemplateResponseDocumentFormFieldText", TemplateResponseDocumentFormFieldText.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldText.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentFormFieldText", TemplateResponseDocumentFormFieldText.class); + JSON.registerDiscriminator(TemplateResponseDocumentFormFieldText.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java index f49aaac42..323d7d2a3 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java @@ -14,17 +14,9 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -32,43 +24,36 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. */ -@ApiModel(description = "An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.") @JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_TYPE, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_API_ID, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_NAME, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_SIGNER, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_X, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_Y, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_WIDTH, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_HEIGHT, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_REQUIRED, - TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_GROUP + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_TYPE, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_API_ID, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_NAME, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_SIGNER, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_X, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_Y, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_WIDTH, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_HEIGHT, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_REQUIRED, + TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "TemplateResponseDocumentStaticFieldCheckbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "TemplateResponseDocumentStaticFieldDateSigned"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "TemplateResponseDocumentStaticFieldDropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldHyperlink.class, name = "TemplateResponseDocumentStaticFieldHyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldInitials.class, name = "TemplateResponseDocumentStaticFieldInitials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "TemplateResponseDocumentStaticFieldRadio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldSignature.class, name = "TemplateResponseDocumentStaticFieldSignature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "TemplateResponseDocumentStaticFieldText"), @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "date_signed"), @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "dropdown"), @@ -133,12 +118,11 @@ public TemplateResponseDocumentStaticFieldBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -159,12 +143,11 @@ public TemplateResponseDocumentStaticFieldBase apiId(String apiId) { return this; } - /** + /** * A unique id for the static field. * @return apiId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A unique id for the static field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -185,12 +168,11 @@ public TemplateResponseDocumentStaticFieldBase name(String name) { return this; } - /** + /** * The name of the static field. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the static field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -211,12 +193,11 @@ public TemplateResponseDocumentStaticFieldBase signer(String signer) { return this; } - /** + /** * The signer of the Static Field. * @return signer - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The signer of the Static Field.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -237,12 +218,11 @@ public TemplateResponseDocumentStaticFieldBase x(Integer x) { return this; } - /** + /** * The horizontal offset in pixels for this static field. * @return x - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The horizontal offset in pixels for this static field.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -263,12 +243,11 @@ public TemplateResponseDocumentStaticFieldBase y(Integer y) { return this; } - /** + /** * The vertical offset in pixels for this static field. * @return y - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The vertical offset in pixels for this static field.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -289,12 +268,11 @@ public TemplateResponseDocumentStaticFieldBase width(Integer width) { return this; } - /** + /** * The width in pixels of this static field. * @return width - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The width in pixels of this static field.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -315,12 +293,11 @@ public TemplateResponseDocumentStaticFieldBase height(Integer height) { return this; } - /** + /** * The height in pixels of this static field. * @return height - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The height in pixels of this static field.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -341,12 +318,11 @@ public TemplateResponseDocumentStaticFieldBase required(Boolean required) { return this; } - /** + /** * Boolean showing whether or not this field is required. * @return required - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Boolean showing whether or not this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -367,12 +343,11 @@ public TemplateResponseDocumentStaticFieldBase group(String group) { return this; } - /** + /** * The name of the group this field is in. If this field is not a group, this defaults to `null`. * @return group - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the group this field is in. If this field is not a group, this defaults to `null`.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -667,27 +642,19 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("TemplateResponseDocumentStaticFieldCheckbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("TemplateResponseDocumentStaticFieldDateSigned", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("TemplateResponseDocumentStaticFieldDropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("TemplateResponseDocumentStaticFieldHyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("TemplateResponseDocumentStaticFieldInitials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("TemplateResponseDocumentStaticFieldRadio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("TemplateResponseDocumentStaticFieldSignature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("TemplateResponseDocumentStaticFieldText", TemplateResponseDocumentStaticFieldText.class); - mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("text", TemplateResponseDocumentStaticFieldText.class); - mappings.put("TemplateResponseDocumentStaticFieldBase", TemplateResponseDocumentStaticFieldBase.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldBase.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); + mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); + mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); + mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); + mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); + mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); + mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); + mappings.put("text", TemplateResponseDocumentStaticFieldText.class); + mappings.put("TemplateResponseDocumentStaticFieldBase", TemplateResponseDocumentStaticFieldBase.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldBase.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java index 3ae88c08d..8af3ac85c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldCheckbox.JSON_PROPERTY_TYPE + TemplateResponseDocumentStaticFieldCheckbox.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "text"), -}) public class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocumentStaticFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentStaticFieldCheckbox type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("text", TemplateResponseDocumentStaticFieldText.class); - mappings.put("TemplateResponseDocumentStaticFieldCheckbox", TemplateResponseDocumentStaticFieldCheckbox.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldCheckbox.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldCheckbox", TemplateResponseDocumentStaticFieldCheckbox.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldCheckbox.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java index 7b9c675c4..33b76f51d 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldDateSigned.JSON_PROPERTY_TYPE + TemplateResponseDocumentStaticFieldDateSigned.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "text"), -}) public class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocumentStaticFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentStaticFieldDateSigned type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("text", TemplateResponseDocumentStaticFieldText.class); - mappings.put("TemplateResponseDocumentStaticFieldDateSigned", TemplateResponseDocumentStaticFieldDateSigned.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldDateSigned.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldDateSigned", TemplateResponseDocumentStaticFieldDateSigned.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldDateSigned.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java index 95602d0a4..42110fbc4 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldDropdown.JSON_PROPERTY_TYPE + TemplateResponseDocumentStaticFieldDropdown.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "text"), -}) public class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocumentStaticFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentStaticFieldDropdown type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("text", TemplateResponseDocumentStaticFieldText.class); - mappings.put("TemplateResponseDocumentStaticFieldDropdown", TemplateResponseDocumentStaticFieldDropdown.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldDropdown.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldDropdown", TemplateResponseDocumentStaticFieldDropdown.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldDropdown.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java index 8ff161dd8..b3a7df6eb 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldHyperlink.JSON_PROPERTY_TYPE + TemplateResponseDocumentStaticFieldHyperlink.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "text"), -}) public class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocumentStaticFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentStaticFieldHyperlink type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("text", TemplateResponseDocumentStaticFieldText.class); - mappings.put("TemplateResponseDocumentStaticFieldHyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldHyperlink.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldHyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldHyperlink.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java index 7070ced10..9e87a2a7c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldInitials.JSON_PROPERTY_TYPE + TemplateResponseDocumentStaticFieldInitials.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "text"), -}) public class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocumentStaticFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentStaticFieldInitials type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("text", TemplateResponseDocumentStaticFieldText.class); - mappings.put("TemplateResponseDocumentStaticFieldInitials", TemplateResponseDocumentStaticFieldInitials.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldInitials.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldInitials", TemplateResponseDocumentStaticFieldInitials.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldInitials.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java index 638f4cf08..5160c6edf 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldRadio.JSON_PROPERTY_TYPE + TemplateResponseDocumentStaticFieldRadio.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "text"), -}) public class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentStaticFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentStaticFieldRadio type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("text", TemplateResponseDocumentStaticFieldText.class); - mappings.put("TemplateResponseDocumentStaticFieldRadio", TemplateResponseDocumentStaticFieldRadio.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldRadio.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldRadio", TemplateResponseDocumentStaticFieldRadio.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldRadio.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java index 766ee8110..55083a98b 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldSignature.JSON_PROPERTY_TYPE + TemplateResponseDocumentStaticFieldSignature.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "text"), -}) public class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocumentStaticFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentStaticFieldSignature type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("text", TemplateResponseDocumentStaticFieldText.class); - mappings.put("TemplateResponseDocumentStaticFieldSignature", TemplateResponseDocumentStaticFieldSignature.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldSignature.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldSignature", TemplateResponseDocumentStaticFieldSignature.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldSignature.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java index b3fbe2c96..096be22cb 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java @@ -14,18 +14,10 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldCheckbox; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDateSigned; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldDropdown; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldHyperlink; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldInitials; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldRadio; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldSignature; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldText; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,35 +25,26 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldText.JSON_PROPERTY_TYPE + TemplateResponseDocumentStaticFieldText.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDateSigned.class, name = "date_signed"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldDropdown.class, name = "dropdown"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldHyperlink.class, name = "hyperlink"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldInitials.class, name = "initials"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldRadio.class, name = "radio"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldSignature.class, name = "signature"), - @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldText.class, name = "text"), -}) public class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentStaticFieldBase { public static final String JSON_PROPERTY_TYPE = "type"; @@ -90,12 +73,11 @@ public TemplateResponseDocumentStaticFieldText type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,19 +186,11 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("checkbox", TemplateResponseDocumentStaticFieldCheckbox.class); - mappings.put("date_signed", TemplateResponseDocumentStaticFieldDateSigned.class); - mappings.put("dropdown", TemplateResponseDocumentStaticFieldDropdown.class); - mappings.put("hyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - mappings.put("initials", TemplateResponseDocumentStaticFieldInitials.class); - mappings.put("radio", TemplateResponseDocumentStaticFieldRadio.class); - mappings.put("signature", TemplateResponseDocumentStaticFieldSignature.class); - mappings.put("text", TemplateResponseDocumentStaticFieldText.class); - mappings.put("TemplateResponseDocumentStaticFieldText", TemplateResponseDocumentStaticFieldText.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldText.class, "type", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("TemplateResponseDocumentStaticFieldText", TemplateResponseDocumentStaticFieldText.class); + JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldText.class, "type", mappings); + } } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java index 4ab4df839..96d7f2202 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,25 +21,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * Average text length in this field. */ -@ApiModel(description = "Average text length in this field.") @JsonPropertyOrder({ - TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_LINES, - TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_CHARS_PER_LINE + TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_LINES, + TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_CHARS_PER_LINE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseFieldAvgTextLength { public static final String JSON_PROPERTY_NUM_LINES = "num_lines"; private Integer numLines; @@ -71,12 +68,11 @@ public TemplateResponseFieldAvgTextLength numLines(Integer numLines) { return this; } - /** + /** * Number of lines. * @return numLines - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Number of lines.") @JsonProperty(JSON_PROPERTY_NUM_LINES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public TemplateResponseFieldAvgTextLength numCharsPerLine(Integer numCharsPerLin return this; } - /** + /** * Number of characters per line. * @return numCharsPerLine - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Number of characters per line.") @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java index ae85de604..2db65f16f 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,12 +21,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -35,11 +33,11 @@ * TemplateResponseSignerRole */ @JsonPropertyOrder({ - TemplateResponseSignerRole.JSON_PROPERTY_NAME, - TemplateResponseSignerRole.JSON_PROPERTY_ORDER + TemplateResponseSignerRole.JSON_PROPERTY_NAME, + TemplateResponseSignerRole.JSON_PROPERTY_ORDER }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseSignerRole { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -70,12 +68,11 @@ public TemplateResponseSignerRole name(String name) { return this; } - /** + /** * The name of the Role. * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The name of the Role.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public TemplateResponseSignerRole order(Integer order) { return this; } - /** + /** * If signer order is assigned this is the 0-based index for this role. * @return order - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "If signer order is assigned this is the 0-based index for this role.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java index 9168722b2..9a98aa7f3 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,15 +21,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,15 +36,15 @@ * TemplateUpdateFilesRequest */ @JsonPropertyOrder({ - TemplateUpdateFilesRequest.JSON_PROPERTY_CLIENT_ID, - TemplateUpdateFilesRequest.JSON_PROPERTY_FILES, - TemplateUpdateFilesRequest.JSON_PROPERTY_FILE_URLS, - TemplateUpdateFilesRequest.JSON_PROPERTY_MESSAGE, - TemplateUpdateFilesRequest.JSON_PROPERTY_SUBJECT, - TemplateUpdateFilesRequest.JSON_PROPERTY_TEST_MODE + TemplateUpdateFilesRequest.JSON_PROPERTY_CLIENT_ID, + TemplateUpdateFilesRequest.JSON_PROPERTY_FILES, + TemplateUpdateFilesRequest.JSON_PROPERTY_FILE_URLS, + TemplateUpdateFilesRequest.JSON_PROPERTY_MESSAGE, + TemplateUpdateFilesRequest.JSON_PROPERTY_SUBJECT, + TemplateUpdateFilesRequest.JSON_PROPERTY_TEST_MODE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateUpdateFilesRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -89,12 +87,11 @@ public TemplateUpdateFilesRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to update this template. * @return clientId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Client id of the app you're using to update this template.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,12 +120,11 @@ public TemplateUpdateFilesRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +153,11 @@ public TemplateUpdateFilesRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -183,12 +178,11 @@ public TemplateUpdateFilesRequest message(String message) { return this; } - /** + /** * The new default template email message. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The new default template email message.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -209,12 +203,11 @@ public TemplateUpdateFilesRequest subject(String subject) { return this; } - /** + /** * The new default template email subject. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The new default template email subject.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -235,12 +228,11 @@ public TemplateUpdateFilesRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java index 5c3009f71..a393590d8 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.TemplateUpdateFilesResponseTemplate; @@ -23,12 +22,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -36,10 +34,10 @@ * TemplateUpdateFilesResponse */ @JsonPropertyOrder({ - TemplateUpdateFilesResponse.JSON_PROPERTY_TEMPLATE + TemplateUpdateFilesResponse.JSON_PROPERTY_TEMPLATE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateUpdateFilesResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateUpdateFilesResponseTemplate template; @@ -67,14 +65,13 @@ public TemplateUpdateFilesResponse template(TemplateUpdateFilesResponseTemplate return this; } - /** + /** * Get template * @return template - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateUpdateFilesResponseTemplate getTemplate() { return template; @@ -82,7 +79,7 @@ public TemplateUpdateFilesResponseTemplate getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateUpdateFilesResponseTemplate template) { this.template = template; } diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java index 194ebfff4..3a26fc0ec 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.WarningResponse; @@ -23,32 +22,31 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains template id */ -@ApiModel(description = "Contains template id") @JsonPropertyOrder({ - TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, - TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_WARNINGS + TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, + TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateUpdateFilesResponseTemplate { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @Deprecated private List warnings = null; public TemplateUpdateFilesResponseTemplate() { @@ -74,12 +72,11 @@ public TemplateUpdateFilesResponseTemplate templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -95,6 +92,7 @@ public void setTemplateId(String templateId) { } + @Deprecated public TemplateUpdateFilesResponseTemplate warnings(List warnings) { this.warnings = warnings; return this; @@ -108,14 +106,13 @@ public TemplateUpdateFilesResponseTemplate addWarningsItem(WarningResponse warni return this; } - /** + /** * A list of warnings. * @return warnings * @deprecated - **/ + */ @Deprecated @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -124,6 +121,7 @@ public List getWarnings() { } + @Deprecated @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWarnings(List warnings) { diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java index 25b50b72a..34a3441f5 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubAttachment; @@ -31,63 +30,62 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** - * UnclaimedDraftCreateEmbeddedRequest + * */ @JsonPropertyOrder({ - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FILES, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FILE_URLS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_CCS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_EDITOR_OPTIONS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORCE_SIGNER_PAGE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_HOLD_REQUEST, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_MESSAGE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_METADATA, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SHOW_PREVIEW, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNERS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SKIP_ME_NOW, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SUBJECT, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_TEST_MODE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_TYPE, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, - UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FILES, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FILE_URLS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_CCS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_DECLINE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ALLOW_REASSIGN, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_ATTACHMENTS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CUSTOM_FIELDS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_EDITOR_OPTIONS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FIELD_OPTIONS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORCE_SIGNER_PAGE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELD_RULES, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_HOLD_REQUEST, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_MESSAGE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_METADATA, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SHOW_PREVIEW, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNERS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_OPTIONS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SKIP_ME_NOW, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_SUBJECT, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_TEST_MODE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_TYPE, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_USE_TEXT_TAGS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateEmbeddedRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -255,12 +253,11 @@ public UnclaimedDraftCreateEmbeddedRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -281,12 +278,11 @@ public UnclaimedDraftCreateEmbeddedRequest requesterEmailAddress(String requeste return this; } - /** + /** * The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. * @return requesterEmailAddress - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -315,12 +311,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -349,12 +344,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -375,12 +369,11 @@ public UnclaimedDraftCreateEmbeddedRequest allowCcs(Boolean allowCcs) { return this; } - /** + /** * This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. * @return allowCcs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.") @JsonProperty(JSON_PROPERTY_ALLOW_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -401,12 +394,11 @@ public UnclaimedDraftCreateEmbeddedRequest allowDecline(Boolean allowDecline) { return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -427,12 +419,11 @@ public UnclaimedDraftCreateEmbeddedRequest allowReassign(Boolean allowReassign) return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. * @return allowReassign - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -461,12 +452,11 @@ public UnclaimedDraftCreateEmbeddedRequest addAttachmentsItem(SubAttachment atta return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -495,12 +485,11 @@ public UnclaimedDraftCreateEmbeddedRequest addCcEmailAddressesItem(String ccEmai return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -529,12 +518,11 @@ public UnclaimedDraftCreateEmbeddedRequest addCustomFieldsItem(SubCustomField cu return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -555,12 +543,11 @@ public UnclaimedDraftCreateEmbeddedRequest editorOptions(SubEditorOptions editor return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -581,12 +568,11 @@ public UnclaimedDraftCreateEmbeddedRequest fieldOptions(SubFieldOptions fieldOpt return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -607,12 +593,11 @@ public UnclaimedDraftCreateEmbeddedRequest forceSignerPage(Boolean forceSignerPa return this; } - /** + /** * Provide users the ability to review/edit the signers. * @return forceSignerPage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the signers.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -633,12 +618,11 @@ public UnclaimedDraftCreateEmbeddedRequest forceSubjectMessage(Boolean forceSubj return this; } - /** + /** * Provide users the ability to review/edit the subject and message. * @return forceSubjectMessage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -667,12 +651,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFormFieldGroupsItem(SubFormFieldGr return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -701,12 +684,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFormFieldRulesItem(SubFormFieldRul return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -735,12 +717,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFormFieldsPerDocumentItem(SubFormF return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -761,12 +742,11 @@ public UnclaimedDraftCreateEmbeddedRequest hideTextTags(Boolean hideTextTags) { return this; } - /** + /** * Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. * @return hideTextTags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -787,12 +767,11 @@ public UnclaimedDraftCreateEmbeddedRequest holdRequest(Boolean holdRequest) { return this; } - /** + /** * The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. * @return holdRequest - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -813,12 +792,11 @@ public UnclaimedDraftCreateEmbeddedRequest isForEmbeddedSigning(Boolean isForEmb return this; } - /** + /** * The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. * @return isForEmbeddedSigning - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -839,12 +817,11 @@ public UnclaimedDraftCreateEmbeddedRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -873,12 +850,11 @@ public UnclaimedDraftCreateEmbeddedRequest putMetadataItem(String key, Object me return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -899,12 +875,11 @@ public UnclaimedDraftCreateEmbeddedRequest requestingRedirectUrl(String requesti return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature. * @return requestingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature.") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -925,12 +900,11 @@ public UnclaimedDraftCreateEmbeddedRequest showPreview(Boolean showPreview) { return this; } - /** + /** * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. * @return showPreview - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -951,12 +925,11 @@ public UnclaimedDraftCreateEmbeddedRequest showProgressStepper(Boolean showProgr return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -985,12 +958,11 @@ public UnclaimedDraftCreateEmbeddedRequest addSignersItem(SubUnclaimedDraftSigne return this; } - /** + /** * Add Signers to your Unclaimed Draft Signature Request. * @return signers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Unclaimed Draft Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1011,12 +983,11 @@ public UnclaimedDraftCreateEmbeddedRequest signingOptions(SubSigningOptions sign return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1037,12 +1008,11 @@ public UnclaimedDraftCreateEmbeddedRequest signingRedirectUrl(String signingRedi return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1063,12 +1033,11 @@ public UnclaimedDraftCreateEmbeddedRequest skipMeNow(Boolean skipMeNow) { return this; } - /** + /** * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. * @return skipMeNow - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1089,12 +1058,11 @@ public UnclaimedDraftCreateEmbeddedRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1115,12 +1083,11 @@ public UnclaimedDraftCreateEmbeddedRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1141,12 +1108,11 @@ public UnclaimedDraftCreateEmbeddedRequest type(TypeEnum type) { return this; } - /** + /** * The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. * @return type - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1167,12 +1133,11 @@ public UnclaimedDraftCreateEmbeddedRequest usePreexistingFields(Boolean usePreex return this; } - /** + /** * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. * @return usePreexistingFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1193,12 +1158,11 @@ public UnclaimedDraftCreateEmbeddedRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. * @return useTextTags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1219,12 +1183,11 @@ public UnclaimedDraftCreateEmbeddedRequest populateAutoFillFields(Boolean popula return this; } - /** + /** * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. * @return populateAutoFillFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1245,12 +1208,11 @@ public UnclaimedDraftCreateEmbeddedRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java index 4221ef370..29202b7ee 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubCC; @@ -28,17 +27,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; @@ -46,39 +44,39 @@ * UnclaimedDraftCreateEmbeddedWithTemplateRequest */ @JsonPropertyOrder({ - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_REASSIGN, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_EDITOR_OPTIONS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FIELD_OPTIONS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_HOLD_REQUEST, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_PREVIEW_ONLY, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SHOW_PREVIEW, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SKIP_ME_NOW, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, - UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_CCS + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CLIENT_ID, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_DECLINE, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_REASSIGN, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CCS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_EDITOR_OPTIONS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FIELD_OPTIONS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILES, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FILE_URLS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FORCE_SIGNER_ROLES, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_FORCE_SUBJECT_MESSAGE, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_HOLD_REQUEST, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_MESSAGE, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_METADATA, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_PREVIEW_ONLY, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SHOW_PREVIEW, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNERS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SKIP_ME_NOW, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_SUBJECT, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, + UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_CCS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -193,12 +191,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest clientId(String clientId) return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -219,12 +216,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest requesterEmailAddress(Str return this; } - /** + /** * The email address of the user that should be designated as the requester of this draft. * @return requesterEmailAddress - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the user that should be designated as the requester of this draft.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -246,16 +242,18 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest templateIds(List } public UnclaimedDraftCreateEmbeddedWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } this.templateIds.add(templateIdsItem); return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. * @return templateIds - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -276,12 +274,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowDecline(Boolean allo return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -302,12 +299,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowReassign(Boolean all return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. * @return allowReassign - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -336,12 +332,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -370,12 +365,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCustomFieldsItem(SubCu return this; } - /** + /** * An array defining values and options for custom fields. Required when a custom field exists in the Template. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "An array defining values and options for custom fields. Required when a custom field exists in the Template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -396,12 +390,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest editorOptions(SubEditorOp return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -422,12 +415,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest fieldOptions(SubFieldOpti return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -456,12 +448,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFilesItem(File filesIt return this; } - /** + /** * Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -490,12 +481,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fi return this; } - /** + /** * Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. * @return fileUrls - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -516,12 +506,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSignerRoles(Boolean return this; } - /** + /** * Provide users the ability to review/edit the template signer roles. * @return forceSignerRoles - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template signer roles.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -542,12 +531,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSubjectMessage(Boole return this; } - /** + /** * Provide users the ability to review/edit the template subject and message. * @return forceSubjectMessage - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -568,12 +556,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest holdRequest(Boolean holdR return this; } - /** + /** * The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. * @return holdRequest - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -594,12 +581,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest isForEmbeddedSigning(Bool return this; } - /** + /** * The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. * @return isForEmbeddedSigning - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -620,12 +606,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -654,12 +639,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest putMetadataItem(String ke return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -680,12 +664,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest previewOnly(Boolean previ return this; } - /** + /** * This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set). * @return previewOnly - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set).") @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -706,12 +689,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest requestingRedirectUrl(Str return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature. * @return requestingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature.") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -732,12 +714,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest showPreview(Boolean showP return this; } - /** + /** * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. * @return showPreview - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -758,12 +739,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest showProgressStepper(Boole return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -792,12 +772,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addSignersItem(SubUnclaim return this; } - /** + /** * Add Signers to your Templated-based Signature Request. * @return signers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Templated-based Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -818,12 +797,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingOptions(SubSigning return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -844,12 +822,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingRedirectUrl(String return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -870,12 +847,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest skipMeNow(Boolean skipMeN return this; } - /** + /** * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. * @return skipMeNow - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -896,12 +872,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -922,12 +897,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest testMode(Boolean testMode return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -948,12 +922,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -974,12 +947,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest populateAutoFillFields(Bo return this; } - /** + /** * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. * @return populateAutoFillFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1000,12 +972,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowCcs(Boolean allowCcs return this; } - /** + /** * This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. * @return allowCcs - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.") @JsonProperty(JSON_PROPERTY_ALLOW_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java index a3546972d..1aff38f6e 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubAttachment; @@ -30,51 +29,50 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.JSON; import com.dropbox.sign.ApiException; /** - * UnclaimedDraftCreateRequest + * */ @JsonPropertyOrder({ - UnclaimedDraftCreateRequest.JSON_PROPERTY_TYPE, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FILES, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FILE_URLS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_ALLOW_DECLINE, - UnclaimedDraftCreateRequest.JSON_PROPERTY_ATTACHMENTS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, - UnclaimedDraftCreateRequest.JSON_PROPERTY_CLIENT_ID, - UnclaimedDraftCreateRequest.JSON_PROPERTY_CUSTOM_FIELDS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FIELD_OPTIONS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELD_RULES, - UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, - UnclaimedDraftCreateRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_MESSAGE, - UnclaimedDraftCreateRequest.JSON_PROPERTY_METADATA, - UnclaimedDraftCreateRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNERS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNING_OPTIONS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - UnclaimedDraftCreateRequest.JSON_PROPERTY_SUBJECT, - UnclaimedDraftCreateRequest.JSON_PROPERTY_TEST_MODE, - UnclaimedDraftCreateRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_USE_TEXT_TAGS, - UnclaimedDraftCreateRequest.JSON_PROPERTY_EXPIRES_AT + UnclaimedDraftCreateRequest.JSON_PROPERTY_TYPE, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FILES, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FILE_URLS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_ALLOW_DECLINE, + UnclaimedDraftCreateRequest.JSON_PROPERTY_ATTACHMENTS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_CC_EMAIL_ADDRESSES, + UnclaimedDraftCreateRequest.JSON_PROPERTY_CLIENT_ID, + UnclaimedDraftCreateRequest.JSON_PROPERTY_CUSTOM_FIELDS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FIELD_OPTIONS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELD_GROUPS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELD_RULES, + UnclaimedDraftCreateRequest.JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT, + UnclaimedDraftCreateRequest.JSON_PROPERTY_HIDE_TEXT_TAGS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_MESSAGE, + UnclaimedDraftCreateRequest.JSON_PROPERTY_METADATA, + UnclaimedDraftCreateRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNERS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNING_OPTIONS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + UnclaimedDraftCreateRequest.JSON_PROPERTY_SUBJECT, + UnclaimedDraftCreateRequest.JSON_PROPERTY_TEST_MODE, + UnclaimedDraftCreateRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_USE_TEXT_TAGS, + UnclaimedDraftCreateRequest.JSON_PROPERTY_EXPIRES_AT }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateRequest { /** * The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. @@ -206,12 +204,11 @@ public UnclaimedDraftCreateRequest type(TypeEnum type) { return this; } - /** + /** * The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. * @return type - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -240,12 +237,11 @@ public UnclaimedDraftCreateRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -274,12 +270,11 @@ public UnclaimedDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -300,12 +295,11 @@ public UnclaimedDraftCreateRequest allowDecline(Boolean allowDecline) { return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -334,12 +328,11 @@ public UnclaimedDraftCreateRequest addAttachmentsItem(SubAttachment attachmentsI return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -368,12 +361,11 @@ public UnclaimedDraftCreateRequest addCcEmailAddressesItem(String ccEmailAddress return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -394,12 +386,11 @@ public UnclaimedDraftCreateRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -428,12 +419,11 @@ public UnclaimedDraftCreateRequest addCustomFieldsItem(SubCustomField customFiel return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -454,12 +444,11 @@ public UnclaimedDraftCreateRequest fieldOptions(SubFieldOptions fieldOptions) { return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -488,12 +477,11 @@ public UnclaimedDraftCreateRequest addFormFieldGroupsItem(SubFormFieldGroup form return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -522,12 +510,11 @@ public UnclaimedDraftCreateRequest addFormFieldRulesItem(SubFormFieldRule formFi return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -556,12 +543,11 @@ public UnclaimedDraftCreateRequest addFormFieldsPerDocumentItem(SubFormFieldsPer return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -582,12 +568,11 @@ public UnclaimedDraftCreateRequest hideTextTags(Boolean hideTextTags) { return this; } - /** + /** * Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. * @return hideTextTags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -608,12 +593,11 @@ public UnclaimedDraftCreateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -642,12 +626,11 @@ public UnclaimedDraftCreateRequest putMetadataItem(String key, Object metadataIt return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -668,12 +651,11 @@ public UnclaimedDraftCreateRequest showProgressStepper(Boolean showProgressStepp return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -702,12 +684,11 @@ public UnclaimedDraftCreateRequest addSignersItem(SubUnclaimedDraftSigner signer return this; } - /** + /** * Add Signers to your Unclaimed Draft Signature Request. * @return signers - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Unclaimed Draft Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -728,12 +709,11 @@ public UnclaimedDraftCreateRequest signingOptions(SubSigningOptions signingOptio return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -754,12 +734,11 @@ public UnclaimedDraftCreateRequest signingRedirectUrl(String signingRedirectUrl) return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -780,12 +759,11 @@ public UnclaimedDraftCreateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -806,12 +784,11 @@ public UnclaimedDraftCreateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -832,12 +809,11 @@ public UnclaimedDraftCreateRequest usePreexistingFields(Boolean usePreexistingFi return this; } - /** + /** * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. * @return usePreexistingFields - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -858,12 +834,11 @@ public UnclaimedDraftCreateRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. * @return useTextTags - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -884,12 +859,11 @@ public UnclaimedDraftCreateRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java index f72d33d69..1bb63976c 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.UnclaimedDraftResponse; @@ -24,14 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,11 +37,11 @@ * UnclaimedDraftCreateResponse */ @JsonPropertyOrder({ - UnclaimedDraftCreateResponse.JSON_PROPERTY_UNCLAIMED_DRAFT, - UnclaimedDraftCreateResponse.JSON_PROPERTY_WARNINGS + UnclaimedDraftCreateResponse.JSON_PROPERTY_UNCLAIMED_DRAFT, + UnclaimedDraftCreateResponse.JSON_PROPERTY_WARNINGS }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateResponse { public static final String JSON_PROPERTY_UNCLAIMED_DRAFT = "unclaimed_draft"; private UnclaimedDraftResponse unclaimedDraft; @@ -74,14 +72,13 @@ public UnclaimedDraftCreateResponse unclaimedDraft(UnclaimedDraftResponse unclai return this; } - /** + /** * Get unclaimedDraft * @return unclaimedDraft - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") + */ + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public UnclaimedDraftResponse getUnclaimedDraft() { return unclaimedDraft; @@ -89,7 +86,7 @@ public UnclaimedDraftResponse getUnclaimedDraft() { @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setUnclaimedDraft(UnclaimedDraftResponse unclaimedDraft) { this.unclaimedDraft = unclaimedDraft; } @@ -108,12 +105,11 @@ public UnclaimedDraftCreateResponse addWarningsItem(WarningResponse warningsItem return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java index 3e6399b06..d8aaacb42 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.dropbox.sign.model.SubEditorOptions; @@ -23,12 +22,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; @@ -36,17 +34,17 @@ * UnclaimedDraftEditAndResendRequest */ @JsonPropertyOrder({ - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_CLIENT_ID, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_EDITOR_OPTIONS, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, - UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_TEST_MODE + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_CLIENT_ID, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_EDITOR_OPTIONS, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_REQUESTING_REDIRECT_URL, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, + UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_TEST_MODE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftEditAndResendRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -95,12 +93,11 @@ public UnclaimedDraftEditAndResendRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -121,12 +118,11 @@ public UnclaimedDraftEditAndResendRequest editorOptions(SubEditorOptions editorO return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,12 +143,11 @@ public UnclaimedDraftEditAndResendRequest isForEmbeddedSigning(Boolean isForEmbe return this; } - /** + /** * The request created from this draft will also be signable in embedded mode if set to `true`. * @return isForEmbeddedSigning - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The request created from this draft will also be signable in embedded mode if set to `true`.") @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,12 +168,11 @@ public UnclaimedDraftEditAndResendRequest requesterEmailAddress(String requester return this; } - /** + /** * The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used. * @return requesterEmailAddress - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +193,11 @@ public UnclaimedDraftEditAndResendRequest requestingRedirectUrl(String requestin return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature. * @return requestingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature.") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +218,11 @@ public UnclaimedDraftEditAndResendRequest showProgressStepper(Boolean showProgre return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,12 +243,11 @@ public UnclaimedDraftEditAndResendRequest signingRedirectUrl(String signingRedir return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -277,12 +268,11 @@ public UnclaimedDraftEditAndResendRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java index 673c8c434..261ccf575 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,29 +21,27 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * A group of documents that a user can take ownership of via the claim URL. */ -@ApiModel(description = "A group of documents that a user can take ownership of via the claim URL.") @JsonPropertyOrder({ - UnclaimedDraftResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, - UnclaimedDraftResponse.JSON_PROPERTY_CLAIM_URL, - UnclaimedDraftResponse.JSON_PROPERTY_SIGNING_REDIRECT_URL, - UnclaimedDraftResponse.JSON_PROPERTY_REQUESTING_REDIRECT_URL, - UnclaimedDraftResponse.JSON_PROPERTY_EXPIRES_AT, - UnclaimedDraftResponse.JSON_PROPERTY_TEST_MODE + UnclaimedDraftResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, + UnclaimedDraftResponse.JSON_PROPERTY_CLAIM_URL, + UnclaimedDraftResponse.JSON_PROPERTY_SIGNING_REDIRECT_URL, + UnclaimedDraftResponse.JSON_PROPERTY_REQUESTING_REDIRECT_URL, + UnclaimedDraftResponse.JSON_PROPERTY_EXPIRES_AT, + UnclaimedDraftResponse.JSON_PROPERTY_TEST_MODE }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftResponse { public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; private String signatureRequestId; @@ -87,12 +84,11 @@ public UnclaimedDraftResponse signatureRequestId(String signatureRequestId) { return this; } - /** + /** * The ID of the signature request that is represented by this UnclaimedDraft. * @return signatureRequestId - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The ID of the signature request that is represented by this UnclaimedDraft.") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,12 +109,11 @@ public UnclaimedDraftResponse claimUrl(String claimUrl) { return this; } - /** + /** * The URL to be used to claim this UnclaimedDraft. * @return claimUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL to be used to claim this UnclaimedDraft.") @JsonProperty(JSON_PROPERTY_CLAIM_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +134,11 @@ public UnclaimedDraftResponse signingRedirectUrl(String signingRedirectUrl) { return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +159,11 @@ public UnclaimedDraftResponse requestingRedirectUrl(String requestingRedirectUrl return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). * @return requestingRedirectUrl - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.).") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +184,11 @@ public UnclaimedDraftResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * When the link expires. * @return expiresAt - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "When the link expires.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +209,11 @@ public UnclaimedDraftResponse testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test draft. Signature requests made from test drafts have no legal value. * @return testMode - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test draft. Signature requests made from test drafts have no legal value.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v1/src/main/java/com/dropbox/sign/model/WarningResponse.java b/sdks/java-v1/src/main/java/com/dropbox/sign/model/WarningResponse.java index 296e55ab3..96374e99a 100644 --- a/sdks/java-v1/src/main/java/com/dropbox/sign/model/WarningResponse.java +++ b/sdks/java-v1/src/main/java/com/dropbox/sign/model/WarningResponse.java @@ -14,7 +14,6 @@ package com.dropbox.sign.model; import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,25 +21,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +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.JSON; import com.dropbox.sign.ApiException; /** * A list of warnings. */ -@ApiModel(description = "A list of warnings.") @JsonPropertyOrder({ - WarningResponse.JSON_PROPERTY_WARNING_MSG, - WarningResponse.JSON_PROPERTY_WARNING_NAME + WarningResponse.JSON_PROPERTY_WARNING_MSG, + WarningResponse.JSON_PROPERTY_WARNING_NAME }) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class WarningResponse { public static final String JSON_PROPERTY_WARNING_MSG = "warning_msg"; private String warningMsg; @@ -71,12 +68,11 @@ public WarningResponse warningMsg(String warningMsg) { return this; } - /** + /** * Warning message * @return warningMsg - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Warning message") @JsonProperty(JSON_PROPERTY_WARNING_MSG) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -97,12 +93,11 @@ public WarningResponse warningName(String warningName) { return this; } - /** + /** * Warning name * @return warningName - **/ + */ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "Warning name") @JsonProperty(JSON_PROPERTY_WARNING_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java index 903eb2c9c..8bd0c74f5 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java @@ -4,8 +4,10 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.dropbox.sign.model.EventCallbackRequest; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Files; import java.nio.file.Paths; @@ -35,9 +37,9 @@ public void testIsValid() throws Exception { EventCallbackRequest callbackEvent = EventCallbackRequest.init(content.toString()); - Assert.assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); - Assert.assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); - Assert.assertEquals( + assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); + assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); + assertEquals( EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK, EventCallbackHelper.getCallbackType(callbackEvent) ); @@ -55,9 +57,9 @@ public void testIsValid() throws Exception { EventCallbackRequest callbackEvent = EventCallbackRequest.init(content.toString()); - Assert.assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); - Assert.assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); - Assert.assertEquals( + assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); + assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); + assertEquals( EventCallbackHelper.EVENT_TYPE_APP_CALLBACK, EventCallbackHelper.getCallbackType(callbackEvent) ); diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/FixtureTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/FixtureTest.java index 2bef23851..d173e8d93 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/FixtureTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/FixtureTest.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Files; import java.nio.file.Paths; @@ -58,7 +58,7 @@ public void testFixture() throws Exception { JsonNode actual = mapper.readTree(serialized); // String comparison doesn't work due to json fields may be out of order - Assert.assertEquals(expected, actual); + assertEquals(expected, actual); } } } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java index 4dcbddee3..0ec09f9e9 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java @@ -4,8 +4,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Files; import java.nio.file.Paths; @@ -30,13 +31,13 @@ public void testSubFormFieldsPerDocumentBase() throws Exception { SubFormFieldsPerDocumentBase base = SubFormFieldsPerDocumentBase.init(expected.toString()); - Assert.assertTrue(Class.forName(packageNamePrefix + fieldName).isInstance(base)); + assertTrue(Class.forName(packageNamePrefix + fieldName).isInstance(base)); String serialized = mapper.writeValueAsString(base); JsonNode actual = mapper.readTree(serialized); // String comparison doesn't work due to json fields may be out of order - Assert.assertEquals(expected, actual); + assertEquals(expected, actual); } } @@ -57,7 +58,7 @@ public void testSignersAllowsInt() throws Exception { SubFormFieldsPerDocumentBase result = SubFormFieldsPerDocumentBase.init(data.toString()); - Assert.assertEquals(expected_signer, result.getSigner()); + assertEquals(expected_signer, result.getSigner()); } } @@ -78,7 +79,7 @@ public void testSignersAllowsString() throws Exception { SubFormFieldsPerDocumentBase result = SubFormFieldsPerDocumentBase.init(data.toString()); - Assert.assertEquals(expected_signer, result.getSigner()); + assertEquals(expected_signer, result.getSigner()); } } } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/api/AccountApiTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/api/AccountApiTest.java index 334e8d20b..04e0e64f9 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/api/AccountApiTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/api/AccountApiTest.java @@ -5,8 +5,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.stream.IntStream; @@ -24,7 +25,7 @@ public void accountCreateTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountCreateResponse response = accountApi.accountCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -36,7 +37,7 @@ public void accountGetTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountGetResponse response = accountApi.accountGet(null, "jack@example.com"); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -52,7 +53,7 @@ public void accountUpdateTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountGetResponse response = accountApi.accountUpdate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -68,7 +69,7 @@ public void accountVerifyTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountVerifyResponse response = accountApi.accountVerify(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -85,10 +86,10 @@ public void testHttpCodeRange() throws Exception { ApiClient apiClient = TestHelper.setUpMock(value, expectedResponse); AccountApi accountApi = new AccountApi(apiClient); accountApi.accountVerify(request); - Assert.fail(); + fail(); } catch (ApiException e) { - Assert.assertEquals(value, e.getCode()); - Assert.assertEquals(expectedResponse, e.getErrorResponse()); + assertEquals(value, e.getCode()); + assertEquals(expectedResponse, e.getErrorResponse()); } }); } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java index ddaee9815..3c0d800a8 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; @@ -24,7 +25,7 @@ public void apiAppCreateTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppGetResponse response = api.apiAppCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -45,7 +46,7 @@ public void apiAppGetTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppGetResponse response = api.apiAppGet(clientId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -57,7 +58,7 @@ public void apiAppListTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppListResponse response = api.apiAppList(1, 20); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -76,6 +77,6 @@ public void apiAppUpdateTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppGetResponse response = api.apiAppUpdate(clientId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java index 08534d1f6..e70b32563 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class BulkSendJobApiTest { @Test @@ -18,7 +19,7 @@ public void bulkSendJobGetTest() throws Exception { BulkSendJobApi api = new BulkSendJobApi(apiClient); BulkSendJobGetResponse response = api.bulkSendJobGet(id); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -30,6 +31,6 @@ public void bulkSendJobListTest() throws Exception { BulkSendJobApi api = new BulkSendJobApi(apiClient); BulkSendJobListResponse response = api.bulkSendJobList(1, 20); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java index 6bb3ed84b..e52f45574 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class EmbeddedApiTest { @Test @@ -23,7 +24,7 @@ public void embeddedEditUrlTest() throws Exception { EmbeddedApi api = new EmbeddedApi(apiClient); EmbeddedEditUrlResponse response = api.embeddedEditUrl(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -37,6 +38,6 @@ public void embeddedSignUrlTest() throws Exception { EmbeddedApi api = new EmbeddedApi(apiClient); EmbeddedSignUrlResponse response = api.embeddedSignUrl(signatureId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/api/OAuthApiTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/api/OAuthApiTest.java index 2eb9518bf..fe95c51ee 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/api/OAuthApiTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/api/OAuthApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class OAuthApiTest { @Test @@ -21,7 +22,7 @@ public void oauthTokenGenerateTest() throws Exception { OAuthApi api = new OAuthApi(apiClient); OAuthTokenResponse response = api.oauthTokenGenerate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -37,6 +38,6 @@ public void oauthTokenRefreshTest() throws Exception { OAuthApi api = new OAuthApi(apiClient); OAuthTokenResponse response = api.oauthTokenRefresh(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/api/ReportApiTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/api/ReportApiTest.java index 0dde79690..65c4a9c00 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/api/ReportApiTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/api/ReportApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ReportApiTest { @Test @@ -21,6 +22,6 @@ public void reportCreateTest() throws Exception { ReportApi api = new ReportApi(apiClient); ReportCreateResponse response = api.reportCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java index ed48f9c63..eadcbb2ee 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.mockito.Mockito; import static org.mockito.ArgumentMatchers.any; @@ -50,7 +51,7 @@ public void initAcceptsHashMap() throws Exception { ); assert data.getFormFieldsPerDocument() != null; - Assert.assertEquals( + assertEquals( "signature", data.getFormFieldsPerDocument().get(0).getType() ); @@ -70,7 +71,7 @@ public void signatureRequestBulkCreateEmbeddedWithTemplateTest() throws Exceptio SignatureRequestApi api = new SignatureRequestApi(apiClient); BulkSendJobSendResponse response = api.signatureRequestBulkCreateEmbeddedWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -87,7 +88,7 @@ public void signatureRequestBulkSendWithTemplateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); BulkSendJobSendResponse response = api.signatureRequestBulkSendWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -111,7 +112,7 @@ public void signatureRequestCreateEmbeddedTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestCreateEmbedded(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -128,7 +129,7 @@ public void signatureRequestCreateEmbeddedWithTemplateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestCreateEmbeddedWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -147,7 +148,7 @@ public void signatureRequestGetTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestGet(signatureRequestId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -166,7 +167,7 @@ public void signatureRequestListTest() throws Exception { null ); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -180,7 +181,7 @@ public void signatureRequestReleaseHoldTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestReleaseHold(signatureRequestId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -198,7 +199,7 @@ public void signatureRequestRemindTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestRemind(signatureRequestId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -222,7 +223,7 @@ public void signatureRequestSendTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestSend(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -299,7 +300,7 @@ public void signatureRequestSendWithTemplateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestSendWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -317,6 +318,6 @@ public void signatureRequestUpdateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestUpdate(signatureRequestId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/api/TeamApiTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/api/TeamApiTest.java index a97b2b791..bc9e77e13 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/api/TeamApiTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/api/TeamApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * API tests for TeamApi @@ -24,7 +25,7 @@ public void teamAddMemberTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamAddMember(request, null); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -40,7 +41,7 @@ public void teamCreateTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -58,7 +59,7 @@ public void teamGetTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamGet(); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -74,7 +75,7 @@ public void teamRemoveMemberTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamRemoveMember(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -90,6 +91,6 @@ public void teamUpdateTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamUpdate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/api/TemplateApiTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/api/TemplateApiTest.java index d69a9664f..5c1d04b29 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/api/TemplateApiTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/api/TemplateApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; @@ -25,7 +26,7 @@ public void templateAddUserTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateGetResponse response = api.templateAddUser(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -42,7 +43,7 @@ public void templateCreateEmbeddedDraftTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateCreateEmbeddedDraftResponse response = api.templateCreateEmbeddedDraft(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -68,7 +69,7 @@ public void templateGetTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateGetResponse response = api.templateGet(templateId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -82,7 +83,7 @@ public void templateListTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateListResponse response = api.templateList(accountId, 1, 20, null); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -100,7 +101,7 @@ public void templateRemoveUserTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateGetResponse response = api.templateRemoveUser(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -119,6 +120,6 @@ public void templateUpdateFilesTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateUpdateFilesResponse response = api.templateUpdateFiles(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v1/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java b/sdks/java-v1/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java index 6ee2b65ce..5d92e305f 100644 --- a/sdks/java-v1/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java +++ b/sdks/java-v1/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; @@ -24,7 +25,7 @@ public void unclaimedDraftCreateTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -41,7 +42,7 @@ public void unclaimedDraftCreateEmbeddedTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftCreateEmbedded(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -58,7 +59,7 @@ public void unclaimedDraftCreateEmbeddedWithTemplateTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftCreateEmbeddedWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -76,6 +77,6 @@ public void unclaimedDraftEditAndResendTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftEditAndResend(signatureRequestId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v1/templates/ApiClient.mustache b/sdks/java-v1/templates/ApiClient.mustache index 5191e6214..9cf548d44 100644 --- a/sdks/java-v1/templates/ApiClient.mustache +++ b/sdks/java-v1/templates/ApiClient.mustache @@ -1,25 +1,19 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; - -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} +{{#useJakartaEe}} +import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; +{{/useJakartaEe}} +{{^useJakartaEe}} import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; +{{/useJakartaEe}} import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; @@ -32,9 +26,9 @@ import com.sun.jersey.api.client.WebResource.Builder; import com.sun.jersey.multipart.FormDataMultiPart; import com.sun.jersey.multipart.file.FileDataBodyPart; -import javax.ws.rs.core.Cookie; -import javax.ws.rs.core.Response.Status.Family; -import javax.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Cookie; +import {{javaxPackage}}.ws.rs.core.Response.Status.Family; +import {{javaxPackage}}.ws.rs.core.MediaType; import java.util.Collection; import java.util.Collections; @@ -125,16 +119,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); @@ -144,8 +129,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -212,6 +197,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public ApiClient setBasePath(String basePath) { this.basePath = basePath; + this.serverIndex = null; return this; } @@ -552,7 +538,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { List params = new ArrayList(); // preconditions - if (name == null || name.isEmpty() || value == null) { + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { return params; } diff --git a/sdks/java-v1/templates/BeanValidationException.mustache b/sdks/java-v1/templates/BeanValidationException.mustache index 3fc5b8451..d8b0fa695 100644 --- a/sdks/java-v1/templates/BeanValidationException.mustache +++ b/sdks/java-v1/templates/BeanValidationException.mustache @@ -1,9 +1,11 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.ValidationException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ValidationException; public class BeanValidationException extends ValidationException { /** diff --git a/sdks/java-v1/templates/Configuration.mustache b/sdks/java-v1/templates/Configuration.mustache index cb425df35..8e9720e36 100644 --- a/sdks/java-v1/templates/Configuration.mustache +++ b/sdks/java-v1/templates/Configuration.mustache @@ -4,6 +4,8 @@ package {{invokerPackage}}; {{>generatedAnnotation}} public class Configuration { + public static final String VERSION = "{{{artifactVersion}}}"; + private static ApiClient defaultApiClient = new ApiClient(); /** diff --git a/sdks/java-v1/templates/CustomInstantDeserializer.mustache b/sdks/java-v1/templates/CustomInstantDeserializer.mustache index 5ebea810e..d4a3ca97e 100644 --- a/sdks/java-v1/templates/CustomInstantDeserializer.mustache +++ b/sdks/java-v1/templates/CustomInstantDeserializer.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.core.JsonParser; diff --git a/sdks/java-v1/templates/JSON.mustache b/sdks/java-v1/templates/JSON.mustache index 00c553067..1d0a81387 100644 --- a/sdks/java-v1/templates/JSON.mustache +++ b/sdks/java-v1/templates/JSON.mustache @@ -19,11 +19,6 @@ import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; @@ -36,11 +31,9 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/sdks/java-v1/templates/JavaTimeFormatter.mustache b/sdks/java-v1/templates/JavaTimeFormatter.mustache index 07d0eb6ce..f3fb34e55 100644 --- a/sdks/java-v1/templates/JavaTimeFormatter.mustache +++ b/sdks/java-v1/templates/JavaTimeFormatter.mustache @@ -1,16 +1,9 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{^threetenbp}} import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; -{{/threetenbp}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; -{{/threetenbp}} /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/sdks/java-v1/templates/README.mustache b/sdks/java-v1/templates/README.mustache index d752b709d..03b31fa7f 100644 --- a/sdks/java-v1/templates/README.mustache +++ b/sdks/java-v1/templates/README.mustache @@ -1,13 +1,60 @@ # {{artifactId}} +{{^useCustomTemplateCode}} +{{appName}} + +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +- Generator version: {{generatorVersion}} + +{{{appDescriptionWithNewLines}}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} +{{/useCustomTemplateCode}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) {{/infoUrl}} +{{^useCustomTemplateCode}} +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 1.8+ +{{#jersey2}} +2. Maven (3.8.3+)/Gradle (7.2+) +{{/jersey2}} +{{^jersey2}} +2. Maven/Gradle +{{/jersey2}} + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ## Migrating from legacy SDK This SDK is generated from our officially maintained [OpenAPI spec](https://github.com/hellosign/hellosign-openapi/blob/main/openapi.yaml). @@ -51,6 +98,7 @@ Run the following and everything is done for you: *Attention*: Any changes you have made to the SDK code that you have not made to the OAS file and/or the mustache template files _will be lost_ when you run this command. +{{/useCustomTemplateCode}} ### Maven users @@ -93,6 +141,7 @@ Then manually install the following JARs: - `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` - `target/lib/*.jar` +{{#useCustomTemplateCode}} ## Getting Started Please follow the [installation](#installation) instruction and execute the following Java code: @@ -103,34 +152,111 @@ REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Java_CODE ``` {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} {{#jersey2}} - ## Using a Proxy - - To add a HTTP proxy for the API client, use `ClientConfig`: - - ```java - {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} - import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; - import org.glassfish.jersey.client.ClientConfig; - import org.glassfish.jersey.client.ClientProperties; - import {{{invokerPackage}}}.*; - import {{{package}}}.{{{classname}}}; - - ... +{{^useCustomTemplateCode}} +## Usage +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +## Using a Proxy +{{/useCustomTemplateCode}} + +To add a HTTP proxy for the API client, use `ClientConfig`: +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import {{{invokerPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +... + +ApiClient defaultClient = Configuration.getDefaultApiClient(); +ClientConfig clientConfig = defaultClient.getClientConfig(); +clientConfig.connectorProvider(new ApacheConnectorProvider()); +clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); +clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); +clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); +defaultClient.setClientConfig(clientConfig); + +{{{classname}}} apiInstance = new {{{classname}}}(defaultClient); +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` - ApiClient defaultClient = Configuration.getDefaultApiClient(); - ClientConfig clientConfig = defaultClient.getClientConfig(); - clientConfig.connectorProvider(new ApacheConnectorProvider()); - clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); - clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); - clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); - defaultClient.setClientConfig(clientConfig); +{{/jersey2}} +{{^useCustomTemplateCode}} +## Getting Started - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - ``` +Please follow the [installation](#installation) instruction and execute the following Java code: -{{/jersey2}} +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import {{{invokerPackage}}}.*; +import {{{invokerPackage}}}.auth.*; +import {{{modelPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +public class {{{classname}}}Example { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}} + // Configure HTTP signature authorization: {{{name}}} + HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}"); + // All the HTTP signature parameters below should be customized to your environment. + // Configure the keyId + {{{name}}}.setKeyId("YOUR KEY ID"); + // Configure the signature algorithm + {{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019); + // Configure the specific cryptographic algorithm + {{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256); + // Configure the cryptographic algorithm parameters, if applicable + {{{name}}}.setAlgorithmParameterSpec(null); + // Set the cryptographic digest algorithm. + {{{name}}}.setDigestAlgorithm("SHA-256"); + // Set the HTTP headers that should be included in the HTTP signature. + {{{name}}}.setHeaders(Arrays.asList("date", "host")); + // Set the private key used to sign the HTTP messages + {{{name}}}.setPrivateKey();{{/isHttpSignature}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` +{{/useCustomTemplateCode}} ## Documentation for API Endpoints @@ -146,11 +272,14 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}} @@ -158,10 +287,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth @@ -183,6 +320,7 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} +{{#useCustomTemplateCode}} ## About this package This Java package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -220,3 +358,4 @@ mvn clean deploy ``` Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. +{{/useCustomTemplateCode}} diff --git a/sdks/java-v1/templates/RFC3339DateFormat.mustache b/sdks/java-v1/templates/RFC3339DateFormat.mustache index 46c7bb46d..d35040f05 100644 --- a/sdks/java-v1/templates/RFC3339DateFormat.mustache +++ b/sdks/java-v1/templates/RFC3339DateFormat.mustache @@ -7,9 +7,11 @@ import java.text.DateFormat; import java.text.FieldPosition; import java.text.ParsePosition; import java.util.Date; +import java.text.DecimalFormat; import java.util.GregorianCalendar; import java.util.TimeZone; +{{>generatedAnnotation}} public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); @@ -20,6 +22,7 @@ public class RFC3339DateFormat extends DateFormat { public RFC3339DateFormat() { this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); } @Override @@ -41,4 +44,4 @@ public class RFC3339DateFormat extends DateFormat { public Object clone() { return super.clone(); } -} \ No newline at end of file +} diff --git a/sdks/java-v1/templates/ServerConfiguration.mustache b/sdks/java-v1/templates/ServerConfiguration.mustache index e21b63391..728400427 100644 --- a/sdks/java-v1/templates/ServerConfiguration.mustache +++ b/sdks/java-v1/templates/ServerConfiguration.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.Map; @@ -5,6 +7,7 @@ import java.util.Map; /** * Representing a Server configuration. */ +{{>generatedAnnotation}} public class ServerConfiguration { public String URL; public String description; @@ -39,10 +42,10 @@ public class ServerConfiguration { if (variables != null && variables.containsKey(name)) { value = variables.get(name); if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/sdks/java-v1/templates/ServerVariable.mustache b/sdks/java-v1/templates/ServerVariable.mustache index 1978b1eb9..41246a7ac 100644 --- a/sdks/java-v1/templates/ServerVariable.mustache +++ b/sdks/java-v1/templates/ServerVariable.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.HashSet; @@ -5,6 +7,7 @@ import java.util.HashSet; /** * Representing a Server Variable for server URL template substitution. */ +{{>generatedAnnotation}} public class ServerVariable { public String description; public String defaultValue; diff --git a/sdks/java-v1/templates/additionalOneOfTypeAnnotations.mustache b/sdks/java-v1/templates/additionalOneOfTypeAnnotations.mustache new file mode 100644 index 000000000..283f8f91e --- /dev/null +++ b/sdks/java-v1/templates/additionalOneOfTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalOneOfTypeAnnotations}}{{{.}}} +{{/additionalOneOfTypeAnnotations}} \ No newline at end of file diff --git a/sdks/java-v1/templates/api.mustache b/sdks/java-v1/templates/api.mustache index 28b18e2d1..8ce0ae1c4 100644 --- a/sdks/java-v1/templates/api.mustache +++ b/sdks/java-v1/templates/api.mustache @@ -13,12 +13,10 @@ import {{invokerPackage}}.Pair; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} {{>generatedAnnotation}} {{#operations}} @@ -46,7 +44,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} {{#returnType}} * @return {{.}} @@ -76,11 +74,11 @@ public class {{classname}} { .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#queryParams}} {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); diff --git a/sdks/java-v1/templates/apiException.mustache b/sdks/java-v1/templates/apiException.mustache index 5b450c9ba..894486729 100644 --- a/sdks/java-v1/templates/apiException.mustache +++ b/sdks/java-v1/templates/apiException.mustache @@ -7,6 +7,8 @@ import java.util.List; {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; @@ -37,7 +39,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us } public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); } public ApiException(int code, String message) { @@ -77,4 +79,13 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } + + @Override + public String toString() { + return "ApiException{" + + "code=" + code + + ", responseHeaders=" + responseHeaders + + ", responseBody='" + responseBody + '\'' + + '}'; + } } diff --git a/sdks/java-v1/templates/api_doc.mustache b/sdks/java-v1/templates/api_doc.mustache index 78783f194..5ab8c9d93 100644 --- a/sdks/java-v1/templates/api_doc.mustache +++ b/sdks/java-v1/templates/api_doc.mustache @@ -4,10 +4,18 @@ All URIs are relative to *{{basePath}}* +{{^useCustomTemplateCode}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} | +{{/operation}}{{/operations}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} Method | HTTP request | Description ------------- | ------------- | ------------- {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} {{/operation}}{{/operations}} +{{/useCustomTemplateCode}} {{#operations}} {{#operation}} @@ -75,11 +83,20 @@ public class Example { ### Parameters +{{^useCustomTemplateCode}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} {{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} +{{/useCustomTemplateCode}} ### Return type diff --git a/sdks/java-v1/templates/api_test.mustache b/sdks/java-v1/templates/api_test.mustache index b3a544d4c..155f46e40 100644 --- a/sdks/java-v1/templates/api_test.mustache +++ b/sdks/java-v1/templates/api_test.mustache @@ -5,21 +5,21 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} /** * API tests for {{classname}} */ -public class {{classname}}Test { +class {{classname}}Test { private final {{classname}} api = new {{classname}}(); @@ -38,7 +38,7 @@ public class {{classname}}Test { * if the Api call fails */ @Test - public void {{operationId}}Test() throws ApiException { + void {{operationId}}Test() throws ApiException { //{{#allParams}} //{{{dataType}}} {{paramName}} = null; //{{/allParams}} diff --git a/sdks/java-v1/templates/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/auth/HttpBasicAuth.mustache index 4d362cbaf..b5c72de6e 100644 --- a/sdks/java-v1/templates/auth/HttpBasicAuth.mustache +++ b/sdks/java-v1/templates/auth/HttpBasicAuth.mustache @@ -4,21 +4,12 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; -{{^java8}} -import com.migcomponents.migbase64.Base64; -{{/java8}} -{{#java8}} import java.util.Base64; import java.nio.charset.StandardCharsets; -{{/java8}} import java.util.Map; import java.util.List; -{{^java8}} -import java.io.UnsupportedEncodingException; -{{/java8}} - {{>generatedAnnotation}} public class HttpBasicAuth implements Authentication { private String username; @@ -46,15 +37,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); -{{^java8}} - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } -{{/java8}} -{{#java8}} headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); -{{/java8}} } } diff --git a/sdks/java-v1/templates/auth/HttpBearerAuth.mustache b/sdks/java-v1/templates/auth/HttpBearerAuth.mustache index 322281f87..6ed21107d 100644 --- a/sdks/java-v1/templates/auth/HttpBearerAuth.mustache +++ b/sdks/java-v1/templates/auth/HttpBearerAuth.mustache @@ -4,13 +4,15 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; -import java.util.Map; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; {{>generatedAnnotation}} public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -22,7 +24,7 @@ public class HttpBearerAuth implements Authentication { * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** @@ -31,12 +33,22 @@ public class HttpBearerAuth implements Authentication { * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if(bearerToken == null) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { return; } diff --git a/sdks/java-v1/templates/auth/OAuthFlow.mustache b/sdks/java-v1/templates/auth/OAuthFlow.mustache index 05bbf28dd..7a4252662 100644 --- a/sdks/java-v1/templates/auth/OAuthFlow.mustache +++ b/sdks/java-v1/templates/auth/OAuthFlow.mustache @@ -2,10 +2,13 @@ package {{invokerPackage}}.auth; +/** + * OAuth flows that are supported by this client + */ {{>generatedAnnotation}} public enum OAuthFlow { - accessCode, //called authorizationCode in OpenAPI 3.0 - implicit, - password, - application //called clientCredentials in OpenAPI 3.0 + ACCESS_CODE, //called authorizationCode in OpenAPI 3.0 + IMPLICIT, + PASSWORD, + APPLICATION //called clientCredentials in OpenAPI 3.0 } diff --git a/sdks/java-v1/templates/beanValidation.mustache b/sdks/java-v1/templates/beanValidation.mustache index 1bc9afa8f..47f7109e5 100644 --- a/sdks/java-v1/templates/beanValidation.mustache +++ b/sdks/java-v1/templates/beanValidation.mustache @@ -1,5 +1,7 @@ {{#required}} +{{^isReadOnly}} @NotNull +{{/isReadOnly}} {{/required}} {{#isContainer}} {{^isPrimitiveType}} diff --git a/sdks/java-v1/templates/beanValidationQueryParams.mustache b/sdks/java-v1/templates/beanValidationQueryParams.mustache index c4ff01d7e..0f99bffde 100644 --- a/sdks/java-v1/templates/beanValidationQueryParams.mustache +++ b/sdks/java-v1/templates/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull {{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/sdks/java-v1/templates/build.gradle.mustache b/sdks/java-v1/templates/build.gradle.mustache index d9718c1e5..06f9bd5e9 100644 --- a/sdks/java-v1/templates/build.gradle.mustache +++ b/sdks/java-v1/templates/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -126,18 +114,18 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.12.5" - jackson_databind_version = "2.10.5.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} + {{#useBeanValidation}} + bean_validation_version = "3.0.2" + {{/useBeanValidation}} jersey_version = "1.19.4" jodatime_version = "2.9.9" - junit_version = "4.13.1" + junit_version = "5.10.2" } dependencies { @@ -155,15 +143,26 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + {{#useBeanValidation}} + implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + {{/useBeanValidation}} testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + } diff --git a/sdks/java-v1/templates/generatedAnnotation.mustache b/sdks/java-v1/templates/generatedAnnotation.mustache index 875d7b97a..e05689d5f 100644 --- a/sdks/java-v1/templates/generatedAnnotation.mustache +++ b/sdks/java-v1/templates/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/sdks/java-v1/templates/gitignore.mustache b/sdks/java-v1/templates/gitignore.mustache index b6717f0ee..7973a3bc5 100644 --- a/sdks/java-v1/templates/gitignore.mustache +++ b/sdks/java-v1/templates/gitignore.mustache @@ -8,8 +8,10 @@ *.war *.ear +{{^useCustomTemplateCode}} # exclude jar for gradle wrapper !gradle/wrapper/*.jar +{{/useCustomTemplateCode}} # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* @@ -18,12 +20,13 @@ hs_err_pid* **/target target .gradle -build/ +build +{{#useCustomTemplateCode}} .composer vendor - -# Intellij .idea/ - .openapi-generator +.github/workflows/maven.yml +gradle +{{/useCustomTemplateCode}} diff --git a/sdks/java-v1/templates/gradle-wrapper.properties.mustache b/sdks/java-v1/templates/gradle-wrapper.properties.mustache index 774fae876..552ae67dd 100644 --- a/sdks/java-v1/templates/gradle-wrapper.properties.mustache +++ b/sdks/java-v1/templates/gradle-wrapper.properties.mustache @@ -1,5 +1,12 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +{{^useCustomTemplateCode}} +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +{{/useCustomTemplateCode}} +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sdks/java-v1/templates/gradle.properties.mustache b/sdks/java-v1/templates/gradle.properties.mustache index d445b39c4..101f52b9b 100644 --- a/sdks/java-v1/templates/gradle.properties.mustache +++ b/sdks/java-v1/templates/gradle.properties.mustache @@ -4,6 +4,7 @@ # Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties # For example, uncomment below to build for Android #target = android +{{#useCustomTemplateCode}} GROUP={{groupId}} POM_ARTIFACT_ID={{artifactId}} VERSION_NAME={{artifactVersion}} @@ -30,6 +31,7 @@ RELEASE_SIGNING_ENABLED=true SONATYPE_CONNECT_TIMEOUT_SECONDS=300 SONATYPE_CLOSE_TIMEOUT_SECONDS=900 +{{/useCustomTemplateCode}} {{#gradleProperties}} {{{.}}} {{/gradleProperties}} diff --git a/sdks/java-v1/templates/gradlew.bat.mustache b/sdks/java-v1/templates/gradlew.bat.mustache index 6a68175eb..25da30dbd 100644 --- a/sdks/java-v1/templates/gradlew.bat.mustache +++ b/sdks/java-v1/templates/gradlew.bat.mustache @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/sdks/java-v1/templates/gradlew.mustache b/sdks/java-v1/templates/gradlew.mustache index 005bcde04..9d0ce634c 100644 --- a/sdks/java-v1/templates/gradlew.mustache +++ b/sdks/java-v1/templates/gradlew.mustache @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi +fi else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/sdks/java-v1/templates/jackson_annotations.mustache b/sdks/java-v1/templates/jackson_annotations.mustache index ccde126f5..4fbaf983b 100644 --- a/sdks/java-v1/templates/jackson_annotations.mustache +++ b/sdks/java-v1/templates/jackson_annotations.mustache @@ -6,14 +6,9 @@ }} @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) - {{#withXml}} - {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - {{#isXmlWrapped}} - // items.xmlName={{items.xmlName}} - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/withXml}} \ No newline at end of file +{{#withXml}} + @JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isContainer}} + @JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}}) + {{/isContainer}} +{{/withXml}} \ No newline at end of file diff --git a/sdks/java-v1/templates/javaBuilder.mustache b/sdks/java-v1/templates/javaBuilder.mustache new file mode 100644 index 000000000..c02730081 --- /dev/null +++ b/sdks/java-v1/templates/javaBuilder.mustache @@ -0,0 +1,82 @@ +public static class Builder {{#parentModel}}extends {{classname}}.Builder {{/parentModel}}{ + + private {{classname}} instance; + + public Builder() { + this(new {{classname}}()); + } + + protected Builder({{classname}} instance) { + {{#parentModel}} + super(instance); + {{/parentModel}} + this.instance = instance; + } + + {{#vars}} + public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.instance.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.instance.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{#vendorExtensions.x-is-jackson-optional-nullable}} + public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + this.instance.{{name}} = {{name}}; + return this; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{/vars}} + +{{#parentVars}} + public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { // inherited: {{isInherited}} + super.{{name}}({{name}}); + return this; + } + {{#vendorExtensions.x-is-jackson-optional-nullable}} + public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + this.instance.{{name}} = {{name}}; + return this; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{/parentVars}} + + /** + * returns a built {{classname}} instance. + * + * The builder is not reusable. + */ + public {{classname}} build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused{{#parentModel}} + super.build();{{/parentModel}} + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static {{classname}}.Builder builder() { + return new {{classname}}.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public {{classname}}.Builder toBuilder() { + return new {{classname}}.Builder(){{#allVars}} + .{{name}}({{getter}}()){{/allVars}}; + } diff --git a/sdks/java-v1/templates/libraries/apache-httpclient/ApiClient.mustache b/sdks/java-v1/templates/libraries/apache-httpclient/ApiClient.mustache index 371f8ee72..a00c6dc45 100644 --- a/sdks/java-v1/templates/libraries/apache-httpclient/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/apache-httpclient/ApiClient.mustache @@ -1,52 +1,42 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; - -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} -import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JavaType; - -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.HttpStatus; -import org.apache.http.NameValuePair; -import org.apache.http.ParseException; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.RequestBuilder; -import org.apache.http.client.protocol.HttpClientContext; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.FileEntity; -import org.apache.http.entity.StringEntity; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.impl.client.BasicCookieStore; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.cookie.BasicClientCookie; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; -import org.apache.http.cookie.Cookie; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} + +import org.apache.hc.client5.http.cookie.BasicCookieStore; +import org.apache.hc.client5.http.cookie.Cookie; +import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; +import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder; +import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; +import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse; +import org.apache.hc.client5.http.impl.classic.HttpClients; +import org.apache.hc.client5.http.impl.cookie.BasicClientCookie; +import org.apache.hc.client5.http.protocol.HttpClientContext; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.Header; +import org.apache.hc.core5.http.HttpEntity; +import org.apache.hc.core5.http.HttpResponse; +import org.apache.hc.core5.http.HttpStatus; +import org.apache.hc.core5.http.NameValuePair; +import org.apache.hc.core5.http.ParseException; +import org.apache.hc.core5.http.io.entity.ByteArrayEntity; +import org.apache.hc.core5.http.io.entity.EntityUtils; +import org.apache.hc.core5.http.io.entity.FileEntity; +import org.apache.hc.core5.http.io.entity.StringEntity; +import org.apache.hc.core5.http.io.support.ClassicRequestBuilder; +import org.apache.hc.core5.http.message.BasicNameValuePair; import java.util.Collection; import java.util.Collections; @@ -58,7 +48,9 @@ import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.function.Supplier; import java.util.TimeZone; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -68,6 +60,9 @@ import java.io.File; import java.io.InputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.charset.UnsupportedCharsetException; import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.nio.file.Paths; @@ -131,8 +126,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private Map authentications; - private int statusCode; - private Map> responseHeaders; + private Map lastStatusCodeByThread = new ConcurrentHashMap<>(); + private Map>> lastResponseHeadersByThread = new ConcurrentHashMap<>(); private DateFormat dateFormat; @@ -150,16 +145,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} + {{#openApiNullable}} + objectMapper.registerModule(new JsonNullableModule()); + {{/openApiNullable}} objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); @@ -169,8 +158,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -200,6 +189,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the object mapper. + * + * @param objectMapper object mapper * @return API client */ public ApiClient setObjectMapper(ObjectMapper objectMapper) { @@ -212,6 +204,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the HTTP client. + * + * @param httpClient HTTP client * @return API client */ public ApiClient setHttpClient(CloseableHttpClient httpClient) { @@ -224,6 +219,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the base path. + * + * @param basePath base path * @return API client */ public ApiClient setBasePath(String basePath) { @@ -237,6 +235,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the server. + * + * @param servers a list of server configuration * @return API client */ public ApiClient setServers(List servers) { @@ -249,6 +250,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the server index. + * + * @param serverIndex server index * @return API client */ public ApiClient setServerIndex(Integer serverIndex) { @@ -261,6 +265,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the server variables. + * + * @param serverVariables server variables * @return API client */ public ApiClient setServerVariables(Map serverVariables) { @@ -270,18 +277,21 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** * Gets the status code of the previous request + * * @return Status code */ + @Deprecated public int getStatusCode() { - return statusCode; + return lastStatusCodeByThread.get(Thread.currentThread().getId()); } /** * Gets the response headers of the previous request * @return Response headers */ + @Deprecated public Map> getResponseHeaders() { - return responseHeaders; + return lastResponseHeadersByThread.get(Thread.currentThread().getId()); } /** @@ -329,6 +339,20 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RuntimeException("No Bearer authentication configured!"); } + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier the token supplier function + */ + public void setBearerToken(Supplier tokenSupplier) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } {{/hasHttpBearerMethods}} {{#hasHttpBasicMethods}} @@ -580,9 +604,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { List params = new ArrayList(); // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params; + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } - params.add(new Pair(name, parameterToString(value))); + params.add(new Pair(name, escapeString(parameterToString(value)))); return params; } @@ -600,7 +626,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { List params = new ArrayList(); // preconditions - if (name == null || name.isEmpty() || value == null) { + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { return params; } @@ -707,7 +733,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** - * Transform response headers into map + * Transforms response headers into map. + * + * @param headers HTTP headers + * @return a map of string array */ protected Map> transformResponseHeaders(Header[] headers) { Map> headersMap = new HashMap<>(); @@ -730,7 +759,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private ContentType getContentType(String headerValue) throws ApiException { try { return ContentType.parse(headerValue); - } catch (ParseException e) { + } catch (UnsupportedCharsetException e) { throw new ApiException("Could not parse content type " + headerValue); } } @@ -759,7 +788,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String mimeType = contentType.getMimeType(); if (isJsonMime(mimeType)) { try { - return new StringEntity(objectMapper.writeValueAsString(obj), contentType); + return new StringEntity(objectMapper.writeValueAsString(obj), contentType.withCharset(StandardCharsets.UTF_8)); } catch (JsonProcessingException e) { throw new ApiException(e); } @@ -772,7 +801,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else if (value instanceof byte[]) { multiPartBuilder.addBinaryBody(paramEntry.getKey(), (byte[]) value); } else { - multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue())); + Charset charset = contentType.getCharset(); + if (charset != null) { + ContentType customContentType = ContentType.create(ContentType.TEXT_PLAIN.getMimeType(), charset); + multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue()), + customContentType); + } else { + multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue())); + } } } return multiPartBuilder.build(); @@ -781,11 +817,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { for (Entry paramEntry : formParams.entrySet()) { formValues.add(new BasicNameValuePair(paramEntry.getKey(), parameterToString(paramEntry.getValue()))); } - try { - return new UrlEncodedFormEntity(formValues); - } catch (UnsupportedEncodingException e) { - throw new ApiException(e); - } + return new UrlEncodedFormEntity(formValues, contentType.getCharset()); } else { // Handle files with unknown content type if (obj instanceof File) { @@ -798,9 +830,17 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** - * Deserialize response content + * Deserialize response body to Java object according to the Content-Type. + * + * @param Type + * @param response Response + * @param valueType Return type + * @return Deserialized object + * @throws ApiException API exception + * @throws IOException IO exception */ - public T deserialize(HttpResponse response, TypeReference valueType) throws ApiException, IOException { + @SuppressWarnings("unchecked") + public T deserialize(CloseableHttpResponse response, TypeReference valueType) throws ApiException, IOException, ParseException { if (valueType == null) { return null; } @@ -814,18 +854,29 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String mimeType = getResponseMimeType(response); if (mimeType == null || isJsonMime(mimeType)) { // Assume json if no mime type - return objectMapper.readValue(entity.getContent(), valueType); + // convert input stream to string + String content = EntityUtils.toString(entity); + + if ("".equals(content)) { // returns null for empty body + return null; + } + + return objectMapper.readValue(content, valueType); + } else if (mimeType.toLowerCase().startsWith("text/")) { + // convert input stream to string + return (T) EntityUtils.toString(entity); } else { + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); throw new ApiException( "Deserialization for content type '" + mimeType + "' not supported for type '" + valueType + "'", - response.getStatusLine().getStatusCode(), + response.getCode(), responseHeaders, EntityUtils.toString(entity) ); } } - private File downloadFileFromResponse(HttpResponse response) throws IOException { + private File downloadFileFromResponse(CloseableHttpResponse response) throws IOException { Header contentDispositionHeader = response.getFirstHeader("Content-Disposition"); String contentDisposition = contentDispositionHeader == null ? null : contentDispositionHeader.getValue(); File file = prepareDownloadFile(contentDisposition); @@ -868,14 +919,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** - * Build full URL by concatenating base path, the given sub path and query parameters. + * Returns the URL of the client as defined by the server (if exists) or the base path. * - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL + * @return The URL for the client. */ - private String buildUrl(String path, List queryParams, List collectionQueryParams) { + public String getBaseURL() { String baseURL; if (serverIndex != null) { if (serverIndex < 0 || serverIndex >= servers.size()) { @@ -887,6 +935,20 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { baseURL = basePath; } + return baseURL; + } + + /** + * Build full URL by concatenating base URL, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param urlQueryDeepObject URL query string of the deep object parameters + * @return The full URL + */ + private String buildUrl(String path, List queryParams, List collectionQueryParams, String urlQueryDeepObject) { + String baseURL = getBaseURL(); final StringBuilder url = new StringBuilder(); url.append(baseURL).append(path); @@ -903,7 +965,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { url.append("&"); } String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + // query parameter value already escaped as part of parameterToPair + url.append(escapeString(param.getName())).append("=").append(value); } } } @@ -925,6 +988,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } + if (urlQueryDeepObject != null && urlQueryDeepObject.length() > 0) { + url.append(url.toString().contains("?") ? "&" : "?"); + url.append(urlQueryDeepObject); + } + return url.toString(); } @@ -943,13 +1011,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return cookie; } - protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException { - statusCode = response.getStatusLine().getStatusCode(); + protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException, ParseException { + int statusCode = response.getCode(); + lastStatusCodeByThread.put(Thread.currentThread().getId(), statusCode); if (statusCode == HttpStatus.SC_NO_CONTENT) { return null; } - responseHeaders = transformResponseHeaders(response.getAllHeaders()); + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); + lastResponseHeadersByThread.put(Thread.currentThread().getId(), responseHeaders); + if (isSuccessfulStatus(statusCode)) { return this.deserialize(response, returnType); } else { @@ -966,6 +1037,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param method The request method, one of "GET", "POST", "PUT", and "DELETE" * @param queryParams The query parameters * @param collectionQueryParams The collection query parameters + * @param urlQueryDeepObject A URL query string for deep object parameters * @param body The request body object - if it is not binary, otherwise null * @param headerParams The header parameters * @param cookieParams The cookie parameters @@ -982,6 +1054,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String method, List queryParams, List collectionQueryParams, + String urlQueryDeepObject, Object body, Map headerParams, Map cookieParams, @@ -995,16 +1068,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - final String url = buildUrl(path, queryParams, collectionQueryParams); + final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject); - RequestBuilder builder = RequestBuilder.create(method); + ClassicRequestBuilder builder = ClassicRequestBuilder.create(method); builder.setUri(url); - RequestConfig config = RequestConfig.custom() - .setConnectionRequestTimeout(connectionTimeout) - .build(); - builder.setConfig(config); - if (accept != null) { builder.addHeader("Accept", accept); } @@ -1038,11 +1106,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { throw new ApiException("method " + method + " does not support a request body"); } + } else { + // for empty body + builder.setEntity(new StringEntity("", contentTypeObj)); } try (CloseableHttpResponse response = httpClient.execute(builder.build(), context)) { return processResponse(response, returnType); - } catch (IOException e) { + } catch (IOException | ParseException e) { throw new ApiException(e); } } diff --git a/sdks/java-v1/templates/libraries/apache-httpclient/BaseApi.mustache b/sdks/java-v1/templates/libraries/apache-httpclient/BaseApi.mustache new file mode 100644 index 000000000..8b48de086 --- /dev/null +++ b/sdks/java-v1/templates/libraries/apache-httpclient/BaseApi.mustache @@ -0,0 +1,110 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import com.fasterxml.jackson.core.type.TypeReference; + +import java.util.Collections; +import java.util.Map; + +{{>generatedAnnotation}} +public abstract class BaseApi { + + protected ApiClient apiClient; + + public BaseApi() { + this(Configuration.getDefaultApiClient()); + } + + public BaseApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method) throws ApiException { + invokeAPI(url, method, null, null, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param additionalHeaders Additional headers for the request. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method, Map additionalHeaders) throws ApiException { + invokeAPI(url, method, null, null, additionalHeaders); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method, Object request) throws ApiException { + invokeAPI(url, method, request, null, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param additionalHeaders Additional headers for the request. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method, Object request, Map additionalHeaders) throws ApiException { + invokeAPI(url, method, request, null, additionalHeaders); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param returnType The return type. + * @return The API response in the specified type. + * @throws ApiException if fails to make API call. + */ + public T invokeAPI(String url, String method, TypeReference returnType) throws ApiException { + return invokeAPI(url, method, null, returnType, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @return The API response in the specified type. + * @throws ApiException if fails to make API call. + */ + public T invokeAPI(String url, String method, Object request, TypeReference returnType) throws ApiException { + return invokeAPI(url, method, request, returnType, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @param additionalHeaders Additional headers for the request. + * @return The API response in the specified type. + * @throws ApiException if fails to make API call. + */ + public abstract T invokeAPI(String url, String method, Object request, TypeReference returnType, Map additionalHeaders) throws ApiException; +} diff --git a/sdks/java-v1/templates/libraries/apache-httpclient/README.mustache b/sdks/java-v1/templates/libraries/apache-httpclient/README.mustache index 9082f626b..b50e7db08 100644 --- a/sdks/java-v1/templates/libraries/apache-httpclient/README.mustache +++ b/sdks/java-v1/templates/libraries/apache-httpclient/README.mustache @@ -8,6 +8,8 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} + {{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} {{#infoUrl}} @@ -20,7 +22,7 @@ Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ +1. Java 1.8+ 2. Maven/Gradle ## Installation @@ -158,11 +160,14 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}} @@ -170,10 +175,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth diff --git a/sdks/java-v1/templates/libraries/apache-httpclient/api.mustache b/sdks/java-v1/templates/libraries/apache-httpclient/api.mustache index 44122a1e0..27b456417 100644 --- a/sdks/java-v1/templates/libraries/apache-httpclient/api.mustache +++ b/sdks/java-v1/templates/libraries/apache-httpclient/api.mustache @@ -5,49 +5,75 @@ import com.fasterxml.jackson.core.type.TypeReference; import {{invokerPackage}}.ApiException; import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.BaseApi; import {{invokerPackage}}.Configuration; +{{#models.0}} import {{modelPackage}}.*; +{{/models.0}} import {{invokerPackage}}.Pair; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +import java.util.StringJoiner; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} {{>generatedAnnotation}} {{#operations}} -public class {{classname}} { - private ApiClient apiClient; +public class {{classname}} extends BaseApi { public {{classname}}() { - this(Configuration.getDefaultApiClient()); + super(Configuration.getDefaultApiClient()); } public {{classname}}(ApiClient apiClient) { - this.apiClient = apiClient; + super(apiClient); } - public ApiClient getApiClient() { - return apiClient; + {{#operation}} + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} + {{/allParams}} + {{#returnType}} + * @return {{returnType}} + {{/returnType}} + * @throws ApiException if fails to make API call + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{#returnType}}return {{/returnType}}this.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}Collections.emptyMap()); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - {{#operation}} /** * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} + * @param additionalHeaders additionalHeaders for this call {{#returnType}} * @return {{returnType}} {{/returnType}} @@ -63,7 +89,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Map additionalHeaders) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -75,21 +101,58 @@ public class {{classname}} { String localVarPath = "{{{path}}}"{{#pathParams}} .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; - // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#queryParams}} + {{#isDeepObject}} + localVarQueryParameterBaseName = "{{{baseName}}}"; + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + localVarQueryStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i))); + } + {{/isArray}} + {{^isArray}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}")); + {{/isArray}} + {{/isDeepObject}} + {{^isDeepObject}} + {{#isExplode}} + {{#hasVars}} + {{#vars}} + {{#isArray}} + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{^isArray}} + localVarQueryParams.addAll(apiClient.parameterToPair("{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{/vars}} + {{/hasVars}} + {{^hasVars}} + {{#isModel}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString()); + {{/isModel}} + {{^isModel}} + {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{/isModel}} + {{/hasVars}} + {{/isExplode}} + {{^isExplode}} {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{/isExplode}} + {{/isDeepObject}} {{/queryParams}} - {{#headerParams}}if ({{paramName}} != null) localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); {{/headerParams}} + localVarHeaderParams.putAll(additionalHeaders); + {{#cookieParams}}if ({{paramName}} != null) localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); {{/cookieParams}} @@ -121,6 +184,7 @@ public class {{classname}} { "{{httpMethod}}", localVarQueryParams, localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, localVarCookieParams, @@ -131,6 +195,49 @@ public class {{classname}} { {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}} ); } + + {{#-last}} + @Override + public T invokeAPI(String url, String method, Object request, TypeReference returnType, Map additionalHeaders) throws ApiException { + String localVarPath = url.replace(apiClient.getBaseURL(), ""); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + + return apiClient.invokeAPI( + localVarPath, + method, + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + request, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + returnType + ); + } + {{/-last}} {{/operation}} } {{/operations}} diff --git a/sdks/java-v1/templates/libraries/apache-httpclient/api_test.mustache b/sdks/java-v1/templates/libraries/apache-httpclient/api_test.mustache index 8071e035f..b4393ea82 100644 --- a/sdks/java-v1/templates/libraries/apache-httpclient/api_test.mustache +++ b/sdks/java-v1/templates/libraries/apache-httpclient/api_test.mustache @@ -5,21 +5,26 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); diff --git a/sdks/java-v1/templates/libraries/apache-httpclient/build.gradle.mustache b/sdks/java-v1/templates/libraries/apache-httpclient/build.gradle.mustache index 5ae33f37e..f18581f08 100644 --- a/sdks/java-v1/templates/libraries/apache-httpclient/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/apache-httpclient/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -125,26 +113,22 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" - jackson_databind_version = "2.10.5.1" + swagger_annotations_version = "1.6.6" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} - httpclient_version = "4.5.13" + httpclient_version = "5.1.3" jodatime_version = "2.9.9" - junit_version = "4.13.1" + junit_version = "4.13.2" } dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation "org.apache.httpcomponents:httpclient:$httpclient_version" - implementation "org.apache.httpcomponents:httpmime:$httpclient_version" + implementation "org.apache.httpcomponents.client5:httpclient5:$httpclient_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" @@ -155,15 +139,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/sdks/java-v1/templates/libraries/apache-httpclient/pom.mustache b/sdks/java-v1/templates/libraries/apache-httpclient/pom.mustache index 89c3f5ffa..74a70a3ea 100644 --- a/sdks/java-v1/templates/libraries/apache-httpclient/pom.mustache +++ b/sdks/java-v1/templates/libraries/apache-httpclient/pom.mustache @@ -43,8 +43,10 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.10.1 + 1.8 + 1.8 true 128m 512m @@ -58,7 +60,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.1.0 enforce-maven @@ -78,17 +80,17 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.2.5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods - pertest + 10 @@ -110,11 +112,10 @@ org.apache.maven.plugins maven-jar-plugin - 2.2 + 3.3.0 - jar test-jar @@ -126,7 +127,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.10 + 3.3.0 add_sources @@ -154,33 +155,13 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} - - org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.4.1 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -194,7 +175,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.2.1 attach-sources @@ -215,7 +196,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 sign-artifacts @@ -232,11 +213,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -248,13 +238,8 @@ - org.apache.httpcomponents - httpclient - ${httpclient-version} - - - org.apache.httpcomponents - httpmime + org.apache.httpcomponents.client5 + httpclient5 ${httpclient-version} @@ -272,78 +257,77 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} + {{^useJakartaEe}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + {{/useJakartaEe}} + {{#useJakartaEe}} + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{/useJakartaEe}} {{#withXml}} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + {{/withXml}} {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + {{/joda}} - {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} - {{^java8}} - - - com.brsanthu - migbase64 - 2.2 - - {{/java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + {{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + {{/useBeanValidation}} {{#performBeanValidation}} - - - org.hibernate - hibernate-validator - 5.4.1.Final - + + + org.hibernate + hibernate-validator + 5.4.3.Final + {{/performBeanValidation}} {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - + + + com.google.android + android + 4.1.1.4 + provided + {{/parcelableModel}} + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} jakarta.annotation jakarta.annotation-api @@ -352,25 +336,35 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.5.21 - 4.5.13 - 2.12.1 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 5.2.1 + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 1.0.0 - 4.13.1 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 5.10.2 diff --git a/sdks/java-v1/templates/libraries/feign/ApiClient.mustache b/sdks/java-v1/templates/libraries/feign/ApiClient.mustache index 5c4e78970..9a5b9bcd0 100644 --- a/sdks/java-v1/templates/libraries/feign/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/feign/ApiClient.mustache @@ -1,41 +1,47 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.LinkedHashMap; import java.util.Map; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} +{{#jackson}} import feign.okhttp.OkHttpClient; - import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} +{{/jackson}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} +{{#jackson}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} +{{/jackson}} import feign.Feign; import feign.RequestInterceptor; import feign.form.FormEncoder; +{{#jackson}} import feign.jackson.JacksonDecoder; import feign.jackson.JacksonEncoder; +{{/jackson}} +{{#gson}} +import feign.gson.GsonDecoder; +import feign.gson.GsonEncoder; +{{/gson}} import feign.slf4j.Slf4jLogger; import {{invokerPackage}}.auth.HttpBasicAuth; import {{invokerPackage}}.auth.HttpBearerAuth; import {{invokerPackage}}.auth.ApiKeyAuth; +{{#jackson}} import {{invokerPackage}}.ApiResponseDecoder; +{{/jackson}} {{#hasOAuthMethods}} import {{invokerPackage}}.auth.ApiErrorDecoder; @@ -53,14 +59,17 @@ public class ApiClient { public interface Api {} + {{#jackson}} protected ObjectMapper objectMapper; + {{/jackson}} private String basePath = "{{{basePath}}}"; private Map apiAuthorizations; private Feign.Builder feignBuilder; public ApiClient() { - objectMapper = createObjectMapper(); apiAuthorizations = new LinkedHashMap(); + {{#jackson}} + objectMapper = createObjectMapper(); feignBuilder = Feign.builder() .client(new OkHttpClient()) .encoder(new FormEncoder(new JacksonEncoder(objectMapper))) @@ -70,6 +79,17 @@ public class ApiClient { .retryer(new Retryer.Default(0, 0, 2)) {{/hasOAuthMethods}} .logger(new Slf4jLogger()); + {{/jackson}} + {{#gson}} + feignBuilder = Feign.builder() + .encoder(new FormEncoder(new GsonEncoder())) + .decoder(new GsonDecoder()) + {{#hasOAuthMethods}} + .errorDecoder(new ApiErrorDecoder()) + .retryer(new Retryer.Default(0, 0, 2)) + {{/hasOAuthMethods}} + .logger(new Slf4jLogger()); + {{/gson}} } public ApiClient(String[] authNames) { @@ -77,26 +97,26 @@ public class ApiClient { for(String authName : authNames) { log.log(Level.FINE, "Creating authentication {0}", authName); {{#hasAuthMethods}} - RequestInterceptor auth; + RequestInterceptor auth = null; {{#authMethods}}if ("{{name}}".equals(authName)) { - {{#isBasic}} {{#isBasicBasic}} auth = new HttpBasicAuth(); {{/isBasicBasic}} - {{^isBasicBasic}} + {{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}} - {{/isBasic}} + {{/isBasicBearer}} {{#isApiKey}} auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); {{/isApiKey}} {{#isOAuth}} - auth = buildOauthRequestInterceptor(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); + auth = buildOauthRequestInterceptor(OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, "{{{authorizationUrl}}}", "{{{tokenUrl}}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - addAuthorization(authName, auth); + if (auth != null) { + addAuthorization(authName, auth); + } {{/hasAuthMethods}} {{^hasAuthMethods}} throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); @@ -148,6 +168,7 @@ public class ApiClient { return this; } + {{#jackson}} private ObjectMapper createObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); @@ -159,29 +180,21 @@ public class ApiClient { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); objectMapper.registerModule(jnm); {{/openApiNullable}} return objectMapper; } + {{/jackson}} {{#hasOAuthMethods}} private RequestInterceptor buildOauthRequestInterceptor(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { switch (flow) { - case password: + case PASSWORD: return new OauthPasswordGrant(tokenUrl, scopes); - case application: + case APPLICATION: return new OauthClientCredentialsGrant(authorizationUrl, tokenUrl, scopes); default: throw new RuntimeException("Oauth flow \"" + flow + "\" is not implemented"); @@ -189,6 +202,8 @@ public class ApiClient { } {{/hasOAuthMethods}} + + {{#jackson}} public ObjectMapper getObjectMapper(){ return objectMapper; } @@ -196,6 +211,7 @@ public class ApiClient { public void setObjectMapper(ObjectMapper objectMapper) { this.objectMapper = objectMapper; } + {{/jackson}} /** * Creates a feign client for given API interface. @@ -252,6 +268,15 @@ public class ApiClient { apiAuthorization.setBearerToken(bearerToken); } + /** + * Helper method to configure the supplier of bearer tokens. + * @param tokenSupplier the supplier of bearer tokens. + */ + public void setBearerToken(Supplier tokenSupplier) { + HttpBearerAuth apiAuthorization = getAuthorization(HttpBearerAuth.class); + apiAuthorization.setBearerToken(tokenSupplier); + } + /** * Helper method to configure the first api key found * @param apiKey API key @@ -274,8 +299,8 @@ public class ApiClient { {{#hasOAuthMethods}} /** * Helper method to configure the client credentials for Oauth - * @param username Username - * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setClientCredentials(String clientId, String clientSecret) { OauthClientCredentialsGrant authorization = getAuthorization(OauthClientCredentialsGrant.class); @@ -286,6 +311,8 @@ public class ApiClient { * Helper method to configure the username/password for Oauth password grant * @param username Username * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setOauthPassword(String username, String password, String clientId, String clientSecret) { OauthPasswordGrant apiAuthorization = getAuthorization(OauthPasswordGrant.class); @@ -314,7 +341,7 @@ public class ApiClient { /** * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Acesss token listener + * @param accessTokenListener Access token listener */ public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { OAuth apiAuthorization = getAuthorization(OAuth.class); diff --git a/sdks/java-v1/templates/libraries/feign/ApiResponseDecoder.mustache b/sdks/java-v1/templates/libraries/feign/ApiResponseDecoder.mustache index ef171de94..9062b648c 100644 --- a/sdks/java-v1/templates/libraries/feign/ApiResponseDecoder.mustache +++ b/sdks/java-v1/templates/libraries/feign/ApiResponseDecoder.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.databind.ObjectMapper; @@ -22,17 +24,16 @@ public class ApiResponseDecoder extends JacksonDecoder { @Override public Object decode(Response response, Type type) throws IOException { - Map> responseHeaders = Collections.unmodifiableMap(response.headers()); //Detects if the type is an instance of the parameterized class ApiResponse - Type responseBodyType; - if (Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { + if (type instanceof ParameterizedType && Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { //The ApiResponse class has a single type parameter, the Dto class itself - responseBodyType = ((ParameterizedType) type).getActualTypeArguments()[0]; + Type responseBodyType = ((ParameterizedType) type).getActualTypeArguments()[0]; Object body = super.decode(response, responseBodyType); - return new ApiResponse(response.status(), responseHeaders, body); + Map> responseHeaders = Collections.unmodifiableMap(response.headers()); + return new ApiResponse<>(response.status(), responseHeaders, body); } else { //The response is not encapsulated in the ApiResponse, decode the Dto as normal return super.decode(response, type); } } -} \ No newline at end of file +} diff --git a/sdks/java-v1/templates/libraries/feign/EncodingUtils.mustache b/sdks/java-v1/templates/libraries/feign/EncodingUtils.mustache index 705eb6aa9..2312fc631 100644 --- a/sdks/java-v1/templates/libraries/feign/EncodingUtils.mustache +++ b/sdks/java-v1/templates/libraries/feign/EncodingUtils.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.UnsupportedEncodingException; diff --git a/sdks/java-v1/templates/libraries/feign/ParamExpander.mustache b/sdks/java-v1/templates/libraries/feign/ParamExpander.mustache index 2f5095d00..88f0ae22c 100644 --- a/sdks/java-v1/templates/libraries/feign/ParamExpander.mustache +++ b/sdks/java-v1/templates/libraries/feign/ParamExpander.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import feign.Param; diff --git a/sdks/java-v1/templates/libraries/feign/additional_properties.mustache b/sdks/java-v1/templates/libraries/feign/additional_properties.mustache new file mode 100644 index 000000000..8e7182792 --- /dev/null +++ b/sdks/java-v1/templates/libraries/feign/additional_properties.mustache @@ -0,0 +1,45 @@ +{{#additionalPropertiesType}} + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public {{{.}}} getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } +{{/additionalPropertiesType}} diff --git a/sdks/java-v1/templates/libraries/feign/api.mustache b/sdks/java-v1/templates/libraries/feign/api.mustache index c49407000..af05d6595 100644 --- a/sdks/java-v1/templates/libraries/feign/api.mustache +++ b/sdks/java-v1/templates/libraries/feign/api.mustache @@ -10,12 +10,15 @@ import {{modelPackage}}.ApiResponse; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import feign.*; {{>generatedAnnotation}} @@ -44,12 +47,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ -{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", -{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} +{{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", +{{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); /** * {{summary}} @@ -74,12 +77,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ -{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", -{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} +{{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", +{{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#hasQueryParams}} @@ -119,12 +122,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ -{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", -{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} +{{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", +{{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); + {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams); /** * {{summary}} @@ -159,12 +162,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ - {{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", - {{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} + {{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", + {{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams); /** diff --git a/sdks/java-v1/templates/libraries/feign/api_test.mustache b/sdks/java-v1/templates/libraries/feign/api_test.mustache index a7f5bb0b3..1db841158 100644 --- a/sdks/java-v1/templates/libraries/feign/api_test.mustache +++ b/sdks/java-v1/templates/libraries/feign/api_test.mustache @@ -6,13 +6,18 @@ import {{invokerPackage}}.ApiClient; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.BeforeEach; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/sdks/java-v1/templates/libraries/feign/auth/ApiErrorDecoder.mustache b/sdks/java-v1/templates/libraries/feign/auth/ApiErrorDecoder.mustache index da87f2563..aeea7f97e 100644 --- a/sdks/java-v1/templates/libraries/feign/auth/ApiErrorDecoder.mustache +++ b/sdks/java-v1/templates/libraries/feign/auth/ApiErrorDecoder.mustache @@ -1,5 +1,9 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; +import java.util.Date; + import feign.Response; import feign.RetryableException; import feign.codec.ErrorDecoder; @@ -18,7 +22,7 @@ public class ApiErrorDecoder implements ErrorDecoder { Exception httpException = defaultErrorDecoder.decode(methodKey, response); if (response.status() == 401 || response.status() == 403) { return new RetryableException(response.status(), "Received status " + response.status() + " trying to renew access token", - response.request().httpMethod(), httpException, null, response.request()); + response.request().httpMethod(), httpException, (Date) null, response.request()); } return httpException; } diff --git a/sdks/java-v1/templates/libraries/feign/auth/ApiKeyAuth.mustache b/sdks/java-v1/templates/libraries/feign/auth/ApiKeyAuth.mustache index c03fe5c0b..bf7e32c1a 100644 --- a/sdks/java-v1/templates/libraries/feign/auth/ApiKeyAuth.mustache +++ b/sdks/java-v1/templates/libraries/feign/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import feign.RequestInterceptor; diff --git a/sdks/java-v1/templates/libraries/feign/auth/DefaultApi20Impl.mustache b/sdks/java-v1/templates/libraries/feign/auth/DefaultApi20Impl.mustache index 72b0a0049..0c178ae6a 100644 --- a/sdks/java-v1/templates/libraries/feign/auth/DefaultApi20Impl.mustache +++ b/sdks/java-v1/templates/libraries/feign/auth/DefaultApi20Impl.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.builder.api.DefaultApi20; diff --git a/sdks/java-v1/templates/libraries/feign/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/libraries/feign/auth/HttpBasicAuth.mustache index c308131e8..d95589b6f 100644 --- a/sdks/java-v1/templates/libraries/feign/auth/HttpBasicAuth.mustache +++ b/sdks/java-v1/templates/libraries/feign/auth/HttpBasicAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import feign.RequestInterceptor; diff --git a/sdks/java-v1/templates/libraries/feign/auth/HttpBearerAuth.mustache b/sdks/java-v1/templates/libraries/feign/auth/HttpBearerAuth.mustache index 2240a5518..466c1b2ad 100644 --- a/sdks/java-v1/templates/libraries/feign/auth/HttpBearerAuth.mustache +++ b/sdks/java-v1/templates/libraries/feign/auth/HttpBearerAuth.mustache @@ -1,14 +1,18 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import feign.RequestInterceptor; import feign.RequestTemplate; +import java.util.Optional; +import java.util.function.Supplier; /** * An interceptor that adds the request header needed to use HTTP bearer authentication. */ public class HttpBearerAuth implements RequestInterceptor { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -16,21 +20,35 @@ public class HttpBearerAuth implements RequestInterceptor { /** * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void apply(RequestTemplate template) { - if(bearerToken == null) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { return; } diff --git a/sdks/java-v1/templates/libraries/feign/auth/OAuth.mustache b/sdks/java-v1/templates/libraries/feign/auth/OAuth.mustache index e60829656..8309a1f75 100644 --- a/sdks/java-v1/templates/libraries/feign/auth/OAuth.mustache +++ b/sdks/java-v1/templates/libraries/feign/auth/OAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.model.OAuth2AccessToken; @@ -10,6 +12,9 @@ import java.util.Collection; {{>generatedAnnotation}} public abstract class OAuth implements RequestInterceptor { + //https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4 + static final int LEEWAY_SECONDS = 10; + static final int MILLIS_PER_SECOND = 1000; public interface AccessTokenListener { @@ -17,7 +22,7 @@ public abstract class OAuth implements RequestInterceptor { } private volatile String accessToken; - private Long expirationTimeMillis; + private Long expirationTimeSeconds; private AccessTokenListener accessTokenListener; protected OAuth20Service service; @@ -39,6 +44,7 @@ public abstract class OAuth implements RequestInterceptor { } String accessToken = getAccessToken(); if (accessToken != null) { + template.removeHeader("Authorization"); template.header("Authorization", "Bearer " + accessToken); } } @@ -73,7 +79,7 @@ public abstract class OAuth implements RequestInterceptor { public synchronized String getAccessToken() { // If first time, get the token - if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { + if (expirationTimeSeconds == null || System.currentTimeMillis() >= expirationTimeSeconds * MILLIS_PER_SECOND) { updateAccessToken(); } return accessToken; @@ -86,7 +92,7 @@ public abstract class OAuth implements RequestInterceptor { */ public synchronized void setAccessToken(String accessToken, Integer expiresIn) { this.accessToken = accessToken; - this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; + this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SECONDS; } -} \ No newline at end of file +} diff --git a/sdks/java-v1/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache b/sdks/java-v1/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache index ef22c2116..3b8c3421a 100644 --- a/sdks/java-v1/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache +++ b/sdks/java-v1/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.builder.ServiceBuilder; @@ -21,7 +23,7 @@ public class OauthClientCredentialsGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.application; + return OAuthFlow.APPLICATION; } /** diff --git a/sdks/java-v1/templates/libraries/feign/auth/OauthPasswordGrant.mustache b/sdks/java-v1/templates/libraries/feign/auth/OauthPasswordGrant.mustache index 870c3755a..b51ee9161 100644 --- a/sdks/java-v1/templates/libraries/feign/auth/OauthPasswordGrant.mustache +++ b/sdks/java-v1/templates/libraries/feign/auth/OauthPasswordGrant.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.builder.ServiceBuilder; @@ -24,7 +26,7 @@ public class OauthPasswordGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.password; + return OAuthFlow.PASSWORD; } /** @@ -45,4 +47,4 @@ public class OauthPasswordGrant extends OAuth { .defaultScope(scopes) .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); } -} \ No newline at end of file +} diff --git a/sdks/java-v1/templates/libraries/feign/build.gradle.mustache b/sdks/java-v1/templates/libraries/feign/build.gradle.mustache index c9bf7c357..8af1cb136 100644 --- a/sdks/java-v1/templates/libraries/feign/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/feign/build.gradle.mustache @@ -57,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -101,17 +101,16 @@ test { } ext { - swagger_annotations_version = "1.5.24" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + swagger_annotations_version = "1.6.11" + {{#jackson}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + {{/jackson}} {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} - feign_version = "10.11" + feign_version = "10.12" feign_form_version = "3.8.0" junit_version = "5.7.0" scribejava_version = "8.0.0" @@ -121,25 +120,24 @@ dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.github.openfeign:feign-core:$feign_version" + {{#jackson}} implementation "io.github.openfeign:feign-jackson:$feign_version" + {{/jackson}} implementation "io.github.openfeign:feign-slf4j:$feign_version" implementation "io.github.openfeign:feign-okhttp:$feign_version" implementation "io.github.openfeign.form:feign-form:$feign_form_version" + {{#jackson}} + {{#joda}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" + {{/joda}} implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{/jackson}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#joda}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" - {{/joda}} - {{#java8}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} implementation "com.brsanthu:migbase64:2.2" implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" @@ -147,7 +145,7 @@ dependencies { testImplementation "org.junit.jupiter:junit-jupiter:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" - testImplementation "com.github.tomakehurst:wiremock-jre8:2.27.2" + testImplementation "com.github.tomakehurst:wiremock-jre8:2.35.1" testImplementation "org.hamcrest:hamcrest:2.2" testImplementation "commons-io:commons-io:2.8.0" testImplementation "ch.qos.logback:logback-classic:1.2.3" diff --git a/sdks/java-v1/templates/libraries/feign/build.sbt.mustache b/sdks/java-v1/templates/libraries/feign/build.sbt.mustache index f2912f0df..9af32c270 100644 --- a/sdks/java-v1/templates/libraries/feign/build.sbt.mustache +++ b/sdks/java-v1/templates/libraries/feign/build.sbt.mustache @@ -9,24 +9,28 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", + "io.swagger" % "swagger-annotations" % "1.6.11" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", - "io.github.openfeign" % "feign-core" % "10.11" % "compile", - "io.github.openfeign" % "feign-jackson" % "10.11" % "compile", - "io.github.openfeign" % "feign-slf4j" % "10.11" % "compile", + "io.github.openfeign" % "feign-core" % "10.12" % "compile", +{{#jackson}} + "io.github.openfeign" % "feign-jackson" % "10.12" % "compile", +{{/jackson}} + "io.github.openfeign" % "feign-slf4j" % "10.12" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", - "io.github.openfeign" % "feign-okhttp" % "10.11" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}" % "2.9.10" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", + "io.github.openfeign" % "feign-okhttp" % "10.12" % "compile", +{{#jackson}} + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile", +{{/jackson}} "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % "test", "org.junit.jupiter" % "junit-jupiter-params" % "5.7.0" % "test", - "com.github.tomakehurst" % "wiremock-jre8" % "2.27.2" % "test", + "com.github.tomakehurst" % "wiremock-jre8" % "2.35.1" % "test", "org.hamcrest" % "hamcrest" % "2.2" % "test", "commons-io" % "commons-io" % "2.8.0" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/sdks/java-v1/templates/libraries/feign/model.mustache b/sdks/java-v1/templates/libraries/feign/model.mustache new file mode 100644 index 000000000..5fa9bca80 --- /dev/null +++ b/sdks/java-v1/templates/libraries/feign/model.mustache @@ -0,0 +1,78 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#useReflectionEqualsHashCode}} +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +{{/useReflectionEqualsHashCode}} +{{#models}} +{{#model}} +{{#additionalPropertiesType}} +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +{{/additionalPropertiesType}} +{{/model}} +{{/models}} +import java.util.Objects; +import java.util.Arrays; +{{#imports}} +import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.annotation.*; +{{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jackson}} +{{#withXml}} +import {{javaxPackage}}.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.adapters.*; +import io.github.threetenjaxb.core.*; +{{/withXml}} +{{#jsonb}} +import java.lang.reflect.Type; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{javaxPackage}}.json.bind.serializer.DeserializationContext; +import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer; +import {{javaxPackage}}.json.bind.serializer.JsonbSerializer; +import {{javaxPackage}}.json.bind.serializer.SerializationContext; +import {{javaxPackage}}.json.stream.JsonGenerator; +import {{javaxPackage}}.json.stream.JsonParser; +import {{javaxPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{javaxPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} +{{#parcelableModel}} +import android.os.Parcelable; +import android.os.Parcel; +{{/parcelableModel}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} +{{#performBeanValidation}} +import org.hibernate.validator.constraints.*; +{{/performBeanValidation}} +{{#supportUrlQuery}} +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; +{{/supportUrlQuery}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#vendorExtensions.x-is-one-of-interface}}{{>oneof_interface}}{{/vendorExtensions.x-is-one-of-interface}}{{^vendorExtensions.x-is-one-of-interface}}{{>pojo}}{{/vendorExtensions.x-is-one-of-interface}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/sdks/java-v1/templates/libraries/feign/model/ApiResponse.mustache b/sdks/java-v1/templates/libraries/feign/model/ApiResponse.mustache index bc460dc59..9c9b10746 100644 --- a/sdks/java-v1/templates/libraries/feign/model/ApiResponse.mustache +++ b/sdks/java-v1/templates/libraries/feign/model/ApiResponse.mustache @@ -1,19 +1,21 @@ +{{>licenseInfo}} + package {{modelPackage}}; import java.util.Map; -import java.util.List; +import java.util.Collection; public class ApiResponse{ final private int statusCode; - final private Map> headers; + final private Map> headers; final private T data; /** * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response */ - public ApiResponse(int statusCode, Map> headers) { + public ApiResponse(int statusCode, Map> headers) { this(statusCode, headers, null); } @@ -22,7 +24,7 @@ public class ApiResponse{ * @param headers The headers of HTTP response * @param data The object deserialized from response bod */ - public ApiResponse(int statusCode, Map> headers, T data) { + public ApiResponse(int statusCode, Map> headers, T data) { this.statusCode = statusCode; this.headers = headers; this.data = data; @@ -32,7 +34,7 @@ public class ApiResponse{ return statusCode; } - public Map> getHeaders() { + public Map> getHeaders() { return headers; } diff --git a/sdks/java-v1/templates/libraries/feign/model_test.mustache b/sdks/java-v1/templates/libraries/feign/model_test.mustache index 0d75e120b..2759ff525 100644 --- a/sdks/java-v1/templates/libraries/feign/model_test.mustache +++ b/sdks/java-v1/templates/libraries/feign/model_test.mustache @@ -6,13 +6,6 @@ package {{package}}; {{/imports}} import org.junit.jupiter.api.Test; -{{#fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} - /** * Model tests for {{classname}} */ diff --git a/sdks/java-v1/templates/libraries/feign/pojo.mustache b/sdks/java-v1/templates/libraries/feign/pojo.mustache new file mode 100644 index 000000000..fe97e3b1b --- /dev/null +++ b/sdks/java-v1/templates/libraries/feign/pojo.mustache @@ -0,0 +1,580 @@ +/** + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + */{{#isDeprecated}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +{{#isClassnameSanitized}} +{{^hasDiscriminatorWithNonEmptyMapping}} +@JsonTypeName("{{name}}") +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/isClassnameSanitized}} +{{/jackson}} +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +{{#serializableModel}} + private static final long serialVersionUID = 1L; + +{{/serializableModel}} + {{#vars}} + {{#isEnum}} + {{^isContainer}} +{{>modelInnerEnum}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>modelInnerEnum}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + {{#gson}} + public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; + {{/gson}} + {{#jackson}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; + {{/jackson}} + {{#withXml}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{^isXmlAttribute}} + {{#isDateTime}} + @XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class) + {{/isDateTime}} + {{/isXmlAttribute}} + {{/withXml}} + {{#gson}} + @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) + {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{/isContainer}} + {{^isContainer}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} + {{^isContainer}} + {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{/vars}} + public {{classname}}() { + {{#parent}} + {{#parcelableModel}} + super();{{/parcelableModel}} + {{/parent}} + {{#gson}} + {{#discriminator}} + {{#discriminator.isEnum}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator.isEnum}} + {{/discriminator}} + {{/gson}} + } + {{#vendorExtensions.x-has-readonly-properties}} + {{^withXml}} + + {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} + public {{classname}}( + {{#readOnlyVars}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; + {{/readOnlyVars}} + } + {{/withXml}} + {{/vendorExtensions.x-has-readonly-properties}} + {{#vars}} + + {{^isReadOnly}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = {{name}};{{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); + } + try { + this.{{name}}.get().add({{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; + } + this.{{name}}.add({{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); + } + try { + this.{{name}}.get().put(key, {{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; + } + {{/required}} + this.{{name}}.put(key, {{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isMap}} + + {{/isReadOnly}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + */ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#required}} +{{#isNullable}} + @{{javaxPackage}}.annotation.Nullable +{{/isNullable}} +{{^isNullable}} + @{{javaxPackage}}.annotation.Nonnull +{{/isNullable}} +{{/required}} +{{^required}} + @{{javaxPackage}}.annotation.Nullable +{{/required}} +{{#jsonb}} + @JsonbProperty("{{baseName}}") +{{/jsonb}} +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} +{{#vendorExtensions.x-is-jackson-optional-nullable}} + {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} + @JsonIgnore +{{/vendorExtensions.x-is-jackson-optional-nullable}} +{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} + public {{{datatypeWithEnum}}} {{getter}}() { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} + if ({{name}} == null) { + {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + } + {{/isReadOnly}} + return {{name}}.orElse(null); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + return {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + + {{#vendorExtensions.x-is-jackson-optional-nullable}} +{{> jackson_annotations}} + public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { + return {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} + this.{{name}} = {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{^isReadOnly}} +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isReadOnly}} + + {{/vars}} +{{>libraries/feign/additional_properties}} + @Override + public boolean equals(Object o) { + {{#useReflectionEqualsHashCode}} + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} && + {{/-last}}{{/vars}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public int hashCode() { + {{#useReflectionEqualsHashCode}} + return HashCodeBuilder.reflectionHashCode(this); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}} + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + {{/parent}} + {{#vars}} + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); + {{/vars}} + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#allVars}} + // add `{{baseName}}` to the URL query string + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{items.dataType}} _item : {{getter}}()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{items.dataType}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{items.dataType}} _item : {{getter}}()) { + if (_item != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isPrimitiveType}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + {{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + if ({{getter}}().get(_key) != null) { + joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isPrimitiveType}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if ({{getter}}() != null) { + joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + + {{/allVars}} + return joiner.toString(); + } +{{/supportUrlQuery}} +{{#parcelableModel}} + + public void writeToParcel(Parcel out, int flags) { +{{#model}} +{{#isArray}} + out.writeList(this); +{{/isArray}} +{{^isArray}} +{{#parent}} + super.writeToParcel(out, flags); +{{/parent}} +{{#vars}} + out.writeValue({{name}}); +{{/vars}} +{{/isArray}} +{{/model}} + } + + {{classname}}(Parcel in) { +{{#isArray}} + in.readTypedList(this, {{arrayModelType}}.CREATOR); +{{/isArray}} +{{^isArray}} +{{#parent}} + super(in); +{{/parent}} +{{#vars}} +{{#isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); +{{/isPrimitiveType}} +{{/vars}} +{{/isArray}} + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public {{classname}} createFromParcel(Parcel in) { +{{#model}} +{{#isArray}} + {{classname}} result = new {{classname}}(); + result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); + return result; +{{/isArray}} +{{^isArray}} + return new {{classname}}(in); +{{/isArray}} +{{/model}} + } + public {{classname}}[] newArray(int size) { + return new {{classname}}[size]; + } + }; +{{/parcelableModel}} + +} diff --git a/sdks/java-v1/templates/libraries/feign/pom.mustache b/sdks/java-v1/templates/libraries/feign/pom.mustache index f57614c58..9be4a094f 100644 --- a/sdks/java-v1/templates/libraries/feign/pom.mustache +++ b/sdks/java-v1/templates/libraries/feign/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 3.0.0-M4 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -158,7 +158,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none 1.8 @@ -213,11 +213,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -232,11 +241,20 @@ feign-core ${feign-version} + {{#jackson}} io.github.openfeign feign-jackson ${feign-version} + {{/jackson}} + {{#gson}} + + io.github.openfeign + feign-gson + ${feign-version} + + {{/gson}} io.github.openfeign feign-slf4j @@ -253,6 +271,7 @@ ${feign-version} + {{#jackson}} com.fasterxml.jackson.core @@ -269,6 +288,14 @@ jackson-databind ${jackson-databind-version} + {{/jackson}} + {{#gson}} + + com.google.code.gson + gson + ${gson-version} + + {{/gson}} {{#openApiNullable}} org.openapitools @@ -291,20 +318,13 @@ ${jackson-version} {{/joda}} - {{#java8}} + {{#jackson}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} + {{/jackson}} com.github.scribejava scribejava-core @@ -316,12 +336,21 @@ ${jakarta-annotation-version} provided + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} ch.qos.logback logback-classic - 1.2.3 + 1.3.13 test @@ -345,13 +374,7 @@ com.github.tomakehurst wiremock-jre8 - 2.27.2 - test - - - commons-io - commons-io - 2.8.0 + 2.35.1 test @@ -360,20 +383,35 @@ 1.8 ${java.version} ${java.version} - 1.5.24 - 10.11 + {{#swagger1AnnotationLibrary}} + 1.6.11 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 13.2.1 3.8.0 - 2.10.3 + {{#jackson}} + 2.17.1 + 2.17.1 + {{/jackson}} + {{#gson}} + 2.10.1 + {{/gson}} {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} - 2.10.3 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 - 5.7.0 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 5.10.0 1.0.0 - 8.0.0 + 8.3.3 diff --git a/sdks/java-v1/templates/libraries/google-api-client/ApiClient.mustache b/sdks/java-v1/templates/libraries/google-api-client/ApiClient.mustache index aa91362ba..03c44a8ed 100644 --- a/sdks/java-v1/templates/libraries/google-api-client/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/google-api-client/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import {{apiPackage}}.*; @@ -10,15 +12,7 @@ import org.openapitools.jackson.nullable.JsonNullableModule; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.google.api.client.googleapis.util.Utils; import com.google.api.client.http.AbstractHttpContent; import com.google.api.client.http.HttpRequestFactory; @@ -46,16 +40,7 @@ public class ApiClient { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); objectMapper.registerModule(jnm); diff --git a/sdks/java-v1/templates/libraries/google-api-client/api.mustache b/sdks/java-v1/templates/libraries/google-api-client/api.mustache index 97b1dd688..6ca6a2811 100644 --- a/sdks/java-v1/templates/libraries/google-api-client/api.mustache +++ b/sdks/java-v1/templates/libraries/google-api-client/api.mustache @@ -14,7 +14,7 @@ import com.google.api.client.http.HttpMethods; import com.google.api.client.http.HttpResponse; import com.google.api.client.json.Json; -import javax.ws.rs.core.UriBuilder; +import {{javaxPackage}}.ws.rs.core.UriBuilder; import java.io.IOException; import java.util.Collection; import java.util.HashMap; @@ -121,7 +121,7 @@ public class {{classname}} { String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isMethodPutOrPatchOrPost}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isMethodPutOrPatchOrPost}}{{^isMethodPutOrPatchOrPost}}null{{/isMethodPutOrPatchOrPost}}; + HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); }{{#bodyParam}} @@ -199,7 +199,7 @@ public class {{classname}} { String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isMethodPutOrPatchOrPost}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isMethodPutOrPatchOrPost}}{{^isMethodPutOrPatchOrPost}}null{{/isMethodPutOrPatchOrPost}}; + HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); } diff --git a/sdks/java-v1/templates/libraries/google-api-client/api_test.mustache b/sdks/java-v1/templates/libraries/google-api-client/api_test.mustache index 1dc2f174f..bfb939f95 100644 --- a/sdks/java-v1/templates/libraries/google-api-client/api_test.mustache +++ b/sdks/java-v1/templates/libraries/google-api-client/api_test.mustache @@ -4,26 +4,26 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.io.IOException; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} /** * API tests for {{classname}} */ -@Ignore public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); - {{#operations}}{{#operation}} + {{#operations}} + {{#operation}} /** * {{summary}} * @@ -37,9 +37,12 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // uncomment below to test the API function + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } - {{/operation}}{{/operations}} + + {{/operation}} + {{/operations}} } diff --git a/sdks/java-v1/templates/libraries/google-api-client/build.gradle.mustache b/sdks/java-v1/templates/libraries/google-api-client/build.gradle.mustache index 6341f0271..c87983171 100644 --- a/sdks/java-v1/templates/libraries/google-api-client/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/google-api-client/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -110,19 +98,16 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.12.5" - jackson_databind_version = "2.10.5.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" google_api_client_version = "1.32.2" jersey_common_version = "2.25.1" jodatime_version = "2.9.9" - junit_version = "4.13.1" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} + junit_version = "4.13.2" } dependencies { @@ -137,16 +122,11 @@ dependencies { {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" - {{/threetenbp}} {{#withXml}} implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" {{/withXml}} diff --git a/sdks/java-v1/templates/libraries/google-api-client/build.sbt.mustache b/sdks/java-v1/templates/libraries/google-api-client/build.sbt.mustache index 721b638dd..78da21f2e 100644 --- a/sdks/java-v1/templates/libraries/google-api-client/build.sbt.mustache +++ b/sdks/java-v1/templates/libraries/google-api-client/build.sbt.mustache @@ -12,23 +12,18 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.22", "com.google.api-client" % "google-api-client" % "1.23.0", "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", {{#withXml}} "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.9.10" % "compile", {{/withXml}} {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", {{/joda}} - {{#java8}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - {{/threetenbp}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "junit" % "junit" % "4.13.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/sdks/java-v1/templates/libraries/google-api-client/pom.mustache b/sdks/java-v1/templates/libraries/google-api-client/pom.mustache index 81e0ee465..97c5123e9 100644 --- a/sdks/java-v1/templates/libraries/google-api-client/pom.mustache +++ b/sdks/java-v1/templates/libraries/google-api-client/pom.mustache @@ -63,17 +63,16 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods - pertest @@ -144,28 +143,17 @@ maven-compiler-plugin 3.6.1 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + 1.8 + 1.8 org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -217,11 +205,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -254,7 +251,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} {{#openApiNullable}} @@ -271,13 +268,11 @@ ${jackson-version} {{/withXml}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype @@ -290,13 +285,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} jakarta.annotation jakarta.annotation-api @@ -306,30 +294,37 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.5.22 - 1.32.2 - 2.25.1 - 2.12.1 - 2.10.5.1 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.2.0 + 2.40 + 2.17.1 + 2.17.1 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} 1.0.0 - 4.13.1 + 5.10.2 diff --git a/sdks/java-v1/templates/libraries/jersey2/AbstractOpenApiSchema.mustache b/sdks/java-v1/templates/libraries/jersey2/AbstractOpenApiSchema.mustache index 00253ccee..d92c85e26 100644 --- a/sdks/java-v1/templates/libraries/jersey2/AbstractOpenApiSchema.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/AbstractOpenApiSchema.mustache @@ -6,14 +6,14 @@ import {{invokerPackage}}.ApiException; import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.GenericType; import com.fasterxml.jackson.annotation.JsonValue; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} +{{>generatedAnnotation}} public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/sdks/java-v1/templates/libraries/jersey2/ApiClient.mustache b/sdks/java-v1/templates/libraries/jersey2/ApiClient.mustache index 5c0f887d5..6d5f8334e 100644 --- a/sdks/java-v1/templates/libraries/jersey2/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/ApiClient.mustache @@ -1,15 +1,17 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; +import {{javaxPackage}}.ws.rs.client.Client; +import {{javaxPackage}}.ws.rs.client.ClientBuilder; +import {{javaxPackage}}.ws.rs.client.Entity; +import {{javaxPackage}}.ws.rs.client.Invocation; +import {{javaxPackage}}.ws.rs.client.WebTarget; +import {{javaxPackage}}.ws.rs.core.Form; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.Response.Status; {{#hasOAuthMethods}} import com.github.scribejava.core.model.OAuth2AccessToken; @@ -38,6 +40,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -45,18 +48,16 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import java.net.URLEncoder; @@ -78,88 +79,102 @@ import {{invokerPackage}}.auth.ApiKeyAuth; {{#hasOAuthMethods}} import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} - +{{#useCustomTemplateCode}} import com.dropbox.sign.model.ErrorResponse; +{{/useCustomTemplateCode}} /** *

ApiClient class.

*/ {{>generatedAnnotation}} public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "{{{basePath}}}"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList( -{{/-first}} new ServerConfiguration( - "{{{url}}}", - "{{{description}}}{{^description}}No description provided{{/description}}", - new HashMap(){{#variables}}{{#-first}} {{ -{{/-first}} put("{{{name}}}", new ServerVariable( - "{{{description}}}{{^description}}No description provided{{/description}}", - "{{{defaultValue}}}", - new HashSet( - {{#enumValues}} - {{#-first}} - Arrays.asList( - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ) - {{/-last}} - {{/enumValues}} - ) - )); - {{#-last}} - }}{{/-last}}{{/variables}} - ){{^-last}},{{/-last}} + protected List servers = new ArrayList<>({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} {{#-last}} ){{/-last}}{{/servers}}); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ + {{^hasOperationServers}} + protected Map> operationServers = new HashMap<>(); + {{/hasOperationServers}} + {{#hasOperationServers}} + protected Map> operationServers; + + { + Map> operationServers = new HashMap<>(); {{#apiInfo}} {{#apis}} {{#operations}} {{#operation}} {{#servers}} {{#-first}} - put("{{{classname}}}.{{{operationId}}}", new ArrayList(Arrays.asList( + operationServers.put("{{{classname}}}.{{{operationId}}}", new ArrayList<>(Arrays.asList( {{/-first}} - new ServerConfiguration( - "{{{url}}}", - "{{{description}}}{{^description}}No description provided{{/description}}", - new HashMap(){{#variables}}{{#-first}} {{ -{{/-first}} put("{{{name}}}", new ServerVariable( - "{{{description}}}{{^description}}No description provided{{/description}}", - "{{{defaultValue}}}", - new HashSet( - {{#enumValues}} - {{#-first}} - Arrays.asList( - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ) - {{/-last}} - {{/enumValues}} - ) - )); - {{#-last}} - }}{{/-last}}{{/variables}} - ){{^-last}},{{/-last}} + new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} {{#-last}} - )));{{/-last}} + ))); + {{/-last}} {{/servers}} {{/operation}} {{/operations}} {{/apis}} {{/apiInfo}} - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + this.operationServers = operationServers; + } + + {{/hasOperationServers}} + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -196,7 +211,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; {{#authMethods}} if (authMap != null) { @@ -234,7 +249,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (auth instanceof OAuth) { authentications.put("{{name}}", auth); } else { - authentications.put("{{name}}", new OAuth(basePath, "{{tokenUrl}}")); + authentications.put("{{name}}", new OAuth(basePath, "{{{tokenUrl}}}")); } {{/isOAuth}} {{/authMethods}} @@ -242,7 +257,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} + authenticationLookup = new HashMap<>();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} authenticationLookup.put("{{name}}", "{{.}}");{{/vendorExtensions.x-auth-id-alias}}{{/authMethods}} } @@ -258,7 +273,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Getter for the field httpClient.

* - * @return a {@link javax.ws.rs.client.Client} object. + * @return a {@link {{javaxPackage}}.ws.rs.client.Client} object. */ public Client getHttpClient() { return httpClient; @@ -267,8 +282,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Setter for the field httpClient.

* - * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -288,7 +303,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -311,7 +326,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -332,7 +347,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -353,7 +368,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -400,7 +415,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -416,7 +431,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -432,14 +447,19 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { +{{^useCustomTemplateCode}} + if (auth instanceof ApiKeyAuth) { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setUsername(apiKey); return this; } else if (auth instanceof ApiKeyAuth) { +{{/useCustomTemplateCode}} ((ApiKeyAuth) auth).setApiKey(apiKey); return this; } @@ -447,11 +467,51 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RuntimeException("No API key authentication configured!"); } +{{^useCustomTemplateCode}} + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + * @return a {@link ApiClient} object. + */ + public ApiClient configureApiKeys(Map secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.getOrDefault(name, name); + String secret = secrets.get(name); + if (secret != null) { + ((ApiKeyAuth) auth).setApiKey(secret); + } + } + } + return this; + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + * @return a {@link ApiClient} object. + */ + public ApiClient setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } +{{/useCustomTemplateCode}} + /** * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -468,7 +528,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -485,7 +545,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -497,12 +557,28 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + /** * Helper method to set the password flow for the first OAuth2 authentication. * * @param username the user name * @param password the user password - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -518,7 +594,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -534,7 +610,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -551,7 +627,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -573,7 +649,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The header's key * @param value The header's value - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -585,7 +661,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -605,7 +681,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -627,7 +703,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -651,7 +727,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -673,7 +749,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -696,7 +772,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -717,7 +793,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -763,9 +839,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return formatDate((Date) param); } {{#jsr310}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/jsr310}}else if (param instanceof Collection) { + } {{/jsr310}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -786,14 +862,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; @@ -845,14 +921,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -864,8 +939,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -885,8 +960,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -930,7 +1005,17 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { File file = (File) param.getValue(); FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) .fileName(file.getName()).size(file.length()).build(); - multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); + + // Attempt to probe the content type for the file so that the form part is more correctly + // and precisely identified, but fall back to application/octet-stream if that fails. + MediaType type; + try { + type = MediaType.valueOf(Files.probeContentType(file.toPath())); + } catch (IOException | IllegalArgumentException e) { + type = MediaType.APPLICATION_OCTET_STREAM_TYPE; + } + + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type)); } else { FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); @@ -1024,11 +1109,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return file; } - String contentType = null; - List contentTypes = response.getHeaders().get("Content-Type"); - if (contentTypes != null && !contentTypes.isEmpty()) - contentType = String.valueOf(contentTypes.get(0)); - // read the entity stream multiple times response.bufferEntity(); @@ -1055,7 +1135,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Prepare the file for download from the response.

* - * @param response a {@link javax.ws.rs.core.Response} object. + * @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object. * @return a {@link java.io.File} object. * @throws java.io.IOException if any. */ @@ -1130,14 +1210,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { boolean isBodyNullable) throws ApiException { - // Not using `.target(targetURL).path(path)` below, - // to support (constant) query string in `path`, e.g. "/posts?draft=1" String targetURL; - if (serverIndex != null && operationServers.containsKey(operation)) { - Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex; - Map variables = operationServerVariables.containsKey(operation) ? - operationServerVariables.get(operation) : serverVariables; - List serverConfigurations = operationServers.get(operation); + List serverConfigurations; + if (serverIndex != null && (serverConfigurations = operationServers.get(operation)) != null) { + int index = operationServerIndex.getOrDefault(operation, serverIndex).intValue(); + Map variables = operationServerVariables.getOrDefault(operation, serverVariables); if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( @@ -1148,6 +1225,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { targetURL = this.basePath + path; } + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" WebTarget target = httpClient.target(targetURL); if (queryParams != null) { @@ -1158,11 +1237,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } - Invocation.Builder invocationBuilder; + Invocation.Builder invocationBuilder = target.request(); + if (accept != null) { - invocationBuilder = target.request().accept(accept); - } else { - invocationBuilder = target.request(); + invocationBuilder = invocationBuilder.accept(accept); } for (Entry entry : cookieParams.entrySet()) { @@ -1185,15 +1263,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + {{#hasHttpSignatureMethods}} + serializeToString(body, formParams, contentType, isBodyNullable), + {{/hasHttpSignatureMethods}} + {{^hasHttpSignatureMethods}} + null, + {{/hasHttpSignatureMethods}} + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1207,9 +1292,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { try { response = sendRequest(method, invocationBuilder, entity); + final int statusCode = response.getStatusInfo().getStatusCode(); + {{#hasOAuthMethods}} // If OAuth is used and a status 401 is received, renew the access token and retry the request - if (response.getStatusInfo() == Status.UNAUTHORIZED) { + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { for (String authName : authNames) { Authentication authentication = authentications.get(authName); if (authentication instanceof OAuth) { @@ -1225,10 +1312,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } {{/hasOAuthMethods}} - int statusCode = response.getStatusInfo().getStatusCode(); Map> responseHeaders = buildResponseHeaders(response); - if (response.getStatusInfo() == Status.NO_CONTENT) { + if (statusCode == Status.NO_CONTENT.getStatusCode()) { return new ApiResponse(statusCode, responseHeaders); } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { if (returnType == null) { @@ -1237,6 +1323,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return new ApiResponse(statusCode, responseHeaders, deserialize(response, returnType)); } } else { +{{^useCustomTemplateCode}} + String message = "error"; + String respBody = null; + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), message, buildResponseHeaders(response), respBody); + } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} String message = "error"; String respBody = null; ErrorResponse errorResponse = null; @@ -1257,6 +1359,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new ApiException( response.getStatus(), message, buildResponseHeaders(response), respBody, errorResponse); } +{{/useCustomTemplateCode}} } finally { try { response.close(); @@ -1301,8 +1404,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { clientConfig = getDefaultClientConfig(); ClientBuilder clientBuilder = ClientBuilder.newBuilder(); - customizeClientBuilder(clientBuilder); clientBuilder = clientBuilder.withConfig(clientConfig); + customizeClientBuilder(clientBuilder); return clientBuilder.build(); } @@ -1346,7 +1449,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * To completely disable certificate validation (at your own risk), you can * override this method and invoke disableCertificateValidation(clientBuilder). * - * @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object. + * @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object. */ protected void customizeClientBuilder(ClientBuilder clientBuilder) { // No-op extension point @@ -1358,7 +1461,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Please note that trusting all certificates is extremely risky. * This may be useful in a development environment with self-signed certificates. * - * @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object. + * @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object. * @throws java.security.KeyManagementException if any. * @throws java.security.NoSuchAlgorithmException if any. */ @@ -1385,14 +1488,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Build the response headers.

* - * @param response a {@link javax.ws.rs.core.Response} object. + * @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object. * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/sdks/java-v1/templates/libraries/jersey2/JSON.mustache b/sdks/java-v1/templates/libraries/jersey2/JSON.mustache index f132a312b..e1f17c972 100644 --- a/sdks/java-v1/templates/libraries/jersey2/JSON.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/JSON.mustache @@ -1,23 +1,17 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -27,40 +21,36 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.ext.ContextResolver; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; {{>generatedAnnotation}} public class JSON implements ContextResolver { private ObjectMapper mapper; public JSON() { - mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - JsonMapper.builder().configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} - mapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#joda}} - mapper.registerModule(new JodaModule()); - {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} - {{#openApiNullable}} - JsonNullableModule jnm = new JsonNullableModule(); - mapper.registerModule(jnm); - {{/openApiNullable}} + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) +{{^useCustomTemplateCode}} + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) +{{/useCustomTemplateCode}} + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + {{#joda}} + .addModule(new JodaModule()) + {{/joda}} + {{#openApiNullable}} + .addModule(new JsonNullableModule()) + {{/openApiNullable}} + .build(); } /** @@ -93,7 +83,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -113,7 +103,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -197,6 +187,9 @@ public class JSON implements ContextResolver { */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { +{{^useCustomTemplateCode}} + // This handles the 'allOf' use case with single parent inheritance. +{{/useCustomTemplateCode}} return true; } if (visitedClasses.contains(modelClass)) { @@ -207,9 +200,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -221,12 +214,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -246,7 +239,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/sdks/java-v1/templates/libraries/jersey2/additional_properties.mustache b/sdks/java-v1/templates/libraries/jersey2/additional_properties.mustache index 61973dc24..2955e9392 100644 --- a/sdks/java-v1/templates/libraries/jersey2/additional_properties.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/additional_properties.mustache @@ -13,7 +13,7 @@ @JsonAnySetter public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/sdks/java-v1/templates/libraries/jersey2/anyof_model.mustache b/sdks/java-v1/templates/libraries/jersey2/anyof_model.mustache index d5b381987..d480667f3 100644 --- a/sdks/java-v1/templates/libraries/jersey2/anyof_model.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/anyof_model.mustache @@ -1,5 +1,5 @@ -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.Response; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; @@ -24,7 +24,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -57,7 +57,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. @@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -134,7 +134,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); {{#mappedModels}} mappings.put("{{mappingName}}", {{modelName}}.class); {{/mappedModels}} @@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } @@ -166,7 +166,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/isNullable}} {{#anyOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/sdks/java-v1/templates/libraries/jersey2/api.mustache b/sdks/java-v1/templates/libraries/jersey2/api.mustache index dc965e199..629097807 100644 --- a/sdks/java-v1/templates/libraries/jersey2/api.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/api.mustache @@ -6,18 +6,22 @@ import {{invokerPackage}}.ApiResponse; import {{invokerPackage}}.Configuration; import {{invokerPackage}}.Pair; -import javax.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.GenericType; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} {{>generatedAnnotation}} {{#operations}} public class {{classname}} { @@ -86,8 +90,10 @@ public class {{classname}} { } {{/vendorExtensions.x-group-parameters}} + {{#useCustomTemplateCode}} __OVERLOAD_DELIMITER { "class": "{{classname}}", "method": "{{operationId}}", "returnType": "{{#returnType}}{{.}}{{/returnType}}", "parameters": [ {{#allParams}}{ "type": "{{{dataType}}}", "name": "{{paramName}}", "required": {{#required}}true{{/required}}{{^required}}false{{/required}}, "value": {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}"{{/isString}}{{{.}}}{{#isString}}"{{/isString}}{{/defaultValue}} }{{^-last}},{{/-last}}{{/allParams}} ]} + {{/useCustomTemplateCode}} {{^vendorExtensions.x-group-parameters}} /** * {{summary}} @@ -118,72 +124,126 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { +{{#useCustomTemplateCode}} {{#allParams}}{{^required}}{{#defaultValue}} if ({{paramName}} == null) { {{paramName}} = {{#isString}}"{{/isString}}{{{defaultValue}}}{{#isString}}"{{/isString}}; }{{/defaultValue}}{{/required}}{{/allParams}} - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set +{{/useCustomTemplateCode}} + {{#hasRequiredParams}} + // Check required parameters + {{#allParams}} + {{#required}} if ({{paramName}} == null) { throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); } - {{/required}}{{/allParams}} - // create path and map variables - String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + {{/required}} + {{/allParams}} - // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + {{/hasRequiredParams}} + {{#hasPathParams}} + // Path parameters + String localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + {{/hasPathParams}} {{#queryParams}} + {{#-first}} + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}}) + ); + {{/-first}} + {{^-first}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/-first}} + {{#-last}} + + {{/-last}} {{/queryParams}} + {{#headerParams}} + {{#-first}} + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#headerParams}}if ({{paramName}} != null) - localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/headerParams}} + {{#cookieParams}} + {{#-first}} + // Cookie parameters + Map localVarCookieParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#cookieParams}}if ({{paramName}} != null) - localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/cookieParams}} +{{^useCustomTemplateCode}} + {{#formParams}} + {{#-first}} + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarFormParams.put("{{baseName}}", {{paramName}});{{^required}} + }{{/required}} + {{#-last}} - {{#formParams}}if ({{paramName}} != null) - localVarFormParams.put("{{baseName}}", {{paramName}}); + {{/-last}} {{/formParams}} - - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - +{{/useCustomTemplateCode}} + String localVarAccept = apiClient.selectHeaderAccept({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}); +{{^useCustomTemplateCode}} + String localVarContentType = apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = {{#bodyParam}}{{paramName}}.createFormData(){{/bodyParam}}{{^bodyParam}}new {{javaUtilPrefix}}HashMap(){{/bodyParam}}; boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); +{{/useCustomTemplateCode}} + {{#hasAuthMethods}} + String[] localVarAuthNames = {{=% %=}}new String[] {%#authMethods%"%name%"%^-last%, %/-last%%/authMethods%};%={{ }}=% + {{/hasAuthMethods}} {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; - {{/returnType}} - return apiClient.invokeAPI("{{classname}}.{{operationId}}", localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); +{{^useCustomTemplateCode}} + return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + return apiClient.invokeAPI( + "{{classname}}.{{operationId}}", + {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, + "{{httpMethod}}", + {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, + {{#bodyParam}}isFileTypeFound ? null : {{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, + {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, + localVarFormParams, + localVarAccept, + localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, + {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, + {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}} + ); +{{/useCustomTemplateCode}} + } {{#vendorExtensions.x-group-parameters}} public class API{{operationId}}Request { {{#allParams}} - private {{#isRequired}}final {{/isRequired}}{{{dataType}}} {{paramName}}; + private {{{dataType}}} {{paramName}}; {{/allParams}} private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) { diff --git a/sdks/java-v1/templates/libraries/jersey2/apiException.mustache b/sdks/java-v1/templates/libraries/jersey2/apiException.mustache index 84b4567c9..70c2af504 100644 --- a/sdks/java-v1/templates/libraries/jersey2/apiException.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/apiException.mustache @@ -2,23 +2,29 @@ package {{invokerPackage}}; -import com.dropbox.sign.model.ErrorResponse; import java.util.Map; import java.util.List; {{#caseInsensitiveResponseHeaders}} import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} +{{#useCustomTemplateCode}} +import com.dropbox.sign.model.ErrorResponse; +{{/useCustomTemplateCode}} /** * API Exception */ {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; +{{#useCustomTemplateCode}} private ErrorResponse errorResponse; +{{/useCustomTemplateCode}} public ApiException() {} @@ -72,11 +78,13 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us this.responseBody = responseBody; } +{{#useCustomTemplateCode}} public ApiException(int code, String message, Map> responseHeaders, String responseBody, ErrorResponse errorResponse) { this(code, message, responseHeaders, responseBody); this.errorResponse = errorResponse; } +{{/useCustomTemplateCode}} /** * Get the HTTP status code. * @@ -103,8 +111,10 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } +{{#useCustomTemplateCode}} public ErrorResponse getErrorResponse() { return errorResponse; } +{{/useCustomTemplateCode}} } diff --git a/sdks/java-v1/templates/libraries/jersey2/api_doc.mustache b/sdks/java-v1/templates/libraries/jersey2/api_doc.mustache index 3994b56bc..457096710 100644 --- a/sdks/java-v1/templates/libraries/jersey2/api_doc.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/api_doc.mustache @@ -4,10 +4,16 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{^useCustomTemplateCode}} +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | +{{/operation}}{{/operations}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} +{{/useCustomTemplateCode}} {{#operations}} {{#operation}} @@ -28,16 +34,86 @@ Method | HTTP request | Description ### Example ```java +{{^useCustomTemplateCode}} +{{#vendorExtensions.x-java-import}} +import {{.}}; +{{/vendorExtensions.x-java-import}} +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.model.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{^vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} + .execute(); + {{/vendorExtensions.x-group-parameters}} + {{#returnType}} + System.out.println(result); + {{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Java_CODE +{{/useCustomTemplateCode}} ``` ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{^useCustomTemplateCode}} +{{#allParams}}| **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#allParams}} **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} +{{/useCustomTemplateCode}} ### Return type diff --git a/sdks/java-v1/templates/libraries/jersey2/api_test.mustache b/sdks/java-v1/templates/libraries/jersey2/api_test.mustache index c325e3d1e..7b8214bd4 100644 --- a/sdks/java-v1/templates/libraries/jersey2/api_test.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/api_test.mustache @@ -6,18 +6,21 @@ import {{invokerPackage}}.*; import {{invokerPackage}}.auth.*; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ @@ -28,12 +31,15 @@ public class {{classname}}Test { {{#operations}} {{#operation}} /** + {{#summary}} * {{summary}} * + {{/summary}} + {{#notes}} * {{notes}} * - * @throws ApiException - * if the Api call fails + {{/notes}} + * @throws ApiException if the Api call fails */ @Test public void {{operationId}}Test() throws ApiException { diff --git a/sdks/java-v1/templates/libraries/jersey2/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/libraries/jersey2/auth/HttpBasicAuth.mustache index 898bb97ee..13cecfa90 100644 --- a/sdks/java-v1/templates/libraries/jersey2/auth/HttpBasicAuth.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/auth/HttpBasicAuth.mustache @@ -5,22 +5,13 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; import {{invokerPackage}}.ApiException; -{{^java8}} -import com.migcomponents.migbase64.Base64; -{{/java8}} -{{#java8}} import java.util.Base64; import java.nio.charset.StandardCharsets; -{{/java8}} import java.net.URI; import java.util.Map; import java.util.List; -{{^java8}} -import java.io.UnsupportedEncodingException; -{{/java8}} - {{>generatedAnnotation}} public class HttpBasicAuth implements Authentication { private String username; @@ -48,15 +39,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); -{{^java8}} - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } -{{/java8}} -{{#java8}} headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); -{{/java8}} } } diff --git a/sdks/java-v1/templates/libraries/jersey2/auth/OAuth.mustache b/sdks/java-v1/templates/libraries/jersey2/auth/OAuth.mustache index 62b573a66..6617522ed 100644 --- a/sdks/java-v1/templates/libraries/jersey2/auth/OAuth.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/auth/OAuth.mustache @@ -10,7 +10,7 @@ import com.github.scribejava.core.exceptions.OAuthException; import com.github.scribejava.core.model.OAuth2AccessToken; import com.github.scribejava.core.oauth.OAuth20Service; -import javax.ws.rs.core.UriBuilder; +import {{javaxPackage}}.ws.rs.core.UriBuilder; import java.io.IOException; import java.net.MalformedURLException; import java.net.URI; @@ -26,7 +26,7 @@ public class OAuth implements Authentication { private String tokenUrl; private String absoluteTokenUrl; - private OAuthFlow flow = OAuthFlow.application; + private OAuthFlow flow = OAuthFlow.APPLICATION; private OAuth20Service service; private DefaultApi20 authApi; private String scope; @@ -99,22 +99,22 @@ public class OAuth implements Authentication { return service.refreshAccessToken(refreshToken); } } catch (OAuthException | InterruptedException | ExecutionException | IOException e) { - log.log(Level.FINE, "Refreshing the access token using the refresh token failed", e); + throw new ApiException("Refreshing the access token using the refresh token failed: " + e.toString()); } try { switch (flow) { - case password: + case PASSWORD: if (username != null && password != null) { accessToken = service.getAccessTokenPasswordGrant(username, password, scope); } break; - case accessCode: + case ACCESS_CODE: if (code != null) { accessToken = service.getAccessToken(code); code = null; } break; - case application: + case APPLICATION: accessToken = service.getAccessTokenClientCredentialsGrant(scope); break; default: @@ -158,15 +158,28 @@ public class OAuth implements Authentication { return this; } + public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe().debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe() + .build(authApi); + } + return this; + } + public OAuth usePasswordFlow(String username, String password) { - this.flow = OAuthFlow.password; + this.flow = OAuthFlow.PASSWORD; this.username = username; this.password = password; return this; } public OAuth useAuthorizationCodeFlow(String code) { - this.flow = OAuthFlow.accessCode; + this.flow = OAuthFlow.ACCESS_CODE; this.code = code; return this; } diff --git a/sdks/java-v1/templates/libraries/jersey2/auth/OAuthFlow.mustache b/sdks/java-v1/templates/libraries/jersey2/auth/OAuthFlow.mustache index 002e9572f..190781fb1 100644 --- a/sdks/java-v1/templates/libraries/jersey2/auth/OAuthFlow.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/auth/OAuthFlow.mustache @@ -2,6 +2,12 @@ package {{invokerPackage}}.auth; +/** + * OAuth flows that are supported by this client + */ public enum OAuthFlow { - accessCode, implicit, password, application + ACCESS_CODE, + IMPLICIT, + PASSWORD, + APPLICATION } diff --git a/sdks/java-v1/templates/libraries/jersey2/build.gradle.mustache b/sdks/java-v1/templates/libraries/jersey2/build.gradle.mustache index 76671e774..7b991eb00 100644 --- a/sdks/java-v1/templates/libraries/jersey2/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/build.gradle.mustache @@ -1,14 +1,24 @@ +{{^useCustomTemplateCode}} +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' + +group = '{{groupId}}' +version = '{{artifactVersion}}' +{{/useCustomTemplateCode}} + buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' } } +{{#useCustomTemplateCode}} plugins { id 'com.vanniktech.maven.publish' version '0.24.0' } @@ -24,10 +34,90 @@ version = '{{artifactVersion}}' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 +{{/useCustomTemplateCode}} repositories { mavenCentral() } +{{^useCustomTemplateCode}} +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' + + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } @@ -113,32 +203,37 @@ publishing { } } } +{{/useCustomTemplateCode}} ext { - swagger_annotations_version = "1.6.3" - jackson_version = "2.13.0" - jackson_databind_version = "2.13.0" + swagger_annotations_version = "1.6.5" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" + {{#useBeanValidation}} + bean_validation_version = "3.0.2" + {{/useBeanValidation}} jersey_version = "2.35" - junit_version = "4.13.2" - {{#threetenbp}} - threetenbp_version = "2.9.10" - {{/threetenbp}} + junit_version = "5.8.2" {{#hasOAuthMethods}} scribejava_apis_version = "8.3.1" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} tomitribe_http_signatures_version = "1.7" {{/hasHttpSignatureMethods}} +{{#useCustomTemplateCode}} mockito_version = "3.12.4" +{{/useCustomTemplateCode}} } dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" +{{#useCustomTemplateCode}} implementation 'commons-codec:commons-codec:1.15' +{{/useCustomTemplateCode}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "org.glassfish.jersey.core:jersey-client:$jersey_version" implementation "org.glassfish.jersey.inject:jersey-hk2:$jersey_version" @@ -154,24 +249,26 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#hasOAuthMethods}} implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" {{/hasHttpSignatureMethods}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + {{#useBeanValidation}} + implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + {{/useBeanValidation}} + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +{{#useCustomTemplateCode}} testImplementation "org.mockito:mockito-core:$mockito_version" +{{/useCustomTemplateCode}} +} + +test { + useJUnitPlatform() } javadoc { diff --git a/sdks/java-v1/templates/libraries/jersey2/build.sbt.mustache b/sdks/java-v1/templates/libraries/jersey2/build.sbt.mustache index d296ad4df..bb525bf1f 100644 --- a/sdks/java-v1/templates/libraries/jersey2/build.sbt.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/build.sbt.mustache @@ -9,28 +9,25 @@ lazy val root = (project in file(".")). Compile / packageDoc / publishArtifact := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( +{{#useCustomTemplateCode}} libraryDependencies += "commons-codec" % "commons-codec" % "1.15" +{{/useCustomTemplateCode}} "com.google.code.findbugs" % "jsr305" % "3.0.0", - "io.swagger" % "swagger-annotations" % "1.6.3", + "io.swagger" % "swagger-annotations" % "1.6.5", "org.glassfish.jersey.core" % "jersey-client" % "2.35", "org.glassfish.jersey.inject" % "jersey-hk2" % "2.35", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.0" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile", {{/joda}} - {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", - {{/threetenbp}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", {{/openApiNullable}} {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", @@ -38,11 +35,7 @@ lazy val root = (project in file(".")). {{#hasHttpSignatureMethods}} "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", {{/hasHttpSignatureMethods}} - {{^java8}} - "com.brsanthu" % "migbase64" % "2.2", - {{/java8}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/sdks/java-v1/templates/libraries/jersey2/model.mustache b/sdks/java-v1/templates/libraries/jersey2/model.mustache index c5abf57e6..509857733 100644 --- a/sdks/java-v1/templates/libraries/jersey2/model.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/model.mustache @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; {{/model}} {{/models}} import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; {{#imports}} @@ -28,8 +27,6 @@ import java.io.Serializable; {{/serializableModel}} {{#jackson}} import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.ObjectMapper; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.*; {{/withXml}} @@ -38,20 +35,24 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} -import javax.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.*; {{/withXml}} {{#parcelableModel}} import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; {{/performBeanValidation}} import {{invokerPackage}}.JSON; +{{#useCustomTemplateCode}} +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; +{{/useCustomTemplateCode}} {{#models}} {{#model}} diff --git a/sdks/java-v1/templates/libraries/jersey2/model_test.mustache b/sdks/java-v1/templates/libraries/jersey2/model_test.mustache new file mode 100644 index 000000000..acd659b66 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey2/model_test.mustache @@ -0,0 +1,44 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for {{classname}} + */ +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/sdks/java-v1/templates/libraries/jersey2/oneof_model.mustache b/sdks/java-v1/templates/libraries/jersey2/oneof_model.mustache index 18bcbc5e1..09906d7b0 100644 --- a/sdks/java-v1/templates/libraries/jersey2/oneof_model.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/oneof_model.mustache @@ -1,5 +1,5 @@ -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.Response; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; @@ -26,7 +26,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -60,7 +60,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#useOneOfDiscriminatorLookup}} {{#discriminator}} {{classname}} new{{classname}} = new {{classname}}(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); switch (discriminatorValue) { {{#mappedModels}} @@ -78,37 +78,74 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + {{#composedSchemas}} {{#oneOf}} - // deserialize {{{.}}} + // deserialize {{{dataType}}}{{#isNullable}} (nullable){{/isNullable}} try { + {{^isArray}} boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if ({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class) || {{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class) || {{{.}}}.class.equals(Boolean.class) || {{{.}}}.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= (({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= (({{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= ({{{.}}}.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= ({{{.}}}.class.equals(String.class) && token == JsonToken.VALUE_STRING); - {{#isNullable}} - attemptParsing |= (token == JsonToken.VALUE_NULL); - {{/isNullable}} - } + {{#isPrimitiveType}} + attemptParsing = typeCoercion; //respect type coercion setting + if (!attemptParsing) { + {{#isString}} + attemptParsing |= (token == JsonToken.VALUE_STRING); + {{/isString}} + {{#isInteger}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isInteger}} + {{#isLong}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isLong}} + {{#isShort}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isShort}} + {{#isFloat}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isFloat}} + {{#isDouble}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDouble}} + {{#isNumber}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isNumber}} + {{#isDecimal}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDecimal}} + {{#isBoolean}} + attemptParsing |= (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + {{/isBoolean}} + {{#isNullable}} + attemptParsing |= (token == JsonToken.VALUE_NULL); + {{/isNullable}} } + {{/isPrimitiveType}} if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs({{{dataType}}}.class); // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON // validation, which means the 'match' count may be higher than it should be. match++; - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); } + {{/isArray}} + {{#isArray}} + if (token == JsonToken.START_ARRAY) { + final TypeReference<{{{dataType}}}> ref = new TypeReference<{{{dataType}}}>(){}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(ref); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); + } + {{/isArray}} } catch (Exception e) { // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); } {{/oneOf}} + {{/composedSchemas}} if (match == 1) { {{classname}} ret = new {{classname}}(); ret.setActualInstance(deserialized); @@ -132,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -152,13 +189,17 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); } {{/additionalPropertiesType}} + {{#composedSchemas}} {{#oneOf}} - public {{classname}}({{{.}}} o) { + {{^vendorExtensions.x-duplicated-data-type}} + public {{classname}}({{{baseType}}} o) { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); setActualInstance(o); } + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} + {{/composedSchemas}} static { {{#oneOf}} schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { @@ -167,7 +208,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); {{#mappedModels}} mappings.put("{{mappingName}}", {{modelName}}.class); {{/mappedModels}} @@ -177,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } @@ -198,13 +239,17 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/isNullable}} + {{#composedSchemas}} {{#oneOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + {{^vendorExtensions.x-duplicated-data-type}} + if (JSON.isInstanceOf({{{baseType}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} + {{/composedSchemas}} throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); } @@ -219,17 +264,26 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return super.getActualInstance(); } + {{#composedSchemas}} {{#oneOf}} /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, * the ClassCastException will be thrown. * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); + {{^isArray}} + public {{{dataType}}} get{{{dataType}}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); } + {{/isArray}} + {{#isArray}} + public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/isArray}} {{/oneOf}} + {{/composedSchemas}} } diff --git a/sdks/java-v1/templates/libraries/jersey2/pojo.mustache b/sdks/java-v1/templates/libraries/jersey2/pojo.mustache index 4dea6caae..0ba5ad05a 100644 --- a/sdks/java-v1/templates/libraries/jersey2/pojo.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/pojo.mustache @@ -1,19 +1,42 @@ +{{#useCustomTemplateCode}} import com.dropbox.sign.ApiException; +{{/useCustomTemplateCode}} /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} - {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) -@JsonIgnoreProperties(ignoreUnknown=true) +{{#isClassnameSanitized}} +@JsonTypeName("{{name}}") +{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +{{#useCustomTemplateCode}} +{{^parent}} +{{^discriminator}} +@JsonIgnoreProperties(ignoreUnknown=true) +{{/discriminator}} +{{/parent}} +{{/useCustomTemplateCode}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -39,44 +62,46 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); {{/isContainer}} {{^isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{#deprecated}} + @Deprecated + {{/deprecated}} +{{^useCustomTemplateCode}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; {{/isContainer}} {{^isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} +{{/useCustomTemplateCode}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} @@ -93,9 +118,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} }{{/jackson}}{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} +{{#useCustomTemplateCode}} /** * Attempt to instantiate and hydrate a new instance of this class @@ -111,6 +137,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{classname}}.class ); } +{{/useCustomTemplateCode}} {{#vars}} {{^isReadOnly}} @@ -120,6 +147,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens )); {{/vendorExtensions.x-enum-as-string}} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) { @@ -135,18 +165,20 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} return this; } +{{#useCustomTemplateCode}} {{#vendorExtensions.x-int-or-string}} public {{classname}} {{name}}(Integer {{name}}) { this.{{name}} = String.valueOf({{name}}); return this; } {{/vendorExtensions.x-int-or-string}} +{{/useCustomTemplateCode}} {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -156,11 +188,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -168,10 +198,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -181,11 +211,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -193,7 +221,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -210,22 +238,30 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} {{#required}} {{#isNullable}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/isNullable}} {{^isNullable}} - @javax.annotation.Nonnull + @{{javaxPackage}}.annotation.Nonnull {{/isNullable}} {{/required}} {{^required}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/required}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -262,6 +298,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^isReadOnly}} + {{#deprecated}} + @Deprecated + {{/deprecated}} {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} {{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} @@ -277,12 +316,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens this.{{name}} = {{name}}; {{/vendorExtensions.x-is-jackson-optional-nullable}} } +{{#useCustomTemplateCode}} {{#vendorExtensions.x-int-or-string}} public void {{setter}}(Integer {{name}}) { this.{{name}} = String.valueOf({{name}}); } {{/vendorExtensions.x-int-or-string}} +{{/useCustomTemplateCode}} {{/isReadOnly}} {{/vars}} @@ -340,7 +381,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} {{#additionalPropertiesType}} sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -349,6 +390,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return sb.toString(); } +{{#useCustomTemplateCode}} public Map createFormData() throws ApiException { Map map = new HashMap<>(); boolean fileTypeFound = false; @@ -404,6 +446,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } +{{/useCustomTemplateCode}} /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). @@ -456,7 +499,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return 0; } - public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<>() { public {{classname}} createFromParcel(Parcel in) { {{#model}} {{#isArray}} @@ -475,14 +518,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens }; {{/parcelableModel}} {{#discriminator}} -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - {{#mappedModels}} - mappings.put("{{mappingName}}", {{modelName}}.class); - {{/mappedModels}} - mappings.put("{{name}}", {{classname}}.class); - JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + {{#mappedModels}} + mappings.put("{{mappingName}}", {{modelName}}.class); + {{/mappedModels}} + mappings.put("{{name}}", {{classname}}.class); + JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); + } {{/discriminator}} } diff --git a/sdks/java-v1/templates/libraries/jersey2/pom.mustache b/sdks/java-v1/templates/libraries/jersey2/pom.mustache index 15bae375e..9a596b00d 100644 --- a/sdks/java-v1/templates/libraries/jersey2/pom.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 3.0.0-M5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -91,6 +91,7 @@ +{{#useCustomTemplateCode}} maven-assembly-plugin @@ -107,11 +108,12 @@ +{{/useCustomTemplateCode}} org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.2.2 @@ -125,7 +127,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -156,7 +158,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.10.1 1.8 1.8 @@ -172,7 +174,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.3.2 attach-javadocs @@ -257,7 +259,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 sign-artifacts @@ -274,17 +276,27 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} - + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} +{{#useCustomTemplateCode}} commons-codec commons-codec 1.15 +{{/useCustomTemplateCode}} @@ -358,13 +370,6 @@ jackson-datatype-jsr310 ${jackson-version} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#hasHttpSignatureMethods}} org.tomitribe @@ -401,40 +406,51 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test +{{#useCustomTemplateCode}} org.mockito mockito-core ${mockito.version} test +{{/useCustomTemplateCode}} UTF-8 - 1.6.3 - 2.35 - 2.13.0 - 2.13.0 - 0.2.2 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.37 + 2.17.1 + 2.17.1 + 0.2.6 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} - 4.13.2 + 5.10.0 {{#hasHttpSignatureMethods}} - 1.7 + 1.8 {{/hasHttpSignatureMethods}} {{#hasOAuthMethods}} - 8.3.1 + 8.3.3 {{/hasOAuthMethods}} - 2.17.3 + 2.21.0 +{{#useCustomTemplateCode}} 3.12.4 +{{/useCustomTemplateCode}} diff --git a/sdks/java-v1/templates/libraries/jersey3/AbstractOpenApiSchema.mustache b/sdks/java-v1/templates/libraries/jersey3/AbstractOpenApiSchema.mustache new file mode 100644 index 000000000..d92c85e26 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/AbstractOpenApiSchema.mustache @@ -0,0 +1,138 @@ +{{>licenseInfo}} + +package {{modelPackage}}; + +import {{invokerPackage}}.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import {{javaxPackage}}.ws.rs.core.GenericType; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +{{>generatedAnnotation}} +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + +{{>libraries/jersey2/additional_properties}} + +} diff --git a/sdks/java-v1/templates/libraries/jersey3/ApiClient.mustache b/sdks/java-v1/templates/libraries/jersey3/ApiClient.mustache new file mode 100644 index 000000000..09563afa7 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/ApiClient.mustache @@ -0,0 +1,1490 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import {{javaxPackage}}.ws.rs.client.Client; +import {{javaxPackage}}.ws.rs.client.ClientBuilder; +import {{javaxPackage}}.ws.rs.client.Entity; +import {{javaxPackage}}.ws.rs.client.Invocation; +import {{javaxPackage}}.ws.rs.client.WebTarget; +import {{javaxPackage}}.ws.rs.core.Form; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.Response.Status; + +{{#hasOAuthMethods}} +import com.github.scribejava.core.model.OAuth2AccessToken; +{{/hasOAuthMethods}} +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.HttpUrlConnectorProvider; +import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.MultiPart; +import org.glassfish.jersey.media.multipart.MultiPartFeature; + +import java.io.IOException; +import java.io.InputStream; + +import java.net.URI; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.security.cert.X509Certificate; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Map.Entry; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; +{{#jsr310}} +import java.time.OffsetDateTime; +{{/jsr310}} + +import java.net.URLEncoder; + +import java.io.File; +import java.io.UnsupportedEncodingException; + +import java.text.DateFormat; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import {{invokerPackage}}.auth.Authentication; +import {{invokerPackage}}.auth.HttpBasicAuth; +import {{invokerPackage}}.auth.HttpBearerAuth; +{{#hasHttpSignatureMethods}} +import {{invokerPackage}}.auth.HttpSignatureAuth; +{{/hasHttpSignatureMethods}} +import {{invokerPackage}}.auth.ApiKeyAuth; +{{#hasOAuthMethods}} +import {{invokerPackage}}.auth.OAuth; +{{/hasOAuthMethods}} + +/** + *

ApiClient class.

+ */ +{{>generatedAnnotation}} +public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); + protected String basePath = "{{{basePath}}}"; + protected String userAgent; + private static final Logger log = Logger.getLogger(ApiClient.class.getName()); + + protected List servers = new ArrayList<>({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} + {{#-last}} + ){{/-last}}{{/servers}}); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + {{^hasOperationServers}} + protected Map> operationServers = new HashMap<>(); + {{/hasOperationServers}} + {{#hasOperationServers}} + protected Map> operationServers; + + { + Map> operationServers = new HashMap<>(); + {{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + {{#servers}} + {{#-first}} + operationServers.put("{{{classname}}}.{{{operationId}}}", new ArrayList<>(Arrays.asList( + {{/-first}} + new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} + {{#-last}} + ))); + {{/-last}} + {{/servers}} + {{/operation}} + {{/operations}} + {{/apis}} + {{/apiInfo}} + this.operationServers = operationServers; + } + + {{/hasOperationServers}} + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); + protected boolean debugging = false; + protected ClientConfig clientConfig; + protected int connectionTimeout = 0; + private int readTimeout = 0; + + protected Client httpClient; + protected JSON json; + protected String tempFolderPath = null; + + protected Map authentications; + protected Map authenticationLookup; + + protected DateFormat dateFormat; + + /** + * Constructs a new ApiClient with default parameters. + */ + public ApiClient() { + this(null); + } + + /** + * Constructs a new ApiClient with the specified authentication parameters. + * + * @param authMap A hash map containing authentication parameters. + */ + public ApiClient(Map authMap) { + json = new JSON(); + httpClient = buildHttpClient(); + + this.dateFormat = new RFC3339DateFormat(); + + // Set default User-Agent. + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>(); + Authentication auth = null; + {{#authMethods}} + if (authMap != null) { + auth = authMap.get("{{name}}"); + } + {{#isBasic}} + {{#isBasicBasic}} + if (auth instanceof HttpBasicAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new HttpBasicAuth()); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + if (auth instanceof HttpBearerAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}")); + } + {{/isBasicBearer}} + {{#isHttpSignature}} + if (auth instanceof HttpSignatureAuth) { + authentications.put("{{name}}", auth); + } + {{/isHttpSignature}} + {{/isBasic}} + {{#isApiKey}} + if (auth instanceof ApiKeyAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}")); + } + {{/isApiKey}} + {{#isOAuth}} + if (auth instanceof OAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new OAuth(basePath, "{{{tokenUrl}}}")); + } + {{/isOAuth}} + {{/authMethods}} + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + + // Setup authentication lookup (key: authentication alias, value: authentication name) + authenticationLookup = new HashMap<>();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} + authenticationLookup.put("{{name}}", "{{.}}");{{/vendorExtensions.x-auth-id-alias}}{{/authMethods}} + } + + /** + * Gets the JSON instance to do JSON serialization and deserialization. + * + * @return JSON + */ + public JSON getJSON() { + return json; + } + + /** + *

Getter for the field httpClient.

+ * + * @return a {@link {{javaxPackage}}.ws.rs.client.Client} object. + */ + public Client getHttpClient() { + return httpClient; + } + + /** + *

Setter for the field httpClient.

+ * + * @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object. + * @return a {@link ApiClient} object. + */ + public ApiClient setHttpClient(Client httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Returns the base URL to the location where the OpenAPI document is being served. + * + * @return The base URL to the target host. + */ + public String getBasePath() { + return basePath; + } + + /** + * Sets the base URL to the location where the OpenAPI document is being served. + * + * @param basePath The base URL to the target host. + * @return a {@link ApiClient} object. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + {{#hasOAuthMethods}} + setOauthBasePath(basePath); + {{/hasOAuthMethods}} + return this; + } + + /** + *

Getter for the field servers.

+ * + * @return a {@link java.util.List} of servers. + */ + public List getServers() { + return servers; + } + + /** + *

Setter for the field servers.

+ * + * @param servers a {@link java.util.List} of servers. + * @return a {@link ApiClient} object. + */ + public ApiClient setServers(List servers) { + this.servers = servers; + updateBasePath(); + return this; + } + + /** + *

Getter for the field serverIndex.

+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getServerIndex() { + return serverIndex; + } + + /** + *

Setter for the field serverIndex.

+ * + * @param serverIndex the server index + * @return a {@link ApiClient} object. + */ + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + updateBasePath(); + return this; + } + + /** + *

Getter for the field serverVariables.

+ * + * @return a {@link java.util.Map} of server variables. + */ + public Map getServerVariables() { + return serverVariables; + } + + /** + *

Setter for the field serverVariables.

+ * + * @param serverVariables a {@link java.util.Map} of server variables. + * @return a {@link ApiClient} object. + */ + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + updateBasePath(); + return this; + } + + private void updateBasePath() { + if (serverIndex != null) { + setBasePath(servers.get(serverIndex).URL(serverVariables)); + } + } + + {{#hasOAuthMethods}} + private void setOauthBasePath(String basePath) { + for(Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setBasePath(basePath); + } + } + } + + {{/hasOAuthMethods}} + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication object + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + * @return a {@link ApiClient} object. + */ + public ApiClient setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return this; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + * @return a {@link ApiClient} object. + */ + public ApiClient setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return this; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + * @return a {@link ApiClient} object. + */ + public ApiClient setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + * @return a {@link ApiClient} object. + */ + public ApiClient configureApiKeys(Map secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.getOrDefault(name, name); + String secret = secrets.get(name); + if (secret != null) { + ((ApiKeyAuth) auth).setApiKey(secret); + } + } + } + return this; + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + * @return a {@link ApiClient} object. + */ + public ApiClient setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set bearer token for the first Bearer authentication. + * + * @param bearerToken Bearer token + * @return a {@link ApiClient} object. + */ + public ApiClient setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return this; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + {{#hasOAuthMethods}} + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + * @return a {@link ApiClient} object. + */ + public ApiClient setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the credentials for the first OAuth2 authentication. + * + * @param clientId the client ID + * @param clientSecret the client secret + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthCredentials(String clientId, String clientSecret) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentials(clientId, clientSecret, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the password flow for the first OAuth2 authentication. + * + * @param username the user name + * @param password the user password + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthPasswordFlow(String username, String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).usePasswordFlow(username, password); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the authorization code flow for the first OAuth2 authentication. + * + * @param code the authorization code + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthAuthorizationCodeFlow(String code) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).useAuthorizationCodeFlow(code); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the scopes for the first OAuth2 authentication. + * + * @param scope the oauth scope + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthScope(String scope) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setScope(scope); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + {{/hasOAuthMethods}} + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent Http user agent + * @return a {@link ApiClient} object. + */ + public ApiClient setUserAgent(String userAgent) { + this.userAgent = userAgent; + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Get the User-Agent header's value. + * + * @return User-Agent string + */ + public String getUserAgent(){ + return userAgent; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return a {@link ApiClient} object. + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return a {@link ApiClient} object. + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Gets the client config. + * + * @return Client config + */ + public ClientConfig getClientConfig() { + return clientConfig; + } + + /** + * Set the client config. + * + * @param clientConfig Set the client config + * @return a {@link ApiClient} object. + */ + public ApiClient setClientConfig(ClientConfig clientConfig) { + this.clientConfig = clientConfig; + // Rebuild HTTP Client according to the new "clientConfig" value. + this.httpClient = buildHttpClient(); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is switched on + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return a {@link ApiClient} object. + */ + public ApiClient setDebugging(boolean debugging) { + this.debugging = debugging; + // Rebuild HTTP Client according to the new "debugging" value. + this.httpClient = buildHttpClient(); + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @return Temp folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set temp folder path + * + * @param tempFolderPath Temp folder path + * @return a {@link ApiClient} object. + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Connect timeout (in milliseconds). + * + * @return Connection timeout + */ + public int getConnectTimeout() { + return connectionTimeout; + } + + /** + * Set the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param connectionTimeout Connection timeout in milliseconds + * @return a {@link ApiClient} object. + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); + return this; + } + + /** + * read timeout (in milliseconds). + * + * @return Read timeout + */ + public int getReadTimeout() { + return readTimeout; + } + + /** + * Set the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param readTimeout Read timeout in milliseconds + * @return a {@link ApiClient} object. + */ + public ApiClient setReadTimeout(int readTimeout) { + this.readTimeout = readTimeout; + httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * + * @return Date format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * + * @param dateFormat Date format + * @return a {@link ApiClient} object. + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + // also set the date format for model (de)serialization with Date properties + this.json.setDateFormat((DateFormat) dateFormat.clone()); + return this; + } + + /** + * Parse the given string into Date object. + * + * @param str String + * @return Date + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + * + * @param date Date + * @return Date in string format + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * + * @param param Object + * @return Object in string format + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } {{#jsr310}}else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } {{/jsr310}}else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(','); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /* + * Format to {@code Pair} objects. + * + * @param collectionFormat Collection format + * @param name Name + * @param value Value + * @return List of pairs + */ + public List parameterToPairs(String collectionFormat, String name, Object value){ + List params = new ArrayList<>(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + // get the collection format (default: csv) + String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); + + // create the params based on the collection format + if ("multi".equals(format)) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } + + return params; + } + + String delimiter = ","; + + if ("csv".equals(format)) { + delimiter = ","; + } else if ("ssv".equals(format)) { + delimiter = " "; + } else if ("tsv".equals(format)) { + delimiter = "\t"; + } else if ("pipes".equals(format)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "*{@literal /}*" is also considered JSON by this method. + * + * @param mime MIME + * @return True if the MIME type is JSON + */ + public boolean isJsonMime(String mime) { + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * JSON will be used. + */ + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Serialize the given Java object into string entity according the given + * Content-Type (only JSON is supported for now). + * + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @return Entity + * @throws ApiException API exception + */ + public Entity serialize(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException { + Entity entity; + if (contentType.startsWith("multipart/form-data")) { + MultiPart multiPart = new MultiPart(); + for (Entry param: formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) + .fileName(file.getName()).size(file.length()).build(); + + // Attempt to probe the content type for the file so that the form part is more correctly + // and precisely identified, but fall back to application/octet-stream if that fails. + MediaType type; + try { + type = MediaType.valueOf(Files.probeContentType(file.toPath())); + } catch (IOException | IllegalArgumentException e) { + type = MediaType.APPLICATION_OCTET_STREAM_TYPE; + } + + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type)); + } else { + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); + } + } + entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + Form form = new Form(); + for (Entry param: formParams.entrySet()) { + form.param(param.getKey(), parameterToString(param.getValue())); + } + entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); + } else { + // We let jersey handle the serialization + if (isBodyNullable) { // payload is nullable + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "null" : obj, contentType); + } + } else { + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "" : obj, contentType); + } + } + } + return entity; + } + + /** + * Serialize the given Java object into string according the given + * Content-Type (only JSON, HTTP form is supported for now). + * + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @param isBodyNullable True if the body is nullable + * @return String + * @throws ApiException API exception + */ + public String serializeToString(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException { + try { + if (contentType.startsWith("multipart/form-data")) { + throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)"); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + String formString = ""; + for (Entry param : formParams.entrySet()) { + formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&"; + } + + if (formString.length() == 0) { // empty string + return formString; + } else { + return formString.substring(0, formString.length() - 1); + } + } else { + if (isBodyNullable) { + return obj == null ? "null" : json.getMapper().writeValueAsString(obj); + } else { + return obj == null ? "" : json.getMapper().writeValueAsString(obj); + } + } + } catch (Exception ex) { + throw new ApiException("Failed to perform serializeToString: " + ex.toString()); + } + } + + /** + * Deserialize response body to Java object according to the Content-Type. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Deserialize object + * @throws ApiException API exception + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, GenericType returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + return (T) response.readEntity(byte[].class); + } else if (returnType.getRawType() == File.class) { + // Handle file downloading. + T file = (T) downloadFileFromResponse(response); + return file; + } + + // read the entity stream multiple times + response.bufferEntity(); + + return response.readEntity(returnType); + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) + filename = matcher.group(1); + } + + String prefix; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf('.'); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param Type + * @param operation The qualified name of the operation + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @param isBodyNullable True if the body is nullable + * @return The response body in type of string + * @throws ApiException API exception + */ + public ApiResponse invokeAPI( + String operation, + String path, + String method, + List queryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String accept, + String contentType, + String[] authNames, + GenericType returnType, + boolean isBodyNullable) + throws ApiException { + + String targetURL; + List serverConfigurations; + if (serverIndex != null && (serverConfigurations = operationServers.get(operation)) != null) { + int index = operationServerIndex.getOrDefault(operation, serverIndex).intValue(); + Map variables = operationServerVariables.getOrDefault(operation, serverVariables); + if (index < 0 || index >= serverConfigurations.size()) { + throw new ArrayIndexOutOfBoundsException( + String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", + index, serverConfigurations.size())); + } + targetURL = serverConfigurations.get(index).URL(variables) + path; + } else { + targetURL = this.basePath + path; + } + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" + WebTarget target = httpClient.target(targetURL); + + if (queryParams != null) { + for (Pair queryParam : queryParams) { + if (queryParam.getValue() != null) { + target = target.queryParam(queryParam.getName(), escapeString(queryParam.getValue())); + } + } + } + + Invocation.Builder invocationBuilder = target.request(); + + if (accept != null) { + invocationBuilder = invocationBuilder.accept(accept); + } + + for (Entry entry : cookieParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + Entity entity = serialize(body, formParams, contentType, isBodyNullable); + + // put all headers in one place + Map allHeaderParams = new HashMap<>(defaultHeaderMap); + allHeaderParams.putAll(headerParams); + + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + {{#hasHttpSignatureMethods}} + serializeToString(body, formParams, contentType, isBodyNullable), + {{/hasHttpSignatureMethods}} + {{^hasHttpSignatureMethods}} + null, + {{/hasHttpSignatureMethods}} + method, + target.getUri()); + } + + for (Entry entry : allHeaderParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.header(entry.getKey(), value); + } + } + + Response response = null; + + try { + response = sendRequest(method, invocationBuilder, entity); + + final int statusCode = response.getStatusInfo().getStatusCode(); + + {{#hasOAuthMethods}} + // If OAuth is used and a status 401 is received, renew the access token and retry the request + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { + for (String authName : authNames) { + Authentication authentication = authentications.get(authName); + if (authentication instanceof OAuth) { + OAuth2AccessToken accessToken = ((OAuth) authentication).renewAccessToken(); + if (accessToken != null) { + invocationBuilder.header("Authorization", null); + invocationBuilder.header("Authorization", "Bearer " + accessToken.getAccessToken()); + response = sendRequest(method, invocationBuilder, entity); + } + break; + } + } + } + + {{/hasOAuthMethods}} + Map> responseHeaders = buildResponseHeaders(response); + + if (statusCode == Status.NO_CONTENT.getStatusCode()) { + return new ApiResponse(statusCode, responseHeaders); + } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { + if (returnType == null) { + return new ApiResponse(statusCode, responseHeaders); + } else { + return new ApiResponse(statusCode, responseHeaders, deserialize(response, returnType)); + } + } else { + String message = "error"; + String respBody = null; + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), message, buildResponseHeaders(response), respBody); + } + } finally { + try { + response.close(); + } catch (Exception e) { + // it's not critical, since the response object is local in method invokeAPI; that's fine, + // just continue + } + } + } + + private Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { + Response response; + if ("POST".equals(method)) { + response = invocationBuilder.post(entity); + } else if ("PUT".equals(method)) { + response = invocationBuilder.put(entity); + } else if ("DELETE".equals(method)) { + response = invocationBuilder.method("DELETE", entity); + } else if ("PATCH".equals(method)) { + response = invocationBuilder.method("PATCH", entity); + } else { + response = invocationBuilder.method(method); + } + return response; + } + + /** + * @deprecated Add qualified name of the operation as a first parameter. + */ + @Deprecated + public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); + } + + /** + * Build the Client used to make HTTP requests. + * + * @return Client + */ + protected Client buildHttpClient() { + // recreate the client config to pickup changes + clientConfig = getDefaultClientConfig(); + + ClientBuilder clientBuilder = ClientBuilder.newBuilder(); + clientBuilder = clientBuilder.withConfig(clientConfig); + customizeClientBuilder(clientBuilder); + return clientBuilder.build(); + } + + /** + * Get the default client config. + * + * @return Client config + */ + public ClientConfig getDefaultClientConfig() { + ClientConfig clientConfig = new ClientConfig(); + clientConfig.register(MultiPartFeature.class); + clientConfig.register(json); + clientConfig.register(JacksonFeature.class); + clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); + if (debugging) { + clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); + clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); + // Set logger to ALL + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); + } + + return clientConfig; + } + + /** + * Customize the client builder. + * + * This method can be overridden to customize the API client. For example, this can be used to: + * 1. Set the hostname verifier to be used by the client to verify the endpoint's hostname + * against its identification information. + * 2. Set the client-side key store. + * 3. Set the SSL context that will be used when creating secured transport connections to + * server endpoints from web targets created by the client instance that is using this SSL context. + * 4. Set the client-side trust store. + * + * To completely disable certificate validation (at your own risk), you can + * override this method and invoke disableCertificateValidation(clientBuilder). + * + * @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object. + */ + protected void customizeClientBuilder(ClientBuilder clientBuilder) { + // No-op extension point + } + + /** + * Disable X.509 certificate validation in TLS connections. + * + * Please note that trusting all certificates is extremely risky. + * This may be useful in a development environment with self-signed certificates. + * + * @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object. + * @throws java.security.KeyManagementException if any. + * @throws java.security.NoSuchAlgorithmException if any. + */ + protected void disableCertificateValidation(ClientBuilder clientBuilder) throws KeyManagementException, NoSuchAlgorithmException { + TrustManager[] trustAllCerts = new X509TrustManager[] { + new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + @Override + public void checkClientTrusted(X509Certificate[] certs, String authType) { + } + @Override + public void checkServerTrusted(X509Certificate[] certs, String authType) { + } + } + }; + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, trustAllCerts, new SecureRandom()); + clientBuilder.sslContext(sslContext); + } + + /** + *

Build the response headers.

+ * + * @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object. + * @return a {@link java.util.Map} of response headers. + */ + protected Map> buildResponseHeaders(Response response) { + Map> responseHeaders = new HashMap<>(); + for (Entry> entry: response.getHeaders().entrySet()) { + List values = entry.getValue(); + List headers = new ArrayList<>(); + for (Object o : values) { + headers.add(String.valueOf(o)); + } + responseHeaders.put(entry.getKey(), headers); + } + return responseHeaders; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param method HTTP method (e.g. POST) + * @param uri HTTP URI + */ + protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + continue; + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } +} diff --git a/sdks/java-v1/templates/libraries/jersey3/ApiResponse.mustache b/sdks/java-v1/templates/libraries/jersey3/ApiResponse.mustache new file mode 100644 index 000000000..86c889b0f --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/ApiResponse.mustache @@ -0,0 +1,73 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.util.List; +import java.util.Map; +{{#caseInsensitiveResponseHeaders}} +import java.util.Map.Entry; +import java.util.TreeMap; +{{/caseInsensitiveResponseHeaders}} + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + private final int statusCode; + private final Map> headers; + private final T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + {{#caseInsensitiveResponseHeaders}} + Map> responseHeaders = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : headers.entrySet()){ + responseHeaders.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.headers = {{#caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}; + this.data = data; + } + + /** + * Get the status code + * + * @return status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + * Get the headers + * + * @return map of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + * Get the data + * + * @return data + */ + public T getData() { + return data; + } +} diff --git a/sdks/java-v1/templates/libraries/jersey3/JSON.mustache b/sdks/java-v1/templates/libraries/jersey3/JSON.mustache new file mode 100644 index 000000000..97cee6394 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/JSON.mustache @@ -0,0 +1,263 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +{{#joda}} +import com.fasterxml.jackson.datatype.joda.JodaModule; +{{/joda}} +{{#models.0}} +import {{modelPackage}}.*; +{{/models.0}} + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; + +{{>generatedAnnotation}} +public class JSON implements ContextResolver { + private ObjectMapper mapper; + + public JSON() { + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + {{#joda}} + .addModule(new JodaModule()) + {{/joda}} + {{#openApiNullable}} + .addModule(new JsonNullableModule()) + {{/openApiNullable}} + .build(); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet<>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap<>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (GenericType childType : descendants.values()) { + if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map>> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static + { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/sdks/java-v1/templates/libraries/jersey3/additional_properties.mustache b/sdks/java-v1/templates/libraries/jersey3/additional_properties.mustache new file mode 100644 index 000000000..2955e9392 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/additional_properties.mustache @@ -0,0 +1,39 @@ +{{#additionalPropertiesType}} + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public {{{.}}} getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } +{{/additionalPropertiesType}} diff --git a/sdks/java-v1/templates/libraries/jersey3/anyof_model.mustache b/sdks/java-v1/templates/libraries/jersey3/anyof_model.mustache new file mode 100644 index 000000000..d480667f3 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/anyof_model.mustache @@ -0,0 +1,202 @@ +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import {{invokerPackage}}.JSON; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +@JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) +@JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + + public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { + public {{classname}}Serializer(Class<{{classname}}> t) { + super(t); + } + + public {{classname}}Serializer() { + this(null); + } + + @Override + public void serialize({{classname}} value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class {{classname}}Deserializer extends StdDeserializer<{{classname}}> { + public {{classname}}Deserializer() { + this({{classname}}.class); + } + + public {{classname}}Deserializer(Class vc) { + super(vc); + } + + @Override + public {{classname}} deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + {{#discriminator}} + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); + if (cls != null) { + // When the OAS schema includes a discriminator, use the discriminator value to + // discriminate the anyOf schemas. + // Get the discriminator mapping value to get the class. + deserialized = tree.traverse(jp.getCodec()).readValueAs(cls); + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(deserialized); + return ret; + } + {{/discriminator}} + {{#anyOf}} + // deserialize {{{.}}} + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match '{{classname}}'", e); + } + + {{/anyOf}} + throw new IOException(String.format("Failed deserialization for {{classname}}: no match found")); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public {{classname}} getNullValue(DeserializationContext ctxt) throws JsonMappingException { + {{#isNullable}} + return null; + {{/isNullable}} + {{^isNullable}} + throw new JsonMappingException(ctxt.getParser(), "{{classname}} cannot be null"); + {{/isNullable}} + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap<>(); + + public {{classname}}() { + super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + } +{{> libraries/jersey2/additional_properties }} + {{#additionalPropertiesType}} + /** + * Return true if this {{name}} object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, (({{classname}})o).additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } + {{/additionalPropertiesType}} + {{#anyOf}} + public {{classname}}({{{.}}} o) { + super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + + {{/anyOf}} + static { + {{#anyOf}} + schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { + }); + {{/anyOf}} + JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); + {{#discriminator}} + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + {{#mappedModels}} + mappings.put("{{mappingName}}", {{modelName}}.class); + {{/mappedModels}} + mappings.put("{{name}}", {{classname}}.class); + JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); + {{/discriminator}} + } + + @Override + public Map> getSchemas() { + return {{classname}}.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + {{#isNullable}} + if (instance == null) { + super.setActualInstance(instance); + return; + } + + {{/isNullable}} + {{#anyOf}} + if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + + {{/anyOf}} + throw new RuntimeException("Invalid instance type. Must be {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + } + + /** + * Get the actual instance, which can be the following: + * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * + * @return The actual instance ({{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + {{#anyOf}} + /** + * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{.}}}` + * @throws ClassCastException if the instance is not `{{{.}}}` + */ + public {{{.}}} get{{{.}}}() throws ClassCastException { + return ({{{.}}})super.getActualInstance(); + } + + {{/anyOf}} +} diff --git a/sdks/java-v1/templates/libraries/jersey3/api.mustache b/sdks/java-v1/templates/libraries/jersey3/api.mustache new file mode 100644 index 000000000..8d3e62f27 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/api.mustache @@ -0,0 +1,292 @@ +package {{package}}; + +import {{invokerPackage}}.ApiException; +import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.ApiResponse; +import {{invokerPackage}}.Configuration; +import {{invokerPackage}}.Pair; + +import {{javaxPackage}}.ws.rs.core.GenericType; + +{{#imports}}import {{import}}; +{{/imports}} + +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}} { + private ApiClient apiClient; + + public {{classname}}() { + this(Configuration.getDefaultApiClient()); + } + + public {{classname}}(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; + } + + {{#operation}} + {{^vendorExtensions.x-group-parameters}} + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + {{#returnType}} + * @return {{.}} + {{/returnType}} + * @throws ApiException if fails to make API call + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
+ {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}.getData(){{/returnType}}; + } + {{/vendorExtensions.x-group-parameters}} + + {{^vendorExtensions.x-group-parameters}} + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> + * @throws ApiException if fails to make API call + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
+ {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{#hasRequiredParams}} + // Check required parameters + {{#allParams}} + {{#required}} + if ({{paramName}} == null) { + throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); + } + {{/required}} + {{/allParams}} + + {{/hasRequiredParams}} + {{#hasPathParams}} + // Path parameters + String localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + + {{/hasPathParams}} + {{#queryParams}} + {{#-first}} + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}}) + ); + {{/-first}} + {{^-first}} + localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/-first}} + {{#-last}} + + {{/-last}} + {{/queryParams}} + {{#headerParams}} + {{#-first}} + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} + + {{/-last}} + {{/headerParams}} + {{#cookieParams}} + {{#-first}} + // Cookie parameters + Map localVarCookieParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} + + {{/-last}} + {{/cookieParams}} + {{#formParams}} + {{#-first}} + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarFormParams.put("{{baseName}}", {{paramName}});{{^required}} + }{{/required}} + {{#-last}} + + {{/-last}} + {{/formParams}} + String localVarAccept = apiClient.selectHeaderAccept({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}); + String localVarContentType = apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); + {{#hasAuthMethods}} + String[] localVarAuthNames = {{=% %=}}new String[] {%#authMethods%"%name%"%^-last%, %/-last%%/authMethods%};%={{ }}=% + {{/hasAuthMethods}} + {{#returnType}} + GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; + {{/returnType}} + return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); + } + {{#vendorExtensions.x-group-parameters}} + + public class API{{operationId}}Request { + {{#allParams}} + private {{{dataType}}} {{paramName}}; + {{/allParams}} + + private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) { + {{#pathParams}} + this.{{paramName}} = {{paramName}}; + {{/pathParams}} + } + {{#allParams}} + {{^isPathParam}} + + /** + * Set {{paramName}} + * @param {{paramName}} {{description}} ({{^required}}optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}{{/required}}{{#required}}required{{/required}}) + * @return API{{operationId}}Request + */ + public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) { + this.{{paramName}} = {{paramName}}; + return this; + } + {{/isPathParam}} + {{/allParams}} + + /** + * Execute {{operationId}} request + {{#returnType}}* @return {{.}}{{/returnType}} + * @throws ApiException if fails to make API call + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
+ {{/responses.0}} + {{#isDeprecated}}* @deprecated{{/isDeprecated}} + */ + {{#isDeprecated}}@Deprecated{{/isDeprecated}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { + {{#returnType}}return {{/returnType}}this.executeWithHttpInfo().getData(); + } + + /** + * Execute {{operationId}} request with HTTP info returned + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> + * @throws ApiException if fails to make API call + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
+ {{/responses.0}} + {{#isDeprecated}} + * @deprecated{{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { + return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + } + + /** + * {{summary}} + * {{notes}}{{#pathParams}} + * @param {{paramName}} {{description}} (required){{/pathParams}} + * @return {{operationId}}Request + * @throws ApiException if fails to make API call + {{#isDeprecated}}* @deprecated{{/isDeprecated}} + {{#externalDocs}}* {{description}} + * @see {{summary}} Documentation{{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public API{{operationId}}Request {{operationId}}({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) throws ApiException { + return new API{{operationId}}Request({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}); + } + {{/vendorExtensions.x-group-parameters}} + {{/operation}} +} +{{/operations}} diff --git a/sdks/java-v1/templates/libraries/jersey3/apiException.mustache b/sdks/java-v1/templates/libraries/jersey3/apiException.mustache new file mode 100644 index 000000000..d10322379 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/apiException.mustache @@ -0,0 +1,101 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.util.Map; +import java.util.List; +{{#caseInsensitiveResponseHeaders}} +import java.util.Map.Entry; +import java.util.TreeMap; +{{/caseInsensitiveResponseHeaders}} + +/** + * API Exception + */ +{{>generatedAnnotation}} +public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + {{#caseInsensitiveResponseHeaders}} + Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : responseHeaders.entrySet()){ + headers.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + {{#caseInsensitiveResponseHeaders}} + Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : responseHeaders.entrySet()){ + headers.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/sdks/java-v1/templates/libraries/jersey3/api_doc.mustache b/sdks/java-v1/templates/libraries/jersey3/api_doc.mustache new file mode 100644 index 000000000..26c98508e --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/api_doc.mustache @@ -0,0 +1,124 @@ +# {{classname}}{{#description}} + +{{.}}{{/description}} + +All URIs are relative to *{{basePath}}* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +## {{operationId}} + +{{^vendorExtensions.x-group-parameters}} +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) +{{/vendorExtensions.x-group-parameters}} +{{#vendorExtensions.x-group-parameters}} +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}.execute(); +{{/vendorExtensions.x-group-parameters}} + +{{summary}}{{#notes}} + +{{{unescapedNotes}}}{{/notes}} + +### Example + +```java +{{#vendorExtensions.x-java-import}} +import {{.}}; +{{/vendorExtensions.x-java-import}} +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.model.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{^vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} + .execute(); + {{/vendorExtensions.x-group-parameters}} + {{#returnType}} + System.out.println(result); + {{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + +- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +{{/operation}} +{{/operations}} diff --git a/sdks/java-v1/templates/libraries/jersey3/api_test.mustache b/sdks/java-v1/templates/libraries/jersey3/api_test.mustache new file mode 100644 index 000000000..7b8214bd4 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/api_test.mustache @@ -0,0 +1,62 @@ +{{>licenseInfo}} + +package {{package}}; + +import {{invokerPackage}}.*; +import {{invokerPackage}}.auth.*; +{{#imports}}import {{import}}; +{{/imports}} + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} +/** + * API tests for {{classname}} + */ +public class {{classname}}Test { + + private final {{classname}} api = new {{classname}}(); + + {{#operations}} + {{#operation}} + /** + {{#summary}} + * {{summary}} + * + {{/summary}} + {{#notes}} + * {{notes}} + * + {{/notes}} + * @throws ApiException if the Api call fails + */ + @Test + public void {{operationId}}Test() throws ApiException { + {{#allParams}} + //{{{dataType}}} {{paramName}} = null; + {{/allParams}} + {{^vendorExtensions.x-group-parameters}} + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#vendorExtensions.x-group-parameters}} + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + // .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} + // .execute(); + {{/vendorExtensions.x-group-parameters}} + // TODO: test validations + } + + {{/operation}} + {{/operations}} +} diff --git a/sdks/java-v1/templates/libraries/jersey3/auth/ApiKeyAuth.mustache b/sdks/java-v1/templates/libraries/jersey3/auth/ApiKeyAuth.mustache new file mode 100644 index 000000000..1731f936f --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/auth/ApiKeyAuth.mustache @@ -0,0 +1,68 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/sdks/java-v1/templates/libraries/jersey3/auth/Authentication.mustache b/sdks/java-v1/templates/libraries/jersey3/auth/Authentication.mustache new file mode 100644 index 000000000..46d9c1ab6 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/auth/Authentication.mustache @@ -0,0 +1,22 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; + +} diff --git a/sdks/java-v1/templates/libraries/jersey3/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/libraries/jersey3/auth/HttpBasicAuth.mustache new file mode 100644 index 000000000..13cecfa90 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/auth/HttpBasicAuth.mustache @@ -0,0 +1,44 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.util.Base64; +import java.nio.charset.StandardCharsets; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/sdks/java-v1/templates/libraries/jersey3/auth/HttpBearerAuth.mustache b/sdks/java-v1/templates/libraries/jersey3/auth/HttpBearerAuth.mustache new file mode 100644 index 000000000..110a11ea7 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/auth/HttpBearerAuth.mustache @@ -0,0 +1,51 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if(bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/sdks/java-v1/templates/libraries/jersey3/auth/HttpSignatureAuth.mustache b/sdks/java-v1/templates/libraries/jersey3/auth/HttpSignatureAuth.mustache new file mode 100644 index 000000000..ac0a77db8 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/auth/HttpSignatureAuth.mustache @@ -0,0 +1,269 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.net.URLEncoder; +import java.security.MessageDigest; +import java.security.Key; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.List; +import java.util.TimeZone; +import java.security.spec.AlgorithmParameterSpec; +import java.security.InvalidKeyException; + +import org.tomitribe.auth.signatures.Algorithm; +import org.tomitribe.auth.signatures.Signer; +import org.tomitribe.auth.signatures.Signature; +import org.tomitribe.auth.signatures.SigningAlgorithm; + +/** + * A Configuration object for the HTTP message signature security scheme. + */ +public class HttpSignatureAuth implements Authentication { + + private Signer signer; + + // An opaque string that the server can use to look up the component they need to validate the signature. + private String keyId; + + // The HTTP signature algorithm. + private SigningAlgorithm signingAlgorithm; + + // The HTTP cryptographic algorithm. + private Algorithm algorithm; + + // The cryptographic parameters. + private AlgorithmParameterSpec parameterSpec; + + // The list of HTTP headers that should be included in the HTTP signature. + private List headers; + + // The digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. + private String digestAlgorithm; + + // The maximum validity duration of the HTTP signature. + private Long maxSignatureValidity; + + /** + * Construct a new HTTP signature auth configuration object. + * + * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. + * @param signingAlgorithm The signature algorithm. + * @param algorithm The cryptographic algorithm. + * @param digestAlgorithm The digest algorithm. + * @param headers The list of HTTP headers that should be included in the HTTP signature. + * @param maxSignatureValidity The maximum validity duration of the HTTP signature. + * Used to set the '(expires)' field in the HTTP signature. + */ + public HttpSignatureAuth(String keyId, + SigningAlgorithm signingAlgorithm, + Algorithm algorithm, + String digestAlgorithm, + AlgorithmParameterSpec parameterSpec, + List headers, + Long maxSignatureValidity) { + this.keyId = keyId; + this.signingAlgorithm = signingAlgorithm; + this.algorithm = algorithm; + this.parameterSpec = parameterSpec; + this.digestAlgorithm = digestAlgorithm; + this.headers = headers; + this.maxSignatureValidity = maxSignatureValidity; + } + + /** + * Returns the opaque string that the server can use to look up the component they need to validate the signature. + * + * @return The keyId. + */ + public String getKeyId() { + return keyId; + } + + /** + * Set the HTTP signature key id. + * + * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. + */ + public void setKeyId(String keyId) { + this.keyId = keyId; + } + + /** + * Returns the HTTP signature algorithm which is used to sign HTTP requests. + */ + public SigningAlgorithm getSigningAlgorithm() { + return signingAlgorithm; + } + + /** + * Sets the HTTP signature algorithm which is used to sign HTTP requests. + * + * @param signingAlgorithm The HTTP signature algorithm. + */ + public void setSigningAlgorithm(SigningAlgorithm signingAlgorithm) { + this.signingAlgorithm = signingAlgorithm; + } + + /** + * Returns the HTTP cryptographic algorithm which is used to sign HTTP requests. + */ + public Algorithm getAlgorithm() { + return algorithm; + } + + /** + * Sets the HTTP cryptographic algorithm which is used to sign HTTP requests. + * + * @param algorithm The HTTP signature algorithm. + */ + public void setAlgorithm(Algorithm algorithm) { + this.algorithm = algorithm; + } + + /** + * Returns the cryptographic parameters which are used to sign HTTP requests. + */ + public AlgorithmParameterSpec getAlgorithmParameterSpec() { + return parameterSpec; + } + + /** + * Sets the cryptographic parameters which are used to sign HTTP requests. + * + * @param parameterSpec The cryptographic parameters. + */ + public void setAlgorithmParameterSpec(AlgorithmParameterSpec parameterSpec) { + this.parameterSpec = parameterSpec; + } + + /** + * Returns the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. + * + * @see java.security.MessageDigest + */ + public String getDigestAlgorithm() { + return digestAlgorithm; + } + + /** + * Sets the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. + * + * The exact list of supported digest algorithms depends on the installed security providers. + * Every implementation of the Java platform is required to support "MD5", "SHA-1" and "SHA-256". + * Do not use "MD5" and "SHA-1", they are vulnerable to multiple known attacks. + * By default, "SHA-256" is used. + * + * @param digestAlgorithm The digest algorithm. + * + * @see java.security.MessageDigest + */ + public void setDigestAlgorithm(String digestAlgorithm) { + this.digestAlgorithm = digestAlgorithm; + } + + /** + * Returns the list of HTTP headers that should be included in the HTTP signature. + */ + public List getHeaders() { + return headers; + } + + /** + * Sets the list of HTTP headers that should be included in the HTTP signature. + * + * @param headers The HTTP headers. + */ + public void setHeaders(List headers) { + this.headers = headers; + } + + /** + * Returns the maximum validity duration of the HTTP signature. + * @return The maximum validity duration of the HTTP signature. + */ + public Long getMaxSignatureValidity() { + return maxSignatureValidity; + } + + /** + * Returns the signer instance used to sign HTTP messages. + * + * @return the signer instance. + */ + public Signer getSigner() { + return signer; + } + + /** + * Sets the signer instance used to sign HTTP messages. + * + * @param signer The signer instance to set. + */ + public void setSigner(Signer signer) { + this.signer = signer; + } + + /** + * Set the private key used to sign HTTP requests using the HTTP signature scheme. + * + * @param key The private key. + * + * @throws InvalidKeyException Unable to parse the key, or the security provider for this key + * is not installed. + */ + public void setPrivateKey(Key key) throws InvalidKeyException, ApiException { + if (key == null) { + throw new ApiException("Private key (java.security.Key) cannot be null"); + } + signer = new Signer(key, new Signature(keyId, signingAlgorithm, algorithm, parameterSpec, null, headers, maxSignatureValidity)); + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + try { + if (headers.contains("host")) { + headerParams.put("host", uri.getHost()); + } + + if (headers.contains("date")) { + SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US); + dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + headerParams.put("date", dateFormat.format(Calendar.getInstance().getTime())); + } + + if (headers.contains("digest")) { + headerParams.put("digest", + this.digestAlgorithm + "=" + + new String(Base64.getEncoder().encode(MessageDigest.getInstance(this.digestAlgorithm).digest(payload.getBytes())))); + } + + if (signer == null) { + throw new ApiException("Signer cannot be null. Please call the method `setPrivateKey` to set it up correctly"); + } + + // construct the path with the URL-encoded path and query. + // Calling getRawPath and getRawQuery ensures the path is URL-encoded as it will be serialized + // on the wire. The HTTP signature must use the encode URL as it is sent on the wire. + String path = uri.getRawPath(); + if (uri.getRawQuery() != null && !"".equals(uri.getRawQuery())) { + path += "?" + uri.getRawQuery(); + } + + headerParams.put("Authorization", signer.sign(method, path, headerParams).toString()); + } catch (Exception ex) { + throw new ApiException("Failed to create signature in the HTTP request header: " + ex.toString()); + } + } +} diff --git a/sdks/java-v1/templates/libraries/jersey3/auth/OAuth.mustache b/sdks/java-v1/templates/libraries/jersey3/auth/OAuth.mustache new file mode 100644 index 000000000..6617522ed --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/auth/OAuth.mustache @@ -0,0 +1,195 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.builder.api.DefaultApi20; +import com.github.scribejava.core.exceptions.OAuthException; +import com.github.scribejava.core.model.OAuth2AccessToken; +import com.github.scribejava.core.oauth.OAuth20Service; + +import {{javaxPackage}}.ws.rs.core.UriBuilder; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.logging.Level; +import java.util.logging.Logger; + +{{>generatedAnnotation}} +public class OAuth implements Authentication { + private static final Logger log = Logger.getLogger(OAuth.class.getName()); + + private String tokenUrl; + private String absoluteTokenUrl; + private OAuthFlow flow = OAuthFlow.APPLICATION; + private OAuth20Service service; + private DefaultApi20 authApi; + private String scope; + private String username; + private String password; + private String code; + private volatile OAuth2AccessToken accessToken; + + public OAuth(String basePath, String tokenUrl) { + this.tokenUrl = tokenUrl; + this.absoluteTokenUrl = createAbsoluteTokenUrl(basePath, tokenUrl); + authApi = new DefaultApi20() { + @Override + public String getAccessTokenEndpoint() { + return absoluteTokenUrl; + } + + @Override + protected String getAuthorizationBaseUrl() { + throw new UnsupportedOperationException("Shouldn't get there !"); + } + }; + } + + private static String createAbsoluteTokenUrl(String basePath, String tokenUrl) { + if (!URI.create(tokenUrl).isAbsolute()) { + try { + return UriBuilder.fromPath(basePath).path(tokenUrl).build().toURL().toString(); + } catch (MalformedURLException e) { + log.log(Level.SEVERE, "Couldn't create absolute token URL", e); + } + } + return tokenUrl; + } + + @Override + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { + + if (accessToken == null) { + obtainAccessToken(null); + } + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken.getAccessToken()); + } + } + + public OAuth2AccessToken renewAccessToken() throws ApiException { + String refreshToken = null; + if (accessToken != null) { + refreshToken = accessToken.getRefreshToken(); + accessToken = null; + } + return obtainAccessToken(refreshToken); + } + + public synchronized OAuth2AccessToken obtainAccessToken(String refreshToken) throws ApiException { + if (service == null) { + log.log(Level.FINE, "service is null in obtainAccessToken."); + return null; + } + try { + if (refreshToken != null) { + return service.refreshAccessToken(refreshToken); + } + } catch (OAuthException | InterruptedException | ExecutionException | IOException e) { + throw new ApiException("Refreshing the access token using the refresh token failed: " + e.toString()); + } + try { + switch (flow) { + case PASSWORD: + if (username != null && password != null) { + accessToken = service.getAccessTokenPasswordGrant(username, password, scope); + } + break; + case ACCESS_CODE: + if (code != null) { + accessToken = service.getAccessToken(code); + code = null; + } + break; + case APPLICATION: + accessToken = service.getAccessTokenClientCredentialsGrant(scope); + break; + default: + log.log(Level.SEVERE, "Invalid flow in obtainAccessToken: " + flow); + } + } catch (OAuthException | InterruptedException | ExecutionException | IOException e) { + throw new ApiException(e); + } + return accessToken; + } + + public OAuth2AccessToken getAccessToken() { + return accessToken; + } + + public OAuth setAccessToken(OAuth2AccessToken accessToken) { + this.accessToken = accessToken; + return this; + } + + public OAuth setAccessToken(String accessToken) { + this.accessToken = new OAuth2AccessToken(accessToken); + return this; + } + + public OAuth setScope(String scope) { + this.scope = scope; + return this; + } + + public OAuth setCredentials(String clientId, String clientSecret, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecret(clientSecret).debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecret(clientSecret) + .build(authApi); + } + return this; + } + + public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe().debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe() + .build(authApi); + } + return this; + } + + public OAuth usePasswordFlow(String username, String password) { + this.flow = OAuthFlow.PASSWORD; + this.username = username; + this.password = password; + return this; + } + + public OAuth useAuthorizationCodeFlow(String code) { + this.flow = OAuthFlow.ACCESS_CODE; + this.code = code; + return this; + } + + public OAuth setFlow(OAuthFlow flow) { + this.flow = flow; + return this; + } + + public void setBasePath(String basePath) { + this.absoluteTokenUrl = createAbsoluteTokenUrl(basePath, tokenUrl); + } +} diff --git a/sdks/java-v1/templates/libraries/jersey3/auth/OAuthFlow.mustache b/sdks/java-v1/templates/libraries/jersey3/auth/OAuthFlow.mustache new file mode 100644 index 000000000..190781fb1 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/auth/OAuthFlow.mustache @@ -0,0 +1,13 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +/** + * OAuth flows that are supported by this client + */ +public enum OAuthFlow { + ACCESS_CODE, + IMPLICIT, + PASSWORD, + APPLICATION +} diff --git a/sdks/java-v1/templates/libraries/jersey3/build.gradle.mustache b/sdks/java-v1/templates/libraries/jersey3/build.gradle.mustache new file mode 100644 index 000000000..42908c8bb --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/build.gradle.mustache @@ -0,0 +1,184 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' + +group = '{{groupId}}' +version = '{{artifactVersion}}' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' + } +} + +repositories { + mavenCentral() +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' + + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + swagger_annotations_version = "1.6.5" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + {{#openApiNullable}} + jackson_databind_nullable_version = "0.2.6" + {{/openApiNullable}} + jakarta_annotation_version = "2.1.0" + {{#useBeanValidation}} + bean_validation_version = "3.0.2" + {{/useBeanValidation}} + jersey_version = "3.0.4" + junit_version = "5.8.2" + {{#hasOAuthMethods}} + scribejava_apis_version = "8.3.1" + {{/hasOAuthMethods}} + {{#hasHttpSignatureMethods}} + tomitribe_http_signatures_version = "1.7" + {{/hasHttpSignatureMethods}} +} + +dependencies { + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.glassfish.jersey.core:jersey-client:$jersey_version" + implementation "org.glassfish.jersey.inject:jersey-hk2:$jersey_version" + implementation "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" + implementation "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" + implementation "org.glassfish.jersey.connectors:jersey-apache-connector:$jersey_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + {{#openApiNullable}} + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + {{/openApiNullable}} + {{#joda}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" + {{/joda}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{#hasOAuthMethods}} + implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" + {{/hasOAuthMethods}} + {{#hasHttpSignatureMethods}} + implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" + {{/hasHttpSignatureMethods}} + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + {{#useBeanValidation}} + implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + {{/useBeanValidation}} + + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + useJUnitPlatform() +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } +} diff --git a/sdks/java-v1/templates/libraries/jersey3/build.sbt.mustache b/sdks/java-v1/templates/libraries/jersey3/build.sbt.mustache new file mode 100644 index 000000000..6e89375a6 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/build.sbt.mustache @@ -0,0 +1,38 @@ +lazy val root = (project in file(".")). + settings( + organization := "{{groupId}}", + name := "{{artifactId}}", + version := "{{artifactVersion}}", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + Compile / javacOptions ++= Seq("-Xlint:deprecation"), + Compile / packageDoc / publishArtifact := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "com.google.code.findbugs" % "jsr305" % "3.0.0", + "io.swagger" % "swagger-annotations" % "1.6.5", + "org.glassfish.jersey.core" % "jersey-client" % "3.0.4", + "org.glassfish.jersey.inject" % "jersey-hk2" % "3.0.4", + "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4", + "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4", + "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + {{#joda}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile", + {{/joda}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", + {{#openApiNullable}} + "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", + {{/openApiNullable}} + {{#hasOAuthMethods}} + "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", + {{/hasOAuthMethods}} + {{#hasHttpSignatureMethods}} + "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", + {{/hasHttpSignatureMethods}} + "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" + ) + ) diff --git a/sdks/java-v1/templates/libraries/jersey3/generatedAnnotation.mustache b/sdks/java-v1/templates/libraries/jersey3/generatedAnnotation.mustache new file mode 100644 index 000000000..e05689d5f --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/generatedAnnotation.mustache @@ -0,0 +1 @@ +@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/jersey3/model.mustache b/sdks/java-v1/templates/libraries/jersey3/model.mustache new file mode 100644 index 000000000..1904ee40e --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/model.mustache @@ -0,0 +1,63 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#useReflectionEqualsHashCode}} +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +{{/useReflectionEqualsHashCode}} +{{#models}} +{{#model}} +{{#additionalPropertiesType}} +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +{{/additionalPropertiesType}} +{{/model}} +{{/models}} +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +{{#imports}} +import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.annotation.*; +{{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jackson}} +{{#withXml}} +import {{javaxPackage}}.xml.bind.annotation.*; +{{/withXml}} +{{#parcelableModel}} +import android.os.Parcelable; +import android.os.Parcel; +{{/parcelableModel}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} +{{#performBeanValidation}} +import org.hibernate.validator.constraints.*; +{{/performBeanValidation}} +import {{invokerPackage}}.JSON; + +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +import com.fasterxml.jackson.core.type.TypeReference; +{{/-first}} +{{/oneOf}} + +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>oneof_model}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>anyof_model}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>pojo}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/sdks/java-v1/templates/libraries/jersey3/model_anyof_doc.mustache b/sdks/java-v1/templates/libraries/jersey3/model_anyof_doc.mustache new file mode 100644 index 000000000..e360aa56e --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/model_anyof_doc.mustache @@ -0,0 +1,38 @@ +# {{classname}} + +{{#description}} +{{&description}} + +{{/description}} +## anyOf schemas +{{#anyOf}} +* [{{{.}}}]({{{.}}}.md) +{{/anyOf}} + +{{#isNullable}} +NOTE: this class is nullable. + +{{/isNullable}} +## Example +```java +// Import classes: +import {{{package}}}.{{{classname}}}; +{{#anyOf}} +import {{{package}}}.{{{.}}}; +{{/anyOf}} + +public class Example { + public static void main(String[] args) { + {{classname}} example{{classname}} = new {{classname}}(); + {{#anyOf}} + + // create a new {{{.}}} + {{{.}}} example{{{.}}} = new {{{.}}}(); + // set {{{classname}}} to {{{.}}} + example{{classname}}.setActualInstance(example{{{.}}}); + // to get back the {{{.}}} set earlier + {{{.}}} test{{{.}}} = ({{{.}}}) example{{classname}}.getActualInstance(); + {{/anyOf}} + } +} +``` diff --git a/sdks/java-v1/templates/libraries/jersey3/model_doc.mustache b/sdks/java-v1/templates/libraries/jersey3/model_doc.mustache new file mode 100644 index 000000000..be1aedcf2 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/model_doc.mustache @@ -0,0 +1,19 @@ +{{#models}}{{#model}} + +{{#isEnum}} +{{>enum_outer_doc}} +{{/isEnum}} +{{^isEnum}} +{{^oneOf.isEmpty}} +{{>model_oneof_doc}} +{{/oneOf.isEmpty}} +{{^anyOf.isEmpty}} +{{>model_anyof_doc}} +{{/anyOf.isEmpty}} +{{^anyOf}} +{{^oneOf}} +{{>pojo_doc}} +{{/oneOf}} +{{/anyOf}} +{{/isEnum}} +{{/model}}{{/models}} diff --git a/sdks/java-v1/templates/libraries/jersey3/model_oneof_doc.mustache b/sdks/java-v1/templates/libraries/jersey3/model_oneof_doc.mustache new file mode 100644 index 000000000..5fff76c9e --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/model_oneof_doc.mustache @@ -0,0 +1,38 @@ +# {{classname}} + +{{#description}} +{{&description}} + +{{/description}} +## oneOf schemas +{{#oneOf}} +* [{{{.}}}]({{{.}}}.md) +{{/oneOf}} + +{{#isNullable}} +NOTE: this class is nullable. + +{{/isNullable}} +## Example +```java +// Import classes: +import {{{package}}}.{{{classname}}}; +{{#oneOf}} +import {{{package}}}.{{{.}}}; +{{/oneOf}} + +public class Example { + public static void main(String[] args) { + {{classname}} example{{classname}} = new {{classname}}(); + {{#oneOf}} + + // create a new {{{.}}} + {{{.}}} example{{{.}}} = new {{{.}}}(); + // set {{{classname}}} to {{{.}}} + example{{classname}}.setActualInstance(example{{{.}}}); + // to get back the {{{.}}} set earlier + {{{.}}} test{{{.}}} = ({{{.}}}) example{{classname}}.getActualInstance(); + {{/oneOf}} + } +} +``` diff --git a/sdks/java-v1/templates/libraries/jersey3/model_test.mustache b/sdks/java-v1/templates/libraries/jersey3/model_test.mustache new file mode 100644 index 000000000..acd659b66 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/model_test.mustache @@ -0,0 +1,44 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for {{classname}} + */ +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/sdks/java-v1/templates/libraries/jersey3/oneof_model.mustache b/sdks/java-v1/templates/libraries/jersey3/oneof_model.mustache new file mode 100644 index 000000000..09906d7b0 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/oneof_model.mustache @@ -0,0 +1,289 @@ +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import {{invokerPackage}}.JSON; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +@JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class) +@JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + + public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { + public {{classname}}Serializer(Class<{{classname}}> t) { + super(t); + } + + public {{classname}}Serializer() { + this(null); + } + + @Override + public void serialize({{classname}} value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class {{classname}}Deserializer extends StdDeserializer<{{classname}}> { + public {{classname}}Deserializer() { + this({{classname}}.class); + } + + public {{classname}}Deserializer(Class vc) { + super(vc); + } + + @Override + public {{classname}} deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + {{classname}} new{{classname}} = new {{classname}}(); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); + switch (discriminatorValue) { + {{#mappedModels}} + case "{{{mappingName}}}": + deserialized = tree.traverse(jp.getCodec()).readValueAs({{{modelName}}}.class); + new{{classname}}.setActualInstance(deserialized); + return new{{classname}}; + {{/mappedModels}} + default: + log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); + } + + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + {{#composedSchemas}} + {{#oneOf}} + // deserialize {{{dataType}}}{{#isNullable}} (nullable){{/isNullable}} + try { + {{^isArray}} + boolean attemptParsing = true; + {{#isPrimitiveType}} + attemptParsing = typeCoercion; //respect type coercion setting + if (!attemptParsing) { + {{#isString}} + attemptParsing |= (token == JsonToken.VALUE_STRING); + {{/isString}} + {{#isInteger}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isInteger}} + {{#isLong}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isLong}} + {{#isShort}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isShort}} + {{#isFloat}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isFloat}} + {{#isDouble}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDouble}} + {{#isNumber}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isNumber}} + {{#isDecimal}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDecimal}} + {{#isBoolean}} + attemptParsing |= (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + {{/isBoolean}} + {{#isNullable}} + attemptParsing |= (token == JsonToken.VALUE_NULL); + {{/isNullable}} + } + {{/isPrimitiveType}} + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs({{{dataType}}}.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); + } + {{/isArray}} + {{#isArray}} + if (token == JsonToken.START_ARRAY) { + final TypeReference<{{{dataType}}}> ref = new TypeReference<{{{dataType}}}>(){}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(ref); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); + } + {{/isArray}} + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); + } + + {{/oneOf}} + {{/composedSchemas}} + if (match == 1) { + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public {{classname}} getNullValue(DeserializationContext ctxt) throws JsonMappingException { + {{#isNullable}} + return null; + {{/isNullable}} + {{^isNullable}} + throw new JsonMappingException(ctxt.getParser(), "{{classname}} cannot be null"); + {{/isNullable}} + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public {{classname}}() { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + } +{{> libraries/jersey2/additional_properties }} + {{#additionalPropertiesType}} + /** + * Return true if this {{name}} object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, (({{classname}})o).additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } + {{/additionalPropertiesType}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + public {{classname}}({{{baseType}}} o) { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + {{/vendorExtensions.x-duplicated-data-type}} + + {{/oneOf}} + {{/composedSchemas}} + static { + {{#oneOf}} + schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { + }); + {{/oneOf}} + JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); + {{#discriminator}} + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + {{#mappedModels}} + mappings.put("{{mappingName}}", {{modelName}}.class); + {{/mappedModels}} + mappings.put("{{name}}", {{classname}}.class); + JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); + {{/discriminator}} + } + + @Override + public Map> getSchemas() { + return {{classname}}.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + {{#isNullable}} + if (instance == null) { + super.setActualInstance(instance); + return; + } + + {{/isNullable}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (JSON.isInstanceOf({{{baseType}}}.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + } + + /** + * Get the actual instance, which can be the following: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + {{#composedSchemas}} + {{#oneOf}} + /** + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` + */ + {{^isArray}} + public {{{dataType}}} get{{{dataType}}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/isArray}} + {{#isArray}} + public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/isArray}} + + {{/oneOf}} + {{/composedSchemas}} +} diff --git a/sdks/java-v1/templates/libraries/jersey3/pojo.mustache b/sdks/java-v1/templates/libraries/jersey3/pojo.mustache new file mode 100644 index 000000000..06be4ddf2 --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/pojo.mustache @@ -0,0 +1,421 @@ +/** + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + */{{#isDeprecated}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +{{#isClassnameSanitized}} +@JsonTypeName("{{name}}") +{{/isClassnameSanitized}} +{{/jackson}} +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +{{#serializableModel}} + private static final long serialVersionUID = 1L; + +{{/serializableModel}} + {{#vars}} + {{#isEnum}} + {{^isContainer}} + {{^vendorExtensions.x-enum-as-string}} +{{>modelInnerEnum}} + {{/vendorExtensions.x-enum-as-string}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>modelInnerEnum}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + {{#gson}} + public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; + {{/gson}} + {{#jackson}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; + {{/jackson}} + {{#withXml}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{/withXml}} + {{#gson}} + @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) + {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{/isContainer}} + {{^isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{/vars}} + public {{classname}}() { {{#parent}}{{#parcelableModel}} + super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} + }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}}{{#jackson}} + + @JsonCreator + public {{classname}}( + {{#readOnlyVars}} + {{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; + {{/readOnlyVars}} + }{{/jackson}}{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} + {{#vars}} + + {{^isReadOnly}} + {{#vendorExtensions.x-enum-as-string}} + public static final Set {{{nameInSnakeCase}}}_VALUES = new HashSet<>(Arrays.asList( + {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} + )); + + {{/vendorExtensions.x-enum-as-string}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-enum-as-string}} + if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) { + throw new IllegalArgumentException({{name}} + " is invalid. Possible values for {{name}}: " + String.join(", ", {{{nameInSnakeCase}}}_VALUES)); + } + + {{/vendorExtensions.x-enum-as-string}} + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); + } + try { + this.{{name}}.get().add({{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; + } + this.{{name}}.add({{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); + } + try { + this.{{name}}.get().put(key, {{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; + } + this.{{name}}.put(key, {{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isMap}} + + {{/isReadOnly}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + */ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#required}} +{{#isNullable}} + @{{javaxPackage}}.annotation.Nullable +{{/isNullable}} +{{^isNullable}} + @{{javaxPackage}}.annotation.Nonnull +{{/isNullable}} +{{/required}} +{{^required}} + @{{javaxPackage}}.annotation.Nullable +{{/required}} +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} +{{#vendorExtensions.x-is-jackson-optional-nullable}} + {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} + @JsonIgnore +{{/vendorExtensions.x-is-jackson-optional-nullable}} +{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} + public {{{datatypeWithEnum}}} {{getter}}() { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} + if ({{name}} == null) { + {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + } + {{/isReadOnly}} + return {{name}}.orElse(null); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + return {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + + {{#vendorExtensions.x-is-jackson-optional-nullable}} +{{> jackson_annotations}} + public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { + return {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} + this.{{name}} = {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{^isReadOnly}} + {{#deprecated}} + @Deprecated + {{/deprecated}} +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-enum-as-string}} + if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) { + throw new IllegalArgumentException({{name}} + " is invalid. Possible values for {{name}}: " + String.join(", ", {{{nameInSnakeCase}}}_VALUES)); + } + + {{/vendorExtensions.x-enum-as-string}} + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isReadOnly}} + + {{/vars}} +{{>libraries/jersey2/additional_properties}} + /** + * Return true if this {{name}} object is equal to o. + */ + @Override + public boolean equals(Object o) { + {{#useReflectionEqualsHashCode}} + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} && + {{/-last}}{{/vars}}{{#additionalPropertiesType}}&& + Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/additionalPropertiesType}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public int hashCode() { + {{#useReflectionEqualsHashCode}} + return HashCodeBuilder.reflectionHashCode(this); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}{{#hasVars}}, {{/hasVars}}{{^hasVars}}{{#parent}}, {{/parent}}{{/hasVars}}additionalProperties{{/additionalPropertiesType}}); + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}} + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + {{/parent}} + {{#vars}} + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); + {{/vars}} + {{#additionalPropertiesType}} + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + {{/additionalPropertiesType}} + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + +{{#parcelableModel}} + + public void writeToParcel(Parcel out, int flags) { +{{#model}} +{{#isArray}} + out.writeList(this); +{{/isArray}} +{{^isArray}} +{{#parent}} + super.writeToParcel(out, flags); +{{/parent}} +{{#vars}} + out.writeValue({{name}}); +{{/vars}} +{{/isArray}} +{{/model}} + } + + {{classname}}(Parcel in) { +{{#isArray}} + in.readTypedList(this, {{arrayModelType}}.CREATOR); +{{/isArray}} +{{^isArray}} +{{#parent}} + super(in); +{{/parent}} +{{#vars}} +{{#isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); +{{/isPrimitiveType}} +{{/vars}} +{{/isArray}} + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<>() { + public {{classname}} createFromParcel(Parcel in) { +{{#model}} +{{#isArray}} + {{classname}} result = new {{classname}}(); + result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); + return result; +{{/isArray}} +{{^isArray}} + return new {{classname}}(in); +{{/isArray}} +{{/model}} + } + public {{classname}}[] newArray(int size) { + return new {{classname}}[size]; + } + }; +{{/parcelableModel}} +{{#discriminator}} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + {{#mappedModels}} + mappings.put("{{mappingName}}", {{modelName}}.class); + {{/mappedModels}} + mappings.put("{{name}}", {{classname}}.class); + JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); + } +{{/discriminator}} +} diff --git a/sdks/java-v1/templates/libraries/jersey3/pom.mustache b/sdks/java-v1/templates/libraries/jersey3/pom.mustache new file mode 100644 index 000000000..d2f13457c --- /dev/null +++ b/sdks/java-v1/templates/libraries/jersey3/pom.mustache @@ -0,0 +1,415 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + {{artifactUrl}} + {{artifactDescription}} + + {{scmConnection}} + {{scmDeveloperConnection}} + {{scmUrl}} + +{{#parentOverridden}} + + {{{parentGroupId}}} + {{{parentArtifactId}}} + {{{parentVersion}}} + +{{/parentOverridden}} + + + + {{licenseName}} + {{licenseUrl}} + repo + + + + + + {{developerName}} + {{developerEmail}} + {{developerOrganization}} + {{developerOrganizationUrl}} + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + false + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.2 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.3.2 + + + attach-javadocs + + jar + + + + + none + 1.8 + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + {{#swagger1AnnotationLibrary}} + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} + {{#withXml}} + + + org.glassfish.jersey.media + jersey-media-jaxb + ${jersey-version} + + {{/withXml}} + {{#joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + {{/joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + {{#hasHttpSignatureMethods}} + + org.tomitribe + tomitribe-http-signatures + ${http-signature-version} + + {{/hasHttpSignatureMethods}} + {{#hasOAuthMethods}} + + com.github.scribejava + scribejava-apis + ${scribejava-apis-version} + + {{/hasOAuthMethods}} + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.glassfish.jersey.connectors + jersey-apache-connector + ${jersey-version} + + + + org.junit.jupiter + junit-jupiter-api + ${junit-version} + test + + + + UTF-8 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 3.1.1 + 2.17.1 + 2.17.1 + 0.2.6 + 2.1.1 + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 5.10.0 + {{#hasHttpSignatureMethods}} + 1.8 + {{/hasHttpSignatureMethods}} + {{#hasOAuthMethods}} + 8.3.3 + {{/hasOAuthMethods}} + 2.21.0 + + diff --git a/sdks/java-v1/templates/libraries/microprofile/README.mustache b/sdks/java-v1/templates/libraries/microprofile/README.mustache index 58d2d5f5c..377dfc2c9 100644 --- a/sdks/java-v1/templates/libraries/microprofile/README.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/README.mustache @@ -1,10 +1,19 @@ -# {{appName}} - MicroProfile Rest Client +# {{appName}} - MicroProfile Rest Client & MicroProfile Server {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} +{{^microprofileServer}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. +{{/microprofileServer}} + +{{#microprofileServer}} +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +The generated server contains an interface which acts as the server, you can inject it into the controller class. +This module is intended to provide additional server features, like accessing an operations response object, when multiple responses where specified. +{{/microprofileServer}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/microprofile/api.mustache b/sdks/java-v1/templates/libraries/microprofile/api.mustache index 119494e54..6e25c1f10 100644 --- a/sdks/java-v1/templates/libraries/microprofile/api.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/api.mustache @@ -9,12 +9,20 @@ import java.io.OutputStream; import java.util.List; import java.util.Map; import java.util.Set; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.MediaType; +import {{rootJavaEEPackage}}.ws.rs.*; +import {{rootJavaEEPackage}}.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.core.MediaType; {{^disableMultipart}} import org.apache.cxf.jaxrs.ext.multipart.*; {{/disableMultipart}} +{{#microprofileMutiny}} +import io.smallrye.mutiny.Uni; +{{/microprofileMutiny}} + +{{#useBeanValidation}} +import {{rootJavaEEPackage}}.validation.constraints.*; +import {{rootJavaEEPackage}}.validation.Valid; +{{/useBeanValidation}} import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; @@ -30,7 +38,9 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; */ {{/appName}} -@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}} +{{^microprofileServer}} +@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}}{{#configKeyFromClassName}}{{#operations}}(configKey="{{configKey}}"){{/operations}}{{/configKeyFromClassName}} +{{/microprofileServer}} @RegisterProvider(ApiExceptionMapper.class) @Path("{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}{{commonPath}}") public interface {{classname}} { @@ -61,7 +71,50 @@ public interface {{classname}} { {{#hasProduces}} @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }) {{/hasProduces}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; +{{^useSingleRequestParameter}} + {{^vendorExtensions.x-java-is-response-void}}{{#microprofileServer}}{{> server_operation}}{{/microprofileServer}}{{^microprofileServer}}{{> client_operation}}{{/microprofileServer}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; +{{/useSingleRequestParameter}} +{{#useSingleRequestParameter}} + {{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#hasNonBodyParams}}@BeanParam {{operationIdCamelCase}}Request request{{/hasNonBodyParams}}{{#bodyParams}}{{#hasNonBodyParams}}, {{/hasNonBodyParams}}{{>bodyParams}}{{/bodyParams}}) throws ApiException, ProcessingException; + {{#hasNonBodyParams}} + public class {{operationIdCamelCase}}Request { + + {{#queryParams}} + private {{>queryParams}}; + {{/queryParams}} + {{#headerParams}} + private {{>headerParams}}; + {{/headerParams}} + {{#pathParams}} + private {{>pathParams}}; + {{/pathParams}} + {{#formParams}} + private {{>formParams}}; + {{/formParams}} + + private {{operationIdCamelCase}}Request() { + } + + public static {{operationIdCamelCase}}Request newInstance() { + return new {{operationIdCamelCase}}Request(); + } + + {{#allParams}} + {{^isBodyParam}} + /** + * Set {{paramName}}{{>formParamsNameSuffix}} + * @param {{paramName}}{{>formParamsNameSuffix}} {{description}} ({{^required}}optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}{{/required}}{{#required}}required{{/required}}) + * @return {{operationIdCamelCase}}Request + */ + public {{operationIdCamelCase}}Request {{paramName}}{{>formParamsNameSuffix}}({{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>formParamsImpl}}) { + this.{{paramName}}{{>formParamsNameSuffix}} = {{paramName}}{{>formParamsNameSuffix}}; + return this; + } + {{/isBodyParam}} + {{/allParams}} + } + {{/hasNonBodyParams}} +{{/useSingleRequestParameter}} {{/operation}} } {{/operations}} diff --git a/sdks/java-v1/templates/libraries/microprofile/api_exception.mustache b/sdks/java-v1/templates/libraries/microprofile/api_exception.mustache index fc5c5e500..63a218675 100644 --- a/sdks/java-v1/templates/libraries/microprofile/api_exception.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/api_exception.mustache @@ -1,9 +1,9 @@ {{>licenseInfo}} package {{apiPackage}}; -import javax.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.core.Response; -public class ApiException extends Exception { +public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ private static final long serialVersionUID = 1L; private Response response; diff --git a/sdks/java-v1/templates/libraries/microprofile/api_exception_mapper.mustache b/sdks/java-v1/templates/libraries/microprofile/api_exception_mapper.mustache index 9c5988414..12988f5ed 100644 --- a/sdks/java-v1/templates/libraries/microprofile/api_exception_mapper.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/api_exception_mapper.mustache @@ -1,9 +1,9 @@ {{>licenseInfo}} package {{apiPackage}}; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.Provider; +import {{rootJavaEEPackage}}.ws.rs.core.MultivaluedMap; +import {{rootJavaEEPackage}}.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.ext.Provider; import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; @Provider diff --git a/sdks/java-v1/templates/libraries/microprofile/api_test.mustache b/sdks/java-v1/templates/libraries/microprofile/api_test.mustache index a53acad5c..d9af87719 100644 --- a/sdks/java-v1/templates/libraries/microprofile/api_test.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/api_test.mustache @@ -4,23 +4,23 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; +{{#generateSpringBootApplication}} +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.test.context.junit.jupiter.SpringExtension; +{{/generateSpringBootApplication}} import org.eclipse.microprofile.rest.client.RestClientBuilder; import java.net.URL; import java.net.MalformedURLException; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -{{/fullJavaUtil}} - - /** {{#appName}} @@ -30,7 +30,7 @@ import java.util.Set; * API tests for {{classname}} */ {{#generateSpringBootApplication}} -@RunWith(SpringJUnit4ClassRunner.class) +@ExtendWith(SpringExtension.class) @SpringApplicationConfiguration(classes = SpringBootApplication.class) @WebAppConfiguration @IntegrationTest("server.port=0") @@ -40,12 +40,17 @@ public class {{classname}}Test { private {{classname}} client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { + {{#microprofile3}} + // TODO initialize the client + {{/microprofile3}} + {{^microprofile3}} client = RestClientBuilder.newBuilder() .baseUrl(new URL(baseUrl)) .register(ApiException.class) .build({{classname}}.class); + {{/microprofile3}} } {{#operations}}{{#operation}} @@ -67,8 +72,8 @@ public class {{classname}}Test { {{#allParams}} {{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}} {{/allParams}} - //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - //{{#returnType}}assertNotNull(response);{{/returnType}} + //{{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}Assertions.assertNotNull(response);{{/returnType}} } diff --git a/sdks/java-v1/templates/libraries/microprofile/beanValidation.mustache b/sdks/java-v1/templates/libraries/microprofile/beanValidation.mustache index c8c6946fe..f8724b244 100644 --- a/sdks/java-v1/templates/libraries/microprofile/beanValidation.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/beanValidation.mustache @@ -1,4 +1,6 @@ {{#required}} +{{^isReadOnly}} @NotNull +{{/isReadOnly}} {{/required}} {{>beanValidationCore}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/microprofile/client_operation.mustache b/sdks/java-v1/templates/libraries/microprofile/client_operation.mustache new file mode 100644 index 000000000..403918ddc --- /dev/null +++ b/sdks/java-v1/templates/libraries/microprofile/client_operation.mustache @@ -0,0 +1 @@ +{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/microprofile/enumClass.mustache b/sdks/java-v1/templates/libraries/microprofile/enumClass.mustache index 38127a637..cb8539bd1 100644 --- a/sdks/java-v1/templates/libraries/microprofile/enumClass.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/enumClass.mustache @@ -3,8 +3,10 @@ @XmlEnum({{dataType}}.class) {{/withXml}} {{^withXml}} + {{#jsonb}} @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) + {{/jsonb}} {{/withXml}} {{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} { @@ -13,7 +15,7 @@ {{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/withXml}} {{^withXml}} - {{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} + {{#enumVars}}{{name}}({{^isUri}}{{dataType}}.valueOf({{/isUri}}{{{value}}}{{^isUri}}){{/isUri}}){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/withXml}} {{/allowableValues}} @@ -24,6 +26,9 @@ value = v; } + {{#jackson}} + @JsonValue + {{/jackson}} public {{dataType}} value() { return value; } @@ -44,6 +49,7 @@ } {{/withXml}} {{^withXml}} + {{#jsonb}} public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { @@ -59,8 +65,20 @@ public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { @Override public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { - generator.write(obj.value); + generator.write(obj.value{{#isUri}}.toASCIIString(){{/isUri}}); } } + {{/jsonb}} + {{#jackson}} + @JsonCreator + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.equals(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + } + {{/jackson}} {{/withXml}} } diff --git a/sdks/java-v1/templates/libraries/microprofile/enumOuterClass.mustache b/sdks/java-v1/templates/libraries/microprofile/enumOuterClass.mustache index 894ce951f..2539064d1 100644 --- a/sdks/java-v1/templates/libraries/microprofile/enumOuterClass.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/enumOuterClass.mustache @@ -2,10 +2,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} +{{#isUri}} +import java.net.URI; +{{/isUri}} /** * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ +{{#jsonb}} +@JsonbTypeSerializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Serializer.class) +@JsonbTypeDeserializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @@ -33,6 +40,22 @@ import com.fasterxml.jackson.annotation.JsonValue; return String.valueOf(value); } +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void serialize({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value{{#isUri}}.toASCIIString(){{/isUri}}); + } + } + +{{/jsonb}} {{#jackson}} @JsonCreator {{/jackson}} @@ -44,5 +67,4 @@ import com.fasterxml.jackson.annotation.JsonValue; } {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}} } - } diff --git a/sdks/java-v1/templates/libraries/microprofile/formParamsNameSuffix.mustache b/sdks/java-v1/templates/libraries/microprofile/formParamsNameSuffix.mustache new file mode 100644 index 000000000..a44f6d710 --- /dev/null +++ b/sdks/java-v1/templates/libraries/microprofile/formParamsNameSuffix.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{#isFile}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/microprofile/generatedAnnotation.mustache b/sdks/java-v1/templates/libraries/microprofile/generatedAnnotation.mustache index 875d7b97a..cf058a0fa 100644 --- a/sdks/java-v1/templates/libraries/microprofile/generatedAnnotation.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{rootJavaEEPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/microprofile/kumuluzee.pom.mustache b/sdks/java-v1/templates/libraries/microprofile/kumuluzee.pom.mustache index ac235b7ed..195aa9d44 100644 --- a/sdks/java-v1/templates/libraries/microprofile/kumuluzee.pom.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/kumuluzee.pom.mustache @@ -18,7 +18,7 @@ 1.2.3 1.4.1 3.2.6 - 4.13 + 5.10.2 2.28 @@ -70,8 +70,8 @@ ${cxf-rt-rs-extension-providers.version} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test diff --git a/sdks/java-v1/templates/libraries/microprofile/model.mustache b/sdks/java-v1/templates/libraries/microprofile/model.mustache index 5272ff094..e10e68d83 100644 --- a/sdks/java-v1/templates/libraries/microprofile/model.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/model.mustache @@ -6,9 +6,38 @@ package {{package}}; {{#serializableModel}} import java.io.Serializable; {{/serializableModel}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.annotation.*; +{{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jackson}} +{{#withXml}} +import {{rootJavaEEPackage}}.xml.bind.annotation.*; +import {{rootJavaEEPackage}}.xml.bind.annotation.adapters.*; +{{/withXml}} +{{#jsonb}} +import java.lang.reflect.Type; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.DeserializationContext; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbDeserializer; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.SerializationContext; +import {{rootJavaEEPackage}}.json.stream.JsonGenerator; +import {{rootJavaEEPackage}}.json.stream.JsonParser; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import {{rootJavaEEPackage}}.validation.constraints.*; +import {{rootJavaEEPackage}}.validation.Valid; {{/useBeanValidation}} {{#models}} @@ -20,4 +49,4 @@ import javax.validation.Valid; {{>pojo}} {{/isEnum}} {{/model}} -{{/models}} +{{/models}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/microprofile/pojo.mustache b/sdks/java-v1/templates/libraries/microprofile/pojo.mustache index f2f269ab7..afad09aa3 100644 --- a/sdks/java-v1/templates/libraries/microprofile/pojo.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/pojo.mustache @@ -1,57 +1,55 @@ {{#withXml}} -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -{{/withXml}} -{{^withXml}} -import java.lang.reflect.Type; -import javax.json.bind.annotation.JsonbTypeDeserializer; -import javax.json.bind.annotation.JsonbTypeSerializer; -import javax.json.bind.serializer.DeserializationContext; -import javax.json.bind.serializer.JsonbDeserializer; -import javax.json.bind.serializer.JsonbSerializer; -import javax.json.bind.serializer.SerializationContext; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.bind.annotation.JsonbProperty; -{{#vendorExtensions.x-has-readonly-properties}} -import javax.json.bind.annotation.JsonbCreator; -{{/vendorExtensions.x-has-readonly-properties}} -{{/withXml}} - -{{#withXml}} -@XmlAccessorType(XmlAccessType.FIELD) -{{#hasVars}} @XmlType(name = "{{classname}}", propOrder = - { {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}} -}){{/hasVars}} +{{#hasVars}}@XmlType(name = "{{classname}}", propOrder = + { {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}} } +){{/hasVars}} {{^hasVars}}@XmlType(name = "{{classname}}"){{/hasVars}} -{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}} +{{> xmlAnnotation }} {{/withXml}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +{{#isClassnameSanitized}} +{{^hasDiscriminatorWithNonEmptyMapping}} +@JsonTypeName("{{name}}") +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/isClassnameSanitized}} +{{/jackson}} {{#description}} /** * {{{.}}} - **/ + */ {{/description}} {{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensions.x-implements}}{{#-first}} implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} +{{#jackson}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; +{{/jackson}} {{#withXml}} - @XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}}) + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#description}} /** - * {{{.}}} - **/ + * {{{.}}} + */ {{/description}} {{^withXml}} - @JsonbProperty("{{baseName}}") + {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}} {{/withXml}} +{{#vendorExtensions.x-field-extra-annotation}} +{{{vendorExtensions.x-field-extra-annotation}}} +{{/vendorExtensions.x-field-extra-annotation}} {{#isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}}; {{/isContainer}} @@ -63,10 +61,10 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM public {{classname}}() { } - @JsonbCreator + {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} public {{classname}}( {{#readOnlyVars}} - @JsonbProperty("{{baseName}}") {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nillable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(value = JSON_PROPERTY_{{nameInSnakeCase}}{{#required}}, required = true{{/required}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} {{/readOnlyVars}} ) { {{#readOnlyVars}} @@ -75,7 +73,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM } {{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -92,14 +90,14 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM {{#deprecated}} * @deprecated {{/deprecated}} - **/ + **/ {{#deprecated}} @Deprecated {{/deprecated}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} {{#withXml}}{{#isEnum}}{{^isArray}}{{^isMap}}public {{dataType}} {{getter}}() { +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}}{{#jackson}}{{> jackson_annotations}}{{/jackson}} {{#withXml}}{{#isEnum}}{{^isArray}}{{^isMap}} public {{dataType}} {{getter}}() { if ({{name}} == null) { return null; } @@ -116,10 +114,10 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM {{^isReadOnly}} /** - * Set {{name}} - **/ - {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} - {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + * Set {{name}} + */ +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{> jackson_annotations}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } @@ -129,14 +127,20 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; + } this.{{name}}.add({{name}}Item); return this; } {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; + } this.{{name}}.put(key, {{name}}Item); return this; } @@ -146,14 +150,14 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM {{/vars}} /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class {{classname}} {\n"); {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} - {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{#vars}}sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}}sb.append("}"); return sb.toString(); } diff --git a/sdks/java-v1/templates/libraries/microprofile/pom.mustache b/sdks/java-v1/templates/libraries/microprofile/pom.mustache index 3d5f94190..f814d4c0d 100644 --- a/sdks/java-v1/templates/libraries/microprofile/pom.mustache +++ b/sdks/java-v1/templates/libraries/microprofile/pom.mustache @@ -14,7 +14,7 @@ org.jboss.jandex jandex-maven-plugin - 1.1.0 + ${jandex.maven.plugin.version} make-index @@ -26,7 +26,7 @@ maven-failsafe-plugin - 2.6 + ${maven.failsafe.plugin.version} @@ -39,7 +39,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.9.1 + ${build.helper.maven.plugin.version} add-source @@ -58,10 +58,10 @@ - - junit - junit - ${junit-version} + + org.junit.jupiter + junit-jupiter-api + ${junit.version} test {{#useBeanValidation}} @@ -69,7 +69,7 @@ jakarta.validation jakarta.validation-api - ${beanvalidation-version} + ${beanvalidation.version} provided {{/useBeanValidation}} @@ -77,95 +77,125 @@ org.eclipse.microprofile.rest.client microprofile-rest-client-api - 1.4.1 + ${microprofile.rest.client.api.version} jakarta.ws.rs jakarta.ws.rs-api - ${jakarta.ws.rs-version} + ${jakarta.ws.rs.version} provided io.smallrye smallrye-rest-client - 1.2.1 + ${smallrye.rest.client.version} test io.smallrye smallrye-config - 1.3.5 + ${smallrye.config.version} test {{^disableMultipart}} org.apache.cxf cxf-rt-rs-extension-providers - 3.2.6 + ${cxf.rt.rs.extension.providers.version} {{/disableMultipart}} + {{#jsonb}} jakarta.json.bind jakarta.json.bind-api - ${jakarta.json.bind-version} + ${jakarta.json.bind.version} jakarta.json jakarta.json-api - ${jakarta.json-version} + ${jakarta.json.version} jakarta.xml.bind jakarta.xml.bind-api - ${jakarta.xml.bind-version} + ${jakarta.xml.bind.version} com.sun.xml.bind jaxb-core - 2.2.11 + ${jaxb.core.version} com.sun.xml.bind jaxb-impl - 2.2.11 + ${jaxb.impl.version} + + {{/jsonb}} + {{#jackson}} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + {{#withXml}} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson.version} + + {{/withXml}} + {{/jackson}} jakarta.activation jakarta.activation-api - ${jakarta.activation-version} + ${jakarta.activation.version} - -{{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - ${jackson-jaxrs-version} + ${jackson.jaxrs.version} -{{/java8}} -{{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - -{{/java8}} {{#useBeanValidationFeature}} org.hibernate hibernate-validator - 5.2.2.Final + ${hibernate.validator.version} {{/useBeanValidationFeature}} jakarta.annotation jakarta.annotation-api - ${jakarta-annotation-version} + ${jakarta.annotation.version} provided +{{#microprofileMutiny}} + + io.smallrye.reactive + mutiny + ${mutiny.version} + +{{/microprofileMutiny}} @@ -180,21 +210,37 @@ 1.8 ${java.version} ${java.version} - 1.5.18 - 9.2.9.v20150224 - 4.13.1 - 1.2.0 + 1.5.18 + 9.2.9.v20150224 + 5.10.2 + 1.4.14 {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} - 3.2.7 - 2.9.7 - 1.2.2 - 1.3.5 - 1.0.2 - 1.1.6 - 2.1.6 - 2.3.3 + 3.2.7 + 2.17.1 +{{#jackson}} + 2.17.1 +{{/jackson}} + 1.2.2 + 1.3.5 + 1.0.2 + 1.1.6 + 2.1.6 + 2.3.3 + {{microprofileRestClientVersion}} + 1.2.1 + 1.3.5 + 3.2.6 + 2.2.11 + 2.2.11 + 5.2.2.Final + 1.1.0 + 2.6 + 1.9.1 UTF-8 +{{#microprofileMutiny}} + 1.2.0 +{{/microprofileMutiny}} diff --git a/sdks/java-v1/templates/libraries/microprofile/pom_3.0.mustache b/sdks/java-v1/templates/libraries/microprofile/pom_3.0.mustache new file mode 100644 index 000000000..7accc4cb2 --- /dev/null +++ b/sdks/java-v1/templates/libraries/microprofile/pom_3.0.mustache @@ -0,0 +1,236 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{#appDescription}} + {{.}} + {{/appDescription}} + {{artifactVersion}} + + src/main/java + + + org.jboss.jandex + jandex-maven-plugin + ${jandex.maven.plugin.version} + + + make-index + + jandex + + + + + + maven-failsafe-plugin + ${maven.failsafe.plugin.version} + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${build.helper.maven.plugin.version} + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + +{{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation.version} + provided + +{{/useBeanValidation}} + + + org.eclipse.microprofile.rest.client + microprofile-rest-client-api + ${microprofile.rest.client.api.version} + + + + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs.version} + provided + + + + org.glassfish.jersey.ext.microprofile + jersey-mp-rest-client + ${jersey.mp.rest.client.version} + test + + + org.apache.geronimo.config + geronimo-config-impl + ${geronimo.config.impl.version} + test + + + {{^disableMultipart}} + + org.apache.cxf + cxf-rt-rs-extension-providers + ${cxf.rt.rs.extension.providers.version} + + {{/disableMultipart}} + {{#jsonb}} + + jakarta.json.bind + jakarta.json.bind-api + ${jakarta.json.bind.version} + + + jakarta.json + jakarta.json-api + ${jakarta.json.version} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.sun.xml.bind + jaxb-core + ${jaxb.core.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb.impl.version} + + {{/jsonb}} + {{#jackson}} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + {{#withXml}} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson.version} + + {{/withXml}} + {{/jackson}} + + jakarta.activation + jakarta.activation-api + ${jakarta.activation.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.jaxrs.version} + +{{#useBeanValidationFeature}} + + org.hibernate + hibernate-validator + ${hibernate.validator.version} + +{{/useBeanValidationFeature}} + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation.version} + provided + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 11 + ${java.version} + ${java.version} + 1.5.18 + 9.2.9.v20150224 + 5.10.2 + 1.4.14 +{{#useBeanValidation}} + 3.0.1 +{{/useBeanValidation}} + 3.2.7 + 2.17.1 +{{#jackson}} + 2.17.1 +{{/jackson}} + 2.1.0 + 2.0.0 + 2.0.0 + 2.0.1 + 3.0.0 + 3.0.1 + {{microprofileRestClientVersion}} + 3.0.4 + 1.2.3 + 3.5.1 + 3.0.2 + 3.0.2 + 7.0.4.Final + 1.1.0 + 2.6 + 1.9.1 + UTF-8 + + diff --git a/sdks/java-v1/templates/libraries/microprofile/returnTypes.mustache b/sdks/java-v1/templates/libraries/microprofile/returnTypes.mustache deleted file mode 100644 index 32f96a904..000000000 --- a/sdks/java-v1/templates/libraries/microprofile/returnTypes.mustache +++ /dev/null @@ -1,4 +0,0 @@ -{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: -}}{{^useGenericResponse}}{{! -}}{{{returnType}}}{{! -}}{{/useGenericResponse}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/microprofile/server_operation.mustache b/sdks/java-v1/templates/libraries/microprofile/server_operation.mustache new file mode 100644 index 000000000..d6fa9054d --- /dev/null +++ b/sdks/java-v1/templates/libraries/microprofile/server_operation.mustache @@ -0,0 +1 @@ +{{#vendorExtensions.x-multiple-2xx-response-operation}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}Response{{/microprofileMutiny}}{{/vendorExtensions.x-multiple-2xx-response-operation}}{{^vendorExtensions.x-multiple-2xx-response-operation}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-multiple-2xx-response-operation}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/native/AbstractOpenApiSchema.mustache b/sdks/java-v1/templates/libraries/native/AbstractOpenApiSchema.mustache index 19bf0a634..f196a13ec 100644 --- a/sdks/java-v1/templates/libraries/native/AbstractOpenApiSchema.mustache +++ b/sdks/java-v1/templates/libraries/native/AbstractOpenApiSchema.mustache @@ -2,7 +2,6 @@ package {{modelPackage}}; -import {{invokerPackage}}.ApiException; import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; @@ -12,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} +{{>generatedAnnotation}} public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/sdks/java-v1/templates/libraries/native/ApiClient.mustache b/sdks/java-v1/templates/libraries/native/ApiClient.mustache index 03fe2a468..a641525af 100644 --- a/sdks/java-v1/templates/libraries/native/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/native/ApiClient.mustache @@ -14,13 +14,12 @@ import java.io.InputStream; import java.net.URI; import java.net.URLEncoder; import java.net.http.HttpClient; +import java.net.http.HttpConnectTimeoutException; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; -{{#java8}} import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Collection; import java.util.Collections; import java.util.List; @@ -56,16 +55,15 @@ public class ApiClient { private Consumer> responseInterceptor; private Consumer> asyncResponseInterceptor; private Duration readTimeout; + private Duration connectTimeout; - private static String valueToString(Object value) { + public static String valueToString(Object value) { if (value == null) { return ""; } - {{#java8}} if (value instanceof OffsetDateTime) { return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); } - {{/java8}} return value.toString(); } @@ -154,7 +152,7 @@ public class ApiClient { } /** - * Ctor. + * Create an instance of ApiClient. */ public ApiClient() { this.builder = createDefaultHttpClientBuilder(); @@ -162,12 +160,17 @@ public class ApiClient { updateBaseUri(getDefaultBaseUri()); interceptor = null; readTimeout = null; + connectTimeout = null; responseInterceptor = null; asyncResponseInterceptor = null; } /** - * Ctor. + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI */ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { this.builder = builder; @@ -175,6 +178,7 @@ public class ApiClient { updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); interceptor = null; readTimeout = null; + connectTimeout = null; responseInterceptor = null; asyncResponseInterceptor = null; } @@ -411,4 +415,35 @@ public class ApiClient { public Duration getReadTimeout() { return readTimeout; } + /** + * Sets the connect timeout (in milliseconds) for the http client. + * + *

In the case where a new connection needs to be established, if + * the connection cannot be established within the given {@code + * duration}, then {@link HttpClient#send(HttpRequest,BodyHandler) + * HttpClient::send} throws an {@link HttpConnectTimeoutException}, or + * {@link HttpClient#sendAsync(HttpRequest,BodyHandler) + * HttpClient::sendAsync} completes exceptionally with an + * {@code HttpConnectTimeoutException}. If a new connection does not + * need to be established, for example if a connection can be reused + * from a previous request, then this timeout duration has no effect. + * + * @param connectTimeout connection timeout in milliseconds + * + * @return This object. + */ + public ApiClient setConnectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + this.builder.connectTimeout(connectTimeout); + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public Duration getConnectTimeout() { + return connectTimeout; + } } diff --git a/sdks/java-v1/templates/libraries/native/ApiResponse.mustache b/sdks/java-v1/templates/libraries/native/ApiResponse.mustache index 1e277319a..e2f8f6cd4 100644 --- a/sdks/java-v1/templates/libraries/native/ApiResponse.mustache +++ b/sdks/java-v1/templates/libraries/native/ApiResponse.mustache @@ -14,6 +14,7 @@ import java.util.TreeMap; * * @param The type of data that is deserialized from response body */ +{{>generatedAnnotation}} public class ApiResponse { final private int statusCode; final private Map> headers; diff --git a/sdks/java-v1/templates/libraries/native/JSON.mustache b/sdks/java-v1/templates/libraries/native/JSON.mustache index 961f23b48..813bb7940 100644 --- a/sdks/java-v1/templates/libraries/native/JSON.mustache +++ b/sdks/java-v1/templates/libraries/native/JSON.mustache @@ -1,22 +1,17 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -32,28 +27,20 @@ public class JSON { private ObjectMapper mapper; public JSON() { - mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} - mapper.registerModule(new JavaTimeModule()); - {{/java8}} + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS) + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + .build(); {{#joda}} mapper.registerModule(new JodaModule()); {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); @@ -62,6 +49,7 @@ public class JSON { /** * Set the date format for JSON (de)serialization with Date properties. + * * @param dateFormat Date format */ public void setDateFormat(DateFormat dateFormat) { @@ -81,6 +69,8 @@ public class JSON { * * @param node The input data. * @param modelClass The class that contains the discriminator mappings. + * + * @return the target model class. */ public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); @@ -93,6 +83,7 @@ public class JSON { /** * Helper class to register the discriminator mappings. */ + {{>generatedAnnotation}} private static class ClassDiscriminatorMapping { // The model class name. Class modelClass; @@ -140,6 +131,8 @@ public class JSON { * * @param node The input data. * @param visitedClasses The set of classes that have already been visited. + * + * @return the target model class. */ Class getClassForElement(JsonNode node, Set> visitedClasses) { if (visitedClasses.contains(modelClass)) { @@ -186,6 +179,9 @@ public class JSON { * * @param modelClass A OpenAPI model class. * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { diff --git a/sdks/java-v1/templates/libraries/native/README.mustache b/sdks/java-v1/templates/libraries/native/README.mustache index ef15f379a..fd7d4905a 100644 --- a/sdks/java-v1/templates/libraries/native/README.mustache +++ b/sdks/java-v1/templates/libraries/native/README.mustache @@ -8,6 +8,8 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} + {{{appDescriptionWithNewLines}}} {{#infoUrl}} @@ -139,11 +141,14 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}} @@ -151,10 +156,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth diff --git a/sdks/java-v1/templates/libraries/native/additional_properties.mustache b/sdks/java-v1/templates/libraries/native/additional_properties.mustache index 61973dc24..8e7182792 100644 --- a/sdks/java-v1/templates/libraries/native/additional_properties.mustache +++ b/sdks/java-v1/templates/libraries/native/additional_properties.mustache @@ -9,6 +9,9 @@ /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference */ @JsonAnySetter public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { @@ -20,7 +23,8 @@ } /** - * Return the additional (undeclared) property. + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties */ @JsonAnyGetter public Map getAdditionalProperties() { @@ -29,6 +33,8 @@ /** * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name */ public {{{.}}} getAdditionalProperty(String key) { if (this.additionalProperties == null) { diff --git a/sdks/java-v1/templates/libraries/native/anyof_model.mustache b/sdks/java-v1/templates/libraries/native/anyof_model.mustache index c87c932fe..dfb6464d5 100644 --- a/sdks/java-v1/templates/libraries/native/anyof_model.mustache +++ b/sdks/java-v1/templates/libraries/native/anyof_model.mustache @@ -21,7 +21,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -54,7 +54,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. @@ -195,4 +195,168 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} + +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (getActualInstance() instanceof {{{dataType}}}) { + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getActualInstance().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if ((({{{dataType}}})getActualInstance()).get(i) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if (getActualInstance().get(i) != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getActualInstance().get(_key), URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + if ((({{{dataType}}})getActualInstance()).get(_key) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isPrimitiveType}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if (getActualInstance() != null) { + joiner.add((({{{dataType}}})getActualInstance()).toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + return joiner.toString(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + return null; + } +{{/supportUrlQuery}} + } diff --git a/sdks/java-v1/templates/libraries/native/api.mustache b/sdks/java-v1/templates/libraries/native/api.mustache index 86fb8dd89..a80dcbac8 100644 --- a/sdks/java-v1/templates/libraries/native/api.mustache +++ b/sdks/java-v1/templates/libraries/native/api.mustache @@ -13,22 +13,40 @@ import {{import}}; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import java.io.IOException; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} +{{#hasFormParamsInSpec}} +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; + +{{/hasFormParamsInSpec}} import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; -import java.util.function.Consumer; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.StringJoiner; import java.util.List; import java.util.Map; import java.util.Set; -{{/fullJavaUtil}} +import java.util.function.Consumer; {{#asyncNative}} import java.util.concurrent.CompletableFuture; @@ -91,6 +109,11 @@ public class {{classname}} { {{#returnType}} * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}{{returnType}}{{#asyncNative}}>{{/asyncNative}} {{/returnType}} + {{^returnType}} + {{#asyncNative}} + * @return CompletableFuture<Void> + {{/asyncNative}} + {{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -140,11 +163,16 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} {{#returnType}} * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}{{returnType}}{{#asyncNative}}>{{/asyncNative}} {{/returnType}} + {{^returnType}} + {{#asyncNative}} + * @return CompletableFuture<Void> + {{/asyncNative}} + {{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -175,8 +203,9 @@ public class {{classname}} { } {{#returnType}} try { + String responseBody = localVarResponse.body(); return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) + responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<{{{returnType}}}>() {}) ); } catch (IOException e) { return CompletableFuture.failedFuture(new ApiException(e)); @@ -197,7 +226,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} * @throws ApiException if fails to make API call @@ -226,12 +255,33 @@ public class {{classname}} { if (localVarResponse.statusCode()/ 100 != 2) { throw getApiException("{{operationId}}", localVarResponse); } + {{#vendorExtensions.x-java-text-plain-string}} + // for plain text response + if (localVarResponse.headers().map().containsKey("Content-Type") && + "text/plain".equalsIgnoreCase(localVarResponse.headers().map().get("Content-Type").get(0).split(";")[0].trim())) { + java.util.Scanner s = new java.util.Scanner(localVarResponse.body()).useDelimiter("\\A"); + String responseBodyText = s.hasNext() ? s.next() : ""; + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBodyText + ); + } else { + throw new RuntimeException("Error! The response Content-Type is supposed to be `text/plain` but it's not: " + localVarResponse); + } + {{/vendorExtensions.x-java-text-plain-string}} + {{^vendorExtensions.x-java-text-plain-string}} return new ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>( localVarResponse.statusCode(), localVarResponse.headers().map(), - {{#returnType}}memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) // closes the InputStream{{/returnType}} - {{^returnType}}null{{/returnType}} + {{#returnType}} + localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) // closes the InputStream + {{/returnType}} + {{^returnType}} + null + {{/returnType}} ); + {{/vendorExtensions.x-java-text-plain-string}} } finally { {{^returnType}} // Drain the InputStream @@ -263,11 +313,12 @@ public class {{classname}} { } {{#returnType}} try { + String responseBody = localVarResponse.body(); return CompletableFuture.completedFuture( new ApiResponse<{{{returnType}}}>( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {})) + responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<{{{returnType}}}>() {})) ); } catch (IOException e) { return CompletableFuture.failedFuture(new ApiException(e)); @@ -304,28 +355,64 @@ public class {{classname}} { .replace({{=<% %>=}}"{<%baseName%>}"<%={{ }}=%>, ApiClient.urlEncode({{{paramName}}}.toString())){{/pathParams}}; {{#hasQueryParams}} - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList<>(); + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; {{#queryParams}} + localVarQueryParameterBaseName = "{{{baseName}}}"; {{#collectionFormat}} localVarQueryParams.addAll(ApiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/collectionFormat}} {{^collectionFormat}} {{#isDeepObject}} if ({{paramName}} != null) { - {{#items.vars}} - localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}())); - {{/items.vars}} + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + localVarQueryStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i))); + } + {{/isArray}} + {{^isArray}} + String queryString = {{paramName}}.toUrlQueryString("{{baseName}}"); + if (!queryString.isBlank()) { + localVarQueryStringJoiner.add(queryString); + } + {{/isArray}} } {{/isDeepObject}} {{^isDeepObject}} + {{#isExplode}} + {{#hasVars}} + {{#vars}} + {{#isArray}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{^isArray}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{/vars}} + {{/hasVars}} + {{^hasVars}} + {{#isModel}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString()); + {{/isModel}} + {{^isModel}} localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}})); + {{/isModel}} + {{/hasVars}} + {{/isExplode}} + {{^isExplode}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}})); + {{/isExplode}} {{/isDeepObject}} {{/collectionFormat}} {{/queryParams}} - if (!localVarQueryParams.isEmpty()) { - {{javaUtilPrefix}}StringJoiner queryJoiner = new StringJoiner("&"); + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); } else { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); @@ -341,20 +428,113 @@ public class {{classname}} { } {{/headerParams}} {{#bodyParam}} - localVarRequestBuilder.header("Content-Type", "{{#hasConsumes}}{{#consumes}}{{#-first}}{{mediaType}}{{/-first}}{{/consumes}}{{/hasConsumes}}{{#hasConsumes}}{{^consumes}}application/json{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}application/json{{/hasConsumes}}"); + localVarRequestBuilder.header("Content-Type", "{{#hasConsumes}}{{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}{{/hasConsumes}}{{#hasConsumes}}{{^consumes}}application/json{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}application/json{{/hasConsumes}}"); {{/bodyParam}} - localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{mediaType}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}"); + localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}"); {{#bodyParam}} + {{#isString}} + localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.ofString({{paramName}})); + {{/isString}} + {{^isString}} try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes({{paramName}}); localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); } catch (IOException e) { throw new ApiException(e); } + {{/isString}} {{/bodyParam}} {{^bodyParam}} + {{#hasFormParams}} + {{#isMultipart}} + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + {{#formParams}} + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + {{#isFile}} + multiPartBuilder.addBinaryBody("{{{baseName}}}", {{paramName}}.get(i)); + hasFiles = true; + {{/isFile}} + {{^isFile}} + multiPartBuilder.addTextBody("{{{baseName}}}", {{paramName}}.get(i).toString()); + {{/isFile}} + } + {{/isArray}} + {{^isArray}} + {{#isFile}} + multiPartBuilder.addBinaryBody("{{{baseName}}}", {{paramName}}); + hasFiles = true; + {{/isFile}} + {{^isFile}} + multiPartBuilder.addTextBody("{{{baseName}}}", {{paramName}}.toString()); + {{/isFile}} + {{/isArray}} + {{/formParams}} + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("{{httpMethod}}", formDataPublisher); + {{/isMultipart}} + {{^isMultipart}} + List formValues = new ArrayList<>(); + {{#formParams}} + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + if ({{paramName}}.get(i) != null) { + formValues.add(new BasicNameValuePair("{{{baseName}}}", {{paramName}}.get(i).toString())); + } + } + {{/isArray}} + {{^isArray}} + if ({{paramName}} != null) { + formValues.add(new BasicNameValuePair("{{{baseName}}}", {{paramName}}.toString())); + } + {{/isArray}} + {{/formParams}} + HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("{{httpMethod}}", HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray()))); + {{/isMultipart}} + {{/hasFormParams}} + {{^hasFormParams}} localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.noBody()); + {{/hasFormParams}} {{/bodyParam}} if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); @@ -364,6 +544,7 @@ public class {{classname}} { } return localVarRequestBuilder; } + {{#vendorExtensions.x-group-parameters}} {{#hasParams}} @@ -372,7 +553,7 @@ public class {{classname}} { private {{{dataType}}} {{paramName}}; // {{description}} (required) {{/requiredParams}} {{#optionalParams}} - private {{{dataType}}} {{paramName}}; // {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}} + private {{{dataType}}} {{paramName}}; // {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}) {{/optionalParams}} private API{{operationId}}Request(Builder builder) { diff --git a/sdks/java-v1/templates/libraries/native/apiException.mustache b/sdks/java-v1/templates/libraries/native/apiException.mustache index 3d0eee4bf..9596b73b6 100644 --- a/sdks/java-v1/templates/libraries/native/apiException.mustache +++ b/sdks/java-v1/templates/libraries/native/apiException.mustache @@ -6,6 +6,8 @@ import java.net.http.HttpHeaders; {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private HttpHeaders responseHeaders = null; private String responseBody = null; diff --git a/sdks/java-v1/templates/libraries/native/api_doc.mustache b/sdks/java-v1/templates/libraries/native/api_doc.mustache index 3af38b331..2b125e1f9 100644 --- a/sdks/java-v1/templates/libraries/native/api_doc.mustache +++ b/sdks/java-v1/templates/libraries/native/api_doc.mustache @@ -4,10 +4,10 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -[**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | +| [**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} @@ -98,9 +98,9 @@ public class Example { ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} @@ -230,9 +230,9 @@ public class Example { ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} @@ -266,13 +266,13 @@ Name | Type | Description | Notes {{/responses.0}} {{#vendorExtensions.x-group-parameters}}{{#hasParams}} - + ## API{{operationId}}Request ### Properties {{#allParams}}{{#-last}} | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} {{/hasParams}}{{/vendorExtensions.x-group-parameters}} diff --git a/sdks/java-v1/templates/libraries/native/api_test.mustache b/sdks/java-v1/templates/libraries/native/api_test.mustache index ffcf05ec3..497bd5308 100644 --- a/sdks/java-v1/templates/libraries/native/api_test.mustache +++ b/sdks/java-v1/templates/libraries/native/api_test.mustache @@ -5,25 +5,28 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -{{/fullJavaUtil}} {{#asyncNative}} import java.util.concurrent.CompletableFuture; {{/asyncNative}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); diff --git a/sdks/java-v1/templates/libraries/native/build.gradle.mustache b/sdks/java-v1/templates/libraries/native/build.gradle.mustache index 03d303d0d..24ea4fef0 100644 --- a/sdks/java-v1/templates/libraries/native/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/native/build.gradle.mustache @@ -1,5 +1,6 @@ apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' group = '{{groupId}}' version = '{{artifactVersion}}' @@ -8,6 +9,9 @@ buildscript { repositories { mavenCentral() } + dependencies { + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } } repositories { @@ -62,17 +66,27 @@ artifacts { ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.4" + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" - junit_version = "4.13.1" - {{#threetenbp}} - threetenbp_version = "2.9.10" - {{/threetenbp}} + junit_version = "5.10.2" + {{#hasFormParamsInSpec}} + httpmime_version = "4.5.13" + {{/hasFormParamsInSpec}} } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" @@ -80,8 +94,31 @@ dependencies { implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" - {{/threetenbp}} - testImplementation "junit:junit:$junit_version" + {{#hasFormParamsInSpec}} + implementation "org.apache.httpcomponents:httpmime:$httpmime_version" + {{/hasFormParamsInSpec}} + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } } diff --git a/sdks/java-v1/templates/libraries/native/generatedAnnotation.mustache b/sdks/java-v1/templates/libraries/native/generatedAnnotation.mustache index baf5ff08b..e05689d5f 100644 --- a/sdks/java-v1/templates/libraries/native/generatedAnnotation.mustache +++ b/sdks/java-v1/templates/libraries/native/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.processing.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/native/model.mustache b/sdks/java-v1/templates/libraries/native/model.mustache index 6f2436c38..cd2a85a22 100644 --- a/sdks/java-v1/templates/libraries/native/model.mustache +++ b/sdks/java-v1/templates/libraries/native/model.mustache @@ -16,8 +16,12 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; {{/additionalPropertiesType}} {{/model}} {{/models}} +{{#supportUrlQuery}} +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +{{/supportUrlQuery}} import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; {{#imports}} @@ -36,15 +40,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} -import javax.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.*; {{/withXml}} {{#parcelableModel}} import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/sdks/java-v1/templates/libraries/native/modelEnum.mustache b/sdks/java-v1/templates/libraries/native/modelEnum.mustache new file mode 100644 index 000000000..5f22f7559 --- /dev/null +++ b/sdks/java-v1/templates/libraries/native/modelEnum.mustache @@ -0,0 +1,120 @@ +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +{{/jackson}} +{{#gson}} +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +{{/gson}} +{{#isUri}} +import java.net.URI; +{{/isUri}} + +/** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +{{#gson}} +@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class) +{{/gson}} +{{#jsonb}} +@JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) +@JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + +{{#jackson}} + @JsonValue +{{/jackson}} + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +{{#jackson}} + @JsonCreator +{{/jackson}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +{{/supportUrlQuery}} + +{{#gson}} + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } +{{/gson}} +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { + @Override + public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}} + } + } + + public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { + @Override + public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } +{{/jsonb}} +} diff --git a/sdks/java-v1/templates/libraries/native/oneof_model.mustache b/sdks/java-v1/templates/libraries/native/oneof_model.mustache index 993961a6e..8aa2ef073 100644 --- a/sdks/java-v1/templates/libraries/native/oneof_model.mustache +++ b/sdks/java-v1/templates/libraries/native/oneof_model.mustache @@ -23,7 +23,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -60,12 +60,12 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); switch (discriminatorValue) { - {{#mappedModels}} + {{#mappedModels}} case "{{{mappingName}}}": deserialized = tree.traverse(jp.getCodec()).readValueAs({{{modelName}}}.class); new{{classname}}.setActualInstance(deserialized); return new{{classname}}; - {{/mappedModels}} + {{/mappedModels}} default: log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); } @@ -228,4 +228,168 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/oneOf}} + +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (getActualInstance() instanceof {{{dataType}}}) { + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getActualInstance().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if ((({{{dataType}}})getActualInstance()).get(i) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if (getActualInstance().get(i) != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getActualInstance().get(_key), URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + if ((({{{dataType}}})getActualInstance()).get(_key) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isPrimitiveType}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if (getActualInstance() != null) { + joiner.add((({{{dataType}}})getActualInstance()).toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + return joiner.toString(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + return null; + } +{{/supportUrlQuery}} + } diff --git a/sdks/java-v1/templates/libraries/native/pojo.mustache b/sdks/java-v1/templates/libraries/native/pojo.mustache index 5f0c03679..1250a71ec 100644 --- a/sdks/java-v1/templates/libraries/native/pojo.mustache +++ b/sdks/java-v1/templates/libraries/native/pojo.mustache @@ -1,12 +1,24 @@ {{#discriminator}} import {{invokerPackage}}.JSON; {{/discriminator}} +{{#supportUrlQuery}} +import {{invokerPackage}}.ApiClient; +{{/supportUrlQuery}} /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -15,6 +27,9 @@ import {{invokerPackage}}.JSON; }) {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -40,29 +55,17 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); @@ -72,12 +75,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; - {{/isContainer}} - {{^isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; - {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} @@ -94,7 +92,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} @@ -123,10 +121,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -136,11 +134,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -148,10 +144,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -161,11 +157,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -173,7 +167,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -190,22 +184,30 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} {{#required}} {{#isNullable}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/isNullable}} {{^isNullable}} - @javax.annotation.Nonnull + @{{javaxPackage}}.annotation.Nonnull {{/isNullable}} {{/required}} {{^required}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/required}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -213,8 +215,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} @JsonIgnore {{/vendorExtensions.x-is-jackson-optional-nullable}} -{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} - public {{{datatypeWithEnum}}} {{getter}}() { +{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} public {{{datatypeWithEnum}}} {{getter}}() { {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} if ({{name}} == null) { @@ -261,6 +262,23 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vars}} {{>libraries/native/additional_properties}} + {{#parent}} + {{#allVars}} + {{#isOverridden}} + @Override + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}(JsonNullable.<{{{datatypeWithEnum}}}>of({{name}})); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + + {{/isOverridden}} + {{/allVars}} + {{/parent}} /** * Return true if this {{name}} object is equal to o. */ @@ -314,7 +332,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} {{#additionalPropertiesType}} sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -333,7 +351,165 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } return o.toString().replace("\n", "\n "); } +{{#supportUrlQuery}} + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#allVars}} + // add `{{baseName}}` to the URL query string + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{^items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + {{getter}}().get(_key), URLEncoder.encode(ApiClient.valueToString({{getter}}().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/items.isModel}} + {{#items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + if ({{getter}}().get(_key) != null) { + joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isModel}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if ({{getter}}() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if ({{getter}}() != null) { + joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if ({{getter}}() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + + {{/allVars}} + return joiner.toString(); + } +{{/supportUrlQuery}} {{#parcelableModel}} public void writeToParcel(Parcel out, int flags) { @@ -404,4 +580,8 @@ static { JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); } {{/discriminator}} +{{#generateBuilders}} + + {{>javaBuilder}} +{{/generateBuilders}} } diff --git a/sdks/java-v1/templates/libraries/native/pom.mustache b/sdks/java-v1/templates/libraries/native/pom.mustache index c0c151cda..8ed827791 100644 --- a/sdks/java-v1/templates/libraries/native/pom.mustache +++ b/sdks/java-v1/templates/libraries/native/pom.mustache @@ -42,7 +42,7 @@ maven-enforcer-plugin - 3.0.0-M1 + 3.1.0 enforce-maven @@ -64,7 +64,7 @@ maven-surefire-plugin - 3.0.0-M3 + 3.2.5 conf/log4j.properties @@ -76,7 +76,7 @@ maven-dependency-plugin - 3.1.1 + 3.3.0 package @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.1.2 + 3.3.0 @@ -107,12 +107,12 @@ maven-compiler-plugin - 3.8.1 + 3.10.1 org.apache.maven.plugins maven-javadoc-plugin - 3.1.0 + 3.4.1 attach-javadocs @@ -124,7 +124,7 @@ maven-source-plugin - 3.1.0 + 3.2.1 attach-sources @@ -134,6 +134,46 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + @@ -144,7 +184,7 @@ maven-gpg-plugin - 1.6 + 3.0.1 sign-artifacts @@ -161,11 +201,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -193,13 +242,6 @@ jackson-databind-nullable ${jackson-databind-nullable-version} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - - {{/threetenbp}} @@ -213,11 +255,27 @@ ${jakarta-annotation-version} provided + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + {{#hasFormParamsInSpec}} + + org.apache.httpcomponents + httpmime + ${httpmime-version} + + {{/hasFormParamsInSpec}} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -225,15 +283,29 @@ UTF-8 - 1.5.22 + {{#swagger1AnnotationLibrary}} + 1.6.9 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} 11 11 - 2.10.4 - 0.2.2 + 2.17.1 + 0.2.6 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} - 4.13.1 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + {{#hasFormParamsInSpec}} + 4.5.14 + {{/hasFormParamsInSpec}} + 5.10.2 + 2.27.2 diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache deleted file mode 100644 index 3ba02e44c..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache +++ /dev/null @@ -1,138 +0,0 @@ -{{>licenseInfo}} - -package {{modelPackage}}; - -import {{invokerPackage}}.ApiException; -import java.util.Objects; -import java.lang.reflect.Type; -import java.util.Map; -import javax.ws.rs.core.GenericType; - -//import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec - */ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} -public abstract class AbstractOpenApiSchema { - - // store the actual instance of the schema/object - private Object instance; - - // is nullable - private Boolean isNullable; - - // schema type (e.g. oneOf, anyOf) - private final String schemaType; - - public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { - this.schemaType = schemaType; - this.isNullable = isNullable; - } - - /** - * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object - * - * @return an instance of the actual schema/object - */ - public abstract Map getSchemas(); - - /** - * Get the actual instance - * - * @return an instance of the actual schema/object - */ - //@JsonValue - public Object getActualInstance() {return instance;} - - /** - * Set the actual instance - * - * @param instance the actual instance of the schema/object - */ - public void setActualInstance(Object instance) {this.instance = instance;} - - /** - * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well - * - * @return an instance of the actual schema/object - */ - public Object getActualInstanceRecursively() { - return getActualInstanceRecursively(this); - } - - private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { - if (object.getActualInstance() == null) { - return null; - } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { - return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); - } else { - return object.getActualInstance(); - } - } - - /** - * Get the schema type (e.g. anyOf, oneOf) - * - * @return the schema type - */ - public String getSchemaType() { - return schemaType; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ").append(getClass()).append(" {\n"); - sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); - sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); - sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * 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 "); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; - return Objects.equals(this.instance, a.instance) && - Objects.equals(this.isNullable, a.isNullable) && - Objects.equals(this.schemaType, a.schemaType); - } - - @Override - public int hashCode() { - return Objects.hash(instance, isNullable, schemaType); - } - - /** - * Is nullable - * - * @return true if it's nullable - */ - public Boolean isNullable() { - if (Boolean.TRUE.equals(isNullable)) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } - -{{>libraries/jersey2/additional_properties}} - -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ApiCallback.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ApiCallback.mustache deleted file mode 100644 index 53b6a7b8e..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ApiCallback.mustache +++ /dev/null @@ -1,51 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.io.IOException; - -import java.util.Map; -import java.util.List; - -/** - * Callback for asynchronous API call. - * - * @param The return type - */ -public interface ApiCallback { - /** - * This is called when the API call fails. - * - * @param e The exception causing the failure - * @param statusCode Status code of the response if available, otherwise it would be 0 - * @param responseHeaders Headers of the response if available, otherwise it would be null - */ - void onFailure(ApiException e, int statusCode, Map> responseHeaders); - - /** - * This is called when the API call succeeded. - * - * @param result The result deserialized from response - * @param statusCode Status code of the response - * @param responseHeaders Headers of the response - */ - void onSuccess(T result, int statusCode, Map> responseHeaders); - - /** - * This is called when the API upload processing. - * - * @param bytesWritten bytes Written - * @param contentLength content length of request body - * @param done write end - */ - void onUploadProgress(long bytesWritten, long contentLength, boolean done); - - /** - * This is called when the API download processing. - * - * @param bytesRead bytes Read - * @param contentLength content length of the response - * @param done Read end - */ - void onDownloadProgress(long bytesRead, long contentLength, boolean done); -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ApiClient.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ApiClient.mustache deleted file mode 100644 index de8ac2527..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ApiClient.mustache +++ /dev/null @@ -1,1738 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -{{#dynamicOperations}} -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.Parameter.StyleEnum; -import io.swagger.v3.parser.OpenAPIV3Parser; -{{/dynamicOperations}} -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; -{{#joda}} -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormatter; -{{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} -{{#hasOAuthMethods}} -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.common.message.types.GrantType; -{{/hasOAuthMethods}} - -import javax.net.ssl.*; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URI; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.KeyStore; -import java.security.SecureRandom; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.text.DateFormat; -{{#java8}} -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -{{/java8}} -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import {{invokerPackage}}.auth.Authentication; -import {{invokerPackage}}.auth.HttpBasicAuth; -import {{invokerPackage}}.auth.HttpBearerAuth; -import {{invokerPackage}}.auth.ApiKeyAuth; -{{#hasOAuthMethods}} -import {{invokerPackage}}.auth.OAuth; -import {{invokerPackage}}.auth.RetryingOAuth; -import {{invokerPackage}}.auth.OAuthFlow; -{{/hasOAuthMethods}} - -/** - *

ApiClient class.

- */ -public class ApiClient { - - private String basePath = "{{{basePath}}}"; - private boolean debugging = false; - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String tempFolderPath = null; - - private Map authentications; - - private DateFormat dateFormat; - private DateFormat datetimeFormat; - private boolean lenientDatetimeFormat; - private int dateLength; - - private InputStream sslCaCert; - private boolean verifyingSsl; - private KeyManager[] keyManagers; - - private OkHttpClient httpClient; - private JSON json; - - private HttpLoggingInterceptor loggingInterceptor; - - {{#dynamicOperations}} - private Map operationLookupMap = new HashMap<>(); - - {{/dynamicOperations}} - /** - * Basic constructor for ApiClient - */ - public ApiClient() { - init(); - initHttpClient(); - - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Basic constructor with custom OkHttpClient - * - * @param client a {@link okhttp3.OkHttpClient} object - */ - public ApiClient(OkHttpClient client) { - init(); - - httpClient = client; - - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - {{#hasOAuthMethods}} - {{#oauthMethods}} - {{#-first}} - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID - * - * @param clientId client ID - */ - public ApiClient(String clientId) { - this(clientId, null, null); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters - * - * @param clientId client ID - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String clientId, Map parameters) { - this(clientId, null, parameters); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters - * - * @param clientId client ID - * @param clientSecret client secret - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String clientId, String clientSecret, Map parameters) { - this(null, clientId, clientSecret, parameters); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters - * - * @param basePath base path - * @param clientId client ID - * @param clientSecret client secret - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { - init(); - if (basePath != null) { - this.basePath = basePath; - } - -{{#hasOAuthMethods}} - String tokenUrl = "{{tokenUrl}}"; - if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { - URI uri = URI.create(getBasePath()); - tokenUrl = uri.getScheme() + ":" + - (uri.getAuthority() != null ? "//" + uri.getAuthority() : "") + - tokenUrl; - if (!URI.create(tokenUrl).isAbsolute()) { - throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); - } - } - RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{flow}}, clientSecret, parameters); - authentications.put( - "{{name}}", - retryingOAuth - ); - initHttpClient(Collections.singletonList(retryingOAuth)); -{{/hasOAuthMethods}} - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}} - - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - {{/-first}} - {{/oauthMethods}} - {{/hasOAuthMethods}} - private void initHttpClient() { - initHttpClient(Collections.emptyList()); - } - - private void initHttpClient(List interceptors) { - OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor: interceptors) { - builder.addInterceptor(interceptor); - } - {{#useGzipFeature}} - // Enable gzip request compression - builder.addInterceptor(new GzipRequestInterceptor()); - {{/useGzipFeature}} - - httpClient = builder.build(); - } - - private void init() { - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); - - authentications = new HashMap(); - {{#dynamicOperations}} - - OpenAPI openAPI = new OpenAPIV3Parser().read("openapi/openapi.yaml"); - createOperationLookupMap(openAPI); - {{/dynamicOperations}} - } - - /** - * Get base path - * - * @return Base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g {{{basePath}}} - * @return An instance of OkHttpClient - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Set HTTP client, which must never be null. - * - * @param newHttpClient An instance of OkHttpClient - * @return Api Client - * @throws java.lang.NullPointerException when newHttpClient is null - */ - public ApiClient setHttpClient(OkHttpClient newHttpClient) { - this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); - return this; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - /** - * Configure whether to verify certificate and hostname when making https requests. - * Default to true. - * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - /** - *

Getter for the field keyManagers.

- * - * @return an array of {@link javax.net.ssl.KeyManager} objects - */ - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - /** - *

Getter for the field dateFormat.

- * - * @return a {@link java.text.DateFormat} object - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - *

Setter for the field dateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); - return this; - } - - /** - *

Set SqlDateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); - return this; - } - - {{#joda}} - public ApiClient setDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setDateTimeFormat(dateFormat); - return this; - } - - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; - } - - {{/joda}} - {{#jsr310}} - /** - *

Set OffsetDateTimeFormat.

- * - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); - return this; - } - - /** - *

Set LocalDateFormat.

- * - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; - } - - {{/jsr310}} - /** - *

Set LenientOnJson.

- * - * @param lenientOnJson a boolean - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication objects - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - {{#hasHttpBearerMethods}} - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); - } - {{/hasHttpBearerMethods}} - - /** - * Helper method to set username for the first HTTP basic authentication. - * - * @param username Username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * - * @param apiKey API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - {{#hasOAuthMethods}} - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - {{/hasOAuthMethods}} - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return ApiClient - */ - public ApiClient addDefaultCookie(String key, String value) { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. - * - * @see createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - /** - * Sets the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - {{#hasOAuthMethods}} - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * - * @return Token request builder - */ - public TokenRequestBuilder getTokenEndPoint() { - for (Authentication apiAuth : authentications.values()) { - if (apiAuth instanceof RetryingOAuth) { - RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; - return retryingOAuth.getTokenRequestBuilder(); - } - } - return null; - } - {{/hasOAuthMethods}} - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date {{#joda}}|| param instanceof DateTime || param instanceof LocalDate{{/joda}}{{#jsr310}}|| param instanceof OffsetDateTime || param instanceof LocalDate{{/jsr310}}) { - //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - * Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - {{^dynamicOperations}} - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - * Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - {{/dynamicOperations}} - {{#dynamicOperations}} - public List parameterToPairs(Parameter param, Collection value) { - List params = new ArrayList(); - - // preconditions - if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) { - return params; - } - - // create the params based on the collection format - if (StyleEnum.FORM.equals(param.getStyle()) && Boolean.TRUE.equals(param.getExplode())) { - for (Object item : value) { - params.add(new Pair(param.getName(), escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if (StyleEnum.SPACEDELIMITED.equals(param.getStyle())) { - delimiter = escapeString(" "); - } else if (StyleEnum.PIPEDELIMITED.equals(param.getStyle())) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(param.getName(), sb.substring(delimiter.length()))); - - return params; - } - {{/dynamicOperations}} - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString(String collectionFormat, Collection value) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - return sb.substring(delimiter.length()); - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(String filename) { - return filename.replaceAll(".*[/\\\\]", ""); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * returns null. If it matches "any", JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return null; - } - - if (contentTypes[0].equals("*/*")) { - return "application/json"; - } - - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body - * or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - String respBody; - try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; - } catch (IOException e) { - throw new ApiException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new ApiException( - "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody); - } - } - - /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws org.openapitools.client.ApiException If fail to serialize the given object - */ - public RequestBody serialize(Object obj, String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = json.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @return Prepared file for the download - * @throws java.io.IOException If fail to prepare file for download - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and - * data, which is a Java object deserialized from response body and would be null - * when returnType is null. - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse(response.code(), response.headers().toMultimap(), data); - } catch (IOException e) { - throw new ApiException(e); - } - } - - {{#supportStreaming}} - /** - *

Execute stream.

- * - * @param call a {@link okhttp3.Call} object - * @param returnType a {@link java.lang.reflect.Type} object - * @return a {@link java.io.InputStream} object - * @throws org.openapitools.client.ApiException if any. - */ - public InputStream executeStream(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - if (!response.isSuccessful()) { - throw new ApiException(response.code(), response.message()); - } - if (response.body() == null) { - return null; - } - return response.body().byteStream(); - } catch (IOException e) { - throw new ApiException(e); - } - } - - {{/supportStreaming}} - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - @SuppressWarnings("unchecked") - public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (Exception e) { - callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); - return; - } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); - } - }); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or - * fail to deserialize the response body - */ - public T handleResponse(Response response, Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (Exception e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - /** - * Build HTTP call with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - - final String url = buildUrl(path, queryParams, collectionQueryParams); - - // prepare HTTP request body - RequestBody reqBody; - String contentType = headerParams.get("Content-Type"); - - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentType)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentType)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); - } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Set cookie parameters to the request builder, including default cookies. - * - * @param cookieParams Cookie parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { - for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - for (Entry param : defaultCookieMap.entrySet()) { - if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - } - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws org.openapitools.client.ApiException If fails to update the parameters - */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, - Map cookieParams, String payload, String method, URI uri) throws ApiException { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) { - throw new RuntimeException("Authentication undefined: " + authName); - } - auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(Map formParams) { - okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); - } else { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); - mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); - } - } - return mpBuilder.build(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(File file) { - String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for - * async requests. - */ - private Interceptor getProgressInterceptor() { - return new Interceptor() { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - } - }; - } - - /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. - */ - private void applySslSettings() { - try { - TrustManager[] trustManagers; - HostnameVerifier hostnameVerifier; - if (!verifyingSsl) { - trustManagers = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; - } - } - }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - } else { - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - if (sslCaCert == null) { - trustManagerFactory.init((KeyStore) null); - } else { - char[] password = null; // Any password will work. - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); - } - KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - trustManagerFactory.init(caKeyStore); - } - trustManagers = trustManagerFactory.getTrustManagers(); - hostnameVerifier = OkHostnameVerifier.INSTANCE; - } - - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = httpClient.newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) - .hostnameVerifier(hostnameVerifier) - .build(); - } catch (GeneralSecurityException e) { - throw new RuntimeException(e); - } - } - - private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { - try { - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (IOException e) { - throw new AssertionError(e); - } - } - {{#dynamicOperations}} - - public ApiClient createOperationLookupMap(OpenAPI openAPI) { - operationLookupMap = new HashMap<>(); - for (Map.Entry pathItemEntry : openAPI.getPaths().entrySet()) { - String path = pathItemEntry.getKey(); - PathItem pathItem = pathItemEntry.getValue(); - addOperationLookupEntry(path, "GET", pathItem.getGet()); - addOperationLookupEntry(path, "PUT", pathItem.getPut()); - addOperationLookupEntry(path, "POST", pathItem.getPost()); - addOperationLookupEntry(path, "DELETE", pathItem.getDelete()); - addOperationLookupEntry(path, "OPTIONS", pathItem.getOptions()); - addOperationLookupEntry(path, "HEAD", pathItem.getHead()); - addOperationLookupEntry(path, "PATCH", pathItem.getPatch()); - addOperationLookupEntry(path, "TRACE", pathItem.getTrace()); - } - return this; - } - - private void addOperationLookupEntry(String path, String method, Operation operation) { - if ( operation != null && operation.getOperationId() != null) { - operationLookupMap.put( - operation.getOperationId(), - new ApiOperation(path, method, operation)); - } - } - - public Map getOperationLookupMap() { - return operationLookupMap; - } - - public String fillParametersFromOperation( - Operation operation, - Map paramMap, - String path, - List queryParams, - List collectionQueryParams, - Map headerParams, - Map cookieParams - ) { - for (Map.Entry entry : paramMap.entrySet()) { - Object value = entry.getValue(); - for (Parameter param : operation.getParameters()) { - if (entry.getKey().equals(param.getName())) { - switch (param.getIn()) { - case "path": - path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString())); - break; - case "query": - if (value instanceof Collection) { - collectionQueryParams.addAll(parameterToPairs(param, (Collection) value)); - } else { - queryParams.addAll(parameterToPair(param.getName(), value)); - } - break; - case "header": - headerParams.put(param.getName(), parameterToString(value)); - break; - case "cookie": - cookieParams.put(param.getName(), parameterToString(value)); - break; - default: - throw new IllegalStateException("Unexpected param in: " + param.getIn()); - } - - } - } - } - return path; - } - {{/dynamicOperations}} - - /** - * Convert the HTTP request body to a string. - * - * @param request The HTTP request object - * @return The string representation of the HTTP request body - * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string - */ - private String requestBodyToString(RequestBody requestBody) throws ApiException { - if (requestBody != null) { - try { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - throw new ApiException(e); - } - } - - // empty http request body - return ""; - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ApiResponse.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ApiResponse.mustache deleted file mode 100644 index cecbaac1d..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ApiResponse.mustache +++ /dev/null @@ -1,75 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.util.List; -import java.util.Map; -{{#caseInsensitiveResponseHeaders}} -import java.util.Map.Entry; -import java.util.TreeMap; -{{/caseInsensitiveResponseHeaders}} - -/** - * API response returned by API call. - */ -public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; - - /** - *

Constructor for ApiResponse.

- * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - *

Constructor for ApiResponse.

- * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - {{#caseInsensitiveResponseHeaders}} - Map> responseHeaders = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : headers.entrySet()){ - responseHeaders.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.headers = {{#caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}; - this.data = data; - } - - /** - *

Get the status code.

- * - * @return the status code - */ - public int getStatusCode() { - return statusCode; - } - - /** - *

Get the headers.

- * - * @return a {@link java.util.Map} of headers - */ - public Map> getHeaders() { - return headers; - } - - /** - *

Get the data.

- * - * @return the data - */ - public T getData() { - return data; - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache deleted file mode 100644 index b633aa8f5..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache +++ /dev/null @@ -1,74 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.*; -import okio.Buffer; -import okio.BufferedSink; -import okio.GzipSink; -import okio.Okio; - -import java.io.IOException; - -/** - * Encodes request bodies using gzip. - * - * Taken from https://github.com/square/okhttp/issues/350 - */ -class GzipRequestInterceptor implements Interceptor { - @Override - public Response intercept(Chain chain) throws IOException { - Request originalRequest = chain.request(); - if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { - return chain.proceed(originalRequest); - } - - Request compressedRequest = originalRequest.newBuilder() - .header("Content-Encoding", "gzip") - .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) - .build(); - return chain.proceed(compressedRequest); - } - - private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return new RequestBody() { - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() { - return buffer.size(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - sink.write(buffer.snapshot()); - } - }; - } - - private RequestBody gzip(final RequestBody body) { - return new RequestBody() { - @Override - public MediaType contentType() { - return body.contentType(); - } - - @Override - public long contentLength() { - return -1; // We don't know the compressed length in advance! - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); - body.writeTo(gzipSink); - gzipSink.close(); - } - }; - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/JSON.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/JSON.mustache deleted file mode 100644 index 32bef199e..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/JSON.mustache +++ /dev/null @@ -1,541 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonElement; -import io.gsonfire.GsonFireBuilder; -import io.gsonfire.TypeSelector; -{{#joda}} -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.DateTimeFormatterBuilder; -import org.joda.time.format.ISODateTimeFormat; -{{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} - -import okio.ByteString; - -import java.io.IOException; -import java.io.StringReader; -import java.lang.reflect.Type; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -{{#java8}} -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -{{/java8}} -import java.util.Date; -import java.util.Locale; -import java.util.Map; -import java.util.HashMap; - -/* - * A JSON utility class - * - * NOTE: in the future, this class may be converted to static, which may break - * backward-compatibility - */ -public class JSON { - private static Gson gson; - private static boolean isLenientOnJson = false; - private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - {{#joda}} - private static DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); - private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - {{/joda}} - {{#jsr310}} - private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - {{/jsr310}} - private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); - - @SuppressWarnings("unchecked") - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder() - {{#models}} - {{#model}} - {{#discriminator}} - .registerTypeSelector({{modelPackage}}.{{classname}}.class, new TypeSelector<{{modelPackage}}.{{classname}}>() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - {{#mappedModels}} - classByDiscriminatorValue.put("{{mappingName}}"{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}, {{modelPackage}}.{{modelName}}.class); - {{/mappedModels}} - classByDiscriminatorValue.put("{{name}}"{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}, {{modelPackage}}.{{classname}}.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "{{{propertyBaseName}}}")); - } - }) - {{/discriminator}} - {{/model}} - {{/models}} - ; - GsonBuilder builder = fireBuilder.createGsonBuilder(); - {{#disableHtmlEscaping}} - builder.disableHtmlEscaping(); - {{/disableHtmlEscaping}} - return builder; - } - - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if (null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - /** - * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. - * - * @param classByDiscriminatorValue The map of discriminator values to Java classes. - * @param discriminatorValue The value of the OpenAPI discriminator in the input data. - * @return The Java class that implements the OpenAPI schema - */ - private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}); - if (null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } - - { - gson = createGson() - .registerTypeAdapter(Date.class, dateTypeAdapter) - .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) - {{#joda}} - .registerTypeAdapter(DateTime.class, dateTimeTypeAdapter) - .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) - {{/joda}} - {{#jsr310}} - .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) - .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) - {{/jsr310}} - .registerTypeAdapter(byte[].class, byteArrayAdapter) - {{#models}} - {{#model}} - {{^isEnum}} - {{^hasChildren}} - .registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) - {{/hasChildren}} - {{/isEnum}} - {{/model}} - {{/models}} - .create(); - } - - /** - * Get Gson. - * - * @return Gson - */ - public static Gson getGson() { - return gson; - } - - /** - * Set Gson. - * - * @param gson Gson - */ - public static void setGson(Gson gson) { - JSON.gson = gson; - } - - public static void setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - } - - /** - * Serialize the given Java object into JSON string. - * - * @param obj Object - * @return String representation of the JSON - */ - public static String serialize(Object obj) { - return gson.toJson(obj); - } - - /** - * Deserialize the given JSON string to Java object. - * - * @param Type - * @param body The JSON string - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - @SuppressWarnings("unchecked") - public static T deserialize(String body, Type returnType) { - try { - if (isLenientOnJson) { - JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(body, returnType); - } - } catch (JsonParseException e) { - // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; - if (returnType.equals(String.class)) { - return (T) body; - } else { - throw (e); - } - } - } - - /** - * Gson TypeAdapter for Byte Array type - */ - public static class ByteArrayAdapter extends TypeAdapter { - - @Override - public void write(JsonWriter out, byte[] value) throws IOException { - if (value == null) { - out.nullValue(); - } else { - out.value(ByteString.of(value).base64()); - } - } - - @Override - public byte[] read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String bytesAsBase64 = in.nextString(); - ByteString byteString = ByteString.decodeBase64(bytesAsBase64); - return byteString.toByteArray(); - } - } - } - - {{#joda}} - /** - * Gson TypeAdapter for Joda DateTime type - */ - public static class DateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public DateTimeTypeAdapter() { - this(new DateTimeFormatterBuilder() - .append(ISODateTimeFormat.dateTime().getPrinter(), ISODateTimeFormat.dateOptionalTimeParser().getParser()) - .toFormatter()); - } - - public DateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, DateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.print(date)); - } - } - - @Override - public DateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return formatter.parseDateTime(date); - } - } - } - - /** - * Gson TypeAdapter for Joda LocalDate type - */ - public static class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(ISODateTimeFormat.date()); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.print(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return formatter.parseLocalDate(date); - } - } - } - - public static void setDateTimeFormat(DateTimeFormatter dateFormat) { - dateTimeTypeAdapter.setFormat(dateFormat); - } - - public static void setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - } - - {{/joda}} - {{#jsr310}} - /** - * Gson TypeAdapter for JSR310 OffsetDateTime type - */ - public static class OffsetDateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length()-5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } - } - } - - /** - * Gson TypeAdapter for JSR310 LocalDate type - */ - public static class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } - } - } - - public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - } - - public static void setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - } - - {{/jsr310}} - /** - * Gson TypeAdapter for java.sql.Date type - * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used - * (more efficient than SimpleDateFormat). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() {} - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - - /** - * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, ISO8601Utils will be used. - */ - public static class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() {} - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } - } - - public static void setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - } - - public static void setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache deleted file mode 100644 index 71e1e2b4c..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache +++ /dev/null @@ -1,62 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.MediaType; -import okhttp3.RequestBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSink; -import okio.ForwardingSink; -import okio.Okio; -import okio.Sink; - -public class ProgressRequestBody extends RequestBody { - - private final RequestBody requestBody; - - private final ApiCallback callback; - - public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { - this.requestBody = requestBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return requestBody.contentLength(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink bufferedSink = Okio.buffer(sink(sink)); - requestBody.writeTo(bufferedSink); - bufferedSink.flush(); - } - - private Sink sink(Sink sink) { - return new ForwardingSink(sink) { - - long bytesWritten = 0L; - long contentLength = 0L; - - @Override - public void write(Buffer source, long byteCount) throws IOException { - super.write(source, byteCount); - if (contentLength == 0) { - contentLength = contentLength(); - } - - bytesWritten += byteCount; - callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); - } - }; - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache deleted file mode 100644 index 45115940b..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache +++ /dev/null @@ -1,59 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.MediaType; -import okhttp3.ResponseBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; - -public class ProgressResponseBody extends ResponseBody { - - private final ResponseBody responseBody; - private final ApiCallback callback; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { - this.responseBody = responseBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return responseBody.contentType(); - } - - @Override - public long contentLength() { - return responseBody.contentLength(); - } - - @Override - public BufferedSource source() { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - - @Override - public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); - return bytesRead; - } - }; - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/README.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/README.mustache deleted file mode 100644 index a1a142bd4..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/README.mustache +++ /dev/null @@ -1,183 +0,0 @@ -# {{artifactId}} - -{{appName}} -- API version: {{appVersion}} -{{^hideGenerationTimestamp}} - - Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} - -{{{appDescriptionWithNewLines}}} - -{{#infoUrl}} - For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* - - -## Requirements - -Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ -2. Maven (3.8.3+)/Gradle (7.2+) - -## Installation - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn clean install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn clean deploy -``` - -Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - {{{groupId}}} - {{{artifactId}}} - {{{artifactVersion}}} - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy - repositories { - mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central. - mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo. - } - - dependencies { - implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" - } -``` - -### Others - -At first generate the JAR by executing: - -```shell -mvn clean package -``` - -Then manually install the following JARs: - -* `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` -* `target/lib/*.jar` - -## Getting Started - -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -// Import classes: -import {{{invokerPackage}}}.ApiClient; -import {{{invokerPackage}}}.ApiException; -import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} -import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} -import {{{invokerPackage}}}.models.*; -import {{{package}}}.{{{classname}}}; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("{{{basePath}}}"); - {{#hasAuthMethods}} - {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setUsername("YOUR USERNAME"); - {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} - // Configure HTTP bearer authorization: {{{name}}} - HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - // Configure API key authorization: {{{name}}} - ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} - {{/authMethods}} - {{/hasAuthMethods}} - - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{#allParams}} - {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} - {{/allParams}} - try { - {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{{paramName}}}({{{paramName}}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} - System.out.println(result);{{/returnType}} - } catch (ApiException e) { - System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} -``` - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation for Models - -{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) -{{/model}}{{/models}} - -## Documentation for Authorization - -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - {{scope}}: {{description}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/anyof_model.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/anyof_model.mustache deleted file mode 100644 index fae56fd29..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ /dev/null @@ -1,236 +0,0 @@ -import javax.ws.rs.core.GenericType; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; - -import {{invokerPackage}}.JSON; - -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { - private static final Logger log = Logger.getLogger({{classname}}.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes '{{classname}}' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - {{#anyOf}} - final TypeAdapter<{{.}}> adapter{{.}} = gson.getDelegateAdapter(this, TypeToken.get({{.}}.class)); - {{/anyOf}} - - return (TypeAdapter) new TypeAdapter<{{classname}}>() { - @Override - public void write(JsonWriter out, {{classname}} value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - {{#anyOf}} - // check if the actual instance is of the type `{{.}}` - if (value.getActualInstance() instanceof {{.}}) { - JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - {{/anyOf}} - throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); - } - - @Override - public {{classname}} read(JsonReader in) throws IOException { - Object deserialized = null; - JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - - {{#useOneOfDiscriminatorLookup}} - {{#discriminator}} - // use discriminator value for faster anyOf lookup - {{classname}} new{{classname}} = new {{classname}}(); - String discriminatorValue = elementAdapter.read(in).getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); - switch (discriminatorValue) { - {{#mappedModels}} - case "{{{mappingName}}}": - deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); - new{{classname}}.setActualInstance(deserialized); - return new{{classname}}; - {{/mappedModels}} - default: - log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); - } - - {{/discriminator}} - {{/useOneOfDiscriminatorLookup}} - {{#anyOf}} - // deserialize {{{.}}} - try { - // validate the JSON object to see if any excpetion is thrown - {{.}}.validateJsonObject(jsonObject); - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); - {{classname}} ret = new {{classname}}(); - ret.setActualInstance(adapter{{.}}.fromJsonTree(jsonObject)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); - } - - {{/anyOf}} - - throw new IOException(String.format("Failed deserialization for {{classname}}: no class matched. JSON: %s", jsonObject.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); - - public {{classname}}() { - super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - } - - {{#anyOf}} - public {{classname}}({{{.}}} o) { - super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - setActualInstance(o); - } - - {{/anyOf}} - static { - {{#anyOf}} - schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { - }); - {{/anyOf}} - } - - @Override - public Map getSchemas() { - return {{classname}}.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check - * the instance parameter is valid against the anyOf child schemas: - * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} - * - * It could be an instance of the 'anyOf' schemas. - * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). - */ - @Override - public void setActualInstance(Object instance) { - {{#isNullable}} - if (instance == null) { - super.setActualInstance(instance); - return; - } - - {{/isNullable}} - {{#anyOf}} - if (instance instanceof {{{.}}}) { - super.setActualInstance(instance); - return; - } - - {{/anyOf}} - throw new RuntimeException("Invalid instance type. Must be {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); - } - - /** - * Get the actual instance, which can be the following: - * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} - * - * @return The actual instance ({{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - {{#anyOf}} - /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` - */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); - } - - {{/anyOf}} - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to {{classname}} - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - // validate anyOf schemas one by one - int validCount = 0; - {{#anyOf}} - // validate the json string with {{{.}}} - try { - {{{.}}}.validateJsonObject(jsonObj); - return; // return earlier as at least one schema is valid with respect to the Json object - //validCount++; - } catch (Exception e) { - // continue to the next one - } - {{/anyOf}} - if (validCount == 0) { - throw new IOException(String.format("The JSON string is invalid for {{classname}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObj.toString())); - } - } - - /** - * Create an instance of {{classname}} given an JSON string - * - * @param jsonString JSON string - * @return An instance of {{classname}} - * @throws IOException if the JSON string is invalid with respect to {{classname}} - */ - public static {{{classname}}} fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); - } - - /** - * Convert an instance of {{classname}} to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/api.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/api.mustache deleted file mode 100644 index 943e6948d..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/api.mustache +++ /dev/null @@ -1,520 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -import {{invokerPackage}}.ApiCallback; -import {{invokerPackage}}.ApiClient; -import {{invokerPackage}}.ApiException; -{{#dynamicOperations}} -import {{invokerPackage}}.ApiOperation; -{{/dynamicOperations}} -import {{invokerPackage}}.ApiResponse; -import {{invokerPackage}}.Configuration; -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ProgressRequestBody; -import {{invokerPackage}}.ProgressResponseBody; -{{#performBeanValidation}} -import {{invokerPackage}}.BeanValidationException; -{{/performBeanValidation}} - -import com.google.gson.reflect.TypeToken; -{{#dynamicOperations}} -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.parameters.Parameter; -{{/dynamicOperations}} - -import java.io.IOException; - -{{#useBeanValidation}} -import javax.validation.constraints.*; -{{/useBeanValidation}} -{{#performBeanValidation}} -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.ValidatorFactory; -import javax.validation.executable.ExecutableValidator; -import java.util.Set; -import java.lang.reflect.Method; -import java.lang.reflect.Type; -{{/performBeanValidation}} - -{{#imports}}import {{import}}; -{{/imports}} - -import java.lang.reflect.Type; -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{#supportStreaming}} -import java.io.InputStream; -{{/supportStreaming}} -{{/fullJavaUtil}} -import javax.ws.rs.core.GenericType; - -{{#operations}} -public class {{classname}} { - private ApiClient localVarApiClient; - - public {{classname}}() { - this(Configuration.getDefaultApiClient()); - } - - public {{classname}}(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - {{#operation}} - {{^vendorExtensions.x-group-parameters}}/** - * Build call for {{operationId}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - - // create path and map variables - {{^dynamicOperations}} - String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; - {{/dynamicOperations}} - {{#dynamicOperations}} - ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}"); - if (apiOperation == null) { - throw new ApiException("Operation not found in OAS"); - } - Operation operation = apiOperation.getOperation(); - String localVarPath = apiOperation.getPath(); - Map paramMap = new HashMap<>(); - {{#allParams}} - {{^isFormParam}} - {{^isBodyParam}} - paramMap.put("{{baseName}}", {{paramName}}); - {{/isBodyParam}} - {{/isFormParam}} - {{/allParams}} - {{/dynamicOperations}} - - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); - - {{#formParams}} - if ({{paramName}} != null) { - localVarFormParams.put("{{baseName}}", {{paramName}}); - } - - {{/formParams}} - {{^dynamicOperations}} - {{#queryParams}} - if ({{paramName}} != null) { - {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); - } - - {{/queryParams}} - {{#headerParams}} - if ({{paramName}} != null) { - localVarHeaderParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); - } - - {{/headerParams}} - {{#cookieParams}} - if ({{paramName}} != null) { - localVarCookieParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); - } - - {{/cookieParams}} - {{/dynamicOperations}} - {{#dynamicOperations}} - localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); - - {{/dynamicOperations}} - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - return localVarApiClient.buildCall(localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - @SuppressWarnings("rawtypes") - private okhttp3.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { - {{^performBeanValidation}} - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) { - throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)"); - } - {{/required}}{{/allParams}} - - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - - {{/performBeanValidation}} - {{#performBeanValidation}} - try { - ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); - ExecutableValidator executableValidator = factory.getValidator().forExecutables(); - - Object[] parameterValues = { {{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}} }; - Method method = this.getClass().getMethod("{{operationId}}WithHttpInfo"{{#allParams}}, {{#isArray}}java.util.List{{/isArray}}{{#isMap}}java.util.Map{{/isMap}}{{^isArray}}{{^isMap}}{{{dataType}}}{{/isMap}}{{/isArray}}.class{{/allParams}}); - Set> violations = executableValidator.validateParameters(this, method, - parameterValues); - - if (violations.size() == 0) { - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - - } else { - throw new BeanValidationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - - {{/performBeanValidation}} - } - - {{^vendorExtensions.x-group-parameters}} - /** - * {{summary}} - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}{{#returnType}} - * @return {{.}}{{/returnType}} - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#vendorExtensions.x-streaming}} - public {{#returnType}}InputStream {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}InputStream localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp;{{/returnType}} - } - {{/vendorExtensions.x-streaming}} - {{^vendorExtensions.x-streaming}} - public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp.getData();{{/returnType}} - } - {{/vendorExtensions.x-streaming}} - {{/vendorExtensions.x-group-parameters}} - - {{^vendorExtensions.x-group-parameters}}/** - * {{summary}} - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}} - try { - Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); - e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); - throw e; - } - {{/returnType}} - } - {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{^returnType}} - return localVarApiClient.execute(localVarCall); - {{/returnType}} - {{#returnType}} - try { - Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); - e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); - throw e; - } - {{/returnType}} - } - {{/vendorExtensions.x-streaming}} - - {{^vendorExtensions.x-group-parameters}}/** - * {{summary}} (asynchronously) - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { - - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}_callback); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);{{/returnType}}{{^returnType}}localVarApiClient.executeAsync(localVarCall, _callback);{{/returnType}} - return localVarCall; - } - {{#vendorExtensions.x-group-parameters}} - - public class API{{operationId}}Request { - {{#requiredParams}} - private final {{{dataType}}} {{paramName}}; - {{/requiredParams}} - {{#optionalParams}} - private {{{dataType}}} {{paramName}}; - {{/optionalParams}} - - private API{{operationId}}Request({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) { - {{#requiredParams}} - this.{{paramName}} = {{paramName}}; - {{/requiredParams}} - } - - {{#optionalParams}} - /** - * Set {{paramName}} - * @param {{paramName}} {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}) - * @return API{{operationId}}Request - */ - public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) { - this.{{paramName}} = {{paramName}}; - return this; - } - - {{/optionalParams}} - /** - * Build call for {{operationId}} - * @param _callback ApiCallback API callback - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - } - - /** - * Execute {{operationId}} request{{#returnType}} - * @return {{.}}{{/returnType}} - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { - {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp.getData();{{/returnType}} - } - - /** - * Execute {{operationId}} request with HTTP info returned - * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { - return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - } - - /** - * Execute {{operationId}} request (asynchronously) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public okhttp3.Call executeAsync(final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { - return {{operationId}}Async({{#allParams}}{{paramName}}, {{/allParams}}_callback); - } - } - - /** - * {{summary}} - * {{notes}}{{#requiredParams}} - * @param {{paramName}} {{description}} (required){{/requiredParams}} - * @return API{{operationId}}Request - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public API{{operationId}}Request {{operationId}}({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) { - return new API{{operationId}}Request({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}); - } - {{/vendorExtensions.x-group-parameters}} - {{/operation}} -} -{{/operations}} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/apiException.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/apiException.mustache deleted file mode 100644 index 59da3c51c..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/apiException.mustache +++ /dev/null @@ -1,199 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.util.Map; -import java.util.List; -{{#caseInsensitiveResponseHeaders}} -import java.util.Map.Entry; -import java.util.TreeMap; -{{/caseInsensitiveResponseHeaders}} - -import javax.ws.rs.core.GenericType; - -/** - *

ApiException class.

- */ -@SuppressWarnings("serial") -{{>generatedAnnotation}} -public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - private {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject = null; - private GenericType errorObjectType = null; - - /** - *

Constructor for ApiException.

- */ - public ApiException() {} - - /** - *

Constructor for ApiException.

- * - * @param throwable a {@link java.lang.Throwable} object - */ - public ApiException(Throwable throwable) { - super(throwable); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - */ - public ApiException(String message) { - super(message); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - {{#caseInsensitiveResponseHeaders}} - Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : responseHeaders.entrySet()){ - headers.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; - this.responseBody = responseBody; - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param message a {@link java.lang.String} object - */ - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param message the error message - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - {{#caseInsensitiveResponseHeaders}} - Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : responseHeaders.entrySet()){ - headers.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } - - /** - * Get the error object type. - * - * @return Error object type - */ - public GenericType getErrorObjectType() { - return errorObjectType; - } - - /** - * Set the error object type. - * - * @param errorObjectType object type - */ - public void setErrorObjectType(GenericType errorObjectType) { - this.errorObjectType = errorObjectType; - } - - /** - * Get the error object. - * - * @return Error object - */ - public {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} getErrorObject() { - return errorObject; - } - - /** - * Get the error object. - * - * @param errorObject Error object - */ - public void setErrorObject({{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject) { - this.errorObject = errorObject; - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/api_doc.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/api_doc.mustache deleted file mode 100644 index 616ad65a5..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/api_doc.mustache +++ /dev/null @@ -1,118 +0,0 @@ -# {{classname}}{{#description}} -{{.}}{{/description}} - -All URIs are relative to *{{basePath}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} - -# **{{operationId}}**{{^vendorExtensions.x-group-parameters}} -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} - -{{summary}}{{#notes}} - -{{.}}{{/notes}} - -### Example -```java -// Import classes: -import {{{invokerPackage}}}.ApiClient; -import {{{invokerPackage}}}.ApiException; -import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} -import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} -import {{{invokerPackage}}}.models.*; -import {{{package}}}.{{{classname}}}; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("{{{basePath}}}"); - {{#hasAuthMethods}} - {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setUsername("YOUR USERNAME"); - {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} - // Configure HTTP bearer authorization: {{{name}}} - HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - // Configure API key authorization: {{{name}}} - ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} - {{/authMethods}} - {{/hasAuthMethods}} - - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{#allParams}} - {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} - {{/allParams}} - try { - {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{{paramName}}}({{{paramName}}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} - System.out.println(result);{{/returnType}} - } catch (ApiException e) { - {{=< >=}} - <#errorObjectSubtype> - <^-first>} else if (e.getErrorObject() instanceof <&.>) { - // do something here - <#-last> - } else { - // something else happened - System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - - - <={{ }}=> - - } - } -} -``` - -### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} -{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} - -{{#responses.0}} -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -{{#responses}} -**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | -{{/responses}} -{{/responses.0}} - -{{/operation}} -{{/operations}} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/api_test.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/api_test.mustache deleted file mode 100644 index 98a30a60c..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/api_test.mustache +++ /dev/null @@ -1,56 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -import {{invokerPackage}}.ApiException; -{{#imports}}import {{import}}; -{{/imports}} -import org.junit.Test; -import org.junit.Ignore; - -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{#supportStreaming}} -import java.io.InputStream; -{{/supportStreaming}} -{{/fullJavaUtil}} - -/** - * API tests for {{classname}} - */ -@Ignore -public class {{classname}}Test { - - private final {{classname}} api = new {{classname}}(); - - {{#operations}}{{#operation}} - /** - * {{summary}} - * - * {{notes}} - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void {{operationId}}Test() throws ApiException { - {{#allParams}} - {{{dataType}}} {{paramName}} = null; - {{/allParams}} - {{#vendorExtensions.x-streaming}} - InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{paramName}}({{paramName}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}} - {{/vendorExtensions.x-streaming}} - {{^vendorExtensions.x-streaming}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{paramName}}({{paramName}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}} - {{/vendorExtensions.x-streaming}} - // TODO: test validations - } - {{/operation}}{{/operations}} -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache deleted file mode 100644 index a0dda669a..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache +++ /dev/null @@ -1,69 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } else if ("cookie".equals(location)) { - cookieParams.put(paramName, value); - } - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/Authentication.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/Authentication.mustache deleted file mode 100644 index c4ad338c7..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/Authentication.mustache +++ /dev/null @@ -1,25 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws ApiException if failed to update the parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache deleted file mode 100644 index 417a89e34..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache +++ /dev/null @@ -1,46 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import okhttp3.Credentials; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -import java.io.UnsupportedEncodingException; - -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (username == null && password == null) { - return; - } - headerParams.put("Authorization", Credentials.basic( - username == null ? "" : username, - password == null ? "" : password)); - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache deleted file mode 100644 index c8a9fce29..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache +++ /dev/null @@ -1,52 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class HttpBearerAuth implements Authentication { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return bearerToken; - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (bearerToken == null) { - return; - } - - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/OAuth.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/OAuth.mustache deleted file mode 100644 index 34d359857..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/OAuth.mustache +++ /dev/null @@ -1,31 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class OAuth implements Authentication { - private String accessToken; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (accessToken != null) { - headerParams.put("Authorization", "Bearer " + accessToken); - } - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache deleted file mode 100644 index cb0e82505..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache +++ /dev/null @@ -1,70 +0,0 @@ -{{#hasOAuthMethods}} -package {{invokerPackage}}.auth; - -import okhttp3.OkHttpClient; -import okhttp3.MediaType; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -public class OAuthOkHttpClient implements HttpClient { - private OkHttpClient client; - - public OAuthOkHttpClient() { - this.client = new OkHttpClient(); - } - - public OAuthOkHttpClient(OkHttpClient client) { - this.client = client; - } - - @Override - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - MediaType mediaType = MediaType.parse("application/json"); - Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); - - if(headers != null) { - for (Entry entry : headers.entrySet()) { - if (entry.getKey().equalsIgnoreCase("Content-Type")) { - mediaType = MediaType.parse(entry.getValue()); - } else { - requestBuilder.addHeader(entry.getKey(), entry.getValue()); - } - } - } - - RequestBody body = request.getBody() != null ? RequestBody.create(request.getBody(), mediaType) : null; - requestBuilder.method(requestMethod, body); - - try { - Response response = client.newCall(requestBuilder.build()).execute(); - return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), - response.body().contentType().toString(), - response.code(), - responseClass); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - } - - @Override - public void shutdown() { - // Nothing to do here - } -} -{{/hasOAuthMethods}} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache deleted file mode 100644 index 43d58ce88..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache +++ /dev/null @@ -1,213 +0,0 @@ -{{#hasOAuthMethods}} -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import okhttp3.Interceptor; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; - -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URI; -import java.util.Map; -import java.util.List; - -public class RetryingOAuth extends OAuth implements Interceptor { - private OAuthClient oAuthClient; - - private TokenRequestBuilder tokenRequestBuilder; - - /** - * @param client An OkHttp client - * @param tokenRequestBuilder A token request builder - */ - public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { - this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); - this.tokenRequestBuilder = tokenRequestBuilder; - } - - /** - * @param tokenRequestBuilder A token request builder - */ - public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { - this(new OkHttpClient(), tokenRequestBuilder); - } - - /** - * @param tokenUrl The token URL to be used for this OAuth2 flow. - * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - * The value must be an absolute URL. - * @param clientId The OAuth2 client ID for the "clientCredentials" flow. - * @param flow OAuth flow. - * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - * @param parameters A map of string. - */ - public RetryingOAuth( - String tokenUrl, - String clientId, - OAuthFlow flow, - String clientSecret, - Map parameters - ) { - this(OAuthClientRequest.tokenLocation(tokenUrl) - .setClientId(clientId) - .setClientSecret(clientSecret)); - setFlow(flow); - if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); - } - } - } - - /** - * Set the OAuth flow - * - * @param flow The OAuth flow. - */ - public void setFlow(OAuthFlow flow) { - switch(flow) { - case accessCode: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case implicit: - tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); - break; - case password: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case application: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - } - - @Override - public Response intercept(Chain chain) throws IOException { - return retryingIntercept(chain, true); - } - - private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { - Request request = chain.request(); - - // If the request already has an authorization (e.g. Basic auth), proceed with the request as is - if (request.header("Authorization") != null) { - return chain.proceed(request); - } - - // Get the token if it has not yet been acquired - if (getAccessToken() == null) { - updateAccessToken(null); - } - - OAuthClientRequest oAuthRequest; - if (getAccessToken() != null) { - // Build the request - Request.Builder requestBuilder = request.newBuilder(); - - String requestAccessToken = getAccessToken(); - try { - oAuthRequest = - new OAuthBearerClientRequest(request.url().toString()). - setAccessToken(requestAccessToken). - buildHeaderMessage(); - } catch (OAuthSystemException e) { - throw new IOException(e); - } - - Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); - } - requestBuilder.url(oAuthRequest.getLocationUri()); - - // Execute the request - Response response = chain.proceed(requestBuilder.build()); - - // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row - if ( - response != null && - ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || - response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && - updateTokenAndRetryOnAuthorizationFailure - ) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body().close(); - return retryingIntercept(chain, false); - } - } catch (Exception e) { - response.body().close(); - throw e; - } - } - return response; - } - else { - return chain.proceed(chain.request()); - } - } - - /** - * Returns true if the access token has been updated - * - * @param requestAccessToken the request access token - * @return True if the update is successful - * @throws java.io.IOException If fail to update the access token - */ - public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { - try { - OAuthJSONAccessTokenResponse accessTokenResponse = - oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken()); - } - } catch (OAuthSystemException | OAuthProblemException e) { - throw new IOException(e); - } - } - return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); - } - - /** - * Gets the token request builder - * - * @return A token request builder - * @throws java.io.IOException If fail to update the access token - */ - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } - - /** - * Sets the token request builder - * - * @param tokenRequestBuilder Token request builder - */ - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - // Applying authorization to parameters is performed in the retryingIntercept method - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - // No implementation necessary - } -} -{{/hasOAuthMethods}} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/build.gradle.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/build.gradle.mustache deleted file mode 100644 index c97cb873e..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/build.gradle.mustache +++ /dev/null @@ -1,169 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' -{{#sourceFolder}} -apply plugin: 'java' -{{/sourceFolder}} -apply plugin: 'com.diffplug.spotless' - -group = '{{groupId}}' -version = '{{artifactVersion}}' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' - } -} - -repositories { - mavenCentral() -} -{{#sourceFolder}} -sourceSets { - main.java.srcDirs = ['{{sourceFolder}}'] -} - -{{/sourceFolder}} -if(hasProperty('target') && target == 'android') { - - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' - - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } - - dependencies { - provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - } - } - - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven-publish' - - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - - publishing { - publications { - maven(MavenPublication) { - artifactId = '{{artifactId}}' - from components.java - } - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - jakarta_annotation_version = "1.3.5" -} - -dependencies { - implementation 'io.swagger:swagger-annotations:1.5.24' - implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'io.gsonfire:gson-fire:1.8.4' - {{#openApiNullable}} - implementation 'org.openapitools:jackson-databind-nullable:0.2.1' - {{/openApiNullable}} - {{#hasOAuthMethods}} - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' - {{/hasOAuthMethods}} - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - {{#joda}} - implementation 'joda-time:joda-time:2.9.9' - {{/joda}} - {{#threetenbp}} - implementation 'org.threeten:threetenbp:1.4.3' - {{/threetenbp}} - {{#dynamicOperations}} - implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.23' - {{/dynamicOperations}} - implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:3.11.2' -} - -javadoc { - options.tags = [ "http.response.details:a:Http Response Details" ] -} - -// Use spotless plugin to automatically format code, remove unused import, etc -// To apply changes directly to the file, run `gradlew spotlessApply` -// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle -spotless { - // comment out below to run spotless as part of the `check` task - enforceCheck false - - format 'misc', { - // define the files (e.g. '*.gradle', '*.md') to apply `misc` to - target '.gitignore' - - // define the steps to apply to those files - trimTrailingWhitespace() - indentWithSpaces() // Takes an integer argument if you don't like 4 - endWithNewline() - } - java { - // don't need to set target, it is inferred from java - - // apply a specific flavor of google-java-format - googleJavaFormat('1.8').aosp().reflowLongStrings() - - removeUnusedImports() - importOrder() - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/build.sbt.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/build.sbt.mustache deleted file mode 100644 index 5e0c74c55..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/build.sbt.mustache +++ /dev/null @@ -1,39 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "{{groupId}}", - name := "{{artifactId}}", - version := "{{artifactVersion}}", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24", - "com.squareup.okhttp3" % "okhttp" % "4.9.1", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", - "com.google.code.gson" % "gson" % "2.8.6", - "org.apache.commons" % "commons-lang3" % "3.10", - {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", - {{/openApiNullable}} - {{#hasOAuthMethods}} - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", - {{/hasOAuthMethods}} - {{#joda}} - "joda-time" % "joda-time" % "2.9.9" % "compile", - {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - {{/threetenbp}} - {{#dynamicOperations}} - "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" - {{/dynamicOperations}} - "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" - ) - ) diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/model.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/model.mustache deleted file mode 100644 index b6b0381a5..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/model.mustache +++ /dev/null @@ -1,61 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -{{#useReflectionEqualsHashCode}} -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -{{/useReflectionEqualsHashCode}} -import java.util.Objects; -import java.util.Arrays; -{{#imports}} -import {{import}}; -{{/imports}} -{{#serializableModel}} -import java.io.Serializable; -{{/serializableModel}} -{{#jackson}} -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -{{#withXml}} -import com.fasterxml.jackson.dataformat.xml.annotation.*; -{{/withXml}} -{{#vendorExtensions.x-has-readonly-properties}} -import com.fasterxml.jackson.annotation.JsonCreator; -{{/vendorExtensions.x-has-readonly-properties}} -{{/jackson}} -{{#withXml}} -import javax.xml.bind.annotation.*; -{{/withXml}} -{{#jsonb}} -import java.lang.reflect.Type; -import javax.json.bind.annotation.JsonbTypeDeserializer; -import javax.json.bind.annotation.JsonbTypeSerializer; -import javax.json.bind.serializer.DeserializationContext; -import javax.json.bind.serializer.JsonbDeserializer; -import javax.json.bind.serializer.JsonbSerializer; -import javax.json.bind.serializer.SerializationContext; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.bind.annotation.JsonbProperty; -{{#vendorExtensions.x-has-readonly-properties}} -import javax.json.bind.annotation.JsonbCreator; -{{/vendorExtensions.x-has-readonly-properties}} -{{/jsonb}} -{{#parcelableModel}} -import android.os.Parcelable; -import android.os.Parcel; -{{/parcelableModel}} -{{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; -{{/useBeanValidation}} -{{#performBeanValidation}} -import org.hibernate.validator.constraints.*; -{{/performBeanValidation}} - -{{#models}} -{{#model}} -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>oneof_model}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>anyof_model}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>pojo}}{{/anyOf}}{{/oneOf}}{{/isEnum}} -{{/model}} -{{/models}} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/oneof_model.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/oneof_model.mustache deleted file mode 100644 index ce88e9a78..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ /dev/null @@ -1,242 +0,0 @@ -import javax.ws.rs.core.GenericType; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; - -import {{invokerPackage}}.JSON; - -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { - private static final Logger log = Logger.getLogger({{classname}}.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes '{{classname}}' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - {{#oneOf}} - final TypeAdapter<{{.}}> adapter{{.}} = gson.getDelegateAdapter(this, TypeToken.get({{.}}.class)); - {{/oneOf}} - - return (TypeAdapter) new TypeAdapter<{{classname}}>() { - @Override - public void write(JsonWriter out, {{classname}} value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - {{#oneOf}} - // check if the actual instance is of the type `{{.}}` - if (value.getActualInstance() instanceof {{.}}) { - JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - {{/oneOf}} - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); - } - - @Override - public {{classname}} read(JsonReader in) throws IOException { - Object deserialized = null; - JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - - {{#useOneOfDiscriminatorLookup}} - {{#discriminator}} - // use discriminator value for faster oneOf lookup - {{classname}} new{{classname}} = new {{classname}}(); - String discriminatorValue = elementAdapter.read(in).getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); - switch (discriminatorValue) { - {{#mappedModels}} - case "{{{mappingName}}}": - deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); - new{{classname}}.setActualInstance(deserialized); - return new{{classname}}; - {{/mappedModels}} - default: - log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); - } - - {{/discriminator}} - {{/useOneOfDiscriminatorLookup}} - int match = 0; - TypeAdapter actualAdapter = elementAdapter; - - {{#oneOf}} - // deserialize {{{.}}} - try { - // validate the JSON object to see if any excpetion is thrown - {{.}}.validateJsonObject(jsonObject); - actualAdapter = adapter{{.}}; - match++; - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); - } - - {{/oneOf}} - if (match == 1) { - {{classname}} ret = new {{classname}}(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); - return ret; - } - - throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); - - public {{classname}}() { - super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - } - - {{#oneOf}} - public {{classname}}({{{.}}} o) { - super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - setActualInstance(o); - } - - {{/oneOf}} - static { - {{#oneOf}} - schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { - }); - {{/oneOf}} - } - - @Override - public Map getSchemas() { - return {{classname}}.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} - * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). - */ - @Override - public void setActualInstance(Object instance) { - {{#isNullable}} - if (instance == null) { - super.setActualInstance(instance); - return; - } - - {{/isNullable}} - {{#oneOf}} - if (instance instanceof {{{.}}}) { - super.setActualInstance(instance); - return; - } - - {{/oneOf}} - throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); - } - - /** - * Get the actual instance, which can be the following: - * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} - * - * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - {{#oneOf}} - /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` - */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); - } - - {{/oneOf}} - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to {{classname}} - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - {{#oneOf}} - // validate the json string with {{{.}}} - try { - {{{.}}}.validateJsonObject(jsonObj); - validCount++; - } catch (Exception e) { - // continue to the next one - } - {{/oneOf}} - if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); - } - } - - /** - * Create an instance of {{classname}} given an JSON string - * - * @param jsonString JSON string - * @return An instance of {{classname}} - * @throws IOException if the JSON string is invalid with respect to {{classname}} - */ - public static {{{classname}}} fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); - } - - /** - * Convert an instance of {{classname}} to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/pojo.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/pojo.mustache deleted file mode 100644 index b30ce069f..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/pojo.mustache +++ /dev/null @@ -1,541 +0,0 @@ -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import {{invokerPackage}}.JSON; - -/** - * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} - * @deprecated{{/isDeprecated}} - */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} -{{#jackson}} -@JsonPropertyOrder({ -{{#vars}} - {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} -{{/vars}} -}) -@JsonTypeName("{{name}}") -{{/jackson}} -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} -public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ -{{#serializableModel}} - private static final long serialVersionUID = 1L; - -{{/serializableModel}} - {{#vars}} - {{#isEnum}} - {{^isContainer}} -{{>modelInnerEnum}} - {{/isContainer}} - {{#isContainer}} - {{#mostInnerItems}} -{{>modelInnerEnum}} - {{/mostInnerItems}} - {{/isContainer}} - {{/isEnum}} - {{#gson}} - public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; - {{/gson}} - {{#jackson}} - public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; - {{/jackson}} - {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} - {{/withXml}} - {{#gson}} - @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) - {{/gson}} - {{#vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); - {{/isContainer}} - {{^isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; - {{/isContainer}} - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; - {{/isContainer}} - {{^isContainer}} - {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; - {{/isContainer}} - {{/vendorExtensions.x-is-jackson-optional-nullable}} - - {{/vars}} - public {{classname}}() { {{#parent}}{{#parcelableModel}} - super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} - this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} - }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} - - {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} - public {{classname}}( - {{#readOnlyVars}} - {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} - {{/readOnlyVars}} - ) { - this(); - {{#readOnlyVars}} - this.{{name}} = {{name}}; - {{/readOnlyVars}} - }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} - {{#vars}} - - {{^isReadOnly}} - public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { - {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = {{name}};{{/vendorExtensions.x-is-jackson-optional-nullable}} - return this; - } - {{#isArray}} - - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); - } - try { - this.{{name}}.get().add({{name}}Item); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present - } - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; - } - {{/required}} - this.{{name}}.add({{name}}Item); - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - {{/isArray}} - {{#isMap}} - - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); - } - try { - this.{{name}}.get().put(key, {{name}}Item); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present - } - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; - } - {{/required}} - this.{{name}}.put(key, {{name}}Item); - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - {{/isMap}} - - {{/isReadOnly}} - /** - {{#description}} - * {{.}} - {{/description}} - {{^description}} - * Get {{name}} - {{/description}} - {{#minimum}} - * minimum: {{.}} - {{/minimum}} - {{#maximum}} - * maximum: {{.}} - {{/maximum}} - * @return {{name}} - {{#deprecated}} - * @deprecated - {{/deprecated}} - **/ -{{#deprecated}} - @Deprecated -{{/deprecated}} -{{#required}} -{{#isNullable}} - @javax.annotation.Nullable -{{/isNullable}} -{{^isNullable}} - @javax.annotation.Nonnull -{{/isNullable}} -{{/required}} -{{^required}} - @javax.annotation.Nullable -{{/required}} -{{#jsonb}} - @JsonbProperty("{{baseName}}") -{{/jsonb}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") -{{#vendorExtensions.x-extra-annotation}} - {{{vendorExtensions.x-extra-annotation}}} -{{/vendorExtensions.x-extra-annotation}} -{{#vendorExtensions.x-is-jackson-optional-nullable}} - {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} - @JsonIgnore -{{/vendorExtensions.x-is-jackson-optional-nullable}} -{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} - public {{{datatypeWithEnum}}} {{getter}}() { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} - if ({{name}} == null) { - {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; - } - {{/isReadOnly}} - return {{name}}.orElse(null); - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - return {{name}}; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - - {{#vendorExtensions.x-is-jackson-optional-nullable}} -{{> jackson_annotations}} - public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { - return {{name}}; - } - {{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}} - @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) - {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { - {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} - this.{{name}} = {{name}}; - } - {{/vendorExtensions.x-is-jackson-optional-nullable}} - - {{^isReadOnly}} -{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} -{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - this.{{name}} = {{name}}; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - {{/isReadOnly}} - - {{/vars}} - - @Override - public boolean equals(Object o) { - {{#useReflectionEqualsHashCode}} - return EqualsBuilder.reflectionEquals(this, o, false, null, true); - {{/useReflectionEqualsHashCode}} - {{^useReflectionEqualsHashCode}} - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - }{{#hasVars}} - {{classname}} {{classVarName}} = ({{classname}}) o; - return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} && - {{/-last}}{{/vars}}{{#parent}} && - super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} - return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} - {{/useReflectionEqualsHashCode}} - }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} - - @Override - public int hashCode() { - {{#useReflectionEqualsHashCode}} - return HashCodeBuilder.reflectionHashCode(this); - {{/useReflectionEqualsHashCode}} - {{^useReflectionEqualsHashCode}} - return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); - {{/useReflectionEqualsHashCode}} - }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class {{classname}} {\n"); - {{#parent}} - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - {{/parent}} - {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); - {{/vars}} - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -{{#parcelableModel}} - - public void writeToParcel(Parcel out, int flags) { -{{#model}} -{{#isArray}} - out.writeList(this); -{{/isArray}} -{{^isArray}} -{{#parent}} - super.writeToParcel(out, flags); -{{/parent}} -{{#vars}} - out.writeValue({{name}}); -{{/vars}} -{{/isArray}} -{{/model}} - } - - {{classname}}(Parcel in) { -{{#isArray}} - in.readTypedList(this, {{arrayModelType}}.CREATOR); -{{/isArray}} -{{^isArray}} -{{#parent}} - super(in); -{{/parent}} -{{#vars}} -{{#isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); -{{/isPrimitiveType}} -{{^isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); -{{/isPrimitiveType}} -{{/vars}} -{{/isArray}} - } - - public int describeContents() { - return 0; - } - - public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { - public {{classname}} createFromParcel(Parcel in) { -{{#model}} -{{#isArray}} - {{classname}} result = new {{classname}}(); - result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); - return result; -{{/isArray}} -{{^isArray}} - return new {{classname}}(in); -{{/isArray}} -{{/model}} - } - public {{classname}}[] newArray(int size) { - return new {{classname}}[size]; - } - }; -{{/parcelableModel}} - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - {{#allVars}} - openapiFields.add("{{baseName}}"); - {{/allVars}} - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - {{#requiredVars}} - openapiRequiredFields.add("{{baseName}}"); - {{/requiredVars}} - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to {{classname}} - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if ({{classname}}.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in {{{classname}}} is not found in the empty JSON string", {{classname}}.openapiRequiredFields.toString())); - } - } - {{^hasChildren}} - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!{{classname}}.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - {{#requiredVars}} - {{#-first}} - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : {{classname}}.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - {{/-first}} - {{/requiredVars}} - {{/hasChildren}} - {{^discriminator}} - {{#vars}} - {{#isArray}} - {{#items.isModel}} - JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); - {{#isRequired}} - // validate the required field `{{{baseName}}}` (array) - for (int i = 0; i < jsonArray{{name}}.size(); i++) { - {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); - }; - {{/isRequired}} - {{^isRequired}} - // validate the optional field `{{{baseName}}}` (array) - if (jsonArray{{name}} != null) { - for (int i = 0; i < jsonArray{{name}}.size(); i++) { - {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); - }; - } - {{/isRequired}} - {{/items.isModel}} - {{/isArray}} - {{^isContainer}} - {{#isModel}} - {{#isRequired}} - // validate the required field `{{{baseName}}}` - {{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}")); - {{/isRequired}} - {{^isRequired}} - // validate the optional field `{{{baseName}}}` - if (jsonObj.getAsJsonObject("{{{baseName}}}") != null) { - {{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}")); - } - {{/isRequired}} - {{/isModel}} - {{/isContainer}} - {{/vars}} - {{/discriminator}} - {{#hasChildren}} - {{#discriminator}} - - String discriminatorValue = jsonObj.get("{{{propertyBaseName}}}").getAsString(); - switch (discriminatorValue) { - {{#mappedModels}} - case "{{mappingName}}": - {{modelName}}.validateJsonObject(jsonObj); - break; - {{/mappedModels}} - default: - throw new IllegalArgumentException(String.format("The value of the `{{{propertyBaseName}}}` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); - } - {{/discriminator}} - {{/hasChildren}} - } - -{{^hasChildren}} - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes '{{classname}}' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter<{{classname}}> thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get({{classname}}.class)); - - return (TypeAdapter) new TypeAdapter<{{classname}}>() { - @Override - public void write(JsonWriter out, {{classname}} value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public {{classname}} read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } -{{/hasChildren}} - - /** - * Create an instance of {{classname}} given an JSON string - * - * @param jsonString JSON string - * @return An instance of {{classname}} - * @throws IOException if the JSON string is invalid with respect to {{classname}} - */ - public static {{{classname}}} fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); - } - - /** - * Convert an instance of {{classname}} to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/pom.mustache b/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/pom.mustache deleted file mode 100644 index 10dfc15ab..000000000 --- a/sdks/java-v1/templates/libraries/okhttp-gson-nextgen/pom.mustache +++ /dev/null @@ -1,420 +0,0 @@ - - 4.0.0 - {{groupId}} - {{artifactId}} - jar - {{artifactId}} - {{artifactVersion}} - {{artifactUrl}} - {{artifactDescription}} - - {{scmConnection}} - {{scmDeveloperConnection}} - {{scmUrl}} - -{{#parentOverridden}} - - {{{parentGroupId}}} - {{{parentArtifactId}}} - {{{parentVersion}}} - -{{/parentOverridden}} - - - - {{licenseName}} - {{licenseUrl}} - repo - - - - - - {{developerName}} - {{developerEmail}} - {{developerOrganization}} - {{developerOrganizationUrl}} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - true - 128m - 512m - - -Xlint:all - -J-Xss4m - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M5 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - 10 - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - - - - test-jar - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.2.0 - - - add_sources - generate-sources - - add-source - - - - {{{sourceFolder}}} - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.3.1 - - - attach-javadocs - - jar - - - - - none - - - http.response.details - a - Http Response Details: - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.0 - - - attach-sources - - jar-no-fork - - - - - - - com.diffplug.spotless - spotless-maven-plugin - ${spotless.version} - - - - - - - .gitignore - - - - - - true - 4 - - - - - - - - - - 1.8 - - true - - - - - - - - - - - - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.squareup.okhttp3 - okhttp - ${okhttp-version} - - - com.squareup.okhttp3 - logging-interceptor - ${okhttp-version} - - - com.google.code.gson - gson - ${gson-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - {{#hasOAuthMethods}} - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - 1.0.1 - - {{/hasOAuthMethods}} - - org.apache.commons - commons-lang3 - ${commons-lang3-version} - - {{#joda}} - - joda-time - joda-time - ${jodatime-version} - - {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} - {{#dynamicOperations}} - - io.swagger.parser.v3 - swagger-parser-v3 - 2.0.28 - - {{/dynamicOperations}} - {{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - {{/useBeanValidation}} - {{#performBeanValidation}} - - - org.hibernate - hibernate-validator - 5.4.3.Final - - - jakarta.el - jakarta.el-api - ${jakarta.el-version} - - {{/performBeanValidation}} - {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - - {{/parcelableModel}} - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - provided - - {{#openApiNullable}} - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - {{/openApiNullable}} - - javax.ws.rs - jsr311-api - 1.1.1 - - - javax.ws.rs - javax.ws.rs-api - 2.0 - - - - junit - junit - ${junit-version} - test - - - org.mockito - mockito-core - 3.12.4 - test - - - - 1.8 - ${java.version} - ${java.version} - 1.8.5 - 1.6.3 - 4.9.2 - 2.8.8 - 3.12.0 - {{#openApiNullable}} - 0.2.2 - {{/openApiNullable}} - {{#joda}} - 2.10.9 - {{/joda}} - {{#threetenbp}} - 1.5.0 - {{/threetenbp}} - 1.3.5 -{{#performBeanValidation}} - 3.0.3 -{{/performBeanValidation}} -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 4.13.2 - UTF-8 - 2.17.3 - - diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache new file mode 100644 index 000000000..8d11435be --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache @@ -0,0 +1,135 @@ +{{>licenseInfo}} + +package {{modelPackage}}; + +import {{invokerPackage}}.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +{{>generatedAnnotation}} +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + +{{>libraries/jersey2/additional_properties}} + +} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/ApiClient.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/ApiClient.mustache index 421b7782e..c5e7ae225 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/ApiClient.mustache @@ -23,11 +23,6 @@ import org.joda.time.DateTime; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormatter; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#hasOAuthMethods}} import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; import org.apache.oltu.oauth2.common.message.types.GrantType; @@ -52,14 +47,13 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -72,6 +66,9 @@ import {{invokerPackage}}.auth.OAuth; import {{invokerPackage}}.auth.RetryingOAuth; import {{invokerPackage}}.auth.OAuthFlow; {{/hasOAuthMethods}} +{{#withAWSV4Signature}} +import {{invokerPackage}}.auth.AWS4Auth; +{{/withAWSV4Signature}} /** *

ApiClient class.

@@ -79,6 +76,33 @@ import {{invokerPackage}}.auth.OAuthFlow; public class ApiClient { private String basePath = "{{{basePath}}}"; + protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + new HashMap(){{#variables}}{{#-first}} {{ +{{/-first}} put("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new HashSet( + {{#enumValues}} + {{#-first}} + Arrays.asList( + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + ) + {{/-last}} + {{/enumValues}} + ) + )); + {{#-last}} + }}{{/-last}}{{/variables}} + ){{^-last}},{{/-last}} + {{#-last}} + ){{/-last}}{{/servers}}); + protected Integer serverIndex = 0; + protected Map serverVariables = null; private boolean debugging = false; private Map defaultHeaderMap = new HashMap(); private Map defaultCookieMap = new HashMap(); @@ -112,10 +136,11 @@ public class ApiClient { initHttpClient(); // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}{{#withAWSV4Signature}} + authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -131,10 +156,11 @@ public class ApiClient { httpClient = client; // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}{{#withAWSV4Signature}} + authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -186,8 +212,7 @@ public class ApiClient { this.basePath = basePath; } -{{#hasOAuthMethods}} - String tokenUrl = "{{tokenUrl}}"; + String tokenUrl = "{{{tokenUrl}}}"; if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { URI uri = URI.create(getBasePath()); tokenUrl = uri.getScheme() + ":" + @@ -197,17 +222,17 @@ public class ApiClient { throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); } } - RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{flow}}, clientSecret, parameters); + RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, clientSecret, parameters); authentications.put( "{{name}}", retryingOAuth ); initHttpClient(Collections.singletonList(retryingOAuth)); -{{/hasOAuthMethods}} // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}}{{#withAWSV4Signature}} + authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); @@ -267,6 +292,34 @@ public class ApiClient { */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; return this; } @@ -391,10 +444,10 @@ public class ApiClient { *

Setter for the field dateFormat.

* * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); + JSON.setDateFormat(dateFormat); return this; } @@ -402,21 +455,21 @@ public class ApiClient { *

Set SqlDateFormat.

* * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); + JSON.setSqlDateFormat(dateFormat); return this; } {{#joda}} public ApiClient setDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setDateTimeFormat(dateFormat); + JSON.setDateTimeFormat(dateFormat); return this; } public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -425,22 +478,22 @@ public class ApiClient { /** *

Set OffsetDateTimeFormat.

* - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); + JSON.setOffsetDateTimeFormat(dateFormat); return this; } /** *

Set LocalDateFormat.

* - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -449,10 +502,10 @@ public class ApiClient { *

Set LenientOnJson.

* * @param lenientOnJson a boolean - * @return a {@link org.openapitools.client.ApiClient} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + JSON.setLenientOnJson(lenientOnJson); return this; } @@ -476,14 +529,23 @@ public class ApiClient { } {{#hasHttpBearerMethods}} - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ public void setBearerToken(String bearerToken) { + setBearerToken(() -> bearerToken); + } + + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setBearerToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); return; } } @@ -568,6 +630,51 @@ public class ApiClient { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + {{#withAWSV4Signature}} + for (Authentication auth : authentications.values()) { + if (auth instanceof AWS4Auth) { + ((AWS4Auth) auth).setCredentials(accessKey, secretKey); + ((AWS4Auth) auth).setRegion(region); + ((AWS4Auth) auth).setService(service); + return; + } + } + {{/withAWSV4Signature}} + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + {{#withAWSV4Signature}} + for (Authentication auth : authentications.values()) { + if (auth instanceof AWS4Auth) { + ((AWS4Auth) auth).setCredentials(accessKey, secretKey, sessionToken); + ((AWS4Auth) auth).setRegion(region); + ((AWS4Auth) auth).setService(service); + return; + } + } + {{/withAWSV4Signature}} + throw new RuntimeException("No AWS4 authentication configured!"); + } + /** * Set the User-Agent header's value (by adding to the default header map). * @@ -752,7 +859,7 @@ public class ApiClient { return ""; } else if (param instanceof Date {{#joda}}|| param instanceof DateTime || param instanceof LocalDate{{/joda}}{{#jsr310}}|| param instanceof OffsetDateTime || param instanceof LocalDate{{/jsr310}}) { //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -760,7 +867,7 @@ public class ApiClient { if (b.length() > 0) { b.append(","); } - b.append(String.valueOf(o)); + b.append(o); } return b.toString(); } else { @@ -845,7 +952,7 @@ public class ApiClient { List params = new ArrayList(); // preconditions - if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) { + if (param == null || param.getName() == null || param.getName().isEmpty() || value == null || value.isEmpty()) { return params; } @@ -880,6 +987,30 @@ public class ApiClient { } {{/dynamicOperations}} + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + /** * Formats the specified collection path parameter to a string value. * @@ -1011,7 +1142,7 @@ public class ApiClient { * @param response HTTP response * @param returnType The type of the Java object * @return The deserialized Java object - * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * @throws {{invokerPackage}}.ApiException If fail to deserialize response body, i.e. cannot read response body * or the Content-Type of the response is not supported. */ @SuppressWarnings("unchecked") @@ -1052,7 +1183,7 @@ public class ApiClient { contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; @@ -1072,7 +1203,7 @@ public class ApiClient { * @param obj The Java object * @param contentType The request Content-Type * @return The serialized request body - * @throws org.openapitools.client.ApiException If fail to serialize the given object + * @throws {{invokerPackage}}.ApiException If fail to serialize the given object */ public RequestBody serialize(Object obj, String contentType) throws ApiException { if (obj instanceof byte[]) { @@ -1086,11 +1217,13 @@ public class ApiClient { } else if (isJsonMime(contentType)) { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } @@ -1100,7 +1233,7 @@ public class ApiClient { * Download file from the given response. * * @param response An instance of the Response object - * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk + * @throws {{invokerPackage}}.ApiException If fail to read file content from response and write to disk * @return Downloaded file */ public File downloadFileFromResponse(Response response) throws ApiException { @@ -1164,7 +1297,7 @@ public class ApiClient { * @param Type * @param call An instance of the Call object * @return ApiResponse<T> - * @throws org.openapitools.client.ApiException If fail to execute the call + * @throws {{invokerPackage}}.ApiException If fail to execute the call */ public ApiResponse execute(Call call) throws ApiException { return execute(call, null); @@ -1179,7 +1312,7 @@ public class ApiClient { * @return ApiResponse object containing response status, headers and * data, which is a Java object deserialized from response body and would be null * when returnType is null. - * @throws org.openapitools.client.ApiException If fail to execute the call + * @throws {{invokerPackage}}.ApiException If fail to execute the call */ public ApiResponse execute(Call call, Type returnType) throws ApiException { try { @@ -1198,13 +1331,13 @@ public class ApiClient { * @param call a {@link okhttp3.Call} object * @param returnType a {@link java.lang.reflect.Type} object * @return a {@link java.io.InputStream} object - * @throws org.openapitools.client.ApiException if any. + * @throws {{invokerPackage}}.ApiException if any. */ public InputStream executeStream(Call call, Type returnType) throws ApiException { try { Response response = call.execute(); if (!response.isSuccessful()) { - throw new ApiException(response.code(), response.message()); + throw new ApiException(response.code(), response.message(), response.headers().toMultimap(), null); } if (response.body() == null) { return null; @@ -1268,7 +1401,7 @@ public class ApiClient { * @param response Response * @param returnType Return type * @return Type - * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or + * @throws {{invokerPackage}}.ApiException If the response has an unsuccessful status code or * fail to deserialize the response body */ public T handleResponse(Response response, Type returnType) throws ApiException { @@ -1303,6 +1436,7 @@ public class ApiClient { /** * Build HTTP call with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1314,7 +1448,7 @@ public class ApiClient { * @param authNames The authentications to apply * @param callback Callback for upload/download progress * @return The HTTP call - * @throws org.openapitools.client.ApiException If fail to serialize the request body object + * @throws {{invokerPackage}}.ApiException If fail to serialize the request body object */ public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); @@ -1325,6 +1459,7 @@ public class ApiClient { /** * Build an HTTP request with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1336,24 +1471,23 @@ public class ApiClient { * @param authNames The authentications to apply * @param callback Callback for upload/download progress * @return The HTTP request - * @throws org.openapitools.client.ApiException If fail to serialize the request body object + * @throws {{invokerPackage}}.ApiException If fail to serialize the request body object */ public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body RequestBody reqBody; String contentType = headerParams.get("Content-Type"); - + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } if (!HttpMethod.permitsRequestBody(method)) { reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentType)) { + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentType)) { + } else if ("multipart/form-data".equals(contentTypePure)) { reqBody = buildRequestBodyMultipart(formParams); } else if (body == null) { if ("DELETE".equals(method)) { @@ -1361,16 +1495,18 @@ public class ApiClient { reqBody = null; } else { // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); } } else { reqBody = serialize(body, contentType); } + List updatedQueryParams = new ArrayList<>(queryParams); + // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - final Request.Builder reqBuilder = new Request.Builder().url(url); + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); processHeaderParams(headerParams, reqBuilder); processCookieParams(cookieParams, reqBuilder); @@ -1393,6 +1529,7 @@ public class ApiClient { /** * Build full URL by concatenating base path, the given sub path and query parameters. * + * @param baseUrl The base URL * @param path The sub path * @param queryParams The query parameters * @param collectionQueryParams The collection query parameters @@ -1403,7 +1540,18 @@ public class ApiClient { if (baseUrl != null) { url.append(baseUrl).append(path); } else { - url.append(basePath).append(path); + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); } if (queryParams != null && !queryParams.isEmpty()) { @@ -1487,6 +1635,7 @@ public class ApiClient { * @param payload HTTP request body * @param method HTTP method * @param uri URI + * @throws {{invokerPackage}}.ApiException If fails to update the parameters */ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { @@ -1525,12 +1674,18 @@ public class ApiClient { for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } } else { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); - mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); } } return mpBuilder.build(); @@ -1551,6 +1706,44 @@ public class ApiClient { } } + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + /** * Get network interceptor to add it to the httpClient to track download progress for * async requests. @@ -1618,7 +1811,7 @@ public class ApiClient { KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); + String certificateAlias = "ca" + (index++); caKeyStore.setCertificateEntry(certificateAlias, certificate); } trustManagerFactory.init(caKeyStore); @@ -1693,7 +1886,7 @@ public class ApiClient { if (entry.getKey().equals(param.getName())) { switch (param.getIn()) { case "path": - path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString())); + path = path.replace("{" + param.getName() + "}", escapeString(value.toString())); break; case "query": if (value instanceof Collection) { @@ -1722,9 +1915,9 @@ public class ApiClient { /** * Convert the HTTP request body to a string. * - * @param request The HTTP request object + * @param requestBody The HTTP request object * @return The string representation of the HTTP request body - * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + * @throws {{invokerPackage}}.ApiException If fail to serialize the request body object into a string */ private String requestBodyToString(RequestBody requestBody) throws ApiException { if (requestBody != null) { diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/JSON.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/JSON.mustache new file mode 100644 index 000000000..6cf7ec789 --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/JSON.mustache @@ -0,0 +1,534 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; +{{#joda}} +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.DateTimeFormatterBuilder; +import org.joda.time.format.ISODateTimeFormat; +{{/joda}} + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + {{#joda}} + private static DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + {{/joda}} + {{#jsr310}} + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + {{/jsr310}} + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + {{#models}} + {{#model}} + {{#discriminator}} + .registerTypeSelector({{modelPackage}}.{{classname}}.class, new TypeSelector<{{modelPackage}}.{{classname}}>() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + {{#mappedModels}} + classByDiscriminatorValue.put("{{mappingName}}"{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}, {{modelPackage}}.{{modelName}}.class); + {{/mappedModels}} + classByDiscriminatorValue.put("{{name}}"{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}, {{modelPackage}}.{{classname}}.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "{{{propertyBaseName}}}")); + } + }) + {{/discriminator}} + {{/model}} + {{/models}} + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + {{#disableHtmlEscaping}} + builder.disableHtmlEscaping(); + {{/disableHtmlEscaping}} + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + {{#joda}} + gsonBuilder.registerTypeAdapter(DateTime.class, dateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + {{/joda}} + {{#jsr310}} + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + {{/jsr310}} + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + {{#models}} + {{#model}} + {{^isEnum}} + {{^hasChildren}} + gsonBuilder.registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()); + {{/hasChildren}} + {{/isEnum}} + {{/model}} + {{/models}} + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + {{#joda}} + /** + * Gson TypeAdapter for Joda DateTime type + */ + public static class DateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public DateTimeTypeAdapter() { + this(new DateTimeFormatterBuilder() + .append(ISODateTimeFormat.dateTime().getPrinter(), ISODateTimeFormat.dateOptionalTimeParser().getParser()) + .toFormatter()); + } + + public DateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, DateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.print(date)); + } + } + + @Override + public DateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return formatter.parseDateTime(date); + } + } + } + + /** + * Gson TypeAdapter for Joda LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(ISODateTimeFormat.date()); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.print(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return formatter.parseLocalDate(date); + } + } + } + + public static void setDateTimeFormat(DateTimeFormatter dateFormat) { + dateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + {{/joda}} + {{#jsr310}} + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + {{/jsr310}} + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/README.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/README.mustache index a1a142bd4..8dbdf2451 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/README.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/README.mustache @@ -5,6 +5,7 @@ {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} + - Generator version: {{generatorVersion}} {{{appDescriptionWithNewLines}}} @@ -18,7 +19,7 @@ ## Requirements Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ +1. Java 1.8+ 2. Maven (3.8.3+)/Gradle (7.2+) ## Installation @@ -96,6 +97,10 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("{{{basePath}}}"); + {{#withAWSV4Signature}} + // Configure AWS Signature V4 authorization + defaultClient.setAWS4Configuration("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", "REGION", "SERVICE") + {{/withAWSV4Signature}} {{#hasAuthMethods}} {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} @@ -151,18 +156,25 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}}- **Type**: API key - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/additional_properties.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/additional_properties.mustache new file mode 100644 index 000000000..bca54f84d --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/additional_properties.mustache @@ -0,0 +1,46 @@ +{{#isAdditionalPropertiesTrue}} + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the {{classname}} instance itself + */ + public {{classname}} putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } +{{/isAdditionalPropertiesTrue}} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/anyof_model.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/anyof_model.mustache new file mode 100644 index 000000000..18447fc12 --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/anyof_model.mustache @@ -0,0 +1,398 @@ + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import {{invokerPackage}}.JSON; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + {{#composedSchemas}} + {{#anyOf}} + {{^isArray}} + {{^vendorExtensions.x-duplicated-data-type}} + final TypeAdapter<{{{dataType}}}> adapter{{{dataType}}} = gson.getDelegateAdapter(this, TypeToken.get({{{dataType}}}.class)); + {{/vendorExtensions.x-duplicated-data-type}} + {{/isArray}} + {{#isArray}} + + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); + {{/isArray}} + {{/anyOf}} + {{/composedSchemas}} + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // check if the actual instance is of the type `{{{dataType}}}` + if (value.getActualInstance() instanceof {{#isArray}}List{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) { + {{#isPrimitiveType}} + JsonPrimitive primitive = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isArray}} + List list = (List) value.getActualInstance(); + if (list.get(0) instanceof {{{items.dataType}}}) { + JsonArray array = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonArray(); + elementAdapter.write(out, array); + return; + } + {{/isArray}} + {{/isPrimitiveType}} + {{^isArray}} + {{^isPrimitiveType}} + JsonElement element = adapter{{{dataType}}}.toJsonTree(({{{dataType}}})value.getActualInstance()); + elementAdapter.write(out, element); + return; + {{/isPrimitiveType}} + {{/isArray}} + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^hasVars}} + // deserialize {{{dataType}}} + try { + // validate the JSON object to see if any exception is thrown + {{^isArray}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isArray}} + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); + } + {{/hasVars}} + {{#hasVars}} + // deserialize {{{.}}} + try { + // validate the JSON object to see if any exception is thrown + {{.}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{.}}; + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{.}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + } + {{/hasVars}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + + throw new IOException(String.format("Failed deserialization for {{classname}}: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public {{classname}}() { + super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + } + + public {{classname}}(Object o) { + super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + + static { + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + schemas.put("{{{dataType}}}", {{{baseType}}}.class); + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + } + + @Override + public Map> getSchemas() { + return {{classname}}.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + {{#isNullable}} + if (instance == null) { + super.setActualInstance(instance); + return; + } + + {{/isNullable}} + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (instance instanceof {{#isArray}}List{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) { + {{#isArray}} + List list = (List) instance; + if (list.get(0) instanceof {{{items.dataType}}}) { + super.setActualInstance(instance); + return; + } + {{/isArray}} + {{^isArray}} + super.setActualInstance(instance); + return; + {{/isArray}} + } + + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + throw new RuntimeException("Invalid instance type. Must be {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + } + + /** + * Get the actual instance, which can be the following: + * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * + * @return The actual instance ({{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + /** + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` + */ + public {{{dataType}}} get{{#isArray}}{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to {{classname}} + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // validate the json string with {{{dataType}}} + try { + {{^hasVars}} + {{^isArray}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isArray}} + {{/hasVars}} + {{#hasVars}} + {{{.}}}.validateJsonElement(jsonElement); + return; + {{/hasVars}} + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + // continue to the next one + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + throw new IOException(String.format("The JSON string is invalid for {{classname}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/api.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/api.mustache index e81f874f1..96757ed64 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/api.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/api.mustache @@ -26,13 +26,14 @@ import io.swagger.v3.oas.models.parameters.Parameter; import java.io.IOException; {{#useBeanValidation}} -import javax.validation.constraints.*; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.ValidatorFactory; -import javax.validation.executable.ExecutableValidator; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.ValidatorFactory; +import jakarta.validation.executable.ExecutableValidator; import java.util.Set; import java.lang.reflect.Method; import java.lang.reflect.Type; @@ -42,7 +43,6 @@ import java.lang.reflect.Type; {{/imports}} import java.lang.reflect.Type; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -50,7 +50,6 @@ import java.util.Map; {{#supportStreaming}} import java.io.InputStream; {{/supportStreaming}} -{{/fullJavaUtil}} {{#operations}} public class {{classname}} { @@ -119,7 +118,6 @@ public class {{classname}} { {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { {{#servers}}"{{{url}}}"{{^-last}}, {{/-last}}{{/servers}} }; @@ -137,7 +135,7 @@ public class {{classname}} { // create path and map variables {{^dynamicOperations}} String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; + .replace("{" + "{{baseName}}" + "}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; {{/dynamicOperations}} {{#dynamicOperations}} ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}"); @@ -156,11 +154,11 @@ public class {{classname}} { {{/allParams}} {{/dynamicOperations}} - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#formParams}} if ({{paramName}} != null) { @@ -171,29 +169,52 @@ public class {{classname}} { {{^dynamicOperations}} {{#queryParams}} if ({{paramName}} != null) { - {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{#isFreeFormObject}}localVarQueryParams.addAll(localVarApiClient.freeFormParameterToPairs({{paramName}}));{{/isFreeFormObject}}{{^isFreeFormObject}}{{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}}));{{/isFreeFormObject}} } {{/queryParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarCollectionQueryParams.add(new Pair("{{baseName}}", {{#_enum}}"{{{.}}}"{{/_enum}})); + + {{/isQueryParam}} + {{/constantParams}} {{#headerParams}} if ({{paramName}} != null) { localVarHeaderParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); } {{/headerParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarHeaderParams.put("{{baseName}}", {{#_enum}}"{{{.}}}"{{/_enum}}); + + {{/isHeaderParam}} + {{/constantParams}} {{#cookieParams}} if ({{paramName}} != null) { localVarCookieParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); } {{/cookieParams}} + {{#constantParams}} + {{#isCookieParam}} + // Set client side default value of Cookie Param "{{baseName}}". + localVarCookieParams.put("{{baseName}}", {{#_enum}}"{{{.}}}"{{/_enum}}); + + {{/isCookieParam}} + {{/constantParams}} {{/dynamicOperations}} {{#dynamicOperations}} localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); {{/dynamicOperations}} final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -201,14 +222,16 @@ public class {{classname}} { } final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + String[] localVarAuthNames = new String[] { {{#withAWSV4Signature}}"AWS4Auth"{{/withAWSV4Signature}}{{#authMethods}}{{#-first}}{{#withAWSV4Signature}}, {{/withAWSV4Signature}}{{/-first}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; return localVarApiClient.buildCall(basePath, localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -218,15 +241,16 @@ public class {{classname}} { @SuppressWarnings("rawtypes") private okhttp3.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { {{^performBeanValidation}} - {{#allParams}}{{#required}} + {{#allParams}} + {{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)"); } - {{/required}}{{/allParams}} - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; + {{/required}} + {{/allParams}} + return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); {{/performBeanValidation}} {{#performBeanValidation}} @@ -240,9 +264,7 @@ public class {{classname}} { parameterValues); if (violations.size() == 0) { - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - + return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); } else { throw new BeanValidationException((Set) violations); } @@ -253,7 +275,6 @@ public class {{classname}} { e.printStackTrace(); throw new ApiException(e.getMessage()); } - {{/performBeanValidation}} } @@ -326,13 +347,42 @@ public class {{classname}} { {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType);{{/returnType}} + {{#returnType}} + {{#errorObjectType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}>(){}.getType())); + throw e; + } + {{/errorObjectType}} + {{^errorObjectType}} + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + {{/errorObjectType}} + {{/returnType}} } {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType);{{/returnType}}{{^returnType}}return localVarApiClient.execute(localVarCall);{{/returnType}} + {{^returnType}} + return localVarApiClient.execute(localVarCall); + {{/returnType}} + {{#returnType}} + {{#errorObjectType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}>(){}.getType())); + throw e; + } + {{/errorObjectType}} + {{^errorObjectType}} + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + {{/errorObjectType}} + {{/returnType}} } {{/vendorExtensions.x-streaming}} @@ -443,10 +493,17 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} + {{^vendorExtensions.x-streaming}} public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} return localVarResp.getData();{{/returnType}} } + {{/vendorExtensions.x-streaming}} + {{#vendorExtensions.x-streaming}} + public InputStream execute() throws ApiException { + return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/vendorExtensions.x-streaming}} /** * Execute {{operationId}} request with HTTP info returned @@ -468,9 +525,16 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} + {{^vendorExtensions.x-streaming}} public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } + {{/vendorExtensions.x-streaming}} + {{#vendorExtensions.x-streaming}} + public InputStream executeWithHttpInfo() throws ApiException { + return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/vendorExtensions.x-streaming}} /** * Execute {{operationId}} request (asynchronously) diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/apiException.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/apiException.mustache index 4bec51da9..3cd6edaf7 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/apiException.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/apiException.mustache @@ -9,16 +9,22 @@ import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} + /** *

ApiException class.

*/ @SuppressWarnings("serial") {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - + {{#errorObjectType}} + private {{{errorObjectType}}} errorObject = null; + {{/errorObjectType}} + /** *

Constructor for ApiException.

*/ @@ -96,7 +102,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us * @param responseBody the response body */ public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); } /** @@ -156,4 +162,34 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } + {{#errorObjectType}} + + /** + * Get the error object. + * + * @return Error object + */ + public {{{errorObjectType}}} getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject({{{errorObjectType}}} errorObject) { + this.errorObject = errorObject; + } + {{/errorObjectType}} } diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/api_doc.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/api_doc.mustache index 5a4e3969c..dea75bd2b 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/api_doc.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/api_doc.mustache @@ -3,14 +3,14 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} {{#operation}} - + # **{{operationId}}**{{^vendorExtensions.x-group-parameters}} > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} @@ -33,6 +33,10 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("{{{basePath}}}"); + {{#withAWSV4Signature}} + // Configure AWS Signature V4 authorization + defaultClient.setAWS4Configuration("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", "REGION", "SERVICE") + {{/withAWSV4Signature}} {{#hasAuthMethods}} {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} @@ -75,9 +79,9 @@ public class Example { ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type @@ -98,7 +102,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| {{#responses}} -**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | {{/responses}} {{/responses.0}} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/api_test.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/api_test.mustache index 98a30a60c..29f682678 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/api_test.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/api_test.mustache @@ -5,10 +5,9 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -16,24 +15,32 @@ import java.util.Map; {{#supportStreaming}} import java.io.InputStream; {{/supportStreaming}} -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); - {{#operations}}{{#operation}} + {{#operations}} + {{#operation}} /** + {{#summary}} * {{summary}} * + {{/summary}} + {{#notes}} * {{notes}} * - * @throws ApiException - * if the Api call fails + {{/notes}} + * @throws ApiException if the Api call fails */ @Test public void {{operationId}}Test() throws ApiException { @@ -41,16 +48,18 @@ public class {{classname}}Test { {{{dataType}}} {{paramName}} = null; {{/allParams}} {{#vendorExtensions.x-streaming}} - InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{paramName}}({{paramName}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}} {{/vendorExtensions.x-streaming}} {{^vendorExtensions.x-streaming}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{paramName}}({{paramName}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}} {{/vendorExtensions.x-streaming}} // TODO: test validations } - {{/operation}}{{/operations}} + + {{/operation}} + {{/operations}} } diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/auth/AWS4Auth.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/auth/AWS4Auth.mustache new file mode 100644 index 000000000..24bfb4c1f --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/auth/AWS4Auth.mustache @@ -0,0 +1,104 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.List; +import java.util.stream.Collectors; + +import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.auth.credentials.AwsSessionCredentials; +import software.amazon.awssdk.auth.credentials.AwsCredentials; +import software.amazon.awssdk.auth.signer.Aws4Signer; +import software.amazon.awssdk.auth.signer.params.Aws4SignerParams; +import software.amazon.awssdk.http.ContentStreamProvider; +import software.amazon.awssdk.http.SdkHttpFullRequest; +import software.amazon.awssdk.http.SdkHttpMethod; +import software.amazon.awssdk.regions.Region; + +import okio.Buffer; + +{{>generatedAnnotation}} +public class AWS4Auth implements Authentication { + + private AwsCredentials credentials; + private String region; + private String service; + + public AWS4Auth() { + this.credentials = AnonymousCredentialsProvider.create().resolveCredentials(); + } + + public void setCredentials(String accessKey, String secretKey) { + this.credentials = AwsBasicCredentials.create(accessKey, secretKey); + } + + public void setCredentials(String accessKey, String secretKey, String sessionToken) { + this.credentials = AwsSessionCredentials.create(accessKey, secretKey, sessionToken); + } + + public void setRegion(String region) { + this.region = region; + } + + public void setService(String service) { + this.service = service; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) + throws ApiException { + + SdkHttpFullRequest.Builder requestBuilder = + SdkHttpFullRequest.builder().uri(uri).method(SdkHttpMethod.fromValue(method)); + + ContentStreamProvider provider = new ContentStreamProvider() { + @Override + public InputStream newStream() { + InputStream is = new ByteArrayInputStream(payload.getBytes(StandardCharsets.UTF_8)); + return is; + } + }; + + requestBuilder = requestBuilder.contentStreamProvider(provider); + + SdkHttpFullRequest signableRequest = sign(requestBuilder); + + Map headers = signableRequest.headers().entrySet().stream() + .collect(Collectors.toMap(s -> s.getKey(), e -> e.getValue().get(0))); + + headerParams.putAll(headers); + } + + /** + * AWS Signature Version 4 signing. + * + * @param request {@link SdkHttpFullRequest.Builder} + * @return {@link SdkHttpFullRequest} + */ + private SdkHttpFullRequest sign(final SdkHttpFullRequest.Builder request) { + + SdkHttpFullRequest req = request.build(); + + if (this.service != null && this.region != null && this.credentials != null) { + Aws4SignerParams params = Aws4SignerParams.builder().signingName(this.service) + .signingRegion(Region.of(this.region)).awsCredentials(this.credentials).build(); + + Aws4Signer signer = Aws4Signer.create(); + + req = signer.sign(req, params); + } + + return req; + } +} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache index 417a89e34..41f336707 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache @@ -11,8 +11,6 @@ import java.net.URI; import java.util.Map; import java.util.List; -import java.io.UnsupportedEncodingException; - public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache index c8a9fce29..abe1cb8b8 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache @@ -6,13 +6,15 @@ import {{invokerPackage}}.ApiException; import {{invokerPackage}}.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; {{>generatedAnnotation}} public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -24,7 +26,7 @@ public class HttpBearerAuth implements Authentication { * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** @@ -33,12 +35,22 @@ public class HttpBearerAuth implements Authentication { * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); if (bearerToken == null) { return; } diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache index cb0e82505..67d7f720d 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + {{#hasOAuthMethods}} package {{invokerPackage}}.auth; @@ -56,6 +58,7 @@ public class OAuthOkHttpClient implements HttpClient { response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache index 137e266b5..fbe73e729 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + {{#hasOAuthMethods}} package {{invokerPackage}}.auth; @@ -29,22 +31,31 @@ public class RetryingOAuth extends OAuth implements Interceptor { private TokenRequestBuilder tokenRequestBuilder; + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); this.tokenRequestBuilder = tokenRequestBuilder; } + /** + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { this(new OkHttpClient(), tokenRequestBuilder); } /** - @param tokenUrl The token URL to be used for this OAuth2 flow. - Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - The value must be an absolute URL. - @param clientId The OAuth2 client ID for the "clientCredentials" flow. - @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - */ + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ public RetryingOAuth( String tokenUrl, String clientId, @@ -57,24 +68,29 @@ public class RetryingOAuth extends OAuth implements Interceptor { .setClientSecret(clientSecret)); setFlow(flow); if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); } } } + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: + case ACCESS_CODE: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case implicit: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: @@ -116,8 +132,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { } Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); } requestBuilder.url(oAuthRequest.getLocationUri()); @@ -148,8 +164,12 @@ public class RetryingOAuth extends OAuth implements Interceptor { } } - /* + /** * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { @@ -166,10 +186,20 @@ public class RetryingOAuth extends OAuth implements Interceptor { return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); } + /** + * Gets the token request builder + * + * @return A token request builder + */ public TokenRequestBuilder getTokenRequestBuilder() { return tokenRequestBuilder; } + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { this.tokenRequestBuilder = tokenRequestBuilder; } diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/build.gradle.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/build.gradle.mustache index c97cb873e..eb67fc112 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/build.gradle.mustache @@ -14,8 +14,8 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -66,10 +66,10 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) } } @@ -110,31 +110,33 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.5.24' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'io.gsonfire:gson-fire:1.8.4' + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.9.0' + implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' {{#openApiNullable}} - implementation 'org.openapitools:jackson-databind-nullable:0.2.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' {{/openApiNullable}} + {{#withAWSV4Signature}} + implementation 'software.amazon.awssdk:auth:2.20.157' + {{/withAWSV4Signature}} {{#hasOAuthMethods}} - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' {{/hasOAuthMethods}} - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' {{#joda}} implementation 'joda-time:joda-time:2.9.9' {{/joda}} - {{#threetenbp}} - implementation 'org.threeten:threetenbp:1.4.3' - {{/threetenbp}} {{#dynamicOperations}} - implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.23' + implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30' {{/dynamicOperations}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:3.11.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { @@ -167,3 +169,17 @@ spotless { importOrder() } } + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/build.sbt.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/build.sbt.mustache index 5e0c74c55..2045b8474 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/build.sbt.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/build.sbt.mustache @@ -9,31 +9,33 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24", - "com.squareup.okhttp3" % "okhttp" % "4.9.1", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", - "com.google.code.gson" % "gson" % "2.8.6", - "org.apache.commons" % "commons-lang3" % "3.10", + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.12.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", {{/openApiNullable}} + {{#withAWSV4Signature}} + "software.amazon.awssdk" % "auth" % "2.20.157", + {{/withAWSV4Signature}} {{#hasOAuthMethods}} - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", {{/hasOAuthMethods}} {{#joda}} "joda-time" % "joda-time" % "2.9.9" % "compile", {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - {{/threetenbp}} {{#dynamicOperations}} - "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" + "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.30" % "compile" {{/dynamicOperations}} - "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" ) ) diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/model.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/model.mustache new file mode 100644 index 000000000..c82b0fbe2 --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/model.mustache @@ -0,0 +1,35 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#useReflectionEqualsHashCode}} +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +{{/useReflectionEqualsHashCode}} +import java.util.Objects; +{{#imports}} +import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#withXml}} +import {{javaxPackage}}.xml.bind.annotation.*; +{{/withXml}} +{{#parcelableModel}} +import android.os.Parcelable; +import android.os.Parcel; +{{/parcelableModel}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} +{{#performBeanValidation}} +import org.hibernate.validator.constraints.*; +{{/performBeanValidation}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>oneof_model}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>anyof_model}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>pojo}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/modelEnum.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/modelEnum.mustache new file mode 100644 index 000000000..b955e53f1 --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/modelEnum.mustache @@ -0,0 +1,85 @@ +import java.io.IOException; +{{#isUri}} +import java.net.URI; +{{/isUri}} +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class) +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + } + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}}{{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isUri}}URI.create({{/isUri}}jsonElement.{{#isNumber}}getAsString(){{/isNumber}}{{#isInteger}}getAsInt(){{/isInteger}}{{#isUri}}getAsString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}getAs{{{dataType}}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +{{/supportUrlQuery}} +} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/modelInnerEnum.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/modelInnerEnum.mustache new file mode 100644 index 000000000..06912e9b1 --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/modelInnerEnum.mustache @@ -0,0 +1,66 @@ + /** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ + @JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.Adapter.class) +{{#withXml}} + @XmlType(name="{{datatypeWithEnum}}") + @XmlEnum({{dataType}}.class) +{{/withXml}} + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + } + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} {{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isUri}}URI.create({{/isUri}}jsonElement.{{#isNumber}}getAsString(){{/isNumber}}{{#isInteger}}getAsInt(){{/isInteger}}{{#isUri}}getAsString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}getAs{{{dataType}}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/model_test.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/model_test.mustache new file mode 100644 index 000000000..040d319bf --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/model_test.mustache @@ -0,0 +1,42 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for {{classname}} + */ +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/oneof_model.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/oneof_model.mustache new file mode 100644 index 000000000..31c63263e --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/oneof_model.mustache @@ -0,0 +1,512 @@ + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import {{invokerPackage}}.JSON; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + {{#composedSchemas}} + {{#oneOf}} + {{^isArray}} + {{^isMap}} + {{^vendorExtensions.x-duplicated-data-type}} + final TypeAdapter<{{{dataType}}}> adapter{{{dataType}}} = gson.getDelegateAdapter(this, TypeToken.get({{{dataType}}}.class)); + {{/vendorExtensions.x-duplicated-data-type}} + {{/isMap}} + {{/isArray}} + {{#isArray}} + + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); + {{/isArray}} + {{#isMap}} + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); + {{/isMap}} + {{/oneOf}} + {{/composedSchemas}} + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // check if the actual instance is of the type `{{{dataType}}}` + if (value.getActualInstance() instanceof {{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}{{^isMap}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isMap}}) { + {{#isPrimitiveType}} + {{^isMap}} + JsonPrimitive primitive = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + {{/isMap}} + {{#isMap}} + JsonObject object = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, object); + return; + {{/isMap}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isArray}} + List list = (List) value.getActualInstance(); + if (list.get(0) instanceof {{{items.dataType}}}) { + JsonArray array = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonArray(); + elementAdapter.write(out, array); + return; + } + {{/isArray}} + {{/isPrimitiveType}} + {{^isMap}} + {{^isArray}} + {{^isPrimitiveType}} + JsonElement element = adapter{{{dataType}}}.toJsonTree(({{{dataType}}})value.getActualInstance()); + elementAdapter.write(out, element); + return; + {{/isPrimitiveType}} + {{/isArray}} + {{/isMap}} + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + {{classname}} new{{classname}} = new {{classname}}(); + if (jsonObject.get("{{{propertyBaseName}}}") == null) { + log.log(Level.WARNING, "Failed to lookup discriminator value for {{classname}} as `{{{propertyBaseName}}}` was not found in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `{{{propertyBaseName}}}` + switch (jsonObject.get("{{{propertyBaseName}}}").getAsString()) { + {{#mappedModels}} + case "{{{mappingName}}}": + deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); + new{{classname}}.setActualInstance(deserialized); + return new{{classname}}; + {{/mappedModels}} + default: + log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", jsonObject.get("{{{propertyBaseName}}}").getAsString())); + } + } + + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^hasVars}} + // deserialize {{{dataType}}} + try { + // validate the JSON object to see if any exception is thrown + {{^isArray}} + {{^isMap}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{/isMap}} + {{/isArray}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isArray}} + {{#isMap}} + if (!jsonElement.isJsonObject()) { + throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString())); + } + + {{^isFreeFormObject}} + Map map = jsonElement.getAsJsonObject().asMap(); + // validate map items + for(JsonElement element : map.values()) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isFreeFormObject}} + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isMap}} + match++; + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); + } + {{/hasVars}} + {{#hasVars}} + // deserialize {{{.}}} + try { + // validate the JSON object to see if any exception is thrown + {{.}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{.}}; + match++; + log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{.}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + } + {{/hasVars}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + + if (match == 1) { + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public {{classname}}() { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + } + + public {{classname}}(Object o) { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + + static { + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + schemas.put("{{{dataType}}}", {{{baseType}}}.class); + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + } + + @Override + public Map> getSchemas() { + return {{classname}}.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + {{#isNullable}} + if (instance == null) { + super.setActualInstance(instance); + return; + } + + {{/isNullable}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (instance instanceof {{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}{{^isMap}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isMap}}) { + {{#isArray}} + List list = (List) instance; + if (list.get(0) instanceof {{{items.dataType}}}) { + super.setActualInstance(instance); + return; + } + {{/isArray}} + {{^isArray}} + super.setActualInstance(instance); + return; + {{/isArray}} + } + + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + } + + /** + * Get the actual instance, which can be the following: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + /** + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` + */ + public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to {{classname}} + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // validate the json string with {{{dataType}}} + try { + {{^hasVars}} + {{^isMap}} + {{^isArray}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{/isMap}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isArray}} + {{#isMap}} + if (!jsonElement.isJsonObject()) { + throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString())); + } + + {{^isFreeFormObject}} + Map map = jsonElement.getAsJsonObject().asMap(); + // validate map items + for(JsonElement element : map.values()) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isFreeFormObject}} + {{/isMap}} + {{/hasVars}} + {{#hasVars}} + {{{.}}}.validateJsonElement(jsonElement); + validCount++; + {{/hasVars}} + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + // continue to the next one + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/pojo.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/pojo.mustache new file mode 100644 index 000000000..0a32ef099 --- /dev/null +++ b/sdks/java-v1/templates/libraries/okhttp-gson/pojo.mustache @@ -0,0 +1,591 @@ +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import {{invokerPackage}}.JSON; + +/** + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + */{{#isDeprecated}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +{{#serializableModel}} + private static final long serialVersionUID = 1L; + +{{/serializableModel}} + {{#vars}} + {{#isEnum}} + {{^isContainer}} +{{>modelInnerEnum}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>modelInnerEnum}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; + {{#withXml}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{/withXml}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} + {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + + {{/vars}} + public {{classname}}() { + {{#parent}} + {{#parcelableModel}} + super(); + {{/parcelableModel}} + {{/parent}} + {{#discriminator}} + {{^discriminator.isEnum}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator.isEnum}} + {{/discriminator}} + } + {{#vendorExtensions.x-has-readonly-properties}} + {{^withXml}} + + public {{classname}}( + {{#readOnlyVars}} + {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + } + {{/withXml}} + {{/vendorExtensions.x-has-readonly-properties}} + {{#vars}} + + {{^isReadOnly}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; + } + this.{{name}}.add({{name}}Item); + return this; + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; + } + this.{{name}}.put(key, {{name}}Item); + return this; + } + {{/isMap}} + + {{/isReadOnly}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + */ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#required}} +{{#isNullable}} + @{{javaxPackage}}.annotation.Nullable +{{/isNullable}} +{{^isNullable}} + @{{javaxPackage}}.annotation.Nonnull +{{/isNullable}} +{{/required}} +{{^required}} + @{{javaxPackage}}.annotation.Nullable +{{/required}} +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} + public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + } + + {{^isReadOnly}} +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#deprecated}} @Deprecated +{{/deprecated}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + } + {{/isReadOnly}} + + {{/vars}} +{{>libraries/okhttp-gson/additional_properties}} + + @Override + public boolean equals(Object o) { + {{#useReflectionEqualsHashCode}} + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} && + {{/-last}}{{/vars}}{{#isAdditionalPropertiesTrue}}&& + Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/isAdditionalPropertiesTrue}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public int hashCode() { + {{#useReflectionEqualsHashCode}} + return HashCodeBuilder.reflectionHashCode(this); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#isAdditionalPropertiesTrue}}{{#hasVars}}, {{/hasVars}}{{^hasVars}}{{#parent}}, {{/parent}}{{/hasVars}}additionalProperties{{/isAdditionalPropertiesTrue}}); + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}} + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + {{/parent}} + {{#vars}} + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); + {{/vars}} +{{#isAdditionalPropertiesTrue}} + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); +{{/isAdditionalPropertiesTrue}} + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + +{{#parcelableModel}} + + public void writeToParcel(Parcel out, int flags) { +{{#model}} +{{#isArray}} + out.writeList(this); +{{/isArray}} +{{^isArray}} +{{#parent}} + super.writeToParcel(out, flags); +{{/parent}} +{{#vars}} + out.writeValue({{name}}); +{{/vars}} +{{/isArray}} +{{/model}} + } + + {{classname}}(Parcel in) { +{{#isArray}} + in.readTypedList(this, {{arrayModelType}}.CREATOR); +{{/isArray}} +{{^isArray}} +{{#parent}} + super(in); +{{/parent}} +{{#vars}} +{{#isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); +{{/isPrimitiveType}} +{{/vars}} +{{/isArray}} + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public {{classname}} createFromParcel(Parcel in) { +{{#model}} +{{#isArray}} + {{classname}} result = new {{classname}}(); + result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); + return result; +{{/isArray}} +{{^isArray}} + return new {{classname}}(in); +{{/isArray}} +{{/model}} + } + public {{classname}}[] newArray(int size) { + return new {{classname}}[size]; + } + }; +{{/parcelableModel}} + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + {{#allVars}} + openapiFields.add("{{baseName}}"); + {{/allVars}} + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + {{#requiredVars}} + openapiRequiredFields.add("{{baseName}}"); + {{/requiredVars}} + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to {{classname}} + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!{{classname}}.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in {{{classname}}} is not found in the empty JSON string", {{classname}}.openapiRequiredFields.toString())); + } + } + {{^hasChildren}} + {{^isAdditionalPropertiesTrue}} + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!{{classname}}.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + {{/isAdditionalPropertiesTrue}} + {{#requiredVars}} + {{#-first}} + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : {{classname}}.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + {{/-first}} + {{/requiredVars}} + {{/hasChildren}} + {{^discriminator}} + {{#hasVars}} + JsonObject jsonObj = jsonElement.getAsJsonObject(); + {{/hasVars}} + {{#vars}} + {{#isArray}} + {{#items.isModel}} + {{#required}} + // ensure the json data is an array + if (!jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + + JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); + // validate the required field `{{{baseName}}}` (array) + for (int i = 0; i < jsonArray{{name}}.size(); i++) { + {{{items.dataType}}}.validateJsonElement(jsonArray{{name}}.get(i)); + }; + {{/required}} + {{^required}} + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); + if (jsonArray{{name}} != null) { + // ensure the json data is an array + if (!jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + + // validate the optional field `{{{baseName}}}` (array) + for (int i = 0; i < jsonArray{{name}}.size(); i++) { + {{{items.dataType}}}.validateJsonElement(jsonArray{{name}}.get(i)); + }; + } + } + {{/required}} + {{/items.isModel}} + {{^items.isModel}} + {{^required}} + // ensure the optional json data is an array if present + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull() && !jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + {{/required}} + {{#required}} + // ensure the required json array is present + if (jsonObj.get("{{{baseName}}}") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + {{/required}} + {{/items.isModel}} + {{/isArray}} + {{^isContainer}} + {{#isString}} + if ({{#notRequiredOrIsNullable}}(jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) && {{/notRequiredOrIsNullable}}!jsonObj.get("{{{baseName}}}").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be a primitive type in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + {{/isString}} + {{#isModel}} + {{#required}} + // validate the required field `{{{baseName}}}` + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + } + {{/required}} + {{/isModel}} + {{#isEnum}} + {{#required}} + // validate the required field `{{{baseName}}}` + {{{datatypeWithEnum}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + {{{datatypeWithEnum}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + } + {{/required}} + {{/isEnum}} + {{#isEnumRef}} + {{#required}} + // validate the required field `{{{baseName}}}` + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + } + {{/required}} + {{/isEnumRef}} + {{/isContainer}} + {{/vars}} + {{/discriminator}} + {{#hasChildren}} + {{#discriminator}} + + String discriminatorValue = jsonElement.getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); + switch (discriminatorValue) { + {{#mappedModels}} + case "{{mappingName}}": + {{modelName}}.validateJsonElement(jsonElement); + break; + {{/mappedModels}} + default: + throw new IllegalArgumentException(String.format("The value of the `{{{propertyBaseName}}}` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + {{/discriminator}} + {{/hasChildren}} + } + +{{^hasChildren}} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<{{classname}}> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get({{classname}}.class)); + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + {{#isAdditionalPropertiesTrue}} + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + {{/isAdditionalPropertiesTrue}} + elementAdapter.write(out, obj); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + {{#isAdditionalPropertiesTrue}} + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + {{classname}} instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + {{/isAdditionalPropertiesTrue}} + {{^isAdditionalPropertiesTrue}} + return thisAdapter.fromJsonTree(jsonElement); + {{/isAdditionalPropertiesTrue}} + } + + }.nullSafe(); + } + } +{{/hasChildren}} + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/sdks/java-v1/templates/libraries/okhttp-gson/pom.mustache b/sdks/java-v1/templates/libraries/okhttp-gson/pom.mustache index 94c057b14..def53f2fc 100644 --- a/sdks/java-v1/templates/libraries/okhttp-gson/pom.mustache +++ b/sdks/java-v1/templates/libraries/okhttp-gson/pom.mustache @@ -57,7 +57,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.4.1 enforce-maven @@ -77,21 +77,30 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin + 3.6.1 package @@ -108,7 +117,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -122,7 +131,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.5.0 add_sources @@ -153,7 +162,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.6.3 attach-javadocs @@ -176,7 +185,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.3.0 attach-sources @@ -239,7 +248,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.2.1 sign-artifacts @@ -256,11 +265,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations - ${swagger-core-version} + ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -291,7 +309,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.client - 1.0.1 + 1.0.2 {{/hasOAuthMethods}} @@ -306,18 +324,11 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#dynamicOperations}} io.swagger.parser.v3 swagger-parser-v3 - 2.0.28 + 2.0.30 {{/dynamicOperations}} {{#useBeanValidation}} @@ -364,17 +375,29 @@ ${jackson-databind-nullable-version} {{/openApiNullable}} + {{#withAWSV4Signature}} + + software.amazon.awssdk + auth + 2.20.157 + + {{/withAWSV4Signature}} + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} + - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test - org.mockito - mockito-core - 3.12.4 + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} test @@ -382,29 +405,39 @@ 1.8 ${java.version} ${java.version} - 1.8.5 - 1.6.3 - 4.9.2 - 2.8.8 - 3.12.0 + 1.9.0 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 4.12.0 + 2.10.1 + 3.14.0 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} {{#joda}} - 2.10.9 + 2.12.0 {{/joda}} - {{#threetenbp}} - 1.5.0 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#performBeanValidation}} + {{/useJakartaEe}} + {{#performBeanValidation}} 3.0.3 -{{/performBeanValidation}} -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 4.13.2 + {{/performBeanValidation}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 5.10.3 + 1.10.0 + 2.1.6 + 1.1.1 UTF-8 - 2.17.3 + 2.43.0 diff --git a/sdks/java-v1/templates/libraries/rest-assured/ApiClient.mustache b/sdks/java-v1/templates/libraries/rest-assured/ApiClient.mustache index 2a0f41737..aa84b2b9e 100644 --- a/sdks/java-v1/templates/libraries/rest-assured/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/rest-assured/ApiClient.mustache @@ -6,7 +6,6 @@ import {{apiPackage}}.*; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import io.restassured.builder.RequestSpecBuilder; import java.util.function.Consumer; import java.util.function.Supplier; @@ -15,8 +14,6 @@ import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jackson}}JacksonObjectMapper.jackson{{/jackson}}; -{{/fullJavaUtil}} - public class ApiClient { {{#basePath}} public static final String BASE_URI = "{{.}}"; diff --git a/sdks/java-v1/templates/libraries/rest-assured/JacksonObjectMapper.mustache b/sdks/java-v1/templates/libraries/rest-assured/JacksonObjectMapper.mustache index 6af705a9d..8919eda30 100644 --- a/sdks/java-v1/templates/libraries/rest-assured/JacksonObjectMapper.mustache +++ b/sdks/java-v1/templates/libraries/rest-assured/JacksonObjectMapper.mustache @@ -2,23 +2,15 @@ package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} import io.restassured.internal.mapping.Jackson2Mapper; import io.restassured.path.json.mapper.factory.Jackson2ObjectMapperFactory; @@ -41,19 +33,10 @@ public class JacksonObjectMapper extends Jackson2Mapper { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} mapper.registerModule(new JavaTimeModule()); - {{/java8}} {{#joda}} mapper.registerModule(new JodaModule()); {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); @@ -65,4 +48,4 @@ public class JacksonObjectMapper extends Jackson2Mapper { public static JacksonObjectMapper jackson() { return new JacksonObjectMapper(); } -} \ No newline at end of file +} diff --git a/sdks/java-v1/templates/libraries/rest-assured/api.mustache b/sdks/java-v1/templates/libraries/rest-assured/api.mustache index 8d4602511..5ae6e5057 100644 --- a/sdks/java-v1/templates/libraries/rest-assured/api.mustache +++ b/sdks/java-v1/templates/libraries/rest-assured/api.mustache @@ -8,7 +8,6 @@ import com.google.gson.reflect.TypeToken; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -22,19 +21,37 @@ import io.restassured.common.mapper.TypeRef; {{/jackson}} import io.restassured.http.Method; import io.restassured.response.Response; +{{#swagger1AnnotationLibrary}} import io.swagger.annotations.*; +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.*; +import io.swagger.v3.oas.annotations.security.*; +{{/swagger2AnnotationLibrary}} + +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} import java.lang.reflect.Type; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; -{{/fullJavaUtil}} {{#gson}} import {{invokerPackage}}.JSON; {{/gson}} import static io.restassured.http.Method.*; +{{#swagger1AnnotationLibrary}} @Api(value = "{{{baseName}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +@Tag(name = "{{{baseName}}}") +{{/swagger2AnnotationLibrary}} public class {{classname}} { private Supplier reqSpecSupplier; @@ -68,12 +85,22 @@ public class {{classname}} { {{#operations}} {{#operation}} +{{#swagger1AnnotationLibrary}} @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", nickname = "{{{operationId}}}", tags = { {{#tags}}{{#name}}"{{{.}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} }) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}") {{^-last}},{{/-last}}{{/responses}} }) +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Operation(summary = "{{{summary}}}", + description = "{{{notes}}}", + operationId = "{{{operationId}}}", + tags = { {{#tags}}{{#name}}"{{{.}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}") {{^-last}},{{/-last}}{{/responses}} }) +{{/swagger2AnnotationLibrary}} {{#isDeprecated}} @Deprecated {{/isDeprecated}} @@ -127,12 +154,10 @@ public class {{classname}} { public {{operationIdCamelCase}}Oper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; {{#vendorExtensions}} - {{#x-contentType}} - reqSpec.setContentType("{{x-contentType}}"); - {{/x-contentType}} - {{#x-accepts}} - reqSpec.setAccept("{{x-accepts}}"); - {{/x-accepts}} + {{#x-content-type}} + reqSpec.setContentType("{{x-content-type}}"); + {{/x-content-type}} + reqSpec.setAccept("{{#x-accepts}}{{.}}{{^-last}},{{/-last}}{{/x-accepts}}"); {{/vendorExtensions}} this.respSpec = new ResponseSpecBuilder(); } diff --git a/sdks/java-v1/templates/libraries/rest-assured/api_doc.mustache b/sdks/java-v1/templates/libraries/rest-assured/api_doc.mustache index c000bc962..42d223aea 100644 --- a/sdks/java-v1/templates/libraries/rest-assured/api_doc.mustache +++ b/sdks/java-v1/templates/libraries/rest-assured/api_doc.mustache @@ -3,14 +3,14 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} {{#operation}} - + # **{{operationId}}** > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) @@ -40,9 +40,9 @@ api.{{operationId}}(){{#allParams}}{{#required}}{{#isPathParam}} ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type diff --git a/sdks/java-v1/templates/libraries/rest-assured/api_test.mustache b/sdks/java-v1/templates/libraries/rest-assured/api_test.mustache index 74a1c9f7e..d7d9dae2b 100644 --- a/sdks/java-v1/templates/libraries/rest-assured/api_test.mustache +++ b/sdks/java-v1/templates/libraries/rest-assured/api_test.mustache @@ -8,16 +8,22 @@ import {{invokerPackage}}.ApiClient; import {{apiPackage}}.{{classname}}; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} + +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jackson}}JacksonObjectMapper.jackson{{/jackson}}; @@ -25,12 +31,12 @@ import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jacks /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -63,4 +69,4 @@ public class {{classname}}Test { {{/responses}} {{/operation}} {{/operations}} -} \ No newline at end of file +} diff --git a/sdks/java-v1/templates/libraries/rest-assured/build.gradle.mustache b/sdks/java-v1/templates/libraries/rest-assured/build.gradle.mustache index e80ea1813..3ddee4535 100644 --- a/sdks/java-v1/templates/libraries/rest-assured/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/rest-assured/build.gradle.mustache @@ -57,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -97,35 +97,39 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.21" - rest_assured_version = "4.3.0" - junit_version = "4.13.1" + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.6" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.15" + {{/swagger2AnnotationLibrary}} + rest_assured_version = "5.3.2" + junit_version = "5.10.3" {{#jackson}} - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.10.0" - {{/threetenbp}} {{/jackson}} {{#gson}} - gson_version = "2.8.6" - gson_fire_version = "1.8.4" + gson_version = "2.10.1" + gson_fire_version = "1.9.0" {{/gson}} {{#joda}} jodatime_version = "2.10.5" {{/joda}} -{{#threetenbp}} - threetenbp_version = "1.4.3" -{{/threetenbp}} - okio_version = "1.17.5" + okio_version = "3.6.0" + jakarta_annotation_version = "1.3.5" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.rest-assured:rest-assured:$rest_assured_version" {{#jackson}} @@ -142,12 +146,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} {{/jackson}} {{#gson}} implementation "io.gsonfire:gson-fire:$gson_fire_version" @@ -156,16 +155,13 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} -{{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" -{{/threetenbp}} implementation "com.squareup.okio:okio:$okio_version" {{#useBeanValidation}} - implementation "jakarta.validation:jakarta.validation-api:2.0.2" + implementation "jakarta.validation:jakarta.validation-api:3.0.2" {{/useBeanValidation}} {{#performBeanValidation}} implementation "org.hibernate:hibernate-validator:6.0.19.Final" {{/performBeanValidation}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/sdks/java-v1/templates/libraries/rest-assured/build.sbt.mustache b/sdks/java-v1/templates/libraries/rest-assured/build.sbt.mustache index 6a048b92f..ce4037ac5 100644 --- a/sdks/java-v1/templates/libraries/rest-assured/build.sbt.mustache +++ b/sdks/java-v1/templates/libraries/rest-assured/build.sbt.mustache @@ -9,49 +9,41 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.21", - "io.rest-assured" % "rest-assured" % "4.3.0", - "io.rest-assured" % "scala-support" % "4.3.0", + "io.swagger" % "swagger-annotations" % "1.6.6", + "io.rest-assured" % "rest-assured" % "4.5.1", + "io.rest-assured" % "scala-support" % "4.5.1", "com.google.code.findbugs" % "jsr305" % "3.0.2", {{#jackson}} - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", {{/openApiNullable}} {{#withXml}} - "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.10.3", + "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.13.4.1", {{/withXml}} {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.3", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.4.1", {{/joda}} - {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.3", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.10.0", - {{/threetenbp}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.4.1", {{/jackson}} {{#gson}} - "com.google.code.gson" % "gson" % "2.8.6", - "io.gsonfire" % "gson-fire" % "1.8.4" % "compile", + "com.google.code.gson" % "gson" % "2.8.9", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", {{/gson}} {{#joda}} "joda-time" % "joda-time" % "2.10.5" % "compile", {{/joda}} -{{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", -{{/threetenbp}} "com.squareup.okio" % "okio" % "1.17.5" % "compile", {{#useBeanValidation}} - "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", + "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", {{/useBeanValidation}} {{#performBeanValidation}} "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", {{/performBeanValidation}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/sdks/java-v1/templates/libraries/rest-assured/pom.mustache b/sdks/java-v1/templates/libraries/rest-assured/pom.mustache index c6e924ecb..396dd69c2 100644 --- a/sdks/java-v1/templates/libraries/rest-assured/pom.mustache +++ b/sdks/java-v1/templates/libraries/rest-assured/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 2.22.2 - + loggerPath conf/log4j.properties - + false 1C @@ -150,7 +150,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.3.2 none 1.8 @@ -219,11 +219,20 @@ {{/jackson}} + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -255,13 +264,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#gson}} io.gsonfire @@ -300,19 +302,10 @@ jackson-datatype-joda {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} {{/jackson}} com.squareup.okio @@ -338,36 +331,41 @@ {{/performBeanValidation}} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.5.21 - 4.3.0 - 2.8.6 - 1.8.4 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 5.3.2 + 2.10.1 + 1.9.0 {{#joda}} 2.10.5 {{/joda}} - {{#threetenbp}} - 1.4.3 - {{/threetenbp}} {{#jackson}} - 2.10.3 - 0.2.2 - {{#threetenbp}} - 2.10.0 - {{/threetenbp}} + 2.17.1 + 2.17.1 + 0.2.6 {{/jackson}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 1.17.5 - 4.13.1 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 3.6.0 + 5.10.3 diff --git a/sdks/java-v1/templates/libraries/restclient/ApiClient.mustache b/sdks/java-v1/templates/libraries/restclient/ApiClient.mustache new file mode 100644 index 000000000..14b1af4af --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/ApiClient.mustache @@ -0,0 +1,756 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +{{/withXml}} +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.util.function.Consumer; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +{{#withXml}} + import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter; +{{/withXml}} +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestClientException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestClient.ResponseSpec; +import java.util.Optional; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; + +import {{javaxPackage}}.annotation.Nullable; + +{{#jsr310}} +import java.time.OffsetDateTime; +{{/jsr310}} + +import {{invokerPackage}}.auth.Authentication; +import {{invokerPackage}}.auth.HttpBasicAuth; +import {{invokerPackage}}.auth.HttpBearerAuth; +import {{invokerPackage}}.auth.ApiKeyAuth; +{{#hasOAuthMethods}} +import {{invokerPackage}}.auth.OAuth; +{{/hasOAuthMethods}} + +{{>generatedAnnotation}} +public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private final HttpHeaders defaultHeaders = new HttpHeaders(); + private final MultiValueMap defaultCookies = new LinkedMultiValueMap<>(); + + private String basePath = "{{basePath}}"; + + private final RestClient restClient; + private final DateFormat dateFormat; + private final ObjectMapper objectMapper; + + private Map authentications; + + + public ApiClient() { + this.dateFormat = createDefaultDateFormat(); + this.objectMapper = createDefaultObjectMapper(this.dateFormat); + this.restClient = buildRestClient(this.objectMapper); + this.init(); + } + + public ApiClient(RestClient restClient) { + this(Optional.ofNullable(restClient).orElseGet(ApiClient::buildRestClient), createDefaultDateFormat()); + } + + public ApiClient(ObjectMapper mapper, DateFormat format) { + this(buildRestClient(mapper.copy()), format); + } + + public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { + this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format); + } + + private ApiClient(RestClient restClient, DateFormat format) { + this.restClient = restClient; + this.dateFormat = format; + this.objectMapper = createDefaultObjectMapper(format); + this.init(); + } + + public static DateFormat createDefaultDateFormat() { + DateFormat dateFormat = new RFC3339DateFormat(); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat; + } + + public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) { + if (null == dateFormat) { + dateFormat = createDefaultDateFormat(); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.setDateFormat(dateFormat); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + {{#openApiNullable}} + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + {{/openApiNullable}} + return mapper; + } + + protected void init() { + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { + {{#withXml}} + XmlMapper xmlMapper = new XmlMapper(); + xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true); + {{#openApiNullable}} + xmlMapper.registerModule(new JsonNullableModule()); + {{/openApiNullable}} + + {{/withXml}} + Consumer>> messageConverters = converters -> { + converters.add(new MappingJackson2HttpMessageConverter(mapper)); + {{#withXml}} + converters.add(new MappingJackson2XmlHttpMessageConverter(xmlMapper)); + {{/withXml}} + }; + + return RestClient.builder().messageConverters(messageConverters); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder() { + return buildRestClientBuilder(createDefaultObjectMapper(null)); + } + + /** + * Build the RestClient used to make HTTP requests. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient buildRestClient(ObjectMapper mapper) { + return buildRestClientBuilder(mapper).build(); + } + + /** + * Build the RestClient used to make HTTP requests. + * @return RestClient + */ + public static RestClient buildRestClient() { + return buildRestClientBuilder(createDefaultObjectMapper(null)).build(); + } + + /** + * Get the current base path + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username the username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password the password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix the API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + {{#hasOAuthMethods}} + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken the access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + {{/hasOAuthMethods}} + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Get the ObjectMapper used to make HTTP requests. + * @return ObjectMapper objectMapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Get the RestClient used to make HTTP requests. + * @return RestClient restClient + */ + public RestClient getRestClient() { + return restClient; + } + + /** + * Format the given parameter object into string. + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } {{#jsr310}}else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } {{/jsr310}}else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection) param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap<>(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList<>(); + for(Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return The response body in chosen type + */ + public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final RestClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + return requestBuilder.retrieve(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + if (value != null) { + String templatizedKey = name + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + }); + return queryBuilder.toString(); + } + + private RestClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, + MultiValueMap queryParams, Object body, HttpHeaders headerParams, + MultiValueMap cookieParams, MultiValueMap formParams, List accept, + MediaType contentType, String[] authNames) { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); + + String finalUri = builder.build(false).toUriString(); + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + + final RestClient.RequestBodySpec requestBuilder = restClient.method(method).uri(finalUri, uriParams); + + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if(contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + var selectedBody = selectBody(body, formParams, contentType); + if (selectedBody != null) { + requestBuilder.body(selectedBody); + } + + return requestBuilder; + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, RestClient.RequestBodySpec requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for(String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, RestClient.RequestBodySpec requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + * @param cookieParams the cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } +} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/restclient/README.mustache b/sdks/java-v1/templates/libraries/restclient/README.mustache new file mode 100644 index 000000000..ec6244a82 --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/README.mustache @@ -0,0 +1,216 @@ +# {{artifactId}} + +{{appName}} + +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +- Generator version: {{generatorVersion}} + +{{{appDescriptionWithNewLines}}} + +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 17+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + {{{groupId}}} + {{{artifactId}}} + {{{artifactVersion}}} + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central. + mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo. + } + + dependencies { + implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import {{{invokerPackage}}}.*; +import {{{invokerPackage}}}.auth.*; +import {{{modelPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +public class {{{classname}}}Example { + + public static void main(String[] args) { + ApiClient defaultClient = new ApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}} + // Configure HTTP signature authorization: {{{name}}} + HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}"); + // All the HTTP signature parameters below should be customized to your environment. + // Configure the keyId + {{{name}}}.setKeyId("YOUR KEY ID"); + // Configure the signature algorithm + {{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019); + // Configure the specific cryptographic algorithm + {{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256); + // Configure the cryptographic algorithm parameters, if applicable + {{{name}}}.setAlgorithmParameterSpec(null); + // Set the cryptographic digest algorithm. + {{{name}}}.setDigestAlgorithm("SHA-256"); + // Set the HTTP headers that should be included in the HTTP signature. + {{{name}}}.setHeaders(Arrays.asList("date", "host")); + // Set the private key used to sign the HTTP messages + {{{name}}}.setPrivateKey();{{/isHttpSignature}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (HttpStatusCodeException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation for Models + +{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) +{{/model}}{{/models}} + + +## Documentation for Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}} + +- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}} + +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}} + +- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} +{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/sdks/java-v1/templates/libraries/restclient/api.mustache b/sdks/java-v1/templates/libraries/restclient/api.mustache new file mode 100644 index 000000000..1475fc0f4 --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/api.mustache @@ -0,0 +1,185 @@ +package {{package}}; + +import {{invokerPackage}}.ApiClient; + +{{#imports}}import {{import}}; +{{/imports}} + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}} { + private ApiClient apiClient; + + public {{classname}}() { + this(new ApiClient()); + } + + @Autowired + public {{classname}}(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + {{#operation}} + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return {{.}} +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} +{{#isDeprecated}} + * @deprecated +{{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + private ResponseSpec {{operationId}}RequestCreation({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) { + throw new RestClientResponseException("Missing the required parameter '{{paramName}}' when calling {{operationId}}", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + {{/required}} + {{/allParams}} + // create path and map variables + final Map pathParams = new HashMap<>(); + {{#hasPathParams}} + + {{#pathParams}} + pathParams.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), {{/collectionFormat}}{{{paramName}}}{{#collectionFormat}}){{/collectionFormat}}); + {{/pathParams}} + {{/hasPathParams}} + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + {{#hasQueryParams}} + + {{#queryParams}}{{#isExplode}}{{#hasVars}}{{#vars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}}{{/hasVars}}{{^hasVars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/hasVars}}{{/isExplode}}{{^isExplode}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} + + {{#headerParams}} + if ({{paramName}} != null) + headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + {{/-last}} + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasCookieParams}} + + {{#cookieParams}} + cookieParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/cookieParams}} + {{/hasCookieParams}} + {{#hasFormParams}} + + {{#formParams}} + if ({{paramName}} != null) + formParams.add{{#collectionFormat}}All{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}); + {{/formParams}} + {{/hasFormParams}} + + final String[] localVarAccepts = { {{#hasProduces}} + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{/hasProduces}}}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { {{#hasConsumes}} + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{/hasConsumes}}}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return {{.}} +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + {{#returnType}}return {{/returnType}}{{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).body(localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return ResponseEntity<{{.}}> +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#returnType}}ResponseEntity<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}ResponseEntity{{/returnType}} {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).toEntity(localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}} + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public ResponseSpec {{operationId}}WithResponseSpec({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/restclient/api_test.mustache b/sdks/java-v1/templates/libraries/restclient/api_test.mustache new file mode 100644 index 000000000..dc3408341 --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/api_test.mustache @@ -0,0 +1,40 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for {{classname}} + */ +@Ignore +public class {{classname}}Test { + + private final {{classname}} api = new {{classname}}(); + + {{#operations}}{{#operation}} + /** + * {{summary}} + * + * {{notes}} + */ + @Test + public void {{operationId}}Test() { + {{#allParams}} + {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; + {{/allParams}} + {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + // TODO: test validations + } + {{/operation}}{{/operations}} +} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/restclient/auth/ApiKeyAuth.mustache b/sdks/java-v1/templates/libraries/restclient/auth/ApiKeyAuth.mustache new file mode 100644 index 000000000..d32930336 --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/auth/ApiKeyAuth.mustache @@ -0,0 +1,64 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/sdks/java-v1/templates/libraries/restclient/auth/Authentication.mustache b/sdks/java-v1/templates/libraries/restclient/auth/Authentication.mustache new file mode 100644 index 000000000..0636a6d96 --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/auth/Authentication.mustache @@ -0,0 +1,16 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/sdks/java-v1/templates/libraries/restclient/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/libraries/restclient/auth/HttpBasicAuth.mustache new file mode 100644 index 000000000..fba126558 --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/auth/HttpBasicAuth.mustache @@ -0,0 +1,40 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/sdks/java-v1/templates/libraries/restclient/auth/HttpBearerAuth.mustache b/sdks/java-v1/templates/libraries/restclient/auth/HttpBearerAuth.mustache new file mode 100644 index 000000000..ecf258a23 --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/auth/HttpBearerAuth.mustache @@ -0,0 +1,58 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/sdks/java-v1/templates/libraries/restclient/auth/OAuth.mustache b/sdks/java-v1/templates/libraries/restclient/auth/OAuth.mustache new file mode 100644 index 000000000..1e1e6247c --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/auth/OAuth.mustache @@ -0,0 +1,26 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (accessToken != null) { + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); + } + } +} diff --git a/sdks/java-v1/templates/libraries/restclient/auth/OAuthFlow.mustache b/sdks/java-v1/templates/libraries/restclient/auth/OAuthFlow.mustache new file mode 100644 index 000000000..759f354f5 --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/auth/OAuthFlow.mustache @@ -0,0 +1,7 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/restclient/build.gradle.mustache b/sdks/java-v1/templates/libraries/restclient/build.gradle.mustache new file mode 100644 index 000000000..4aec430eb --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/build.gradle.mustache @@ -0,0 +1,159 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = '{{groupId}}' +version = '{{artifactVersion}}' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +repositories { + mavenCentral() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + archiveClassifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' + from components.java + } + } + } + + task execute(type:JavaExec) { + mainClass = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + {{#openApiNullable}} + jackson_databind_nullable_version = "0.2.6" + {{/openApiNullable}} + spring_web_version = "6.1.6" + jakarta_annotation_version = "2.1.1" + jodatime_version = "2.9.9" + junit_version = "5.10.2" +} + +dependencies { + {{#swagger1AnnotationLibrary}} + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework:spring-web:$spring_web_version" + implementation "org.springframework:spring-context:$spring_web_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + {{#openApiNullable}} + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + {{/openApiNullable}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{#joda}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" + implementation "joda-time:joda-time:$jodatime_version" + {{/joda}} + {{#withXml}} + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" + {{/withXml}} + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/sdks/java-v1/templates/libraries/restclient/pom.mustache b/sdks/java-v1/templates/libraries/restclient/pom.mustache new file mode 100644 index 000000000..d3f6ab650 --- /dev/null +++ b/sdks/java-v1/templates/libraries/restclient/pom.mustache @@ -0,0 +1,374 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + {{artifactUrl}} + {{artifactDescription}} + + {{scmConnection}} + {{scmDeveloperConnection}} + {{scmUrl}} + +{{#parentOverridden}} + + {{{parentGroupId}}} + {{{parentArtifactId}}} + {{{parentVersion}}} + +{{/parentOverridden}} + + + + {{licenseName}} + {{licenseUrl}} + repo + + + + + + {{developerName}} + {{developerEmail}} + {{developerOrganization}} + {{developerOrganizationUrl}} + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + true + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 17 + 17 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + {{#swagger1AnnotationLibrary}} + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.springframework + spring-web + ${spring-web-version} + + + org.springframework + spring-context + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} + {{#withXml}} + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + + + io.github.threeten-jaxb + threeten-jaxb-core + 1.2 + + {{/withXml}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + {{#joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + + {{/joda}} + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + {{#performBeanValidation}} + + + org.hibernate + hibernate-validator + ${hibernate-validator-version} + + {{/performBeanValidation}} + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + UTF-8 + {{#swagger1AnnotationLibrary}} + 1.6.9 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 6.1.6 + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + 2.1.1 + {{#joda}} + 2.9.9 + {{/joda}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + {{#performBeanValidation}} + 5.4.3.Final + {{/performBeanValidation}} + 5.10.2 + 1.10.0 + + diff --git a/sdks/java-v1/templates/libraries/resteasy/ApiClient.mustache b/sdks/java-v1/templates/libraries/resteasy/ApiClient.mustache index 7bdb6e8e2..fc59766f3 100644 --- a/sdks/java-v1/templates/libraries/resteasy/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/resteasy/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.File; @@ -24,24 +26,20 @@ import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; +import {{javaxPackage}}.ws.rs.client.Client; +import {{javaxPackage}}.ws.rs.client.ClientBuilder; +import {{javaxPackage}}.ws.rs.client.Entity; +import {{javaxPackage}}.ws.rs.client.Invocation; +import {{javaxPackage}}.ws.rs.client.WebTarget; +import {{javaxPackage}}.ws.rs.core.Form; +import {{javaxPackage}}.ws.rs.core.GenericEntity; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.Response.Status; import org.jboss.logging.Logger; import org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration; @@ -90,8 +88,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -502,15 +500,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (param.getValue() instanceof File) { File file = (File) param.getValue(); try { - multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE); + multipart.addFormData(param.getKey(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE, file.getName()); } catch (FileNotFoundException e) { throw new ApiException("Could not serialize multipart/form-data "+e.getMessage()); } } else { - multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); + multipart.addFormData(param.getKey(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); } } - entity = Entity.entity(multipart.getFormData(), MediaType.MULTIPART_FORM_DATA_TYPE); + GenericEntity genericEntity = new GenericEntity(multipart) { }; + entity = Entity.entity(genericEntity, MediaType.MULTIPART_FORM_DATA_TYPE); } else if (contentType.startsWith("application/x-www-form-urlencoded")) { Form form = new Form(); for (Entry param: formParams.entrySet()) { @@ -677,6 +676,38 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { Entity entity = serialize(body, formParams, contentType); + try (Response response = invoke(invocationBuilder, method, entity)) { + statusCode = response.getStatusInfo().getStatusCode(); + responseHeaders = buildResponseHeaders(response); + + if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { + return null; + } else if (response.getStatusInfo().getFamily().equals(Status.Family.SUCCESSFUL)) { + if (returnType == null) + return null; + else + return deserialize(response, returnType); + } else { + String message = "error"; + String respBody = null; + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), + message, + buildResponseHeaders(response), + respBody); + } + } + } + + private Response invoke(Invocation.Builder invocationBuilder, String method, Entity entity) throws ApiException { Response response = null; if ("GET".equals(method)) { @@ -699,36 +730,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new ApiException(500, "unknown method type " + method); } - statusCode = response.getStatusInfo().getStatusCode(); - responseHeaders = buildResponseHeaders(response); - - if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { - return null; - } else if (response.getStatusInfo().getFamily().equals(Status.Family.SUCCESSFUL)) { - if (returnType == null) - return null; - else - return deserialize(response, returnType); - } else { - String message = "error"; - String respBody = null; - if (response.hasEntity()) { - try { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; - } catch (RuntimeException e) { - // e.printStackTrace(); - } - } - throw new ApiException( - response.getStatus(), - message, - buildResponseHeaders(response), - respBody); - } + return response; } - /** + /** * Build the Client used to make HTTP requests. */ private Client buildHttpClient(boolean debugging) { diff --git a/sdks/java-v1/templates/libraries/resteasy/JSON.mustache b/sdks/java-v1/templates/libraries/resteasy/JSON.mustache index 71bd624f7..b57283048 100644 --- a/sdks/java-v1/templates/libraries/resteasy/JSON.mustache +++ b/sdks/java-v1/templates/libraries/resteasy/JSON.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.annotation.*; @@ -9,7 +11,7 @@ import com.fasterxml.jackson.datatype.jsr310.*; import java.text.DateFormat; -import javax.ws.rs.ext.ContextResolver; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; {{>generatedAnnotation}} public class JSON implements ContextResolver { diff --git a/sdks/java-v1/templates/libraries/resteasy/api.mustache b/sdks/java-v1/templates/libraries/resteasy/api.mustache index 9194b7541..773fc51ce 100644 --- a/sdks/java-v1/templates/libraries/resteasy/api.mustache +++ b/sdks/java-v1/templates/libraries/resteasy/api.mustache @@ -5,17 +5,15 @@ import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.Configuration; import {{invokerPackage}}.Pair; -import javax.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.GenericType; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} {{>generatedAnnotation}} {{#operations}} @@ -69,10 +67,10 @@ public class {{classname}} { .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#queryParams}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); diff --git a/sdks/java-v1/templates/libraries/resteasy/build.gradle.mustache b/sdks/java-v1/templates/libraries/resteasy/build.gradle.mustache index 0a801b9ff..de86eb0bd 100644 --- a/sdks/java-v1/templates/libraries/resteasy/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/resteasy/build.gradle.mustache @@ -57,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -98,15 +98,16 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" resteasy_version = "4.5.11.Final" - junit_version = "4.13" + assertj_version = "3.23.1" + junit_version = "5.10.2" } dependencies { @@ -124,5 +125,6 @@ dependencies { {{/openApiNullable}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.assertj:assertj-core:$assertj_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/sdks/java-v1/templates/libraries/resteasy/build.sbt.mustache b/sdks/java-v1/templates/libraries/resteasy/build.sbt.mustache index 957990ebf..8ebcd9092 100644 --- a/sdks/java-v1/templates/libraries/resteasy/build.sbt.mustache +++ b/sdks/java-v1/templates/libraries/resteasy/build.sbt.mustache @@ -13,13 +13,14 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "4.5.11.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "4.5.11.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13" % "test", + "org.assertj" % "assertj-core" % "3.23.1" % "test", + "junit" % "junit" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/sdks/java-v1/templates/libraries/resteasy/pom.mustache b/sdks/java-v1/templates/libraries/resteasy/pom.mustache index cf39a160c..1b0dec8c4 100644 --- a/sdks/java-v1/templates/libraries/resteasy/pom.mustache +++ b/sdks/java-v1/templates/libraries/resteasy/pom.mustache @@ -61,17 +61,16 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods - pertest @@ -149,7 +148,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none 1.8 @@ -166,11 +165,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -239,6 +247,11 @@ jackson-dataformat-xml ${jackson-version} + + io.github.threeten-jaxb + threeten-jaxb-core + 1.2 + {{/withXml}} @@ -264,24 +277,41 @@ - junit - junit + org.assertj + assertj-core + ${assertj-version} + test + + + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.6.3 - 4.5.11.Final - 2.10.5 - 2.10.5.1 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 4.7.6.Final + 2.17.1 + 2.17.1 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} 2.9.10 1.0.0 - 4.13 + 3.23.1 + 5.10.2 diff --git a/sdks/java-v1/templates/libraries/resttemplate/ApiClient.mustache b/sdks/java-v1/templates/libraries/resttemplate/ApiClient.mustache index f868eaa6d..e4711ca05 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; {{#withXml}} @@ -31,17 +33,12 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.util.StringUtils; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpServerErrorException; import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.DefaultUriBuilderFactory; -{{#threetenbp}} -import org.threeten.bp.*; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; -import com.fasterxml.jackson.databind.ObjectMapper; -{{/threetenbp}} {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} @@ -69,9 +66,10 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; -{{#jsr310}}{{^threetenbp}} +import java.util.function.Supplier; +{{#jsr310}} import java.time.OffsetDateTime; -{{/threetenbp}}{{/jsr310}} +{{/jsr310}} import {{invokerPackage}}.auth.Authentication; {{#hasHttpBasicMethods}} @@ -88,7 +86,9 @@ import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} {{>generatedAnnotation}} +{{#generateClientAsBean}} @Component("{{invokerPackage}}.ApiClient") +{{/generateClientAsBean}} public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public enum CollectionFormat { CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); @@ -109,6 +109,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private HttpHeaders defaultHeaders = new HttpHeaders(); private MultiValueMap defaultCookies = new LinkedMultiValueMap(); + private int maxAttemptsForRetry = {{maxAttemptsForRetry}}; + + private long waitTimeMillis = {{waitTimeMillis}}; + private String basePath = "{{basePath}}"; private RestTemplate restTemplate; @@ -122,7 +126,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { init(); } + {{#generateClientAsBean}} @Autowired + {{/generateClientAsBean}} public ApiClient(RestTemplate restTemplate) { this.restTemplate = restTemplate; init(); @@ -141,8 +147,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -169,6 +175,46 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return this; } + /** + * Get the max attempts for retry + * + * @return int the max attempts + */ + public int getMaxAttemptsForRetry() { + return maxAttemptsForRetry; + } + + /** + * Set the max attempts for retry + * + * @param maxAttemptsForRetry the max attempts for retry + * @return ApiClient this client + */ + public ApiClient setMaxAttemptsForRetry(int maxAttemptsForRetry) { + this.maxAttemptsForRetry = maxAttemptsForRetry; + return this; + } + + /** + * Get the wait time in milliseconds + * + * @return long wait time in milliseconds + */ + public long getWaitTimeMillis() { + return waitTimeMillis; + } + + /** + * Set the wait time in milliseconds + * + * @param waitTimeMillis the wait time in milliseconds + * @return ApiClient this client + */ + public ApiClient setWaitTimeMillis(long waitTimeMillis) { + this.waitTimeMillis = waitTimeMillis; + return this; + } + /** * Get authentications (key: authentication name, value: authentication). * @@ -190,14 +236,23 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#hasHttpBearerMethods}} /** - * Helper method to set token for HTTP bearer authentication. + * Helper method to set access token for the first Bearer authentication. * - * @param bearerToken the token + * @param bearerToken Bearer token */ public void setBearerToken(String bearerToken) { + setBearerToken(() -> bearerToken); + } + + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setBearerToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); return; } } @@ -278,9 +333,18 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param accessToken Access token */ public void setAccessToken(String accessToken) { + setAccessToken(() -> accessToken); + } + + /** + * Helper method to set the supplier of access tokens for OAuth2 authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setAccessToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); + ((OAuth) auth).setAccessToken(tokenSupplier); return; } } @@ -377,14 +441,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; - {{#threetenbp}} - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter) { - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - mapper.setDateFormat(dateFormat); - } - } - {{/threetenbp}} return this; } @@ -623,12 +679,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return path with placeholders replaced by variables */ public String expandPath(String pathTemplate, Map variables) { - // disable default URL encoding - DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); - uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); - final RestTemplate restTemplate = new RestTemplate(); - restTemplate.setUriTemplateHandler(uriBuilderFactory); - return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); } @@ -658,8 +708,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { queryBuilder.append(encodedName); if (value != null) { String templatizedKey = encodedName + valueItemCounter++; - final String encodedValue = URLEncoder.encode(value.toString(), "UTF-8"); - uriParams.put(templatizedKey, encodedValue); + uriParams.put(templatizedKey, value.toString()); queryBuilder.append('=').append("{").append(templatizedKey).append("}"); } } @@ -693,7 +742,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public ResponseEntity invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - Map uriParams = new HashMap<>(); + Map uriParams = new HashMap<>(); uriParams.putAll(pathParams); String finalUri = path; @@ -714,7 +763,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RestClientException("Could not build URL: " + builder.toUriString(), ex); } - final BodyBuilder requestBuilder = RequestEntity.method(method, uri); + final BodyBuilder requestBuilder = RequestEntity.method(method, UriComponentsBuilder.fromHttpUrl(basePath).toUriString() + finalUri, uriParams); if (accept != null) { requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); } @@ -729,7 +778,36 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { RequestEntity requestEntity = requestBuilder.body(selectBody(body, formParams, contentType)); - ResponseEntity responseEntity = restTemplate.exchange(requestEntity, returnType); + ResponseEntity responseEntity = null; + int attempts = 0; + while (attempts < maxAttemptsForRetry) { + try { + responseEntity = restTemplate.exchange(requestEntity, returnType); + break; + } catch (HttpServerErrorException | HttpClientErrorException ex) { + if (ex instanceof HttpServerErrorException + || ((HttpClientErrorException) ex) + .getStatusCode() + .equals(HttpStatus.TOO_MANY_REQUESTS)) { + attempts++; + if (attempts < maxAttemptsForRetry) { + try { + Thread.sleep(waitTimeMillis); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } else { + throw ex; + } + } else { + throw ex; + } + } + } + + if (responseEntity == null) { + throw new RestClientException("ResponseEntity is null"); + } if (responseEntity.getStatusCode().is2xxSuccessful()) { return responseEntity; @@ -801,23 +879,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { RestTemplate restTemplate = new RestTemplate(messageConverters); {{/withXml}}{{^withXml}}RestTemplate restTemplate = new RestTemplate();{{/withXml}} - {{#threetenbp}} - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter){ - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{#openApiNullable}} - mapper.registerModule(new JsonNullableModule()); - {{/openApiNullable}} - } - } - {{/threetenbp}} // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); + + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.VALUES_ONLY); + restTemplate.setUriTemplateHandler(uriBuilderFactory); return restTemplate; } @@ -857,13 +925,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } private void logResponse(ClientHttpResponse response) throws IOException { - log.info("HTTP Status Code: " + response.getRawStatusCode()); + log.info("HTTP Status Code: " + response.getStatusCode().value()); log.info("Status Text: " + response.getStatusText()); log.info("HTTP Headers: " + headersToString(response.getHeaders())); log.info("Response Body: " + bodyToString(response.getBody())); } private String headersToString(HttpHeaders headers) { + if(headers == null || headers.isEmpty()) { + return ""; + } StringBuilder builder = new StringBuilder(); for (Entry> entry : headers.entrySet()) { builder.append(entry.getKey()).append("=["); diff --git a/sdks/java-v1/templates/libraries/resttemplate/BaseApi.mustache b/sdks/java-v1/templates/libraries/resttemplate/BaseApi.mustache new file mode 100644 index 000000000..3b47979ed --- /dev/null +++ b/sdks/java-v1/templates/libraries/resttemplate/BaseApi.mustache @@ -0,0 +1,76 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import org.springframework.web.client.RestClientException; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; + +{{>generatedAnnotation}} +public abstract class BaseApi { + + protected ApiClient apiClient; + + public BaseApi() { + this(new ApiClient()); + } + + public BaseApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method) throws RestClientException { + return invokeAPI(url, method, null, new ParameterizedTypeReference() {}); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method, Object request) throws RestClientException { + return invokeAPI(url, method, request, new ParameterizedTypeReference() {}); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param returnType The return type. + * @return ResponseEntity in the specified type. + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method, ParameterizedTypeReference returnType) throws RestClientException { + return invokeAPI(url, method, null, returnType); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @return ResponseEntity in the specified type. + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public abstract ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException; +} diff --git a/sdks/java-v1/templates/libraries/resttemplate/api.mustache b/sdks/java-v1/templates/libraries/resttemplate/api.mustache index cc207bd1b..aa1a98fd3 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/api.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/api.mustache @@ -1,17 +1,23 @@ package {{package}}; import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.BaseApi; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}}import java.util.Collections; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.stream.Collectors;{{/fullJavaUtil}} +import java.util.stream.Collectors; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.LinkedMultiValueMap; @@ -27,26 +33,21 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; {{>generatedAnnotation}} +{{#generateClientAsBean}} @Component("{{package}}.{{classname}}") +{{/generateClientAsBean}} {{#operations}} -public class {{classname}} { - private ApiClient apiClient; +public class {{classname}} extends BaseApi { public {{classname}}() { - this(new ApiClient()); + super(new ApiClient()); } + {{#generateClientAsBean}} @Autowired + {{/generateClientAsBean}} public {{classname}}(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + super(apiClient); } {{#operation}} @@ -74,7 +75,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + public {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { {{#returnType}} return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).getBody(); {{/returnType}} @@ -105,8 +106,8 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ResponseEntity<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { - Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + public ResponseEntity<{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { @@ -117,40 +118,71 @@ public class {{classname}} { final Map uriVariables = new HashMap();{{#pathParams}} uriVariables.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase()), {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}});{{/pathParams}}{{/hasPathParams}} - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap();{{#hasQueryParams}} + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap();{{#hasQueryParams}} - {{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{^-last}} - {{/-last}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} + {{#queryParams}}{{#isExplode}}{{#hasVars}} + if ({{paramName}} != null) { + {{#vars}} localVarQueryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}}}{{/hasVars}}{{^hasVars}}localVarQueryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/hasVars}}{{/isExplode}}{{^isExplode}}localVarQueryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} {{#headerParams}}if ({{paramName}} != null) - headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + localVarHeaderParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} {{/-last}}{{/headerParams}}{{/hasHeaderParams}}{{#hasCookieParams}} {{#cookieParams}}if ({{paramName}} != null) - cookieParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + localVarCookieParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} {{/-last}}{{/cookieParams}}{{/hasCookieParams}}{{#hasFormParams}} {{#formParams}}if ({{paramName}} != null) - formParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}addAll{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{^-last}} + localVarFormParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}addAll{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{^-last}} {{/-last}}{{/formParams}}{{/hasFormParams}} final String[] localVarAccepts = { {{#hasProduces}} {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} {{/hasProduces}} }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { {{#hasConsumes}} + final String[] localVarContentTypes = { {{#hasConsumes}} + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{/hasConsumes}} }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + + {{#returnType}}ParameterizedTypeReference<{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}}{{/returnType}}> localReturnType = new ParameterizedTypeReference<{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}}{{/returnType}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};{{/returnType}} + return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.emptyMap(){{/hasPathParams}}, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + } + {{#-last}} + + @Override + public ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException { + String localVarPath = url.replace(apiClient.getBasePath(), ""); + Object localVarPostBody = request; + + final Map uriVariables = new HashMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { {{#hasProduces}} + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{/hasProduces}} }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { {{#hasConsumes}} {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} {{/hasConsumes}} }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - {{#returnType}}ParameterizedTypeReference<{{{returnType}}}> returnType = new ParameterizedTypeReference<{{{returnType}}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};{{/returnType}} - return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.emptyMap(){{/hasPathParams}}, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + return apiClient.invokeAPI(localVarPath, method, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, returnType); } + {{/-last}} {{/operation}} } {{/operations}} diff --git a/sdks/java-v1/templates/libraries/resttemplate/api_test.mustache b/sdks/java-v1/templates/libraries/resttemplate/api_test.mustache index 865572ae8..04a19f1f1 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/api_test.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/api_test.mustache @@ -4,21 +4,27 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.web.client.RestClientException; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore -public class {{classname}}Test { +@Disabled +class {{classname}}Test { private final {{classname}} api = new {{classname}}(); @@ -28,15 +34,16 @@ public class {{classname}}Test { * * {{notes}} * - * @throws ApiException + * @throws RestClientException * if the Api call fails */ @Test - public void {{operationId}}Test() { + void {{operationId}}Test() { {{#allParams}} {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/sdks/java-v1/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache b/sdks/java-v1/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache index 857403b27..d32930336 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/sdks/java-v1/templates/libraries/resttemplate/auth/Authentication.mustache b/sdks/java-v1/templates/libraries/resttemplate/auth/Authentication.mustache index 8e53c2ba0..0636a6d96 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/auth/Authentication.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/auth/Authentication.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/sdks/java-v1/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache index 5b07cb907..fba126558 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache @@ -1,10 +1,11 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; +import java.util.Base64; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} @@ -34,6 +35,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64Utils.encodeToString(str.getBytes(StandardCharsets.UTF_8))); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); } } diff --git a/sdks/java-v1/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache b/sdks/java-v1/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache index 1d1610c61..ecf258a23 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache @@ -1,31 +1,51 @@ -package {{invokerPackage}}.auth; +{{>licenseInfo}} -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; +package {{invokerPackage}}.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; } + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); if (bearerToken == null) { return; } diff --git a/sdks/java-v1/templates/libraries/resttemplate/auth/OAuth.mustache b/sdks/java-v1/templates/libraries/resttemplate/auth/OAuth.mustache index 7889f1582..1e8204285 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/auth/OAuth.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/auth/OAuth.mustache @@ -1,24 +1,50 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; +/** + * Provides support for RFC 6750 - Bearer Token usage for OAUTH 2.0 Authorization. + */ {{>generatedAnnotation}} public class OAuth implements Authentication { - private String accessToken; + private Supplier tokenSupplier; + /** + * Returns the bearer token used for Authorization. + * + * @return The bearer token + */ public String getAccessToken() { - return accessToken; + return tokenSupplier.get(); } + /** + * Sets the bearer access token used for Authorization. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setAccessToken(String accessToken) { - this.accessToken = accessToken; + setAccessToken(() -> accessToken); + } + + /** + * Sets the supplier of bearer tokens used for Authorization. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setAccessToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (accessToken != null) { - headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); - } + Optional.ofNullable(tokenSupplier).map(Supplier::get).ifPresent(accessToken -> + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken) + ); } } diff --git a/sdks/java-v1/templates/libraries/resttemplate/auth/OAuthFlow.mustache b/sdks/java-v1/templates/libraries/resttemplate/auth/OAuthFlow.mustache index 7ab35f6d8..759f354f5 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/auth/OAuthFlow.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/auth/OAuthFlow.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; public enum OAuthFlow { diff --git a/sdks/java-v1/templates/libraries/resttemplate/build.gradle.mustache b/sdks/java-v1/templates/libraries/resttemplate/build.gradle.mustache index 75b4478ea..a900fc806 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/build.gradle.mustache @@ -32,14 +32,14 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} } // Rename the aar correctly @@ -63,16 +63,16 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -84,14 +84,14 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} publishing { publications { @@ -103,29 +103,42 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} + {{#useJakartaEe}} + spring_web_version = "6.1.5" + jakarta_annotation_version = "2.1.1" + {{/useJakartaEe}} + {{^useJakartaEe}} + spring_web_version = "5.3.33" jakarta_annotation_version = "1.3.5" - spring_web_version = "5.2.5.RELEASE" + {{/useJakartaEe}} jodatime_version = "2.9.9" - junit_version = "4.13.1" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} + junit_version = "5.10.2" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "org.springframework:spring-web:$spring_web_version" implementation "org.springframework:spring-context:$spring_web_version" @@ -136,19 +149,29 @@ dependencies { {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" - {{/threetenbp}} {{#withXml}} implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" {{/withXml}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + } diff --git a/sdks/java-v1/templates/libraries/resttemplate/pom.mustache b/sdks/java-v1/templates/libraries/resttemplate/pom.mustache index 6bd56372d..250417d78 100644 --- a/sdks/java-v1/templates/libraries/resttemplate/pom.mustache +++ b/sdks/java-v1/templates/libraries/resttemplate/pom.mustache @@ -43,7 +43,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.4.0 enforce-maven @@ -63,18 +63,27 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.1.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest + true + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin @@ -95,11 +104,10 @@ org.apache.maven.plugins maven-jar-plugin - 2.2 + 3.3.0 - jar test-jar @@ -111,7 +119,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.10 + 3.4.0 add_sources @@ -142,22 +150,22 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.11.0 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + {{#useJakartaEe}} + 17 + 17 + {{/useJakartaEe}} + {{^useJakartaEe}} + 1.8 + 1.8 + {{/useJakartaEe}} org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.5.0 none @@ -173,7 +181,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.0 attach-sources @@ -211,11 +219,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -252,52 +269,75 @@ jackson-databind ${jackson-databind-version} + {{^useJakartaEe}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + {{/useJakartaEe}} + {{#useJakartaEe}} + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{/useJakartaEe}} + {{#openApiNullable}} org.openapitools jackson-databind-nullable ${jackson-databind-nullable-version} + {{/openApiNullable}} {{#withXml}} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + + + io.github.threeten-jaxb + threeten-jaxb-core + 1.2 + {{/withXml}} - {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - {{/java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - - joda-time - joda-time - ${jodatime-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + {{#performBeanValidation}} + + + org.hibernate + hibernate-validator + ${hibernate-validator-version} + + {{/performBeanValidation}} jakarta.annotation jakarta.annotation-api @@ -307,27 +347,53 @@ - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + UTF-8 - 1.5.22 - 5.2.5.RELEASE - 2.10.5 - 2.10.5.1 - 0.2.2 + {{#swagger1AnnotationLibrary}} + 1.6.9 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + {{#useJakartaEe}} + 6.1.5 + {{/useJakartaEe}} + {{^useJakartaEe}} + 5.3.33 + {{/useJakartaEe}} + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} - 1.0.0 - 4.13.1 + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + {{#performBeanValidation}} + 5.4.3.Final + {{/performBeanValidation}} + 5.10.2 + 1.10.0 diff --git a/sdks/java-v1/templates/libraries/retrofit/ApiClient.mustache b/sdks/java-v1/templates/libraries/retrofit/ApiClient.mustache deleted file mode 100644 index ad3057e9c..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/ApiClient.mustache +++ /dev/null @@ -1,448 +0,0 @@ -package {{invokerPackage}}; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Type; -import java.util.LinkedHashMap; -import java.util.Map; - -{{#hasOAuthMethods}} -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -{{/hasOAuthMethods}} - -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import retrofit.RestAdapter; -import retrofit.client.OkClient; -import retrofit.converter.ConversionException; -import retrofit.converter.Converter; -import retrofit.converter.GsonConverter; -import retrofit.mime.TypedByteArray; -import retrofit.mime.TypedInput; -import retrofit.mime.TypedOutput; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.OkHttpClient; - -import {{invokerPackage}}.auth.HttpBasicAuth; -import {{invokerPackage}}.auth.HttpBearerAuth; -import {{invokerPackage}}.auth.ApiKeyAuth; -{{#hasOAuthMethods}} -import {{invokerPackage}}.auth.OAuth; -import {{invokerPackage}}.auth.OAuth.AccessTokenListener; -import {{invokerPackage}}.auth.OAuthFlow; -{{/hasOAuthMethods}} - -public class ApiClient { - - private Map apiAuthorizations; - private OkHttpClient okClient; - private RestAdapter.Builder adapterBuilder; - - public ApiClient() { - apiAuthorizations = new LinkedHashMap(); - createDefaultAdapter(); - } - - public ApiClient(String[] authNames) { - this(); - for(String authName : authNames) { - {{#hasAuthMethods}} - Interceptor auth; - {{#authMethods}}if ("{{name}}".equals(authName)) { - {{#isBasic}} - {{#isBasicBasic}} - auth = new HttpBasicAuth(); - {{/isBasicBasic}} - {{^isBasicBasic}} - auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}} - {{/isBasic}} - {{#isApiKey}} - auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); - {{/isApiKey}} - {{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); - {{/isOAuth}} - } else {{/authMethods}}{ - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); - } - addAuthorization(authName, auth); - {{/hasAuthMethods}} - {{^hasAuthMethods}} - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); - {{/hasAuthMethods}} - } - } - - /** - * Basic constructor for single auth name - * @param authName Authentication name - */ - public ApiClient(String authName) { - this(new String[]{authName}); - } - - /** - * Helper constructor for single api key - * @param authName Authentication name - * @param apiKey API key - */ - public ApiClient(String authName, String apiKey) { - this(authName); - this.setApiKey(apiKey); - } - - /** - * Helper constructor for single basic auth or password oauth2 - * @param authName Authentication name - * @param username Username - * @param password Password - */ - public ApiClient(String authName, String username, String password) { - this(authName); - this.setCredentials(username, password); - } - - {{#hasOAuthMethods}} - /** - * Helper constructor for single password oauth2 - * @param authName Authentication name - * @param clientId Client ID - * @param secret Client secret - * @param username Username - * @param password Password - */ - public ApiClient(String authName, String clientId, String secret, String username, String password) { - this(authName); - this.getTokenEndPoint() - .setClientId(clientId) - .setClientSecret(secret) - .setUsername(username) - .setPassword(password); - } - - {{/hasOAuthMethods}} - public void createDefaultAdapter() { - Gson gson = new GsonBuilder() - .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - .registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter()) - .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter()) - .create(); - - okClient = new OkHttpClient(); - - adapterBuilder = new RestAdapter - .Builder() - .setEndpoint("{{{basePath}}}") - .setClient(new OkClient(okClient)) - .setConverter(new GsonConverterWrapper(gson)); - } - - public S createService(Class serviceClass) { - return adapterBuilder.build().create(serviceClass); - - } - - /** - * Helper method to configure the first api key found - * @param apiKey API key - */ - private void setApiKey(String apiKey) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof ApiKeyAuth) { - ApiKeyAuth keyAuth = (ApiKeyAuth) apiAuthorization; - keyAuth.setApiKey(apiKey); - return; - } - } - } - - /** - * Helper method to set token for the first Http Bearer authentication found. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBearerAuth) { - ((HttpBearerAuth) apiAuthorization).setBearerToken(bearerToken); - return; - } - } - } - - /** - * Helper method to configure the username/password for basic auth or password oauth - * @param username Username - * @param password Password - */ - private void setCredentials(String username, String password) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBasicAuth) { - HttpBasicAuth basicAuth = (HttpBasicAuth) apiAuthorization; - basicAuth.setCredentials(username, password); - return; - } - {{#hasOAuthMethods}} - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder().setUsername(username).setPassword(password); - return; - } - {{/hasOAuthMethods}} - } - } - - {{#hasOAuthMethods}} - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - public TokenRequestBuilder getTokenEndPoint() { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getTokenRequestBuilder(); - } - } - return null; - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - public AuthenticationRequestBuilder getAuthorizationEndPoint() { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getAuthenticationRequestBuilder(); - } - } - return null; - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.setAccessToken(accessToken); - return; - } - } - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - */ - public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder() - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI); - oauth.getAuthenticationRequestBuilder() - .setClientId(clientId) - .setRedirectURI(redirectURI); - return; - } - } - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - */ - public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.registerAccessTokenListener(accessTokenListener); - return; - } - } - } - {{/hasOAuthMethods}} - - /** - * Adds an authorization to be used by the client - * @param authName Authentication name - * @param authorization Authorization - */ - public void addAuthorization(String authName, Interceptor authorization) { - if (apiAuthorizations.containsKey(authName)) { - throw new RuntimeException("auth name \"" + authName + "\" already in api authorizations"); - } - apiAuthorizations.put(authName, authorization); - okClient.interceptors().add(authorization); - } - - public Map getApiAuthorizations() { - return apiAuthorizations; - } - - public void setApiAuthorizations(Map apiAuthorizations) { - this.apiAuthorizations = apiAuthorizations; - } - - public RestAdapter.Builder getAdapterBuilder() { - return adapterBuilder; - } - - public void setAdapterBuilder(RestAdapter.Builder adapterBuilder) { - this.adapterBuilder = adapterBuilder; - } - - public OkHttpClient getOkClient() { - return okClient; - } - - public void addAuthsToOkClient(OkHttpClient okClient) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - okClient.interceptors().add(apiAuthorization); - } - } - - /** - * Clones the okClient given in parameter, adds the auth interceptors and uses it to configure the RestAdapter - * @param okClient OkHttp client - */ - public void configureFromOkclient(OkHttpClient okClient) { - OkHttpClient clone = okClient.clone(); - addAuthsToOkClient(clone); - adapterBuilder.setClient(new OkClient(clone)); - } -} - -/** - * This wrapper is to take care of this case: - * when the deserialization fails due to JsonParseException and the - * expected type is String, then just return the body string. - */ -class GsonConverterWrapper implements Converter { - private GsonConverter converter; - - public GsonConverterWrapper(Gson gson) { - converter = new GsonConverter(gson); - } - - @Override public Object fromBody(TypedInput body, Type type) throws ConversionException { - byte[] bodyBytes = readInBytes(body); - TypedByteArray newBody = new TypedByteArray(body.mimeType(), bodyBytes); - try { - return converter.fromBody(newBody, type); - } catch (ConversionException e) { - if (e.getCause() instanceof JsonParseException && type.equals(String.class)) { - return new String(bodyBytes); - } else { - throw e; - } - } - } - - @Override public TypedOutput toBody(Object object) { - return converter.toBody(object); - } - - private byte[] readInBytes(TypedInput body) throws ConversionException { - InputStream in = null; - try { - in = body.in(); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - byte[] buffer = new byte[0xFFFF]; - for (int len; (len = in.read(buffer)) != -1;) - os.write(buffer, 0, len); - os.flush(); - return os.toByteArray(); - } catch (IOException e) { - throw new ConversionException(e); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException ignored) { - } - } - } - - } -} - -/** - * Gson TypeAdapter for Joda DateTime type - */ -class DateTimeTypeAdapter extends TypeAdapter { - - private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser(); - private final DateTimeFormatter printFormatter = ISODateTimeFormat.dateTime(); - - @Override - public void write(JsonWriter out, DateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(printFormatter.print(date)); - } - } - - @Override - public DateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return parseFormatter.parseDateTime(date); - } - } -} - -/** - * Gson TypeAdapter for Joda DateTime type - */ -class LocalDateTypeAdapter extends TypeAdapter { - - private final DateTimeFormatter formatter = ISODateTimeFormat.date(); - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.print(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return formatter.parseLocalDate(date); - } - } -} diff --git a/sdks/java-v1/templates/libraries/retrofit/CollectionFormats.mustache b/sdks/java-v1/templates/libraries/retrofit/CollectionFormats.mustache deleted file mode 100644 index dbfa4ae76..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/CollectionFormats.mustache +++ /dev/null @@ -1,99 +0,0 @@ -package {{invokerPackage}}; - -import java.util.Arrays; -import java.util.List; - -public class CollectionFormats { - - public static class CSVParams { - - protected List params; - - public CSVParams() { - } - - public CSVParams(List params) { - this.params = params; - } - - public CSVParams(String... params) { - this.params = Arrays.asList(params); - } - - public List getParams() { - return params; - } - - public void setParams(List params) { - this.params = params; - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), ","); - } - - } - - public static class SPACEParams extends SSVParams { - - } - - public static class SSVParams extends CSVParams { - - public SSVParams() { - } - - public SSVParams(List params) { - super(params); - } - - public SSVParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), " "); - } - } - - public static class TSVParams extends CSVParams { - - public TSVParams() { - } - - public TSVParams(List params) { - super(params); - } - - public TSVParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join( params.toArray(new String[0]), "\t"); - } - } - - public static class PIPESParams extends CSVParams { - - public PIPESParams() { - } - - public PIPESParams(List params) { - super(params); - } - - public PIPESParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), "|"); - } - } - -} diff --git a/sdks/java-v1/templates/libraries/retrofit/README.mustache b/sdks/java-v1/templates/libraries/retrofit/README.mustache deleted file mode 100644 index c9877589b..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/README.mustache +++ /dev/null @@ -1,42 +0,0 @@ -# {{artifactId}} - -## Requirements - -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. - -## Installation & Usage - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn deploy -``` - -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. - -After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*: - -```xml - - {{groupId}} - {{artifactId}} - {{artifactVersion}} - compile - - -``` - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/sdks/java-v1/templates/libraries/retrofit/api.mustache b/sdks/java-v1/templates/libraries/retrofit/api.mustache deleted file mode 100644 index 79e4ff137..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/api.mustache +++ /dev/null @@ -1,74 +0,0 @@ -package {{package}}; - -import {{invokerPackage}}.CollectionFormats.*; - -import retrofit.Callback; -import retrofit.http.*; -import retrofit.mime.*; - -{{#imports}}import {{import}}; -{{/imports}} - -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} - -{{#operations}} -public interface {{classname}} { - {{#operation}} - /** - * {{summary}} - * Sync method - * {{notes}} -{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} -{{/allParams}} - * @return {{returnType}}{{^returnType}}Void{{/returnType}} -{{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation -{{/externalDocs}} -{{#isDeprecated}} - * @deprecated -{{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#formParams}}{{#-first}} - {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{{path}}}") - {{{returnType}}}{{^returnType}}Void{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}} - {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{^-last}}, {{/-last}}{{#-last}} - );{{/-last}}{{/allParams}} - - /** - * {{summary}} - * Async method -{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} -{{/allParams}} - * @param cb callback method -{{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation -{{/externalDocs}} -{{#isDeprecated}} - * @deprecated -{{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#formParams}}{{#-first}} - {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{{path}}}") - void {{operationId}}( - {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}, {{/allParams}}Callback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> cb - ); - {{/operation}} -} -{{/operations}} diff --git a/sdks/java-v1/templates/libraries/retrofit/api_test.mustache b/sdks/java-v1/templates/libraries/retrofit/api_test.mustache deleted file mode 100644 index 112d7f73a..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/api_test.mustache +++ /dev/null @@ -1,44 +0,0 @@ -package {{package}}; - -import {{invokerPackage}}.ApiClient; -{{#imports}}import {{import}}; -{{/imports}} -import org.junit.Before; -import org.junit.Test; - -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} - -/** - * API tests for {{classname}} - */ -public class {{classname}}Test { - - private {{classname}} api; - - @Before - public void setup() { - api = new ApiClient().createService({{classname}}.class); - } - - {{#operations}}{{#operation}} - /** - * {{summary}} - * - * {{notes}} - */ - @Test - public void {{operationId}}Test() { - {{#allParams}} - {{{dataType}}} {{paramName}} = null; - {{/allParams}} - // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - - // TODO: test validations - } - {{/operation}}{{/operations}} -} diff --git a/sdks/java-v1/templates/libraries/retrofit/auth/ApiKeyAuth.mustache b/sdks/java-v1/templates/libraries/retrofit/auth/ApiKeyAuth.mustache deleted file mode 100644 index 69205bb20..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/auth/ApiKeyAuth.mustache +++ /dev/null @@ -1,72 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class ApiKeyAuth implements Interceptor { - private final String location; - private final String paramName; - - private String apiKey; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - @Override - public Response intercept(Chain chain) throws IOException { - String paramValue; - Request request = chain.request(); - - if ("query".equals(location)) { - String newQuery = request.uri().getQuery(); - paramValue = paramName + "=" + apiKey; - if (newQuery == null) { - newQuery = paramValue; - } else { - newQuery += "&" + paramValue; - } - - URI newUri; - try { - newUri = new URI(request.uri().getScheme(), request.uri().getAuthority(), - request.uri().getPath(), newQuery, request.uri().getFragment()); - } catch (URISyntaxException e) { - throw new IOException(e); - } - - request = request.newBuilder().url(newUri.toURL()).build(); - } else if ("header".equals(location)) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build(); - } else if ("cookie".equals(location)) { - request = request.newBuilder() - .addHeader("Cookie", String.format("%s=%s", paramName, apiKey)) - .build(); - } - return chain.proceed(request); - } -} diff --git a/sdks/java-v1/templates/libraries/retrofit/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/libraries/retrofit/auth/HttpBasicAuth.mustache deleted file mode 100644 index cf82b2775..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/auth/HttpBasicAuth.mustache +++ /dev/null @@ -1,49 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; - -import com.squareup.okhttp.Credentials; -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class HttpBasicAuth implements Interceptor { - - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public void setCredentials(String username, String password) { - this.username = username; - this.password = password; - } - - @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") == null) { - String credentials = Credentials.basic(username, password); - request = request.newBuilder() - .addHeader("Authorization", credentials) - .build(); - } - return chain.proceed(request); - } -} diff --git a/sdks/java-v1/templates/libraries/retrofit/auth/HttpBearerAuth.mustache b/sdks/java-v1/templates/libraries/retrofit/auth/HttpBearerAuth.mustache deleted file mode 100644 index 9b910c461..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/auth/HttpBearerAuth.mustache +++ /dev/null @@ -1,42 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class HttpBearerAuth implements Interceptor { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - public String getBearerToken() { - return bearerToken; - } - - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") == null && bearerToken != null) { - request = request.newBuilder() - .addHeader("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken) - .build(); - } - return chain.proceed(request); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } - -} diff --git a/sdks/java-v1/templates/libraries/retrofit/auth/OAuth.mustache b/sdks/java-v1/templates/libraries/retrofit/auth/OAuth.mustache deleted file mode 100644 index 57bfd3df2..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/auth/OAuth.mustache +++ /dev/null @@ -1,185 +0,0 @@ -package {{invokerPackage}}.auth; - -import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; -import static java.net.HttpURLConnection.HTTP_FORBIDDEN; - -import java.io.IOException; -import java.util.Map; - -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; -import org.apache.oltu.oauth2.common.token.BasicOAuthToken; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Request.Builder; -import com.squareup.okhttp.Response; - -public class OAuth implements Interceptor { - - public interface AccessTokenListener { - public void notify(BasicOAuthToken token); - } - - private volatile String accessToken; - private OAuthClient oauthClient; - - private TokenRequestBuilder tokenRequestBuilder; - private AuthenticationRequestBuilder authenticationRequestBuilder; - - private AccessTokenListener accessTokenListener; - - public OAuth( OkHttpClient client, TokenRequestBuilder requestBuilder ) { - this.oauthClient = new OAuthClient(new OAuthOkHttpClient(client)); - this.tokenRequestBuilder = requestBuilder; - } - - public OAuth(TokenRequestBuilder requestBuilder ) { - this(new OkHttpClient(), requestBuilder); - } - - public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { - this(OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes)); - setFlow(flow); - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); - } - - public void setFlow(OAuthFlow flow) { - switch(flow) { - case accessCode: - case implicit: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case password: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case application: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - } - - @Override - public Response intercept(Chain chain) - throws IOException { - - return retryingIntercept(chain, true); - } - - private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request); - } - - // If first time, get the token - OAuthClientRequest oAuthRequest; - if (getAccessToken() == null) { - updateAccessToken(null); - } - - if (getAccessToken() != null) { - // Build the request - Builder rb = request.newBuilder(); - - String requestAccessToken = new String(getAccessToken()); - try { - oAuthRequest = new OAuthBearerClientRequest(request.urlString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage(); - } catch (OAuthSystemException e) { - throw new IOException(e); - } - - for ( Map.Entry header : oAuthRequest.getHeaders().entrySet() ) { - rb.addHeader(header.getKey(), header.getValue()); - } - rb.url( oAuthRequest.getLocationUri()); - - //Execute the request - Response response = chain.proceed(rb.build()); - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ( response != null && (response.code() == HTTP_UNAUTHORIZED || response.code() == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure ) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body().close(); - return retryingIntercept( chain, false ); - } - } catch (Exception e) { - response.body().close(); - throw e; - } - } - return response; - } else { - return chain.proceed(chain.request()); - } - } - - /* - * Returns true if the access token has been updated - */ - public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { - try { - OAuthJSONAccessTokenResponse accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()); - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken()); - if (accessTokenListener != null) { - accessTokenListener.notify((BasicOAuthToken) accessTokenResponse.getOAuthToken()); - } - return !getAccessToken().equals(requestAccessToken); - } else { - return false; - } - } catch (OAuthSystemException e) { - throw new IOException(e); - } catch (OAuthProblemException e) { - throw new IOException(e); - } - } - return true; - } - - public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - this.accessTokenListener = accessTokenListener; - } - - public synchronized String getAccessToken() { - return accessToken; - } - - public synchronized void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } - - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - public AuthenticationRequestBuilder getAuthenticationRequestBuilder() { - return authenticationRequestBuilder; - } - - public void setAuthenticationRequestBuilder(AuthenticationRequestBuilder authenticationRequestBuilder) { - this.authenticationRequestBuilder = authenticationRequestBuilder; - } - -} diff --git a/sdks/java-v1/templates/libraries/retrofit/auth/OAuthOkHttpClient.mustache b/sdks/java-v1/templates/libraries/retrofit/auth/OAuthOkHttpClient.mustache deleted file mode 100644 index 48fc7ea4c..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/auth/OAuthOkHttpClient.mustache +++ /dev/null @@ -1,69 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; - -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.RequestBody; -import com.squareup.okhttp.Response; - - -public class OAuthOkHttpClient implements HttpClient { - - private OkHttpClient client; - - public OAuthOkHttpClient() { - this.client = new OkHttpClient(); - } - - public OAuthOkHttpClient(OkHttpClient client) { - this.client = client; - } - - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - MediaType mediaType = MediaType.parse("application/json"); - Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); - - if(headers != null) { - for (Entry entry : headers.entrySet()) { - if (entry.getKey().equalsIgnoreCase("Content-Type")) { - mediaType = MediaType.parse(entry.getValue()); - } else { - requestBuilder.addHeader(entry.getKey(), entry.getValue()); - } - } - } - - RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; - requestBuilder.method(requestMethod, body); - - try { - Response response = client.newCall(requestBuilder.build()).execute(); - return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), - response.body().contentType().toString(), - response.code(), - responseClass); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - } - - public void shutdown() { - // Nothing to do here - } - -} diff --git a/sdks/java-v1/templates/libraries/retrofit/bodyParams.mustache b/sdks/java-v1/templates/libraries/retrofit/bodyParams.mustache deleted file mode 100644 index 81de324b6..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/bodyParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isBodyParam}}@retrofit.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/retrofit/build.gradle.mustache b/sdks/java-v1/templates/libraries/retrofit/build.gradle.mustache deleted file mode 100644 index 1266cde37..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/build.gradle.mustache +++ /dev/null @@ -1,130 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' - -group = '{{groupId}}' -version = '{{artifactVersion}}' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - } -} - -repositories { - mavenCentral() -} - - -if(hasProperty('target') && target == 'android') { - - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' - - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 - } - compileOptions { - {{#java8}} - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } - - dependencies { - provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - } - } - - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven-publish' - - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - - publishing { - publications { - maven(MavenPublication) { - artifactId = '{{artifactId}}' - from components.java - } - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - okhttp_version = "2.7.5" - oltu_version = "1.0.1" - retrofit_version = "1.9.0" - swagger_annotations_version = "1.5.21" - jakarta_annotation_version = "1.3.5" - junit_version = "4.13.1" - jodatime_version = "2.9.3" - {{#threetenbp}} - threetenbp_version = "1.4.0" - {{/threetenbp}} -} - -dependencies { - implementation "com.squareup.okhttp:okhttp:$okhttp_version" - implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation "com.squareup.retrofit:retrofit:$retrofit_version" - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" - implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" - implementation "joda-time:joda-time:$jodatime_version" - {{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" - {{/threetenbp}} - implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" -} diff --git a/sdks/java-v1/templates/libraries/retrofit/build.sbt.mustache b/sdks/java-v1/templates/libraries/retrofit/build.sbt.mustache deleted file mode 100644 index b27931765..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/build.sbt.mustache +++ /dev/null @@ -1,24 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "{{groupId}}", - name := "{{artifactId}}", - version := "{{artifactVersion}}", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "com.squareup.okhttp" % "okhttp" % "2.7.5" % "compile", - "com.squareup.retrofit" % "retrofit" % "1.9.0" % "compile", - "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "joda-time" % "joda-time" % "2.9.3" % "compile", - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.0" % "compile", - {{/threetenbp}} - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" - ) - ) diff --git a/sdks/java-v1/templates/libraries/retrofit/formParams.mustache b/sdks/java-v1/templates/libraries/retrofit/formParams.mustache deleted file mode 100644 index 851072b3f..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/formParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isFormParam}}{{^isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") TypedFile {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/retrofit/headerParams.mustache b/sdks/java-v1/templates/libraries/retrofit/headerParams.mustache deleted file mode 100644 index 5d6da4a94..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/headerParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isHeaderParam}}@retrofit.http.Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/retrofit/pathParams.mustache b/sdks/java-v1/templates/libraries/retrofit/pathParams.mustache deleted file mode 100644 index 7b8be8442..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/pathParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isPathParam}}@retrofit.http.Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/retrofit/pom.mustache b/sdks/java-v1/templates/libraries/retrofit/pom.mustache deleted file mode 100644 index 1566db9a1..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/pom.mustache +++ /dev/null @@ -1,295 +0,0 @@ - - 4.0.0 - {{groupId}} - {{artifactId}} - jar - {{artifactId}} - {{artifactVersion}} - {{artifactUrl}} - {{artifactDescription}} - - {{scmConnection}} - {{scmDeveloperConnection}} - {{scmUrl}} - -{{#parentOverridden}} - - {{{parentGroupId}}} - {{{parentArtifactId}}} - {{{parentVersion}}} - -{{/parentOverridden}} - - - - {{licenseName}} - {{licenseUrl}} - repo - - - - - - {{developerName}} - {{developerEmail}} - {{developerOrganization}} - {{developerOrganizationUrl}} - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.1.1 - - none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} - - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - - - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.squareup.retrofit - retrofit - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - com.squareup.okhttp - okhttp - ${okhttp-version} - - - joda-time - joda-time - ${jodatime-version} - - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} - {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - - {{/parcelableModel}} - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - provided - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.21 - 1.9.0 - 2.7.5 - 2.9.9 - {{#threetenbp}} - 1.4.0 - {{/threetenbp}} - 1.0.1 - 1.3.5 - 1.0.0 - 4.13.1 - - diff --git a/sdks/java-v1/templates/libraries/retrofit/queryParams.mustache b/sdks/java-v1/templates/libraries/retrofit/queryParams.mustache deleted file mode 100644 index 2a580ab34..000000000 --- a/sdks/java-v1/templates/libraries/retrofit/queryParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isQueryParam}}@retrofit.http.Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/retrofit2/ApiClient.mustache b/sdks/java-v1/templates/libraries/retrofit2/ApiClient.mustache index 57c977263..077e8d692 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/ApiClient.mustache @@ -1,8 +1,12 @@ +{{>licenseInfo}} + package {{invokerPackage}}; +{{#gson}} import com.google.gson.Gson; import com.google.gson.JsonParseException; import com.google.gson.JsonElement; +{{/gson}} import okhttp3.Interceptor; import okhttp3.OkHttpClient; import okhttp3.RequestBody; @@ -14,18 +18,20 @@ import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuil {{#joda}} import org.joda.time.format.DateTimeFormatter; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} import retrofit2.Converter; import retrofit2.Retrofit; {{#useRxJava2}} import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; {{/useRxJava2}} {{#useRxJava3}} -import hu.akarnokd.rxjava3.retrofit.RxJava3CallAdapterFactory; +import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory; {{/useRxJava3}} +{{#gson}} import retrofit2.converter.gson.GsonConverterFactory; +{{/gson}} +{{#jackson}} +import retrofit2.converter.jackson.JacksonConverterFactory; +{{/jackson}} import retrofit2.converter.scalars.ScalarsConverterFactory; import {{invokerPackage}}.auth.HttpBasicAuth; import {{invokerPackage}}.auth.HttpBearerAuth; @@ -40,9 +46,7 @@ import java.io.IOException; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; -{{#java8}} import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; @@ -71,24 +75,25 @@ public class ApiClient { this(); for(String authName : authNames) { {{#hasAuthMethods}} - Interceptor auth; + Interceptor auth = null; {{#authMethods}}if ("{{name}}".equals(authName)) { - {{#isBasic}}{{#isBasicBasic}} + {{#isBasicBasic}} auth = new HttpBasicAuth(); - {{/isBasicBasic}}{{^isBasicBasic}} + {{/isBasicBasic}}{{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}}{{/isBasic}} + {{/isBasicBearer}} {{#isApiKey}} auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); {{/isApiKey}} {{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); + auth = new OAuth(OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, "{{{authorizationUrl}}}", "{{{tokenUrl}}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - - addAuthorization(authName, auth); + if (auth != null) { + addAuthorization(authName, auth); + } {{/hasAuthMethods}} {{^hasAuthMethods}} throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); @@ -161,7 +166,12 @@ public class ApiClient { .addCallAdapterFactory(RxJava3CallAdapterFactory.create()) {{/useRxJava3}} .addConverterFactory(ScalarsConverterFactory.create()) + {{#jackson}} + .addConverterFactory(JacksonConverterFactory.create(json.getMapper())); + {{/jackson}} + {{#gson}} .addConverterFactory(GsonCustomConverterFactory.create(json.getGson())); + {{/gson}} } public S createService(Class serviceClass) { @@ -177,6 +187,7 @@ public class ApiClient { return this; } + {{#gson}} public ApiClient setSqlDateFormat(DateFormat dateFormat) { this.json.setSqlDateFormat(dateFormat); return this; @@ -204,8 +215,9 @@ public class ApiClient { this.json.setLocalDateFormat(dateFormat); return this; } - {{/jsr310}} + {{/gson}} + /** * Helper method to configure the first api key found @@ -405,6 +417,7 @@ public class ApiClient { } } +{{#gson}} /** * This wrapper is to take care of this case: * when the deserialization fails due to JsonParseException and the @@ -459,3 +472,4 @@ class GsonCustomConverterFactory extends Converter.Factory return gsonConverterFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit); } } +{{/gson}} \ No newline at end of file diff --git a/sdks/java-v1/templates/libraries/retrofit2/CollectionFormats.mustache b/sdks/java-v1/templates/libraries/retrofit2/CollectionFormats.mustache index dbfa4ae76..d63c8a864 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/CollectionFormats.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/CollectionFormats.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.Arrays; diff --git a/sdks/java-v1/templates/libraries/retrofit2/JSON.mustache b/sdks/java-v1/templates/libraries/retrofit2/JSON.mustache index 9ba7567bf..2ff8b1cb7 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/JSON.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/JSON.mustache @@ -19,11 +19,6 @@ import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; @@ -35,11 +30,9 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/sdks/java-v1/templates/libraries/retrofit2/JSON_jackson.mustache b/sdks/java-v1/templates/libraries/retrofit2/JSON_jackson.mustache new file mode 100644 index 000000000..525fe5d13 --- /dev/null +++ b/sdks/java-v1/templates/libraries/retrofit2/JSON_jackson.mustache @@ -0,0 +1,263 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +{{#joda}} +import com.fasterxml.jackson.datatype.joda.JodaModule; +{{/joda}} +{{#models.0}} +import {{modelPackage}}.*; +{{/models.0}} + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; + +{{>generatedAnnotation}} +public class JSON implements ContextResolver { + private ObjectMapper mapper; + + public JSON() { + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + {{#joda}} + .addModule(new JodaModule()) + {{/joda}} + {{#openApiNullable}} + .addModule(new JsonNullableModule()) + {{/openApiNullable}} + .build(); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet<>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap<>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (GenericType childType : descendants.values()) { + if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static + { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/sdks/java-v1/templates/libraries/retrofit2/api.mustache b/sdks/java-v1/templates/libraries/retrofit2/api.mustache index 82c3fe068..dd521a5fc 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/api.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/api.mustache @@ -28,13 +28,17 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +import java.util.Set; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} {{#operations}} public interface {{classname}} { {{#operation}} diff --git a/sdks/java-v1/templates/libraries/retrofit2/api_test.mustache b/sdks/java-v1/templates/libraries/retrofit2/api_test.mustache index 3f60dd13d..dab62f328 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/api_test.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/api_test.mustache @@ -3,16 +3,22 @@ package {{package}}; import {{invokerPackage}}.ApiClient; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ @@ -20,7 +26,7 @@ public class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService({{classname}}.class); } diff --git a/sdks/java-v1/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache b/sdks/java-v1/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache index bcc62b284..d87c2e4c6 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/sdks/java-v1/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache index 9bd756eb8..ac0347648 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/sdks/java-v1/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache b/sdks/java-v1/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache index da1bef57a..764c8f216 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/sdks/java-v1/templates/libraries/retrofit2/auth/OAuth.mustache b/sdks/java-v1/templates/libraries/retrofit2/auth/OAuth.mustache index 88e4e62bf..6ea77b78d 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/auth/OAuth.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/auth/OAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; @@ -54,14 +56,14 @@ public class OAuth implements Interceptor { public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: - case implicit: + case ACCESS_CODE: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: diff --git a/sdks/java-v1/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache b/sdks/java-v1/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache index a499c7b8b..5fe013184 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/sdks/java-v1/templates/libraries/retrofit2/build.gradle.mustache b/sdks/java-v1/templates/libraries/retrofit2/build.gradle.mustache index a5c716b18..407e97a33 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -110,18 +98,21 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" + retrofit_version = "2.11.0" + {{#jackson}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + javax_ws_rs_api_version = "2.1.1" + {{#openApiNullable}} + jackson_databind_nullable_version = "0.2.6" + {{/openApiNullable}} + {{/jackson}} {{#usePlayWS}} - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" - {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" - {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" play_version = "2.6.7" {{/usePlayWS}} + jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.1" + junit_version = "5.10.3" {{#useRxJava2}} rx_java_version = "2.1.1" {{/useRxJava2}} @@ -131,10 +122,7 @@ ext { {{#joda}} jodatime_version = "2.9.9" {{/joda}} - {{#threetenbp}} - threetenbp_version = "1.4.0" - {{/threetenbp}} - json_fire_version = "1.8.0" + json_fire_version = "1.9.0" } dependencies { @@ -146,7 +134,7 @@ dependencies { implementation "io.reactivex.rxjava2:rxjava:$rx_java_version" {{/useRxJava2}} {{#useRxJava3}} - implementation 'com.github.akarnokd:rxjava3-retrofit-adapter:3.0.0' + implementation 'com.squareup.retrofit2:adapter-rxjava3:$$retrofit_version' implementation "io.reactivex.rxjava3:rxjava:$rx_java_version" {{/useRxJava3}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" @@ -158,21 +146,21 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" - {{/threetenbp}} {{#usePlayWS}} implementation "com.typesafe.play:play-ahc-ws_2.12:$play_version" - implementation "jakarta.validation:jakarta.validation-api:2.0.2" + {{/usePlayWS}} + {{#jackson}} + implementation "jakarta.validation:jakarta.validation-api:3.0.2" implementation "com.squareup.retrofit2:converter-jackson:$retrofit_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "javax.ws.rs:javax.ws.rs-api:$javax_ws_rs_api_version" {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}:$jackson_version" - {{/usePlayWS}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{/jackson}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/sdks/java-v1/templates/libraries/retrofit2/build.sbt.mustache b/sdks/java-v1/templates/libraries/retrofit2/build.sbt.mustache index a572f4b93..03b8653d0 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/build.sbt.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/build.sbt.mustache @@ -9,25 +9,25 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "retrofit" % "2.11.0" % "compile", + "com.squareup.retrofit2" % "converter-scalars" % "2.11.0" % "compile", {{^usePlayWS}} - "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.11.0" % "compile", {{/usePlayWS}} {{#usePlayWS}} "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", - "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", - "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", + "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", + "com.squareup.retrofit2" % "converter-jackson" % "2.11.0" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{/usePlayWS}} {{#useRxJava2}} - "com.squareup.retrofit2" % "adapter-rxjava2" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "adapter-rxjava2" % "2.11.0" % "compile", "io.reactivex.rxjava2" % "rxjava" % "2.1.1" % "compile", {{/useRxJava2}} {{#useRxJava3}} - "com.github.akarnokd" % "rxjava3-retrofit-adapter" % "3.0.0" % "compile", + "com.squareup.retrofit2" % "adapter-rxjava3" % "2.11.0" % "compile", "io.reactivex.rxjava3" % "rxjava" % "3.0.4" % "compile", {{/useRxJava3}} "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", @@ -35,12 +35,9 @@ lazy val root = (project in file(".")). {{#joda}} "joda-time" % "joda-time" % "2.9.9" % "compile", {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.0" % "compile", - {{/threetenbp}} - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/sdks/java-v1/templates/libraries/retrofit2/play24/ApiClient.mustache b/sdks/java-v1/templates/libraries/retrofit2/play24/ApiClient.mustache index c43f800a4..78e3f8510 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play24/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play24/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.IOException; @@ -45,8 +47,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - // authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + // authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/sdks/java-v1/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache b/sdks/java-v1/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache index d9ed3330f..d6411f26f 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import play.libs.F; diff --git a/sdks/java-v1/templates/libraries/retrofit2/play24/Play24CallFactory.mustache b/sdks/java-v1/templates/libraries/retrofit2/play24/Play24CallFactory.mustache index b17ac6415..2808f262a 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play24/Play24CallFactory.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play24/Play24CallFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import okhttp3.*; diff --git a/sdks/java-v1/templates/libraries/retrofit2/play24/api.mustache b/sdks/java-v1/templates/libraries/retrofit2/play24/api.mustache index 2b7512d19..f793699be 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play24/api.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play24/api.mustache @@ -14,12 +14,10 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} import play.libs.F; import retrofit2.Response; diff --git a/sdks/java-v1/templates/libraries/retrofit2/play25/ApiClient.mustache b/sdks/java-v1/templates/libraries/retrofit2/play25/ApiClient.mustache index 849e0665e..22d48bd78 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play25/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play25/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.IOException; @@ -44,8 +46,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<>();{{#authMethods}}{{#isBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} + authentications = new HashMap<>();{{#authMethods}}{{#isBasicBasic}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"query"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/sdks/java-v1/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache b/sdks/java-v1/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache index 62360bf98..b431690f9 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.concurrent.CompletionStage; diff --git a/sdks/java-v1/templates/libraries/retrofit2/play25/Play25CallFactory.mustache b/sdks/java-v1/templates/libraries/retrofit2/play25/Play25CallFactory.mustache index a9f19474f..d7d27d2f8 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play25/Play25CallFactory.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play25/Play25CallFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import okhttp3.*; diff --git a/sdks/java-v1/templates/libraries/retrofit2/play25/api.mustache b/sdks/java-v1/templates/libraries/retrofit2/play25/api.mustache index d4e97cc34..de6a6f6d9 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play25/api.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play25/api.mustache @@ -14,12 +14,10 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} import java.util.concurrent.*; import retrofit2.Response; diff --git a/sdks/java-v1/templates/libraries/retrofit2/play26/ApiClient.mustache b/sdks/java-v1/templates/libraries/retrofit2/play26/ApiClient.mustache index b752b433d..ef1b75d44 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play26/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play26/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.File; @@ -59,8 +61,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<>();{{#authMethods}}{{#isBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} + authentications = new HashMap<>();{{#authMethods}}{{#isBasicBasic}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/sdks/java-v1/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache b/sdks/java-v1/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache index 05c725474..2b7739fe8 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.concurrent.CompletionStage; diff --git a/sdks/java-v1/templates/libraries/retrofit2/play26/Play26CallFactory.mustache b/sdks/java-v1/templates/libraries/retrofit2/play26/Play26CallFactory.mustache index f65c921a7..c309dee98 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play26/Play26CallFactory.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play26/Play26CallFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import okhttp3.*; diff --git a/sdks/java-v1/templates/libraries/retrofit2/play26/api.mustache b/sdks/java-v1/templates/libraries/retrofit2/play26/api.mustache index dd3339ff8..e78bd985a 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/play26/api.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/play26/api.mustache @@ -17,12 +17,15 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} import java.util.concurrent.*; import retrofit2.Response; diff --git a/sdks/java-v1/templates/libraries/retrofit2/pom.mustache b/sdks/java-v1/templates/libraries/retrofit2/pom.mustache index 5c0006171..b02a5fb2e 100644 --- a/sdks/java-v1/templates/libraries/retrofit2/pom.mustache +++ b/sdks/java-v1/templates/libraries/retrofit2/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 2.12 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest @@ -144,28 +144,17 @@ maven-compiler-plugin 3.6.1 - {{#java8}} 1.8 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -228,11 +217,13 @@ jsr305 3.0.2 + {{#gson}} com.squareup.retrofit2 converter-gson ${retrofit-version} + {{/gson}} com.squareup.retrofit2 retrofit @@ -254,11 +245,13 @@ + {{#gson}} io.gsonfire gson-fire ${gson-fire-version} + {{/gson}} {{#joda}} joda-time @@ -266,13 +259,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#useRxJava2}} io.reactivex.rxjava2 @@ -292,12 +278,12 @@ ${rxjava-version} - com.github.akarnokd - rxjava3-retrofit-adapter - 3.0.0 + com.squareup.retrofit2 + adapter-rxjava3 + ${retrofit-version} {{/useRxJava3}} - {{#usePlayWS}} + {{#jackson}} com.squareup.retrofit2 @@ -317,7 +303,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} {{#openApiNullable}} @@ -328,7 +314,7 @@ {{/openApiNullable}} com.fasterxml.jackson.datatype - jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}} + jackson-datatype-jsr310 ${jackson-version} {{#withXml}} @@ -339,6 +325,20 @@ ${jackson-version} {{/withXml}} + {{#useBeanValidation}} + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + + {{/useBeanValidation}} + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + {{/jackson}} + {{#usePlayWS}} com.typesafe.play play-ahc-ws_2.12 @@ -367,27 +367,33 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} - 1.8.3 + {{#gson}} + 1.9.0 + {{/gson}} 1.6.3 + {{#jackson}} + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + 2.1.1 + {{/jackson}} {{#usePlayWS}} - 2.12.1 2.6.7 - {{#openApiNullable}} - 0.2.2 - {{/openApiNullable}} {{/usePlayWS}} - 2.5.0 + 2.11.0 {{#useRxJava2}} 2.1.1 {{/useRxJava2}} @@ -397,14 +403,16 @@ {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 1.4.0 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} 1.0.1 - 4.13.1 + 5.10.3 diff --git a/sdks/java-v1/templates/libraries/vertx/ApiClient.mustache b/sdks/java-v1/templates/libraries/vertx/ApiClient.mustache index b3668e995..6607107ab 100644 --- a/sdks/java-v1/templates/libraries/vertx/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/vertx/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import {{invokerPackage}}.auth.Authentication; @@ -34,12 +36,7 @@ import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import java.text.DateFormat; import java.util.*; @@ -98,8 +95,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). this.authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -685,54 +682,54 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private final Map authentications = new LinkedHashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String username, String password) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String username, String password) { HttpBasicAuth auth = new HttpBasicAuth(); auth.setUsername(username); auth.setPassword(password); authentications.put("{{name}}", auth); - }{{/isBasicBasic}}{{^isBasicBasic}} + }{{/isBasicBasic}}{{#isBasicBearer}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String bearerToken) { HttpBearerAuth auth = new HttpBearerAuth("{{scheme}}"); auth.setBearerToken(bearerToken); authentications.put("{{name}}", auth); - }{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + }{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String apikey, String apiKeyPrefix) { ApiKeyAuth auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}},"{{keyParamName}}"); auth.setApiKey(apikey); auth.setApiKeyPrefix(apiKeyPrefix); authentications.put("{{name}}", auth); }{{/isApiKey}}{{#isOAuth}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String accessToken) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String accessToken) { OAuth auth = new OAuth(); auth.setAccessToken(accessToken); authentications.put("{{name}}", auth); }{{/isOAuth}}{{/authMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}(String username, String password) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}(String username, String password) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(username, password); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(username, password); return authInfo; - }{{/isBasicBasic}}{{^isBasicBasic}} + }{{/isBasicBasic}}{{#isBasicBearer}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String bearerToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(bearerToken); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(bearerToken); return authInfo; - }{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + }{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String apikey, String apiKeyPrefix) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(apikey, apiKeyPrefix); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(apikey, apiKeyPrefix); return authInfo; }{{/isApiKey}}{{#isOAuth}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String accessToken) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String accessToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(accessToken); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(accessToken); return authInfo; }{{/isOAuth}}{{/authMethods}} } diff --git a/sdks/java-v1/templates/libraries/vertx/Configuration.mustache b/sdks/java-v1/templates/libraries/vertx/Configuration.mustache index 17710ae16..5f26ea84b 100644 --- a/sdks/java-v1/templates/libraries/vertx/Configuration.mustache +++ b/sdks/java-v1/templates/libraries/vertx/Configuration.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import io.vertx.core.Vertx; @@ -6,6 +8,7 @@ import io.vertx.core.json.JsonObject; import java.util.Objects; public class Configuration { + public static final String VERSION = "{{{artifactVersion}}}"; private static ApiClient defaultApiClient = null; diff --git a/sdks/java-v1/templates/libraries/vertx/apiException.mustache b/sdks/java-v1/templates/libraries/vertx/apiException.mustache index 6e9bbdbb8..9ce810156 100644 --- a/sdks/java-v1/templates/libraries/vertx/apiException.mustache +++ b/sdks/java-v1/templates/libraries/vertx/apiException.mustache @@ -8,6 +8,8 @@ import io.vertx.core.MultiMap; {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private MultiMap responseHeaders = null; private String responseBody = null; diff --git a/sdks/java-v1/templates/libraries/vertx/api_test.mustache b/sdks/java-v1/templates/libraries/vertx/api_test.mustache index 5eb2ec727..1469d11fb 100644 --- a/sdks/java-v1/templates/libraries/vertx/api_test.mustache +++ b/sdks/java-v1/templates/libraries/vertx/api_test.mustache @@ -6,11 +6,10 @@ package {{package}}; import {{invokerPackage}}.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -21,34 +20,28 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} /** * API tests for {{classname}} */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class {{classname}}Test { private {{classname}} api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new {{classname}}Impl(); } - {{#operations}}{{#operation}} + + {{#operations}} + {{#operation}} /** * {{summary}} * {{notes}} @@ -66,5 +59,6 @@ public class {{classname}}Test { async.complete(); }); } - {{/operation}}{{/operations}} + {{/operation}} + {{/operations}} } diff --git a/sdks/java-v1/templates/libraries/vertx/build.gradle.mustache b/sdks/java-v1/templates/libraries/vertx/build.gradle.mustache index bc33a0774..0e8fd590c 100644 --- a/sdks/java-v1/templates/libraries/vertx/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/vertx/build.gradle.mustache @@ -30,17 +30,14 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" - vertx_version = "3.4.2" - junit_version = "4.13.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + vertx_version = "3.5.2" + junit_version = "5.10.3" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} } dependencies { @@ -54,16 +51,11 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:jackson_threeten_version" - {{/threetenbp}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testImplementation "io.vertx:vertx-unit:$vertx_version" } diff --git a/sdks/java-v1/templates/libraries/vertx/pom.mustache b/sdks/java-v1/templates/libraries/vertx/pom.mustache index 2306edbfe..b9b44cd85 100644 --- a/sdks/java-v1/templates/libraries/vertx/pom.mustache +++ b/sdks/java-v1/templates/libraries/vertx/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 2.12 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest @@ -151,15 +151,10 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -211,11 +206,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -266,20 +270,11 @@ ${jackson-version} {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - 2.9.10 - - {{/threetenbp}} jakarta.annotation jakarta.annotation-api @@ -289,8 +284,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -304,12 +299,22 @@ UTF-8 - 3.4.2 - 1.5.22 - 2.10.5 - 2.10.5.1 - 0.2.2 + 3.5.2 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.17.1 + 2.17.1 + 0.2.6 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 - 4.13.1 + {{/useJakartaEe}} + 5.10.3 diff --git a/sdks/java-v1/templates/libraries/webclient/ApiClient.mustache b/sdks/java-v1/templates/libraries/webclient/ApiClient.mustache index 2fa35f524..9072a8859 100644 --- a/sdks/java-v1/templates/libraries/webclient/ApiClient.mustache +++ b/sdks/java-v1/templates/libraries/webclient/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -6,8 +8,6 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -45,7 +45,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; @@ -62,15 +61,10 @@ import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; -import javax.annotation.Nullable; +import {{javaxPackage}}.annotation.Nullable; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import {{invokerPackage}}.auth.Authentication; @@ -160,8 +154,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { protected void init() { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -522,7 +516,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return boolean true if the MediaType represents JSON, false otherwise */ public boolean isJsonMime(MediaType mediaType) { - return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$")); + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); } /** diff --git a/sdks/java-v1/templates/libraries/webclient/api.mustache b/sdks/java-v1/templates/libraries/webclient/api.mustache index 166a4fbcd..65600dbfc 100644 --- a/sdks/java-v1/templates/libraries/webclient/api.mustache +++ b/sdks/java-v1/templates/libraries/webclient/api.mustache @@ -4,15 +4,18 @@ import {{invokerPackage}}.ApiClient; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.stream.Collectors; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; @@ -94,11 +97,10 @@ public class {{classname}} { final MultiValueMap formParams = new LinkedMultiValueMap(); {{#hasQueryParams}} - {{#queryParams}} - queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); - {{/queryParams}} - {{/hasQueryParams}} - {{#hasHeaderParams}} + {{#queryParams}}{{#isExplode}}{{#hasVars}}{{#vars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}}{{/hasVars}}{{^hasVars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/hasVars}}{{/isExplode}}{{^isExplode}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} {{#headerParams}} if ({{paramName}} != null) @@ -131,7 +133,7 @@ public class {{classname}} { String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - {{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} + {{#returnType}}ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}> localVarReturnType = new ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } @@ -147,14 +149,43 @@ public class {{classname}} { * @see {{summary}} Documentation {{/externalDocs}} */ - public {{#returnType}}{{#isArray}}Flux<{{{returnBaseType}}}>{{/isArray}}{{^isArray}}Mono<{{{returnType}}}>{{/isArray}} {{/returnType}}{{^returnType}}Mono {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { - {{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} - return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#isArray}}bodyToFlux{{/isArray}}{{^isArray}}bodyToMono{{/isArray}}(localVarReturnType); + public {{#returnType}}{{#vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}}{{^vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}Flux<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}Mono<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}} {{/returnType}}{{^returnType}}{{#vendorExtensions.x-webclient-blocking}}void{{/vendorExtensions.x-webclient-blocking}}{{^vendorExtensions.x-webclient-blocking}}Mono{{/vendorExtensions.x-webclient-blocking}} {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}> localVarReturnType = new ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} + {{^returnType}}{{^vendorExtensions.x-webclient-blocking}}return {{/vendorExtensions.x-webclient-blocking}}{{/returnType}}{{#returnType}}return {{/returnType}}{{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#vendorExtensions.x-webclient-return-except-list-of-string}}bodyToFlux{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}bodyToMono{{/vendorExtensions.x-webclient-return-except-list-of-string}}(localVarReturnType){{#vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}.block(){{/vendorExtensions.x-webclient-blocking}}; + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return ResponseEntity<{{.}}> +{{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#vendorExtensions.x-webclient-blocking}}{{#returnType}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}ResponseEntity>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}ResponseEntity<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/returnType}}{{^returnType}}ResponseEntity{{/returnType}} {{/vendorExtensions.x-webclient-blocking}}{{^vendorExtensions.x-webclient-blocking}}{{#returnType}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}Mono>>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}Mono>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/returnType}}{{^returnType}}Mono>{{/returnType}} {{/vendorExtensions.x-webclient-blocking}}{{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}> localVarReturnType = new ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#vendorExtensions.x-webclient-return-except-list-of-string}}toEntityList{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}toEntity{{/vendorExtensions.x-webclient-return-except-list-of-string}}(localVarReturnType){{#vendorExtensions.x-webclient-blocking}}.block(){{/vendorExtensions.x-webclient-blocking}}; } - public {{#returnType}}{{#isArray}}Mono>>{{/isArray}}{{^isArray}}Mono>{{/isArray}} {{/returnType}}{{^returnType}}Mono> {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { - {{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} - return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#isArray}}toEntityList{{/isArray}}{{^isArray}}toEntity{{/isArray}}(localVarReturnType); + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}} + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public ResponseSpec {{operationId}}WithResponseSpec({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } {{/operation}} } diff --git a/sdks/java-v1/templates/libraries/webclient/api_test.mustache b/sdks/java-v1/templates/libraries/webclient/api_test.mustache index b9aea5320..c5d568617 100644 --- a/sdks/java-v1/templates/libraries/webclient/api_test.mustache +++ b/sdks/java-v1/templates/libraries/webclient/api_test.mustache @@ -4,21 +4,25 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); @@ -31,10 +35,11 @@ public class {{classname}}Test { */ @Test public void {{operationId}}Test() { + // uncomment below to test the function {{#allParams}} - {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; + //{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#isArray}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/isArray}}{{^isArray}}.block(){{/isArray}}; + //{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{^vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}.block(){{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}}; // TODO: test validations } diff --git a/sdks/java-v1/templates/libraries/webclient/auth/ApiKeyAuth.mustache b/sdks/java-v1/templates/libraries/webclient/auth/ApiKeyAuth.mustache index 857403b27..d32930336 100644 --- a/sdks/java-v1/templates/libraries/webclient/auth/ApiKeyAuth.mustache +++ b/sdks/java-v1/templates/libraries/webclient/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/sdks/java-v1/templates/libraries/webclient/auth/Authentication.mustache b/sdks/java-v1/templates/libraries/webclient/auth/Authentication.mustache index 8e53c2ba0..0636a6d96 100644 --- a/sdks/java-v1/templates/libraries/webclient/auth/Authentication.mustache +++ b/sdks/java-v1/templates/libraries/webclient/auth/Authentication.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/sdks/java-v1/templates/libraries/webclient/auth/HttpBasicAuth.mustache b/sdks/java-v1/templates/libraries/webclient/auth/HttpBasicAuth.mustache index 5b07cb907..fba126558 100644 --- a/sdks/java-v1/templates/libraries/webclient/auth/HttpBasicAuth.mustache +++ b/sdks/java-v1/templates/libraries/webclient/auth/HttpBasicAuth.mustache @@ -1,10 +1,11 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; +import java.util.Base64; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} @@ -34,6 +35,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64Utils.encodeToString(str.getBytes(StandardCharsets.UTF_8))); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); } } diff --git a/sdks/java-v1/templates/libraries/webclient/auth/HttpBearerAuth.mustache b/sdks/java-v1/templates/libraries/webclient/auth/HttpBearerAuth.mustache index 027c128f4..45931f953 100644 --- a/sdks/java-v1/templates/libraries/webclient/auth/HttpBearerAuth.mustache +++ b/sdks/java-v1/templates/libraries/webclient/auth/HttpBearerAuth.mustache @@ -1,10 +1,8 @@ -package {{invokerPackage}}.auth; +{{>licenseInfo}} -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; +package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} diff --git a/sdks/java-v1/templates/libraries/webclient/auth/OAuth.mustache b/sdks/java-v1/templates/libraries/webclient/auth/OAuth.mustache index 7889f1582..1e1e6247c 100644 --- a/sdks/java-v1/templates/libraries/webclient/auth/OAuth.mustache +++ b/sdks/java-v1/templates/libraries/webclient/auth/OAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/sdks/java-v1/templates/libraries/webclient/auth/OAuthFlow.mustache b/sdks/java-v1/templates/libraries/webclient/auth/OAuthFlow.mustache index 7ab35f6d8..759f354f5 100644 --- a/sdks/java-v1/templates/libraries/webclient/auth/OAuthFlow.mustache +++ b/sdks/java-v1/templates/libraries/webclient/auth/OAuthFlow.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; public enum OAuthFlow { diff --git a/sdks/java-v1/templates/libraries/webclient/build.gradle.mustache b/sdks/java-v1/templates/libraries/webclient/build.gradle.mustache index 8481b945b..597411638 100644 --- a/sdks/java-v1/templates/libraries/webclient/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/webclient/build.gradle.mustache @@ -32,14 +32,14 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} } // Rename the aar correctly @@ -63,16 +63,16 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -84,14 +84,14 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} publishing { publications { @@ -103,17 +103,17 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } @@ -124,26 +124,46 @@ if(hasProperty('target') && target == 'android') { } ext { + {{#swagger1AnnotationLibrary}} swagger_annotations_version = "1.6.3" - spring_web_version = "2.4.3" - jackson_version = "2.11.4" - jackson_databind_version = "2.11.4" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + {{#useJakartaEe}} + spring_boot_version = "3.0.12" + jakarta_annotation_version = "2.1.1" + reactor_version = "3.5.12" + reactor_netty_version = "1.1.13" + {{/useJakartaEe}} + {{^useJakartaEe}} + spring_boot_version = "2.7.17" + jakarta_annotation_version = "1.3.5" + reactor_version = "3.4.34" + reactor_netty_version = "1.0.39" + {{/useJakartaEe}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" - reactor_version = "3.4.3" - reactor_netty_version = "0.7.15.RELEASE" + {{#joda}} jodatime_version = "2.9.9" - junit_version = "4.13.1" + {{/joda}} + junit_version = "5.10.2" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.projectreactor:reactor-core:$reactor_version" - implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_web_version" - implementation "io.projectreactor.ipc:reactor-netty:$reactor_netty_version" + implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" + implementation "io.projectreactor.netty:reactor-netty-http:$reactor_netty_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" @@ -154,12 +174,7 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/sdks/java-v1/templates/libraries/webclient/pom.mustache b/sdks/java-v1/templates/libraries/webclient/pom.mustache index b5e01dff5..4180b2d5f 100644 --- a/sdks/java-v1/templates/libraries/webclient/pom.mustache +++ b/sdks/java-v1/templates/libraries/webclient/pom.mustache @@ -43,16 +43,22 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.13.0 + {{#useJakartaEe}} + 17 + 17 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.8 1.8 + {{/useJakartaEe}} org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -66,11 +72,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -89,12 +104,12 @@ org.springframework.boot spring-boot-starter-webflux - ${spring-web-version} + ${spring-boot-version} - io.projectreactor.ipc - reactor-netty + io.projectreactor.netty + reactor-netty-http ${reactor-netty-version} @@ -112,13 +127,11 @@ {{/openApiNullable}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype @@ -140,25 +153,38 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.6.3 - 2.4.3 - 2.11.3 - 2.11.4 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.17.1 + 2.17.1 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} + {{#useJakartaEe}} + 3.0.12 + 2.1.1 + 3.5.12 + 1.1.13 + {{/useJakartaEe}} + {{^useJakartaEe}} + 2.7.17 1.3.5 - 4.13.1 - 3.4.3 - 0.7.15.RELEASE + 3.4.34 + 1.0.39 + {{/useJakartaEe}} + 5.10.2 {{#joda}} 2.9.9 {{/joda}} diff --git a/sdks/java-v1/templates/maven.yml.mustache b/sdks/java-v1/templates/maven.yml.mustache new file mode 100644 index 000000000..69ad41543 --- /dev/null +++ b/sdks/java-v1/templates/maven.yml.mustache @@ -0,0 +1,31 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build {{{appName}}} + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + {{=< >=}} + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/sdks/java-v1/templates/model.mustache b/sdks/java-v1/templates/model.mustache index 0c4d165f6..b50416793 100644 --- a/sdks/java-v1/templates/model.mustache +++ b/sdks/java-v1/templates/model.mustache @@ -25,21 +25,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} -import javax.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.adapters.*; +import io.github.threetenjaxb.core.*; {{/withXml}} {{#jsonb}} import java.lang.reflect.Type; -import javax.json.bind.annotation.JsonbTypeDeserializer; -import javax.json.bind.annotation.JsonbTypeSerializer; -import javax.json.bind.serializer.DeserializationContext; -import javax.json.bind.serializer.JsonbDeserializer; -import javax.json.bind.serializer.JsonbSerializer; -import javax.json.bind.serializer.SerializationContext; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.bind.annotation.JsonbProperty; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{javaxPackage}}.json.bind.serializer.DeserializationContext; +import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer; +import {{javaxPackage}}.json.bind.serializer.JsonbSerializer; +import {{javaxPackage}}.json.bind.serializer.SerializationContext; +import {{javaxPackage}}.json.stream.JsonGenerator; +import {{javaxPackage}}.json.stream.JsonParser; +import {{javaxPackage}}.json.bind.annotation.JsonbProperty; {{#vendorExtensions.x-has-readonly-properties}} -import javax.json.bind.annotation.JsonbCreator; +import {{javaxPackage}}.json.bind.annotation.JsonbCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jsonb}} {{#parcelableModel}} @@ -47,12 +49,17 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; {{/performBeanValidation}} +{{#supportUrlQuery}} +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; +{{/supportUrlQuery}} {{#models}} {{#model}} diff --git a/sdks/java-v1/templates/modelEnum.mustache b/sdks/java-v1/templates/modelEnum.mustache index f81c7c93f..d1ba359d9 100644 --- a/sdks/java-v1/templates/modelEnum.mustache +++ b/sdks/java-v1/templates/modelEnum.mustache @@ -9,6 +9,9 @@ import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; {{/gson}} +{{#isUri}} +import java.net.URI; +{{/isUri}} /** * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} @@ -56,28 +59,29 @@ import com.google.gson.stream.JsonWriter; {{/jackson}} public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (b.value.equals(value)) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } {{#gson}} public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { @Override public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); } @Override public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { - {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; - return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}}{{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } {{/gson}} {{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { @@ -97,4 +101,20 @@ import com.google.gson.stream.JsonWriter; } } {{/jsonb}} +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +{{/supportUrlQuery}} } diff --git a/sdks/java-v1/templates/modelInnerEnum.mustache b/sdks/java-v1/templates/modelInnerEnum.mustache index a9c99783f..0096d8407 100644 --- a/sdks/java-v1/templates/modelInnerEnum.mustache +++ b/sdks/java-v1/templates/modelInnerEnum.mustache @@ -51,23 +51,23 @@ {{/jackson}} public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (b.value.equals(value)) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } {{#gson}} public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { @Override public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); } @Override public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { - {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isInteger}}{{/isNumber}}; + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} {{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } diff --git a/sdks/java-v1/templates/model_test.mustache b/sdks/java-v1/templates/model_test.mustache index 07468db56..931a5da03 100644 --- a/sdks/java-v1/templates/model_test.mustache +++ b/sdks/java-v1/templates/model_test.mustache @@ -4,21 +4,14 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - -{{#fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for {{classname}} */ -public class {{classname}}Test { +class {{classname}}Test { {{#models}} {{#model}} {{^vendorExtensions.x-is-one-of-interface}} @@ -30,7 +23,7 @@ public class {{classname}}Test { * Model tests for {{classname}} */ @Test - public void test{{classname}}() { + void test{{classname}}() { // TODO: test {{classname}} } @@ -39,7 +32,7 @@ public class {{classname}}Test { * Test the property '{{name}}' */ @Test - public void {{name}}Test() { + void {{name}}Test() { // TODO: test {{name}} } diff --git a/sdks/java-v1/templates/oneof_interface.mustache b/sdks/java-v1/templates/oneof_interface.mustache index 02deb483d..d67277274 100644 --- a/sdks/java-v1/templates/oneof_interface.mustache +++ b/sdks/java-v1/templates/oneof_interface.mustache @@ -1,4 +1,4 @@ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}} +{{>additionalOneOfTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}} public interface {{classname}} {{#vendorExtensions.x-implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { {{#discriminator}} public {{propertyType}} {{propertyGetter}}(); diff --git a/sdks/java-v1/templates/pojo.mustache b/sdks/java-v1/templates/pojo.mustache index 7ca5cedee..05be7e5c5 100644 --- a/sdks/java-v1/templates/pojo.mustache +++ b/sdks/java-v1/templates/pojo.mustache @@ -2,17 +2,33 @@ * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) +{{#isClassnameSanitized}} +{{^hasDiscriminatorWithNonEmptyMapping}} @JsonTypeName("{{name}}") +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -36,65 +52,87 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{^isXmlAttribute}} + {{#isDateTime}} + @XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class) + {{/isDateTime}} + {{/isXmlAttribute}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); {{/isContainer}} {{^isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{^isContainer}} - {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} - public {{classname}}() { {{#parent}}{{#parcelableModel}} - super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} - this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} - }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} - + public {{classname}}() { + {{#parent}} + {{#parcelableModel}} + super();{{/parcelableModel}} + {{/parent}} + {{#gson}} + {{#discriminator}} + {{#discriminator.isEnum}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator.isEnum}} + {{/discriminator}} + {{/gson}} + } + {{#vendorExtensions.x-has-readonly-properties}} + {{^withXml}} + /** + * Constructor with only readonly parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}} + */ {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} public {{classname}}( {{#readOnlyVars}} - {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} {{/readOnlyVars}} ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} - }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} + } + {{/withXml}} + {{/vendorExtensions.x-has-readonly-properties}} +{{#vendorExtensions.x-java-all-args-constructor}} + + /** + * Constructor with all args parameters + */ + public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) { +{{#parent}} + super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}}); +{{/parent}} {{#vars}} + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; +{{/vars}} + } +{{/vendorExtensions.x-java-all-args-constructor}} +{{#vars}} {{^isReadOnly}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -103,10 +141,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -116,11 +154,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -128,10 +164,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -143,7 +179,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{^vendorExtensions.x-is-jackson-optional-nullable}} {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } {{/required}} this.{{name}}.put(key, {{name}}Item); @@ -153,7 +189,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -170,25 +206,33 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} {{#required}} {{#isNullable}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/isNullable}} {{^isNullable}} - @javax.annotation.Nonnull + @{{javaxPackage}}.annotation.Nonnull {{/isNullable}} {{/required}} {{^required}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/required}} {{#jsonb}} @JsonbProperty("{{baseName}}") {{/jsonb}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -237,7 +281,23 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isReadOnly}} {{/vars}} + {{#parent}} + {{#readWriteVars}} + {{#isOverridden}} + @Override + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}(JsonNullable.<{{{datatypeWithEnum}}}>of({{name}})); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{/isOverridden}} + {{/readWriteVars}} + {{/parent}} @Override public boolean equals(Object o) { {{#useReflectionEqualsHashCode}} @@ -287,7 +347,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} sb.append("}"); return sb.toString(); @@ -303,7 +363,200 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } return o.toString().replace("\n", "\n "); } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#allVars}} + // add `{{baseName}}` to the URL query string + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{^items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + {{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/items.isModel}} + {{#items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + if ({{getter}}().get(_key) != null) { + joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isModel}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if ({{getter}}() != null) { + joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + {{/allVars}} + return joiner.toString(); + } +{{/supportUrlQuery}} {{#parcelableModel}} public void writeToParcel(Parcel out, int flags) { @@ -363,4 +616,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } }; {{/parcelableModel}} +{{#generateBuilders}} + + {{>javaBuilder}} +{{/generateBuilders}} + } diff --git a/sdks/java-v1/templates/pojo_doc.mustache b/sdks/java-v1/templates/pojo_doc.mustache index 2c4eac3d5..1617ec546 100644 --- a/sdks/java-v1/templates/pojo_doc.mustache +++ b/sdks/java-v1/templates/pojo_doc.mustache @@ -1,22 +1,40 @@ # {{#vendorExtensions.x-is-one-of-interface}}Interface {{/vendorExtensions.x-is-one-of-interface}}{{classname}} +{{^useCustomTemplateCode}} +{{#description}}{{&description}} +{{/description}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{unescapedDescription}} +{{/useCustomTemplateCode}} {{^vendorExtensions.x-is-one-of-interface}} ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +{{^useCustomTemplateCode}} +{{#vars}}|**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} | +{{/vars}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#vars}}| `{{name}}`{{#required}}*_required_{{/required}} | {{#isEnum}}[```{{datatypeWithEnum}}```](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}```{{baseType}}{{#items}}<{{dataType}}>```{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}```Map```{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}```{{dataType}}```{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{#isReadOnly}} [readonly]{{/isReadOnly}} | {{/vars}} +{{/useCustomTemplateCode}} {{#vars}}{{#isEnum}} ## Enum: {{datatypeWithEnum}} -Name | Value +| Name | Value | +{{^useCustomTemplateCode}} +|---- | -----|{{#allowableValues}}{{#enumVars}} +| {{name}} | {{value}} |{{/enumVars}}{{/allowableValues}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ---- | -----{{#allowableValues}}{{#enumVars}} | {{name}} | {{value}} |{{/enumVars}}{{/allowableValues}} +{{/useCustomTemplateCode}} {{/isEnum}}{{/vars}} {{#vendorExtensions.x-implements.0}} diff --git a/sdks/java-v1/templates/pom.mustache b/sdks/java-v1/templates/pom.mustache index 5705ea7df..b733ab9bb 100644 --- a/sdks/java-v1/templates/pom.mustache +++ b/sdks/java-v1/templates/pom.mustache @@ -45,6 +45,8 @@ maven-compiler-plugin 3.8.1 + 1.8 + 1.8 true 128m 512m @@ -80,16 +82,24 @@ maven-surefire-plugin 2.12 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin @@ -154,33 +164,13 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} - - org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -232,11 +222,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -272,13 +271,22 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} + {{^useJakartaEe}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + {{/useJakartaEe}} + {{#useJakartaEe}} + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{/useJakartaEe}} {{#withXml}} @@ -296,28 +304,11 @@ ${jackson-version} {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} - {{^java8}} - - - com.brsanthu - migbase64 - 2.2 - - {{/java8}} {{#useBeanValidation}} @@ -352,25 +343,40 @@ - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + UTF-8 - 1.6.3 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} 1.19.4 - 2.12.5 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + 2.17.1 + 2.17.1 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} 1.0.0 - 4.13.1 + 5.10.2 + 1.10.0 diff --git a/sdks/java-v1/templates/typeInfoAnnotation.mustache b/sdks/java-v1/templates/typeInfoAnnotation.mustache index 63eb42ea5..c21efb490 100644 --- a/sdks/java-v1/templates/typeInfoAnnotation.mustache +++ b/sdks/java-v1/templates/typeInfoAnnotation.mustache @@ -1,6 +1,21 @@ {{#jackson}} +@JsonIgnoreProperties( +{{^useCustomTemplateCode}} + value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + allowSetters = true, // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization + ignoreUnknown = true +{{/useCustomTemplateCode}} +) +{{^useCustomTemplateCode}} +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +{{/useCustomTemplateCode}} {{#discriminator.mappedModels}} {{#-first}} @JsonSubTypes({ @@ -10,7 +25,4 @@ }) {{/-last}} {{/discriminator.mappedModels}} -{{#isClassnameSanitized}} -@JsonTypeName("{{name}}") -{{/isClassnameSanitized}} {{/jackson}} diff --git a/sdks/java-v2/.github/workflows/maven.yml b/sdks/java-v2/.github/workflows/maven.yml index 37d2b8165..3d1ea7455 100644 --- a/sdks/java-v2/.github/workflows/maven.yml +++ b/sdks/java-v2/.github/workflows/maven.yml @@ -17,11 +17,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: 'temurin' diff --git a/sdks/java-v2/.gitignore b/sdks/java-v2/.gitignore index b6717f0ee..e275017bf 100644 --- a/sdks/java-v2/.gitignore +++ b/sdks/java-v2/.gitignore @@ -8,8 +8,6 @@ *.war *.ear -# exclude jar for gradle wrapper -!gradle/wrapper/*.jar # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* @@ -18,12 +16,11 @@ hs_err_pid* **/target target .gradle -build/ +build .composer vendor - -# Intellij .idea/ - .openapi-generator +.github/workflows/maven.yml +gradle diff --git a/sdks/java-v2/README.md b/sdks/java-v2/README.md index 2453f49d3..75edf1dcb 100644 --- a/sdks/java-v2/README.md +++ b/sdks/java-v2/README.md @@ -56,7 +56,7 @@ Add this dependency to your project's POM: com.dropbox.sign dropbox-sign - 2.1-dev + 2.2-dev compile ``` @@ -72,7 +72,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.dropbox.sign:dropbox-sign:2.1-dev" + implementation "com.dropbox.sign:dropbox-sign:2.2-dev" } ``` @@ -86,7 +86,7 @@ mvn clean package Then manually install the following JARs: -- `target/dropbox-sign-2.1-dev.jar` +- `target/dropbox-sign-2.2-dev.jar` - `target/lib/*.jar` ## Getting Started @@ -133,32 +133,6 @@ public class Example { ``` - ## Using a Proxy - - To add a HTTP proxy for the API client, use `ClientConfig`: - - ```java - - import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; - import org.glassfish.jersey.client.ClientConfig; - import org.glassfish.jersey.client.ClientProperties; - import com.dropbox.sign.*; - import com.dropbox.sign.api.AccountApi; - - ... - - ApiClient defaultClient = Configuration.getDefaultApiClient(); - ClientConfig clientConfig = defaultClient.getClientConfig(); - clientConfig.connectorProvider(new ApacheConnectorProvider()); - clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); - clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); - clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); - defaultClient.setClientConfig(clientConfig); - - AccountApi apiInstance = new AccountApi(defaultClient); - - ``` - ## Documentation for API Endpoints @@ -179,6 +153,13 @@ 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 +*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 +*FaxLineApi* | [**faxLineDelete**](docs/FaxLineApi.md#faxLineDelete) | **DELETE** /fax_line | Delete Fax Line +*FaxLineApi* | [**faxLineGet**](docs/FaxLineApi.md#faxLineGet) | **GET** /fax_line | Get Fax Line +*FaxLineApi* | [**faxLineList**](docs/FaxLineApi.md#faxLineList) | **GET** /fax_line/list | List Fax Lines +*FaxLineApi* | [**faxLineRemoveUser**](docs/FaxLineApi.md#faxLineRemoveUser) | **PUT** /fax_line/remove_user | Remove Fax Line Access *OAuthApi* | [**oauthTokenGenerate**](docs/OAuthApi.md#oauthTokenGenerate) | **POST** /oauth/token | OAuth Token Generate *OAuthApi* | [**oauthTokenRefresh**](docs/OAuthApi.md#oauthTokenRefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh *ReportApi* | [**reportCreate**](docs/ReportApi.md#reportCreate) | **POST** /report/create | Create Report @@ -261,6 +242,17 @@ Class | Method | HTTP request | Description - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) + - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) + - [FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) + - [FaxLineAreaCodeGetResponse](docs/FaxLineAreaCodeGetResponse.md) + - [FaxLineAreaCodeGetStateEnum](docs/FaxLineAreaCodeGetStateEnum.md) + - [FaxLineCreateRequest](docs/FaxLineCreateRequest.md) + - [FaxLineDeleteRequest](docs/FaxLineDeleteRequest.md) + - [FaxLineListResponse](docs/FaxLineListResponse.md) + - [FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) + - [FaxLineResponse](docs/FaxLineResponse.md) + - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) @@ -401,18 +393,22 @@ Class | Method | HTTP request | Description - [WarningResponse](docs/WarningResponse.md) + ## Documentation for Authorization + Authentication schemes defined for the API: + ### api_key - **Type**: HTTP basic authentication + ### oauth2 -- **Type**: HTTP basic authentication +- **Type**: HTTP Bearer Token authentication (JWT) ## Recommendation @@ -429,7 +425,7 @@ apisupport@hellosign.com This Java package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: `3.0.0` - - Package version: `2.1-dev` + - Package version: `2.2-dev` - Build package: `org.openapitools.codegen.languages.JavaClientCodegen` diff --git a/sdks/java-v2/VERSION b/sdks/java-v2/VERSION index 35468ac2c..c78c4fff9 100644 --- a/sdks/java-v2/VERSION +++ b/sdks/java-v2/VERSION @@ -1 +1 @@ -2.1-dev +2.2-dev diff --git a/sdks/java-v2/build.gradle b/sdks/java-v2/build.gradle index 2f3c23340..de5f46162 100644 --- a/sdks/java-v2/build.gradle +++ b/sdks/java-v2/build.gradle @@ -1,3 +1,4 @@ + buildscript { repositories { mavenCentral() @@ -20,7 +21,7 @@ apply plugin: 'signing' group = 'com.dropbox.sign' archivesBaseName = 'dropbox-sign' -version = '2.1-dev' +version = '2.2-dev' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -116,12 +117,11 @@ publishing { ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" jakarta_annotation_version = "2.1.0" - jackson_threetenbp_version = "2.9.10" jersey_version = "3.0.4" - junit_version = "4.13.1" + junit_version = "5.8.2" mockito_version = "3.12.4" } @@ -137,12 +137,16 @@ dependencies { implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" testImplementation "org.mockito:mockito-core:$mockito_version" } +test { + useJUnitPlatform() +} javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] diff --git a/sdks/java-v2/build.sbt b/sdks/java-v2/build.sbt index 2fe727ca9..180a4e618 100644 --- a/sdks/java-v2/build.sbt +++ b/sdks/java-v2/build.sbt @@ -2,13 +2,14 @@ lazy val root = (project in file(".")). settings( organization := "com.dropbox.sign", name := "dropbox-sign", - version := "2.1-dev", + version := "2.2-dev", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), Compile / javacOptions ++= Seq("-Xlint:deprecation"), Compile / packageDoc / publishArtifact := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( + libraryDependencies += "commons-codec" % "commons-codec" % "1.15" "com.google.code.findbugs" % "jsr305" % "3.0.0", "io.swagger" % "swagger-annotations" % "1.6.5", "org.glassfish.jersey.core" % "jersey-client" % "3.0.4", @@ -16,12 +17,11 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", - "junit" % "junit" % "4.13.2" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/sdks/java-v2/docs/AccountApi.md b/sdks/java-v2/docs/AccountApi.md index 6f258c3f7..494853dda 100644 --- a/sdks/java-v2/docs/AccountApi.md +++ b/sdks/java-v2/docs/AccountApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**accountCreate**](AccountApi.md#accountCreate) | **POST** /account/create | Create Account [**accountGet**](AccountApi.md#accountGet) | **GET** /account | Get Account [**accountUpdate**](AccountApi.md#accountUpdate) | **PUT** /account | Update Account @@ -62,8 +62,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountCreateRequest** | [**AccountCreateRequest**](AccountCreateRequest.md)| | ### Return type @@ -134,8 +134,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountId** | **String**| `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. | [optional] **emailAddress** | **String**| `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. | [optional] @@ -210,8 +210,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountUpdateRequest** | [**AccountUpdateRequest**](AccountUpdateRequest.md)| | ### Return type @@ -285,8 +285,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountVerifyRequest** | [**AccountVerifyRequest**](AccountVerifyRequest.md)| | ### Return type diff --git a/sdks/java-v2/docs/AccountCreateRequest.md b/sdks/java-v2/docs/AccountCreateRequest.md index a10ed0814..9c75292a7 100644 --- a/sdks/java-v2/docs/AccountCreateRequest.md +++ b/sdks/java-v2/docs/AccountCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```String``` | The email address which will be associated with the new Account. | | | `clientId` | ```String``` | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | | | `clientSecret` | ```String``` | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | | diff --git a/sdks/java-v2/docs/AccountCreateResponse.md b/sdks/java-v2/docs/AccountCreateResponse.md index 59279d18d..7e09def2b 100644 --- a/sdks/java-v2/docs/AccountCreateResponse.md +++ b/sdks/java-v2/docs/AccountCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `account` | [```AccountResponse```](AccountResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `oauthData` | [```OAuthTokenResponse```](OAuthTokenResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/AccountGetResponse.md b/sdks/java-v2/docs/AccountGetResponse.md index 41508ab37..f5ed78b06 100644 --- a/sdks/java-v2/docs/AccountGetResponse.md +++ b/sdks/java-v2/docs/AccountGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `account` | [```AccountResponse```](AccountResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/AccountResponse.md b/sdks/java-v2/docs/AccountResponse.md index e76348752..5b73aa02d 100644 --- a/sdks/java-v2/docs/AccountResponse.md +++ b/sdks/java-v2/docs/AccountResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The ID of the Account | | | `emailAddress` | ```String``` | The email address associated with the Account. | | | `isLocked` | ```Boolean``` | Returns `true` if the user has been locked out of their account by a team admin. | | diff --git a/sdks/java-v2/docs/AccountResponseQuotas.md b/sdks/java-v2/docs/AccountResponseQuotas.md index c591ff814..3b7fe4e58 100644 --- a/sdks/java-v2/docs/AccountResponseQuotas.md +++ b/sdks/java-v2/docs/AccountResponseQuotas.md @@ -6,8 +6,8 @@ Details concerning remaining monthly quotas. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `apiSignatureRequestsLeft` | ```Integer``` | API signature requests remaining. | | | `documentsLeft` | ```Integer``` | Signature requests remaining. | | | `templatesTotal` | ```Integer``` | Total API templates allowed. | | diff --git a/sdks/java-v2/docs/AccountResponseUsage.md b/sdks/java-v2/docs/AccountResponseUsage.md index f9f367135..1cdb76629 100644 --- a/sdks/java-v2/docs/AccountResponseUsage.md +++ b/sdks/java-v2/docs/AccountResponseUsage.md @@ -6,8 +6,8 @@ Details concerning monthly usage ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `faxPagesSent` | ```Integer``` | Number of fax pages sent | | diff --git a/sdks/java-v2/docs/AccountUpdateRequest.md b/sdks/java-v2/docs/AccountUpdateRequest.md index d1dac210e..43121c890 100644 --- a/sdks/java-v2/docs/AccountUpdateRequest.md +++ b/sdks/java-v2/docs/AccountUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The ID of the Account | | | `callbackUrl` | ```String``` | The URL that Dropbox Sign should POST events to. | | | `locale` | ```String``` | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | | diff --git a/sdks/java-v2/docs/AccountVerifyRequest.md b/sdks/java-v2/docs/AccountVerifyRequest.md index de912c5d4..d14a8eb2b 100644 --- a/sdks/java-v2/docs/AccountVerifyRequest.md +++ b/sdks/java-v2/docs/AccountVerifyRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```String``` | Email address to run the verification for. | | diff --git a/sdks/java-v2/docs/AccountVerifyResponse.md b/sdks/java-v2/docs/AccountVerifyResponse.md index 07f01ffd1..8868f15b2 100644 --- a/sdks/java-v2/docs/AccountVerifyResponse.md +++ b/sdks/java-v2/docs/AccountVerifyResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `account` | [```AccountVerifyResponseAccount```](AccountVerifyResponseAccount.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/AccountVerifyResponseAccount.md b/sdks/java-v2/docs/AccountVerifyResponseAccount.md index efa24dcb4..f83f9f0eb 100644 --- a/sdks/java-v2/docs/AccountVerifyResponseAccount.md +++ b/sdks/java-v2/docs/AccountVerifyResponseAccount.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress` | ```String``` | The email address associated with the Account. | | diff --git a/sdks/java-v2/docs/ApiAppApi.md b/sdks/java-v2/docs/ApiAppApi.md index a22cd2e7c..02630c9d7 100644 --- a/sdks/java-v2/docs/ApiAppApi.md +++ b/sdks/java-v2/docs/ApiAppApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**apiAppCreate**](ApiAppApi.md#apiAppCreate) | **POST** /api_app | Create API App [**apiAppDelete**](ApiAppApi.md#apiAppDelete) | **DELETE** /api_app/{client_id} | Delete API App [**apiAppGet**](ApiAppApi.md#apiAppGet) | **GET** /api_app/{client_id} | Get API App @@ -80,8 +80,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **apiAppCreateRequest** | [**ApiAppCreateRequest**](ApiAppCreateRequest.md)| | ### Return type @@ -152,8 +152,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **clientId** | **String**| The client id of the API App to delete. | ### Return type @@ -226,8 +226,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **clientId** | **String**| The client id of the API App to retrieve. | ### Return type @@ -301,8 +301,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **page** | **Integer**| Which page number of the API App List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -396,8 +396,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **clientId** | **String**| The client id of the API App to update. | **apiAppUpdateRequest** | [**ApiAppUpdateRequest**](ApiAppUpdateRequest.md)| | diff --git a/sdks/java-v2/docs/ApiAppCreateRequest.md b/sdks/java-v2/docs/ApiAppCreateRequest.md index 59c20286d..b787bc7c0 100644 --- a/sdks/java-v2/docs/ApiAppCreateRequest.md +++ b/sdks/java-v2/docs/ApiAppCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `domains`*_required_ | ```List``` | The domain names the ApiApp will be associated with. | | | `name`*_required_ | ```String``` | The name you want to assign to the ApiApp. | | | `callbackUrl` | ```String``` | The URL at which the ApiApp should receive event callbacks. | | diff --git a/sdks/java-v2/docs/ApiAppGetResponse.md b/sdks/java-v2/docs/ApiAppGetResponse.md index b90c30a5f..98e2f98d6 100644 --- a/sdks/java-v2/docs/ApiAppGetResponse.md +++ b/sdks/java-v2/docs/ApiAppGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `apiApp` | [```ApiAppResponse```](ApiAppResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `apiApp`*_required_ | [```ApiAppResponse```](ApiAppResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/ApiAppListResponse.md b/sdks/java-v2/docs/ApiAppListResponse.md index 144b0f45b..14c287f97 100644 --- a/sdks/java-v2/docs/ApiAppListResponse.md +++ b/sdks/java-v2/docs/ApiAppListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `apiApps` | [```List```](ApiAppResponse.md) | Contains information about API Apps. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `apiApps`*_required_ | [```List```](ApiAppResponse.md) | Contains information about API Apps. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/ApiAppResponse.md b/sdks/java-v2/docs/ApiAppResponse.md index bb0836dbf..afe95c850 100644 --- a/sdks/java-v2/docs/ApiAppResponse.md +++ b/sdks/java-v2/docs/ApiAppResponse.md @@ -6,8 +6,8 @@ Contains information about an API App. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The app's callback URL (for events) | | | `clientId` | ```String``` | The app's client id | | | `createdAt` | ```Integer``` | The time that the app was created | | diff --git a/sdks/java-v2/docs/ApiAppResponseOAuth.md b/sdks/java-v2/docs/ApiAppResponseOAuth.md index 20c678a7b..c2f705c7a 100644 --- a/sdks/java-v2/docs/ApiAppResponseOAuth.md +++ b/sdks/java-v2/docs/ApiAppResponseOAuth.md @@ -6,8 +6,8 @@ An object describing the app's OAuth properties, or null if OAuth is not con ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The app's OAuth callback URL. | | | `secret` | ```String``` | The app's OAuth secret, or null if the app does not belong to user. | | | `scopes` | ```List``` | Array of OAuth scopes used by the app. | | diff --git a/sdks/java-v2/docs/ApiAppResponseOptions.md b/sdks/java-v2/docs/ApiAppResponseOptions.md index 827b3b51a..07979f387 100644 --- a/sdks/java-v2/docs/ApiAppResponseOptions.md +++ b/sdks/java-v2/docs/ApiAppResponseOptions.md @@ -6,8 +6,8 @@ An object with options that override account settings. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `canInsertEverywhere` | ```Boolean``` | Boolean denoting if signers can "Insert Everywhere" in one click while signing a document | | diff --git a/sdks/java-v2/docs/ApiAppResponseOwnerAccount.md b/sdks/java-v2/docs/ApiAppResponseOwnerAccount.md index 0ac35eec2..b4d6d4249 100644 --- a/sdks/java-v2/docs/ApiAppResponseOwnerAccount.md +++ b/sdks/java-v2/docs/ApiAppResponseOwnerAccount.md @@ -6,8 +6,8 @@ An object describing the app's owner ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The owner account's ID | | | `emailAddress` | ```String``` | The owner account's email address | | diff --git a/sdks/java-v2/docs/ApiAppResponseWhiteLabelingOptions.md b/sdks/java-v2/docs/ApiAppResponseWhiteLabelingOptions.md index 1ed534a0c..be6d022fd 100644 --- a/sdks/java-v2/docs/ApiAppResponseWhiteLabelingOptions.md +++ b/sdks/java-v2/docs/ApiAppResponseWhiteLabelingOptions.md @@ -6,8 +6,8 @@ An object with options to customize the app's signer page ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `headerBackgroundColor` | ```String``` | | | | `legalVersion` | ```String``` | | | | `linkColor` | ```String``` | | | diff --git a/sdks/java-v2/docs/ApiAppUpdateRequest.md b/sdks/java-v2/docs/ApiAppUpdateRequest.md index 62bc8fd75..1c0efafdc 100644 --- a/sdks/java-v2/docs/ApiAppUpdateRequest.md +++ b/sdks/java-v2/docs/ApiAppUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The URL at which the API App should receive event callbacks. | | | `customLogoFile` | ```File``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | | `domains` | ```List``` | The domain names the ApiApp will be associated with. | | diff --git a/sdks/java-v2/docs/BulkSendJobApi.md b/sdks/java-v2/docs/BulkSendJobApi.md index c369376b6..5d7335a12 100644 --- a/sdks/java-v2/docs/BulkSendJobApi.md +++ b/sdks/java-v2/docs/BulkSendJobApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**bulkSendJobGet**](BulkSendJobApi.md#bulkSendJobGet) | **GET** /bulk_send_job/{bulk_send_job_id} | Get Bulk Send Job [**bulkSendJobList**](BulkSendJobApi.md#bulkSendJobList) | **GET** /bulk_send_job/list | List Bulk Send Jobs @@ -59,8 +59,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **bulkSendJobId** | **String**| The id of the BulkSendJob to retrieve. | **page** | **Integer**| Which page number of the BulkSendJob list to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. | [optional] [default to 20] @@ -136,8 +136,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **page** | **Integer**| Which page number of the BulkSendJob List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. | [optional] [default to 20] diff --git a/sdks/java-v2/docs/BulkSendJobGetResponse.md b/sdks/java-v2/docs/BulkSendJobGetResponse.md index 977a108f8..93395ee2d 100644 --- a/sdks/java-v2/docs/BulkSendJobGetResponse.md +++ b/sdks/java-v2/docs/BulkSendJobGetResponse.md @@ -6,11 +6,11 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `bulkSendJob` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `signatureRequests` | [```List```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `bulkSendJob`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `signatureRequests`*_required_ | [```List```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/BulkSendJobGetResponseSignatureRequests.md b/sdks/java-v2/docs/BulkSendJobGetResponseSignatureRequests.md index 8cf2c0b4c..ba283afd8 100644 --- a/sdks/java-v2/docs/BulkSendJobGetResponseSignatureRequests.md +++ b/sdks/java-v2/docs/BulkSendJobGetResponseSignatureRequests.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `testMode` | ```Boolean``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | | | `signatureRequestId` | ```String``` | The id of the SignatureRequest. | | | `requesterEmailAddress` | ```String``` | The email address of the initiator of the SignatureRequest. | | diff --git a/sdks/java-v2/docs/BulkSendJobListResponse.md b/sdks/java-v2/docs/BulkSendJobListResponse.md index f0ef7df55..e5eb2315d 100644 --- a/sdks/java-v2/docs/BulkSendJobListResponse.md +++ b/sdks/java-v2/docs/BulkSendJobListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `bulkSendJobs` | [```List```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `bulkSendJobs`*_required_ | [```List```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/BulkSendJobResponse.md b/sdks/java-v2/docs/BulkSendJobResponse.md index c97fb3d72..eb2278a34 100644 --- a/sdks/java-v2/docs/BulkSendJobResponse.md +++ b/sdks/java-v2/docs/BulkSendJobResponse.md @@ -6,8 +6,8 @@ Contains information about the BulkSendJob such as when it was created and how m ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `bulkSendJobId` | ```String``` | The id of the BulkSendJob. | | | `total` | ```Integer``` | The total amount of Signature Requests queued for sending. | | | `isCreator` | ```Boolean``` | True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. | | diff --git a/sdks/java-v2/docs/BulkSendJobSendResponse.md b/sdks/java-v2/docs/BulkSendJobSendResponse.md index 9ca50957b..532b64b5b 100644 --- a/sdks/java-v2/docs/BulkSendJobSendResponse.md +++ b/sdks/java-v2/docs/BulkSendJobSendResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `bulkSendJob` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `bulkSendJob`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/EmbeddedApi.md b/sdks/java-v2/docs/EmbeddedApi.md index 7ea121bdf..62955f908 100644 --- a/sdks/java-v2/docs/EmbeddedApi.md +++ b/sdks/java-v2/docs/EmbeddedApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**embeddedEditUrl**](EmbeddedApi.md#embeddedEditUrl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL [**embeddedSignUrl**](EmbeddedApi.md#embeddedSignUrl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL @@ -65,8 +65,8 @@ public class Main { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template to edit. | **embeddedEditUrlRequest** | [**EmbeddedEditUrlRequest**](EmbeddedEditUrlRequest.md)| | @@ -140,8 +140,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureId** | **String**| The id of the signature to get a signature url for. | ### Return type diff --git a/sdks/java-v2/docs/EmbeddedEditUrlRequest.md b/sdks/java-v2/docs/EmbeddedEditUrlRequest.md index 302651222..4e2d8c2e9 100644 --- a/sdks/java-v2/docs/EmbeddedEditUrlRequest.md +++ b/sdks/java-v2/docs/EmbeddedEditUrlRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `allowEditCcs` | ```Boolean``` | This allows the requester to enable/disable to add or change CC roles when editing the template. | | | `ccRoles` | ```List``` | The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. | | | `editorOptions` | [```SubEditorOptions```](SubEditorOptions.md) | | | diff --git a/sdks/java-v2/docs/EmbeddedEditUrlResponse.md b/sdks/java-v2/docs/EmbeddedEditUrlResponse.md index ec2ce550a..959e0c75f 100644 --- a/sdks/java-v2/docs/EmbeddedEditUrlResponse.md +++ b/sdks/java-v2/docs/EmbeddedEditUrlResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `embedded` | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `embedded`*_required_ | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/EmbeddedEditUrlResponseEmbedded.md b/sdks/java-v2/docs/EmbeddedEditUrlResponseEmbedded.md index 640655581..78ad7026c 100644 --- a/sdks/java-v2/docs/EmbeddedEditUrlResponseEmbedded.md +++ b/sdks/java-v2/docs/EmbeddedEditUrlResponseEmbedded.md @@ -6,8 +6,8 @@ An embedded template object. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `editUrl` | ```String``` | A template url that can be opened in an iFrame. | | | `expiresAt` | ```Integer``` | The specific time that the the `edit_url` link expires, in epoch. | | diff --git a/sdks/java-v2/docs/EmbeddedSignUrlResponse.md b/sdks/java-v2/docs/EmbeddedSignUrlResponse.md index a6f119ccf..6f39b97fe 100644 --- a/sdks/java-v2/docs/EmbeddedSignUrlResponse.md +++ b/sdks/java-v2/docs/EmbeddedSignUrlResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `embedded` | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `embedded`*_required_ | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/EmbeddedSignUrlResponseEmbedded.md b/sdks/java-v2/docs/EmbeddedSignUrlResponseEmbedded.md index 4f3a83402..b2fd6c9df 100644 --- a/sdks/java-v2/docs/EmbeddedSignUrlResponseEmbedded.md +++ b/sdks/java-v2/docs/EmbeddedSignUrlResponseEmbedded.md @@ -6,8 +6,8 @@ An object that contains necessary information to set up embedded signing. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signUrl` | ```String``` | A signature url that can be opened in an iFrame. | | | `expiresAt` | ```Integer``` | The specific time that the the `sign_url` link expires, in epoch. | | diff --git a/sdks/java-v2/docs/ErrorResponse.md b/sdks/java-v2/docs/ErrorResponse.md index e3153c6d8..f1a560c3b 100644 --- a/sdks/java-v2/docs/ErrorResponse.md +++ b/sdks/java-v2/docs/ErrorResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `error`*_required_ | [```ErrorResponseError```](ErrorResponseError.md) | | | diff --git a/sdks/java-v2/docs/ErrorResponseError.md b/sdks/java-v2/docs/ErrorResponseError.md index 91f1e8ed8..656aa5c7f 100644 --- a/sdks/java-v2/docs/ErrorResponseError.md +++ b/sdks/java-v2/docs/ErrorResponseError.md @@ -6,8 +6,8 @@ Contains information about an error that occurred. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `errorMsg`*_required_ | ```String``` | Message describing an error. | | | `errorName`*_required_ | ```String``` | Name of the error. | | | `errorPath` | ```String``` | Path at which an error occurred. | | diff --git a/sdks/java-v2/docs/EventCallbackRequest.md b/sdks/java-v2/docs/EventCallbackRequest.md index 9286aecff..73daf943e 100644 --- a/sdks/java-v2/docs/EventCallbackRequest.md +++ b/sdks/java-v2/docs/EventCallbackRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `event`*_required_ | [```EventCallbackRequestEvent```](EventCallbackRequestEvent.md) | | | | `account` | [```AccountResponse```](AccountResponse.md) | | | | `signatureRequest` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | diff --git a/sdks/java-v2/docs/EventCallbackRequestEvent.md b/sdks/java-v2/docs/EventCallbackRequestEvent.md index 1e71c972a..19ab491c2 100644 --- a/sdks/java-v2/docs/EventCallbackRequestEvent.md +++ b/sdks/java-v2/docs/EventCallbackRequestEvent.md @@ -6,8 +6,8 @@ Basic information about the event that occurred. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `eventTime`*_required_ | ```String``` | Time the event was created (using Unix time). | | | `eventType`*_required_ | [```EventTypeEnum```](#EventTypeEnum) | Type of callback event that was triggered. | | | `eventHash`*_required_ | ```String``` | Generated hash used to verify source of event data. | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: EventTypeEnum -Name | Value +| Name | Value | ---- | ----- | ACCOUNT_CONFIRMED | "account_confirmed" | | UNKNOWN_ERROR | "unknown_error" | diff --git a/sdks/java-v2/docs/EventCallbackRequestEventMetadata.md b/sdks/java-v2/docs/EventCallbackRequestEventMetadata.md index c8a911f82..13208c2d1 100644 --- a/sdks/java-v2/docs/EventCallbackRequestEventMetadata.md +++ b/sdks/java-v2/docs/EventCallbackRequestEventMetadata.md @@ -6,8 +6,8 @@ Specific metadata about the event. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `relatedSignatureId` | ```String``` | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | | | `reportedForAccountId` | ```String``` | Account ID the event was reported for. | | | `reportedForAppId` | ```String``` | App ID the event was reported for. | | diff --git a/sdks/java-v2/docs/FaxLineAddUserRequest.md b/sdks/java-v2/docs/FaxLineAddUserRequest.md new file mode 100644 index 000000000..1c9e997f9 --- /dev/null +++ b/sdks/java-v2/docs/FaxLineAddUserRequest.md @@ -0,0 +1,16 @@ + + +# FaxLineAddUserRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number`*_required_ | ```String``` | The Fax Line number. | | +| `accountId` | ```String``` | Account ID | | +| `emailAddress` | ```String``` | Email address | | + + + diff --git a/sdks/java-v2/docs/FaxLineApi.md b/sdks/java-v2/docs/FaxLineApi.md new file mode 100644 index 000000000..1997f1f12 --- /dev/null +++ b/sdks/java-v2/docs/FaxLineApi.md @@ -0,0 +1,504 @@ +# FaxLineApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +[**faxLineAddUser**](FaxLineApi.md#faxLineAddUser) | **PUT** /fax_line/add_user | Add Fax Line User +[**faxLineAreaCodeGet**](FaxLineApi.md#faxLineAreaCodeGet) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes +[**faxLineCreate**](FaxLineApi.md#faxLineCreate) | **POST** /fax_line/create | Purchase Fax Line +[**faxLineDelete**](FaxLineApi.md#faxLineDelete) | **DELETE** /fax_line | Delete Fax Line +[**faxLineGet**](FaxLineApi.md#faxLineGet) | **GET** /fax_line | Get Fax Line +[**faxLineList**](FaxLineApi.md#faxLineList) | **GET** /fax_line/list | List Fax Lines +[**faxLineRemoveUser**](FaxLineApi.md#faxLineRemoveUser) | **PUT** /fax_line/remove_user | Remove Fax Line Access + + + +## faxLineAddUser + +> FaxLineResponse faxLineAddUser(faxLineAddUserRequest) + +Add Fax Line User + +Grants a user access to the specified Fax Line. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineAddUserRequest() + .number("[FAX_NUMBER]") + .emailAddress("member@dropboxsign.com"); + + try { + FaxLineResponse result = faxLineApi.faxLineAddUser(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 | +|------------- | ------------- | ------------- | -------------| + **faxLineAddUserRequest** | [**FaxLineAddUserRequest**](FaxLineAddUserRequest.md)| | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + + +## faxLineAreaCodeGet + +> FaxLineAreaCodeGetResponse faxLineAreaCodeGet(country, state, province, city) + +Get Available Fax Line Area Codes + +Returns a response with the area codes available for a given state/provice and city. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineAreaCodeGetResponse result = faxLineApi.faxLineAreaCodeGet("US", "CA"); + 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 | +|------------- | ------------- | ------------- | -------------| + **country** | **String**| Filter area codes by country. | [enum: CA, US, UK] + **state** | **String**| Filter area codes by state. | [optional] [enum: 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] + **province** | **String**| Filter area codes by province. | [optional] [enum: AB, BC, MB, NB, NL, NT, NS, NU, ON, PE, QC, SK, YT] + **city** | **String**| Filter area codes by city. | [optional] + +### Return type + +[**FaxLineAreaCodeGetResponse**](FaxLineAreaCodeGetResponse.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 | - | + + +## faxLineCreate + +> FaxLineResponse faxLineCreate(faxLineCreateRequest) + +Purchase Fax Line + +Purchases a new Fax Line. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineCreateRequest() + .areaCode(209) + .country("US"); + + try { + FaxLineResponse result = faxLineApi.faxLineCreate(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 | +|------------- | ------------- | ------------- | -------------| + **faxLineCreateRequest** | [**FaxLineCreateRequest**](FaxLineCreateRequest.md)| | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + + +## faxLineDelete + +> faxLineDelete(faxLineDeleteRequest) + +Delete Fax Line + +Deletes the specified Fax Line from the subscription. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineDeleteRequest() + .number("[FAX_NUMBER]"); + + try { + faxLineApi.faxLineDelete(data); + } 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 | +|------------- | ------------- | ------------- | -------------| + **faxLineDeleteRequest** | [**FaxLineDeleteRequest**](FaxLineDeleteRequest.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + + +## faxLineGet + +> FaxLineResponse faxLineGet(number) + +Get Fax Line + +Returns the properties and settings of a Fax Line. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineResponse result = faxLineApi.faxLineGet("[FAX_NUMBER]"); + 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 | +|------------- | ------------- | ------------- | -------------| + **number** | **String**| The Fax Line number. | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.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 | - | + + +## faxLineList + +> FaxLineListResponse faxLineList(accountId, page, pageSize, showTeamLines) + +List Fax Lines + +Returns the properties and settings of multiple Fax Lines. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + try { + FaxLineListResponse result = faxLineApi.faxLineList(); + 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 | +|------------- | ------------- | ------------- | -------------| + **accountId** | **String**| Account ID | [optional] + **page** | **Integer**| Page | [optional] [default to 1] + **pageSize** | **Integer**| Page size | [optional] [default to 20] + **showTeamLines** | **Boolean**| Show team lines | [optional] + +### Return type + +[**FaxLineListResponse**](FaxLineListResponse.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 | - | + + +## faxLineRemoveUser + +> FaxLineResponse faxLineRemoveUser(faxLineRemoveUserRequest) + +Remove Fax Line Access + +Removes a user's access to the specified Fax Line. + +### 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 faxLineApi = new FaxLineApi(apiClient); + + var data = new FaxLineRemoveUserRequest() + .number("[FAX_NUMBER]") + .emailAddress("member@dropboxsign.com"); + + try { + FaxLineResponse result = faxLineApi.faxLineRemoveUser(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 | +|------------- | ------------- | ------------- | -------------| + **faxLineRemoveUserRequest** | [**FaxLineRemoveUserRequest**](FaxLineRemoveUserRequest.md)| | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +| **4XX** | failed_operation | - | + diff --git a/sdks/java-v2/docs/FaxLineAreaCodeGetCountryEnum.md b/sdks/java-v2/docs/FaxLineAreaCodeGetCountryEnum.md new file mode 100644 index 000000000..10275bc6c --- /dev/null +++ b/sdks/java-v2/docs/FaxLineAreaCodeGetCountryEnum.md @@ -0,0 +1,15 @@ + + +# FaxLineAreaCodeGetCountryEnum + +## Enum + + +* `CA` (value: `"CA"`) + +* `US` (value: `"US"`) + +* `UK` (value: `"UK"`) + + + diff --git a/sdks/java-v2/docs/FaxLineAreaCodeGetProvinceEnum.md b/sdks/java-v2/docs/FaxLineAreaCodeGetProvinceEnum.md new file mode 100644 index 000000000..13cf50078 --- /dev/null +++ b/sdks/java-v2/docs/FaxLineAreaCodeGetProvinceEnum.md @@ -0,0 +1,35 @@ + + +# FaxLineAreaCodeGetProvinceEnum + +## Enum + + +* `AB` (value: `"AB"`) + +* `BC` (value: `"BC"`) + +* `MB` (value: `"MB"`) + +* `NB` (value: `"NB"`) + +* `NL` (value: `"NL"`) + +* `NT` (value: `"NT"`) + +* `NS` (value: `"NS"`) + +* `NU` (value: `"NU"`) + +* `ON` (value: `"ON"`) + +* `PE` (value: `"PE"`) + +* `QC` (value: `"QC"`) + +* `SK` (value: `"SK"`) + +* `YT` (value: `"YT"`) + + + diff --git a/sdks/java-v2/docs/FaxLineAreaCodeGetResponse.md b/sdks/java-v2/docs/FaxLineAreaCodeGetResponse.md new file mode 100644 index 000000000..002619333 --- /dev/null +++ b/sdks/java-v2/docs/FaxLineAreaCodeGetResponse.md @@ -0,0 +1,14 @@ + + +# FaxLineAreaCodeGetResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `areaCodes`*_required_ | ```List``` | | | + + + diff --git a/sdks/java-v2/docs/FaxLineAreaCodeGetStateEnum.md b/sdks/java-v2/docs/FaxLineAreaCodeGetStateEnum.md new file mode 100644 index 000000000..577a48c63 --- /dev/null +++ b/sdks/java-v2/docs/FaxLineAreaCodeGetStateEnum.md @@ -0,0 +1,111 @@ + + +# FaxLineAreaCodeGetStateEnum + +## Enum + + +* `AK` (value: `"AK"`) + +* `AL` (value: `"AL"`) + +* `AR` (value: `"AR"`) + +* `AZ` (value: `"AZ"`) + +* `CA` (value: `"CA"`) + +* `CO` (value: `"CO"`) + +* `CT` (value: `"CT"`) + +* `DC` (value: `"DC"`) + +* `DE` (value: `"DE"`) + +* `FL` (value: `"FL"`) + +* `GA` (value: `"GA"`) + +* `HI` (value: `"HI"`) + +* `IA` (value: `"IA"`) + +* `ID` (value: `"ID"`) + +* `IL` (value: `"IL"`) + +* `IN` (value: `"IN"`) + +* `KS` (value: `"KS"`) + +* `KY` (value: `"KY"`) + +* `LA` (value: `"LA"`) + +* `MA` (value: `"MA"`) + +* `MD` (value: `"MD"`) + +* `ME` (value: `"ME"`) + +* `MI` (value: `"MI"`) + +* `MN` (value: `"MN"`) + +* `MO` (value: `"MO"`) + +* `MS` (value: `"MS"`) + +* `MT` (value: `"MT"`) + +* `NC` (value: `"NC"`) + +* `ND` (value: `"ND"`) + +* `NE` (value: `"NE"`) + +* `NH` (value: `"NH"`) + +* `NJ` (value: `"NJ"`) + +* `NM` (value: `"NM"`) + +* `NV` (value: `"NV"`) + +* `NY` (value: `"NY"`) + +* `OH` (value: `"OH"`) + +* `OK` (value: `"OK"`) + +* `OR` (value: `"OR"`) + +* `PA` (value: `"PA"`) + +* `RI` (value: `"RI"`) + +* `SC` (value: `"SC"`) + +* `SD` (value: `"SD"`) + +* `TN` (value: `"TN"`) + +* `TX` (value: `"TX"`) + +* `UT` (value: `"UT"`) + +* `VA` (value: `"VA"`) + +* `VT` (value: `"VT"`) + +* `WA` (value: `"WA"`) + +* `WI` (value: `"WI"`) + +* `WV` (value: `"WV"`) + +* `WY` (value: `"WY"`) + + + diff --git a/sdks/java-v2/docs/FaxLineCreateRequest.md b/sdks/java-v2/docs/FaxLineCreateRequest.md new file mode 100644 index 000000000..da9ba3953 --- /dev/null +++ b/sdks/java-v2/docs/FaxLineCreateRequest.md @@ -0,0 +1,27 @@ + + +# FaxLineCreateRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `areaCode`*_required_ | ```Integer``` | Area code | | +| `country`*_required_ | [```CountryEnum```](#CountryEnum) | Country | | +| `city` | ```String``` | City | | +| `accountId` | ```String``` | Account ID | | + + + +## Enum: CountryEnum + +| Name | Value | +---- | ----- +| CA | "CA" | +| US | "US" | +| UK | "UK" | + + + diff --git a/sdks/java-v2/docs/FaxLineDeleteRequest.md b/sdks/java-v2/docs/FaxLineDeleteRequest.md new file mode 100644 index 000000000..de1748fa1 --- /dev/null +++ b/sdks/java-v2/docs/FaxLineDeleteRequest.md @@ -0,0 +1,14 @@ + + +# FaxLineDeleteRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number`*_required_ | ```String``` | The Fax Line number. | | + + + diff --git a/sdks/java-v2/docs/FaxLineListResponse.md b/sdks/java-v2/docs/FaxLineListResponse.md new file mode 100644 index 000000000..69891dc2f --- /dev/null +++ b/sdks/java-v2/docs/FaxLineListResponse.md @@ -0,0 +1,16 @@ + + +# FaxLineListResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `faxLines`*_required_ | [```List```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + + + diff --git a/sdks/java-v2/docs/FaxLineRemoveUserRequest.md b/sdks/java-v2/docs/FaxLineRemoveUserRequest.md new file mode 100644 index 000000000..51d81b8fa --- /dev/null +++ b/sdks/java-v2/docs/FaxLineRemoveUserRequest.md @@ -0,0 +1,16 @@ + + +# FaxLineRemoveUserRequest + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number`*_required_ | ```String``` | The Fax Line number. | | +| `accountId` | ```String``` | Account ID | | +| `emailAddress` | ```String``` | Email address | | + + + diff --git a/sdks/java-v2/docs/FaxLineResponse.md b/sdks/java-v2/docs/FaxLineResponse.md new file mode 100644 index 000000000..c5256bbc6 --- /dev/null +++ b/sdks/java-v2/docs/FaxLineResponse.md @@ -0,0 +1,15 @@ + + +# FaxLineResponse + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `faxLine`*_required_ | [```FaxLineResponseFaxLine```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + + + diff --git a/sdks/java-v2/docs/FaxLineResponseFaxLine.md b/sdks/java-v2/docs/FaxLineResponseFaxLine.md new file mode 100644 index 000000000..daf0d206a --- /dev/null +++ b/sdks/java-v2/docs/FaxLineResponseFaxLine.md @@ -0,0 +1,17 @@ + + +# FaxLineResponseFaxLine + + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `number` | ```String``` | Number | | +| `createdAt` | ```Integer``` | Created at | | +| `updatedAt` | ```Integer``` | Updated at | | +| `accounts` | [```List```](AccountResponse.md) | | | + + + diff --git a/sdks/java-v2/docs/FileResponse.md b/sdks/java-v2/docs/FileResponse.md index 4851cb4f7..058a80ed5 100644 --- a/sdks/java-v2/docs/FileResponse.md +++ b/sdks/java-v2/docs/FileResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `fileUrl` | ```String``` | URL to the file. | | -| `expiresAt` | ```Integer``` | When the link expires. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `fileUrl`*_required_ | ```String``` | URL to the file. | | +| `expiresAt`*_required_ | ```Integer``` | When the link expires. | | diff --git a/sdks/java-v2/docs/FileResponseDataUri.md b/sdks/java-v2/docs/FileResponseDataUri.md index 19502239d..65c0b7dbc 100644 --- a/sdks/java-v2/docs/FileResponseDataUri.md +++ b/sdks/java-v2/docs/FileResponseDataUri.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `dataUri` | ```String``` | File as base64 encoded string. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `dataUri`*_required_ | ```String``` | File as base64 encoded string. | | diff --git a/sdks/java-v2/docs/ListInfoResponse.md b/sdks/java-v2/docs/ListInfoResponse.md index 02063e79c..b9d464ec7 100644 --- a/sdks/java-v2/docs/ListInfoResponse.md +++ b/sdks/java-v2/docs/ListInfoResponse.md @@ -6,8 +6,8 @@ Contains pagination information about the data returned. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `numPages` | ```Integer``` | Total number of pages available. | | | `numResults` | ```Integer``` | Total number of objects available. | | | `page` | ```Integer``` | Number of the page being returned. | | diff --git a/sdks/java-v2/docs/OAuthApi.md b/sdks/java-v2/docs/OAuthApi.md index 466367afd..533052ba2 100644 --- a/sdks/java-v2/docs/OAuthApi.md +++ b/sdks/java-v2/docs/OAuthApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**oauthTokenGenerate**](OAuthApi.md#oauthTokenGenerate) | **POST** /oauth/token | OAuth Token Generate [**oauthTokenRefresh**](OAuthApi.md#oauthTokenRefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh @@ -56,8 +56,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **oauthTokenGenerateRequest** | [**OAuthTokenGenerateRequest**](OAuthTokenGenerateRequest.md)| | ### Return type @@ -123,8 +123,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **oauthTokenRefreshRequest** | [**OAuthTokenRefreshRequest**](OAuthTokenRefreshRequest.md)| | ### Return type diff --git a/sdks/java-v2/docs/OAuthTokenGenerateRequest.md b/sdks/java-v2/docs/OAuthTokenGenerateRequest.md index 7f376db16..45ad0b08e 100644 --- a/sdks/java-v2/docs/OAuthTokenGenerateRequest.md +++ b/sdks/java-v2/docs/OAuthTokenGenerateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | The client id of the app requesting authorization. | | | `clientSecret`*_required_ | ```String``` | The secret token of your app. | | | `code`*_required_ | ```String``` | The code passed to your callback when the user granted access. | | diff --git a/sdks/java-v2/docs/OAuthTokenRefreshRequest.md b/sdks/java-v2/docs/OAuthTokenRefreshRequest.md index b88bb9ed4..2b985fa91 100644 --- a/sdks/java-v2/docs/OAuthTokenRefreshRequest.md +++ b/sdks/java-v2/docs/OAuthTokenRefreshRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `grantType`*_required_ | ```String``` | When refreshing an existing token use `refresh_token`. | | | `refreshToken`*_required_ | ```String``` | The token provided when you got the expired access token. | | diff --git a/sdks/java-v2/docs/OAuthTokenResponse.md b/sdks/java-v2/docs/OAuthTokenResponse.md index 28da6205f..86824ccb0 100644 --- a/sdks/java-v2/docs/OAuthTokenResponse.md +++ b/sdks/java-v2/docs/OAuthTokenResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accessToken` | ```String``` | | | | `tokenType` | ```String``` | | | | `refreshToken` | ```String``` | | | diff --git a/sdks/java-v2/docs/ReportApi.md b/sdks/java-v2/docs/ReportApi.md index e6af8facf..e0a409741 100644 --- a/sdks/java-v2/docs/ReportApi.md +++ b/sdks/java-v2/docs/ReportApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**reportCreate**](ReportApi.md#reportCreate) | **POST** /report/create | Create Report @@ -68,8 +68,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **reportCreateRequest** | [**ReportCreateRequest**](ReportCreateRequest.md)| | ### Return type diff --git a/sdks/java-v2/docs/ReportCreateRequest.md b/sdks/java-v2/docs/ReportCreateRequest.md index 99053df76..d2f4b67e2 100644 --- a/sdks/java-v2/docs/ReportCreateRequest.md +++ b/sdks/java-v2/docs/ReportCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `endDate`*_required_ | ```String``` | The (inclusive) end date for the report data in `MM/DD/YYYY` format. | | | `reportType`*_required_ | [```List<ReportTypeEnum>```](#List<ReportTypeEnum>) | The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | | | `startDate`*_required_ | ```String``` | The (inclusive) start date for the report data in `MM/DD/YYYY` format. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: List<ReportTypeEnum> -Name | Value +| Name | Value | ---- | ----- | USER_ACTIVITY | "user_activity" | | DOCUMENT_STATUS | "document_status" | diff --git a/sdks/java-v2/docs/ReportCreateResponse.md b/sdks/java-v2/docs/ReportCreateResponse.md index 9f8c1177f..9fc8565de 100644 --- a/sdks/java-v2/docs/ReportCreateResponse.md +++ b/sdks/java-v2/docs/ReportCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `report` | [```ReportResponse```](ReportResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `report`*_required_ | [```ReportResponse```](ReportResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/ReportResponse.md b/sdks/java-v2/docs/ReportResponse.md index ade5b6395..b48dde6f4 100644 --- a/sdks/java-v2/docs/ReportResponse.md +++ b/sdks/java-v2/docs/ReportResponse.md @@ -6,8 +6,8 @@ Contains information about the report request. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `success` | ```String``` | A message indicating the requested operation's success | | | `startDate` | ```String``` | The (inclusive) start date for the report data in MM/DD/YYYY format. | | | `endDate` | ```String``` | The (inclusive) end date for the report data in MM/DD/YYYY format. | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: List<ReportTypeEnum> -Name | Value +| Name | Value | ---- | ----- | USER_ACTIVITY | "user_activity" | | DOCUMENT_STATUS | "document_status" | diff --git a/sdks/java-v2/docs/SignatureRequestApi.md b/sdks/java-v2/docs/SignatureRequestApi.md index f8e0100b2..ee42461ce 100644 --- a/sdks/java-v2/docs/SignatureRequestApi.md +++ b/sdks/java-v2/docs/SignatureRequestApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**signatureRequestBulkCreateEmbeddedWithTemplate**](SignatureRequestApi.md#signatureRequestBulkCreateEmbeddedWithTemplate) | **POST** /signature_request/bulk_create_embedded_with_template | Embedded Bulk Send with Template [**signatureRequestBulkSendWithTemplate**](SignatureRequestApi.md#signatureRequestBulkSendWithTemplate) | **POST** /signature_request/bulk_send_with_template | Bulk Send with Template [**signatureRequestCancel**](SignatureRequestApi.md#signatureRequestCancel) | **POST** /signature_request/cancel/{signature_request_id} | Cancel Incomplete Signature Request @@ -115,8 +115,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestBulkCreateEmbeddedWithTemplateRequest** | [**SignatureRequestBulkCreateEmbeddedWithTemplateRequest**](SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md)| | ### Return type @@ -231,8 +231,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestBulkSendWithTemplateRequest** | [**SignatureRequestBulkSendWithTemplateRequest**](SignatureRequestBulkSendWithTemplateRequest.md)| | ### Return type @@ -311,8 +311,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the incomplete SignatureRequest to cancel. | ### Return type @@ -414,8 +414,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestCreateEmbeddedRequest** | [**SignatureRequestCreateEmbeddedRequest**](SignatureRequestCreateEmbeddedRequest.md)| | ### Return type @@ -508,8 +508,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestCreateEmbeddedWithTemplateRequest** | [**SignatureRequestCreateEmbeddedWithTemplateRequest**](SignatureRequestCreateEmbeddedWithTemplateRequest.md)| | ### Return type @@ -585,8 +585,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | **fileType** | **String**| Set to `pdf` for a single merged document or `zip` for a collection of individual documents. | [optional] [default to pdf] [enum: pdf, zip] @@ -662,8 +662,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | ### Return type @@ -738,8 +738,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | **forceDownload** | **Integer**| By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. | [optional] [default to 1] @@ -813,8 +813,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to retrieve. | ### Return type @@ -897,8 +897,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountId** | **String**| Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. | [optional] **page** | **Integer**| Which page number of the SignatureRequest List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -974,8 +974,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to release. | ### Return type @@ -1053,8 +1053,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to send a reminder for. | **signatureRequestRemindRequest** | [**SignatureRequestRemindRequest**](SignatureRequestRemindRequest.md)| | @@ -1130,8 +1130,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to remove. | ### Return type @@ -1238,8 +1238,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestSendRequest** | [**SignatureRequestSendRequest**](SignatureRequestSendRequest.md)| | ### Return type @@ -1344,8 +1344,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestSendWithTemplateRequest** | [**SignatureRequestSendWithTemplateRequest**](SignatureRequestSendWithTemplateRequest.md)| | ### Return type @@ -1426,8 +1426,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The id of the SignatureRequest to update. | **signatureRequestUpdateRequest** | [**SignatureRequestUpdateRequest**](SignatureRequestUpdateRequest.md)| | diff --git a/sdks/java-v2/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/java-v2/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index fae117acd..4243ead1c 100644 --- a/sdks/java-v2/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/java-v2/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | | `signerFile` | ```File``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | diff --git a/sdks/java-v2/docs/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/java-v2/docs/SignatureRequestBulkSendWithTemplateRequest.md index e57352287..1798f6fdc 100644 --- a/sdks/java-v2/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/java-v2/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `signerFile` | ```File``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | | `signerList` | [```List```](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | | diff --git a/sdks/java-v2/docs/SignatureRequestCreateEmbeddedRequest.md b/sdks/java-v2/docs/SignatureRequestCreateEmbeddedRequest.md index fcfd18518..383f8a8f3 100644 --- a/sdks/java-v2/docs/SignatureRequestCreateEmbeddedRequest.md +++ b/sdks/java-v2/docs/SignatureRequestCreateEmbeddedRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | diff --git a/sdks/java-v2/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/sdks/java-v2/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md index a4dd8ce50..050a7e631 100644 --- a/sdks/java-v2/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/sdks/java-v2/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | | `signers`*_required_ | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | diff --git a/sdks/java-v2/docs/SignatureRequestGetResponse.md b/sdks/java-v2/docs/SignatureRequestGetResponse.md index 7ce17ba9a..25ce665c4 100644 --- a/sdks/java-v2/docs/SignatureRequestGetResponse.md +++ b/sdks/java-v2/docs/SignatureRequestGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `signatureRequest` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `signatureRequest`*_required_ | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/SignatureRequestListResponse.md b/sdks/java-v2/docs/SignatureRequestListResponse.md index 94fb15690..6384d2ad0 100644 --- a/sdks/java-v2/docs/SignatureRequestListResponse.md +++ b/sdks/java-v2/docs/SignatureRequestListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `signatureRequests` | [```List```](SignatureRequestResponse.md) | Contains information about signature requests. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `signatureRequests`*_required_ | [```List```](SignatureRequestResponse.md) | Contains information about signature requests. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/SignatureRequestRemindRequest.md b/sdks/java-v2/docs/SignatureRequestRemindRequest.md index 1a16fc55a..bf76e08f4 100644 --- a/sdks/java-v2/docs/SignatureRequestRemindRequest.md +++ b/sdks/java-v2/docs/SignatureRequestRemindRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```String``` | The email address of the signer to send a reminder to. | | | `name` | ```String``` | The name of the signer to send a reminder to. Include if two or more signers share an email address. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponse.md b/sdks/java-v2/docs/SignatureRequestResponse.md index 50ae41719..2c9efa532 100644 --- a/sdks/java-v2/docs/SignatureRequestResponse.md +++ b/sdks/java-v2/docs/SignatureRequestResponse.md @@ -6,8 +6,8 @@ Contains information about a signature request. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `testMode` | ```Boolean``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | | | `signatureRequestId` | ```String``` | The id of the SignatureRequest. | | | `requesterEmailAddress` | ```String``` | The email address of the initiator of the SignatureRequest. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseAttachment.md b/sdks/java-v2/docs/SignatureRequestResponseAttachment.md index 23267b60e..1ef3a209b 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseAttachment.md +++ b/sdks/java-v2/docs/SignatureRequestResponseAttachment.md @@ -6,8 +6,8 @@ Signer attachments. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `id`*_required_ | ```String``` | The unique ID for this attachment. | | | `signer`*_required_ | ```String``` | The Signer this attachment is assigned to. | | | `name`*_required_ | ```String``` | The name of this attachment. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseCustomFieldBase.md b/sdks/java-v2/docs/SignatureRequestResponseCustomFieldBase.md index 7dbca6c01..7b5f104c4 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseCustomFieldBase.md +++ b/sdks/java-v2/docs/SignatureRequestResponseCustomFieldBase.md @@ -9,8 +9,8 @@ An array of Custom Field objects containing the name and type of each custom fie ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `name`*_required_ | ```String``` | The name of the Custom Field. | | | `required` | ```Boolean``` | A boolean value denoting if this field is required. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseCustomFieldCheckbox.md b/sdks/java-v2/docs/SignatureRequestResponseCustomFieldCheckbox.md index e0f8e10fc..c2cb8414b 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseCustomFieldCheckbox.md +++ b/sdks/java-v2/docs/SignatureRequestResponseCustomFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `SignatureRequestResponseCustomFieldBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `value` | ```Boolean``` | A true/false for checkbox fields | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseCustomFieldText.md b/sdks/java-v2/docs/SignatureRequestResponseCustomFieldText.md index c78e24d5d..23ceb565c 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseCustomFieldText.md +++ b/sdks/java-v2/docs/SignatureRequestResponseCustomFieldText.md @@ -6,8 +6,8 @@ This class extends `SignatureRequestResponseCustomFieldBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `value` | ```String``` | A text string for text fields | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseDataBase.md b/sdks/java-v2/docs/SignatureRequestResponseDataBase.md index 7504c495d..a9605a44a 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseDataBase.md +++ b/sdks/java-v2/docs/SignatureRequestResponseDataBase.md @@ -6,8 +6,8 @@ An array of form field objects containing the name, value, and type of each text ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `apiId` | ```String``` | The unique ID for this field. | | | `signatureId` | ```String``` | The ID of the signature to which this response is linked. | | | `name` | ```String``` | The name of the form field. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseDataValueCheckbox.md b/sdks/java-v2/docs/SignatureRequestResponseDataValueCheckbox.md index 972c48d91..fda57045a 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseDataValueCheckbox.md +++ b/sdks/java-v2/docs/SignatureRequestResponseDataValueCheckbox.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A yes/no checkbox | | | `value` | ```Boolean``` | The value of the form field. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseDataValueCheckboxMerge.md b/sdks/java-v2/docs/SignatureRequestResponseDataValueCheckboxMerge.md index 6abdf9698..96af5ebaf 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseDataValueCheckboxMerge.md +++ b/sdks/java-v2/docs/SignatureRequestResponseDataValueCheckboxMerge.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A checkbox field that has default value set by the api | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseDataValueDateSigned.md b/sdks/java-v2/docs/SignatureRequestResponseDataValueDateSigned.md index 2b9e5a759..308bd8bf2 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseDataValueDateSigned.md +++ b/sdks/java-v2/docs/SignatureRequestResponseDataValueDateSigned.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A date | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseDataValueDropdown.md b/sdks/java-v2/docs/SignatureRequestResponseDataValueDropdown.md index 8b5a0f105..599cb3cef 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseDataValueDropdown.md +++ b/sdks/java-v2/docs/SignatureRequestResponseDataValueDropdown.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | An input field for dropdowns | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseDataValueInitials.md b/sdks/java-v2/docs/SignatureRequestResponseDataValueInitials.md index f1d04539f..7f82d742c 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseDataValueInitials.md +++ b/sdks/java-v2/docs/SignatureRequestResponseDataValueInitials.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | An input field for initials | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseDataValueRadio.md b/sdks/java-v2/docs/SignatureRequestResponseDataValueRadio.md index 2897f89a6..b8e073f1f 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseDataValueRadio.md +++ b/sdks/java-v2/docs/SignatureRequestResponseDataValueRadio.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | An input field for radios | | | `value` | ```Boolean``` | The value of the form field. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseDataValueSignature.md b/sdks/java-v2/docs/SignatureRequestResponseDataValueSignature.md index bb7ce7fe9..910932c19 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseDataValueSignature.md +++ b/sdks/java-v2/docs/SignatureRequestResponseDataValueSignature.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A signature input field | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseDataValueText.md b/sdks/java-v2/docs/SignatureRequestResponseDataValueText.md index 837f27c3f..e08ec8ff8 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseDataValueText.md +++ b/sdks/java-v2/docs/SignatureRequestResponseDataValueText.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A text input field | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseDataValueTextMerge.md b/sdks/java-v2/docs/SignatureRequestResponseDataValueTextMerge.md index 60349e25a..2b5e0d3fe 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseDataValueTextMerge.md +++ b/sdks/java-v2/docs/SignatureRequestResponseDataValueTextMerge.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type` | ```String``` | A text field that has default text set by the api | | | `value` | ```String``` | The value of the form field. | | diff --git a/sdks/java-v2/docs/SignatureRequestResponseSignatures.md b/sdks/java-v2/docs/SignatureRequestResponseSignatures.md index 3eac9dfb9..2f0e16dc0 100644 --- a/sdks/java-v2/docs/SignatureRequestResponseSignatures.md +++ b/sdks/java-v2/docs/SignatureRequestResponseSignatures.md @@ -6,8 +6,8 @@ An array of signature objects, 1 for each signer. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signatureId` | ```String``` | Signature identifier. | | | `signerGroupGuid` | ```String``` | Signer Group GUID | | | `signerEmailAddress` | ```String``` | The email address of the signer. | | diff --git a/sdks/java-v2/docs/SignatureRequestSendRequest.md b/sdks/java-v2/docs/SignatureRequestSendRequest.md index 5b156ef05..914303935 100644 --- a/sdks/java-v2/docs/SignatureRequestSendRequest.md +++ b/sdks/java-v2/docs/SignatureRequestSendRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

This endpoint requires either **signers** or **grouped_signers**, but not both. | | diff --git a/sdks/java-v2/docs/SignatureRequestSendWithTemplateRequest.md b/sdks/java-v2/docs/SignatureRequestSendWithTemplateRequest.md index 5ccd15d24..7a8d8c88a 100644 --- a/sdks/java-v2/docs/SignatureRequestSendWithTemplateRequest.md +++ b/sdks/java-v2/docs/SignatureRequestSendWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `signers`*_required_ | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | | `allowDecline` | ```Boolean``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | | diff --git a/sdks/java-v2/docs/SignatureRequestUpdateRequest.md b/sdks/java-v2/docs/SignatureRequestUpdateRequest.md index 4e1159535..4b38c53e7 100644 --- a/sdks/java-v2/docs/SignatureRequestUpdateRequest.md +++ b/sdks/java-v2/docs/SignatureRequestUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signatureId`*_required_ | ```String``` | The signature ID for the recipient. | | | `emailAddress` | ```String``` | The new email address for the recipient.

This will generate a new `signature_id` value.

**NOTE:** Optional if `name` is provided. | | | `name` | ```String``` | The new name for the recipient.

**NOTE:** Optional if `email_address` is provided. | | diff --git a/sdks/java-v2/docs/SubAttachment.md b/sdks/java-v2/docs/SubAttachment.md index a7e00e026..b5e9c80fd 100644 --- a/sdks/java-v2/docs/SubAttachment.md +++ b/sdks/java-v2/docs/SubAttachment.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of attachment. | | | `signerIndex`*_required_ | ```Integer``` | The signer's index in the `signers` parameter (0-based indexing).

**NOTE:** Only one signer can be assigned per attachment. | | | `instructions` | ```String``` | The instructions for uploading the attachment. | | diff --git a/sdks/java-v2/docs/SubBulkSignerList.md b/sdks/java-v2/docs/SubBulkSignerList.md index 043abbb91..918c935b1 100644 --- a/sdks/java-v2/docs/SubBulkSignerList.md +++ b/sdks/java-v2/docs/SubBulkSignerList.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `customFields` | [```List```](SubBulkSignerListCustomField.md) | An array of custom field values. | | | `signers` | [```List```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document.

Currently only templates with a single role are supported. All signers must have the same `role` value. | | diff --git a/sdks/java-v2/docs/SubBulkSignerListCustomField.md b/sdks/java-v2/docs/SubBulkSignerListCustomField.md index 2a7c9c0d9..b37ad53bc 100644 --- a/sdks/java-v2/docs/SubBulkSignerListCustomField.md +++ b/sdks/java-v2/docs/SubBulkSignerListCustomField.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of the custom field. Must be the field's `name` or `api_id`. | | | `value`*_required_ | ```String``` | The value of the custom field. | | diff --git a/sdks/java-v2/docs/SubCC.md b/sdks/java-v2/docs/SubCC.md index 4f59a7661..37eacd3b8 100644 --- a/sdks/java-v2/docs/SubCC.md +++ b/sdks/java-v2/docs/SubCC.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `role`*_required_ | ```String``` | Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. | | | `emailAddress`*_required_ | ```String``` | The email address of the CC recipient. | | diff --git a/sdks/java-v2/docs/SubCustomField.md b/sdks/java-v2/docs/SubCustomField.md index b65f80470..a309fd6e0 100644 --- a/sdks/java-v2/docs/SubCustomField.md +++ b/sdks/java-v2/docs/SubCustomField.md @@ -10,8 +10,8 @@ For using pre-filled on repeatable signature requests, merge fields are added to ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. | | | `editor` | ```String``` | Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`.

**NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. | | | `required` | ```Boolean``` | Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. | | diff --git a/sdks/java-v2/docs/SubEditorOptions.md b/sdks/java-v2/docs/SubEditorOptions.md index b1c284b19..5483d255f 100644 --- a/sdks/java-v2/docs/SubEditorOptions.md +++ b/sdks/java-v2/docs/SubEditorOptions.md @@ -6,8 +6,8 @@ This allows the requester to specify editor options when a preparing a document ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `allowEditSigners` | ```Boolean``` | Allows requesters to edit the list of signers | | | `allowEditDocuments` | ```Boolean``` | Allows requesters to edit documents, including delete and add | | diff --git a/sdks/java-v2/docs/SubFieldOptions.md b/sdks/java-v2/docs/SubFieldOptions.md index 92ef40d0f..e1be7690d 100644 --- a/sdks/java-v2/docs/SubFieldOptions.md +++ b/sdks/java-v2/docs/SubFieldOptions.md @@ -6,15 +6,15 @@ This allows the requester to specify field options for a signature request. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `dateFormat`*_required_ | [```DateFormatEnum```](#DateFormatEnum) | Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats))

**NOTE:** Only available for Premium and higher. | | ## Enum: DateFormatEnum -Name | Value +| Name | Value | ---- | ----- | MMDDYYYY | "MM / DD / YYYY" | | MM_DD_YYYY | "MM - DD - YYYY" | diff --git a/sdks/java-v2/docs/SubFormFieldGroup.md b/sdks/java-v2/docs/SubFormFieldGroup.md index 676afdd91..c55ffa355 100644 --- a/sdks/java-v2/docs/SubFormFieldGroup.md +++ b/sdks/java-v2/docs/SubFormFieldGroup.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `groupId`*_required_ | ```String``` | ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. | | | `groupLabel`*_required_ | ```String``` | Name of the group | | | `requirement`*_required_ | ```String``` | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | | diff --git a/sdks/java-v2/docs/SubFormFieldRule.md b/sdks/java-v2/docs/SubFormFieldRule.md index eb4d25e4e..ca44afdb6 100644 --- a/sdks/java-v2/docs/SubFormFieldRule.md +++ b/sdks/java-v2/docs/SubFormFieldRule.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `id`*_required_ | ```String``` | Must be unique across all defined rules. | | | `triggerOperator`*_required_ | ```String``` | Currently only `AND` is supported. Support for `OR` is being worked on. | | | `triggers`*_required_ | [```List```](SubFormFieldRuleTrigger.md) | An array of trigger definitions, the "if this" part of "**if this**, then that". Currently only a single trigger per rule is allowed. | | diff --git a/sdks/java-v2/docs/SubFormFieldRuleAction.md b/sdks/java-v2/docs/SubFormFieldRuleAction.md index 12828ad85..6a2d43481 100644 --- a/sdks/java-v2/docs/SubFormFieldRuleAction.md +++ b/sdks/java-v2/docs/SubFormFieldRuleAction.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `hidden`*_required_ | ```Boolean``` | `true` to hide the target field when rule is satisfied, otherwise `false`. | | | `type`*_required_ | [```TypeEnum```](#TypeEnum) | | | | `fieldId` | ```String``` | **field_id** or **group_id** is required, but not both.

Must reference the `api_id` of an existing field defined within `form_fields_per_document`.

Cannot use with `group_id`. Trigger and action fields must belong to the same signer. | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | FIELD_VISIBILITY | "change-field-visibility" | | GROUP_VISIBILITY | "change-group-visibility" | diff --git a/sdks/java-v2/docs/SubFormFieldRuleTrigger.md b/sdks/java-v2/docs/SubFormFieldRuleTrigger.md index ed866d07c..3a82561bd 100644 --- a/sdks/java-v2/docs/SubFormFieldRuleTrigger.md +++ b/sdks/java-v2/docs/SubFormFieldRuleTrigger.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `id`*_required_ | ```String``` | Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. | | | `operator`*_required_ | [```OperatorEnum```](#OperatorEnum) | Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value | | | `value` | ```String``` | **value** or **values** is required, but not both.

The value to match against **operator**.

- When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match`

Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ## Enum: OperatorEnum -Name | Value +| Name | Value | ---- | ----- | ANY | "any" | | IS | "is" | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentBase.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentBase.md index 26ce88d91..a44994a32 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentBase.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentBase.md @@ -19,8 +19,8 @@ The fields that should appear on the document, expressed as an array of objects. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `documentIndex`*_required_ | ```Integer``` | Represents the integer index of the `file` or `file_url` document the field should be attached to. | | | `apiId`*_required_ | ```String``` | An identifier for the field that is unique across all documents in the request. | | | `height`*_required_ | ```Integer``` | Size of the field in pixels. | | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentCheckbox.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentCheckbox.md index efcf95dfb..c4e473f3f 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentCheckbox.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentCheckbox.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | | | `isChecked`*_required_ | ```Boolean``` | `true` for checking the checkbox field by default, otherwise `false`. | | | `group` | ```String``` | String referencing group defined in `form_field_groups` parameter. | | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentCheckboxMerge.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentCheckboxMerge.md index efdc81199..824359645 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentCheckboxMerge.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentCheckboxMerge.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. | | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentDateSigned.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentDateSigned.md index 49d4b5fa0..bffc1a4b5 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentDateSigned.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentDateSigned.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | | | `fontFamily` | [```FontFamilyEnum```](#FontFamilyEnum) | Font family for the field. | | | `fontSize` | ```Integer``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -28,12 +28,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentDropdown.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentDropdown.md index afed12e2a..ca470eaa4 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentDropdown.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentDropdown.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | | | `options`*_required_ | ```List``` | Array of string values representing dropdown values. | | | `content` | ```String``` | Selected value in `options` array. Value must exist in array. | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -30,12 +30,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentFontEnum.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentFontEnum.md index c4ea6231e..b7582a236 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentFontEnum.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentFontEnum.md @@ -25,17 +25,17 @@ * `ROBOTO` (value: `"roboto"`) -* `ROBOTOMONO` (value: `"robotoMono"`) +* `ROBOTO_MONO` (value: `"robotoMono"`) -* `NOTOSANS` (value: `"notoSans"`) +* `NOTO_SANS` (value: `"notoSans"`) -* `NOTOSERIF` (value: `"notoSerif"`) +* `NOTO_SERIF` (value: `"notoSerif"`) -* `NOTOCJK_JP_REGULAR` (value: `"notoCJK-JP-Regular"`) +* `NOTO_CJK_JP_REGULAR` (value: `"notoCJK-JP-Regular"`) -* `NOTOHEBREW_REGULAR` (value: `"notoHebrew-Regular"`) +* `NOTO_HEBREW_REGULAR` (value: `"notoHebrew-Regular"`) -* `NOTOSANTHAIMERGED` (value: `"notoSanThaiMerged"`) +* `NOTO_SAN_THAI_MERGED` (value: `"notoSanThaiMerged"`) diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentHyperlink.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentHyperlink.md index 220f6f9fc..543312b59 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentHyperlink.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentHyperlink.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | | | `content`*_required_ | ```String``` | Link Text. | | | `contentUrl`*_required_ | ```String``` | Link URL. | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -30,12 +30,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentInitials.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentInitials.md index 155c7a57e..c3537c2d1 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentInitials.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentInitials.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. | | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentRadio.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentRadio.md index 38150a4ab..c19487677 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentRadio.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentRadio.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | | | `group`*_required_ | ```String``` | String referencing group defined in `form_field_groups` parameter. | | | `isChecked`*_required_ | ```Boolean``` | `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. | | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentSignature.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentSignature.md index 949922a6b..187b14538 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentSignature.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentSignature.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. | | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentText.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentText.md index 9a0c2d6cc..d431f5422 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentText.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentText.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A text input field. Use the `SubFormFieldsPerDocumentText` class. | | | `placeholder` | ```String``` | Placeholder value for text field. | | | `autoFillType` | ```String``` | Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. | | @@ -24,7 +24,7 @@ Name | Type | Description | Notes ## Enum: ValidationTypeEnum -Name | Value +| Name | Value | ---- | ----- | NUMBERS_ONLY | "numbers_only" | | LETTERS_ONLY | "letters_only" | @@ -41,7 +41,7 @@ Name | Value ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -53,12 +53,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/sdks/java-v2/docs/SubFormFieldsPerDocumentTextMerge.md b/sdks/java-v2/docs/SubFormFieldsPerDocumentTextMerge.md index a5fc080eb..e1876cce1 100644 --- a/sdks/java-v2/docs/SubFormFieldsPerDocumentTextMerge.md +++ b/sdks/java-v2/docs/SubFormFieldsPerDocumentTextMerge.md @@ -6,8 +6,8 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | | | `fontFamily` | [```FontFamilyEnum```](#FontFamilyEnum) | Font family for the field. | | | `fontSize` | ```Integer``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: FontFamilyEnum -Name | Value +| Name | Value | ---- | ----- | HELVETICA | "helvetica" | | ARIAL | "arial" | @@ -28,12 +28,12 @@ Name | Value | TREBUCHET | "trebuchet" | | VERDANA | "verdana" | | ROBOTO | "roboto" | -| ROBOTOMONO | "robotoMono" | -| NOTOSANS | "notoSans" | -| NOTOSERIF | "notoSerif" | -| NOTOCJK_JP_REGULAR | "notoCJK-JP-Regular" | -| NOTOHEBREW_REGULAR | "notoHebrew-Regular" | -| NOTOSANTHAIMERGED | "notoSanThaiMerged" | +| ROBOTO_MONO | "robotoMono" | +| NOTO_SANS | "notoSans" | +| NOTO_SERIF | "notoSerif" | +| NOTO_CJK_JP_REGULAR | "notoCJK-JP-Regular" | +| NOTO_HEBREW_REGULAR | "notoHebrew-Regular" | +| NOTO_SAN_THAI_MERGED | "notoSanThaiMerged" | diff --git a/sdks/java-v2/docs/SubMergeField.md b/sdks/java-v2/docs/SubMergeField.md index f509e1203..66582350e 100644 --- a/sdks/java-v2/docs/SubMergeField.md +++ b/sdks/java-v2/docs/SubMergeField.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of the merge field. Must be unique. | | | `type`*_required_ | [```TypeEnum```](#TypeEnum) | The type of merge field. | | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | TEXT | "text" | | CHECKBOX | "checkbox" | diff --git a/sdks/java-v2/docs/SubOAuth.md b/sdks/java-v2/docs/SubOAuth.md index 23beca8ea..527d0be78 100644 --- a/sdks/java-v2/docs/SubOAuth.md +++ b/sdks/java-v2/docs/SubOAuth.md @@ -6,8 +6,8 @@ OAuth related parameters. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `callbackUrl` | ```String``` | The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) | | | `scopes` | [```List<ScopesEnum>```](#List<ScopesEnum>) | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ## Enum: List<ScopesEnum> -Name | Value +| Name | Value | ---- | ----- | REQUEST_SIGNATURE | "request_signature" | | BASIC_ACCOUNT_INFO | "basic_account_info" | diff --git a/sdks/java-v2/docs/SubOptions.md b/sdks/java-v2/docs/SubOptions.md index 3ddab2e05..c36523a02 100644 --- a/sdks/java-v2/docs/SubOptions.md +++ b/sdks/java-v2/docs/SubOptions.md @@ -6,8 +6,8 @@ Additional options supported by API App. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `canInsertEverywhere` | ```Boolean``` | Determines if signers can use "Insert Everywhere" when signing a document. | | diff --git a/sdks/java-v2/docs/SubSignatureRequestGroupedSigners.md b/sdks/java-v2/docs/SubSignatureRequestGroupedSigners.md index d1845fbb2..80ace3400 100644 --- a/sdks/java-v2/docs/SubSignatureRequestGroupedSigners.md +++ b/sdks/java-v2/docs/SubSignatureRequestGroupedSigners.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `group`*_required_ | ```String``` | The name of the group. | | | `signers`*_required_ | [```List```](SubSignatureRequestSigner.md) | Signers belonging to this Group.

**NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. | | | `order` | ```Integer``` | The order the group is required to sign in. Use this instead of Signer-level `order`. | | diff --git a/sdks/java-v2/docs/SubSignatureRequestSigner.md b/sdks/java-v2/docs/SubSignatureRequestSigner.md index affc50498..109c422bc 100644 --- a/sdks/java-v2/docs/SubSignatureRequestSigner.md +++ b/sdks/java-v2/docs/SubSignatureRequestSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name`*_required_ | ```String``` | The name of the signer. | | | `emailAddress`*_required_ | ```String``` | The email address of the signer. | | | `order` | ```Integer``` | The order the signer is required to sign in. | | @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Enum: SmsPhoneNumberTypeEnum -Name | Value +| Name | Value | ---- | ----- | AUTHENTICATION | "authentication" | | DELIVERY | "delivery" | diff --git a/sdks/java-v2/docs/SubSignatureRequestTemplateSigner.md b/sdks/java-v2/docs/SubSignatureRequestTemplateSigner.md index 0db962b83..866b37355 100644 --- a/sdks/java-v2/docs/SubSignatureRequestTemplateSigner.md +++ b/sdks/java-v2/docs/SubSignatureRequestTemplateSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `role`*_required_ | ```String``` | Must match an existing role in chosen Template(s). It's case-sensitive. | | | `name`*_required_ | ```String``` | The name of the signer. | | | `emailAddress`*_required_ | ```String``` | The email address of the signer. | | @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Enum: SmsPhoneNumberTypeEnum -Name | Value +| Name | Value | ---- | ----- | AUTHENTICATION | "authentication" | | DELIVERY | "delivery" | diff --git a/sdks/java-v2/docs/SubSigningOptions.md b/sdks/java-v2/docs/SubSigningOptions.md index b4acf7f5f..bca116053 100644 --- a/sdks/java-v2/docs/SubSigningOptions.md +++ b/sdks/java-v2/docs/SubSigningOptions.md @@ -8,8 +8,8 @@ This allows the requester to specify the types allowed for creating a signature. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `defaultType`*_required_ | [```DefaultTypeEnum```](#DefaultTypeEnum) | The default type shown (limited to the listed types) | | | `draw` | ```Boolean``` | Allows drawing the signature | | | `phone` | ```Boolean``` | Allows using a smartphone to email the signature | | @@ -20,7 +20,7 @@ Name | Type | Description | Notes ## Enum: DefaultTypeEnum -Name | Value +| Name | Value | ---- | ----- | DRAW | "draw" | | PHONE | "phone" | diff --git a/sdks/java-v2/docs/SubTeamResponse.md b/sdks/java-v2/docs/SubTeamResponse.md index 2b6753033..df784d080 100644 --- a/sdks/java-v2/docs/SubTeamResponse.md +++ b/sdks/java-v2/docs/SubTeamResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `teamId` | ```String``` | The id of a team | | | `name` | ```String``` | The name of a team | | diff --git a/sdks/java-v2/docs/SubTemplateRole.md b/sdks/java-v2/docs/SubTemplateRole.md index 88784cd94..a1ee8e0ea 100644 --- a/sdks/java-v2/docs/SubTemplateRole.md +++ b/sdks/java-v2/docs/SubTemplateRole.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The role name of the signer that will be displayed when the template is used to create a signature request. | | | `order` | ```Integer``` | The order in which this signer role is required to sign. | | diff --git a/sdks/java-v2/docs/SubUnclaimedDraftSigner.md b/sdks/java-v2/docs/SubUnclaimedDraftSigner.md index 70eeb3b07..fec680ac2 100644 --- a/sdks/java-v2/docs/SubUnclaimedDraftSigner.md +++ b/sdks/java-v2/docs/SubUnclaimedDraftSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress`*_required_ | ```String``` | The email address of the signer. | | | `name`*_required_ | ```String``` | The name of the signer. | | | `order` | ```Integer``` | The order the signer is required to sign in. | | diff --git a/sdks/java-v2/docs/SubUnclaimedDraftTemplateSigner.md b/sdks/java-v2/docs/SubUnclaimedDraftTemplateSigner.md index 5e164c44e..1c6547670 100644 --- a/sdks/java-v2/docs/SubUnclaimedDraftTemplateSigner.md +++ b/sdks/java-v2/docs/SubUnclaimedDraftTemplateSigner.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `role`*_required_ | ```String``` | Must match an existing role in chosen Template(s). | | | `name`*_required_ | ```String``` | The name of the signer filling the role of `role`. | | | `emailAddress`*_required_ | ```String``` | The email address of the signer filling the role of `role`. | | diff --git a/sdks/java-v2/docs/SubWhiteLabelingOptions.md b/sdks/java-v2/docs/SubWhiteLabelingOptions.md index c3cb04589..0a5880da3 100644 --- a/sdks/java-v2/docs/SubWhiteLabelingOptions.md +++ b/sdks/java-v2/docs/SubWhiteLabelingOptions.md @@ -8,8 +8,8 @@ Take a look at our [white labeling guide](https://developers.hellosign.com/api/r ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `headerBackgroundColor` | ```String``` | | | | `legalVersion` | [```LegalVersionEnum```](#LegalVersionEnum) | | | | `linkColor` | ```String``` | | | @@ -30,7 +30,7 @@ Name | Type | Description | Notes ## Enum: LegalVersionEnum -Name | Value +| Name | Value | ---- | ----- | TERMS1 | "terms1" | | TERMS2 | "terms2" | diff --git a/sdks/java-v2/docs/TeamAddMemberRequest.md b/sdks/java-v2/docs/TeamAddMemberRequest.md index 062c8b861..122e45b31 100644 --- a/sdks/java-v2/docs/TeamAddMemberRequest.md +++ b/sdks/java-v2/docs/TeamAddMemberRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | `account_id` or `email_address` is required. If both are provided, the account id prevails.

Account id of the user to invite to your Team. | | | `emailAddress` | ```String``` | `account_id` or `email_address` is required, If both are provided, the account id prevails.

Email address of the user to invite to your Team. | | | `role` | [```RoleEnum```](#RoleEnum) | A role member will take in a new Team.

**NOTE:** This parameter is used only if `team_id` is provided. | | @@ -16,7 +16,7 @@ Name | Type | Description | Notes ## Enum: RoleEnum -Name | Value +| Name | Value | ---- | ----- | MEMBER | "Member" | | DEVELOPER | "Developer" | diff --git a/sdks/java-v2/docs/TeamApi.md b/sdks/java-v2/docs/TeamApi.md index 252559811..b35b40ea8 100644 --- a/sdks/java-v2/docs/TeamApi.md +++ b/sdks/java-v2/docs/TeamApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**teamAddMember**](TeamApi.md#teamAddMember) | **PUT** /team/add_member | Add User to Team [**teamCreate**](TeamApi.md#teamCreate) | **POST** /team/create | Create Team [**teamDelete**](TeamApi.md#teamDelete) | **DELETE** /team/destroy | Delete Team @@ -70,8 +70,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamAddMemberRequest** | [**TeamAddMemberRequest**](TeamAddMemberRequest.md)| | **teamId** | **String**| The id of the team. | [optional] @@ -146,8 +146,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamCreateRequest** | [**TeamCreateRequest**](TeamCreateRequest.md)| | ### Return type @@ -354,8 +354,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamId** | **String**| The id of the team. | [optional] ### Return type @@ -428,8 +428,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **emailAddress** | **String**| The email address for which to display the team invites. | [optional] ### Return type @@ -504,8 +504,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamId** | **String**| The id of the team that a member list is being requested from. | **page** | **Integer**| Which page number of the team member list to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -582,8 +582,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamRemoveMemberRequest** | [**TeamRemoveMemberRequest**](TeamRemoveMemberRequest.md)| | ### Return type @@ -658,8 +658,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamId** | **String**| The id of the parent Team. | **page** | **Integer**| Which page number of the SubTeam List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -735,8 +735,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **teamUpdateRequest** | [**TeamUpdateRequest**](TeamUpdateRequest.md)| | ### Return type diff --git a/sdks/java-v2/docs/TeamCreateRequest.md b/sdks/java-v2/docs/TeamCreateRequest.md index cb70adc3d..1a4861618 100644 --- a/sdks/java-v2/docs/TeamCreateRequest.md +++ b/sdks/java-v2/docs/TeamCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of your Team. | | diff --git a/sdks/java-v2/docs/TeamGetInfoResponse.md b/sdks/java-v2/docs/TeamGetInfoResponse.md index 3b6d3e350..1d2bc62a7 100644 --- a/sdks/java-v2/docs/TeamGetInfoResponse.md +++ b/sdks/java-v2/docs/TeamGetInfoResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `team` | [```TeamInfoResponse```](TeamInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `team`*_required_ | [```TeamInfoResponse```](TeamInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/TeamGetResponse.md b/sdks/java-v2/docs/TeamGetResponse.md index fe2d79fa2..690796e1f 100644 --- a/sdks/java-v2/docs/TeamGetResponse.md +++ b/sdks/java-v2/docs/TeamGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `team` | [```TeamResponse```](TeamResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `team`*_required_ | [```TeamResponse```](TeamResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/TeamInfoResponse.md b/sdks/java-v2/docs/TeamInfoResponse.md index aaf76ca89..a776d4e09 100644 --- a/sdks/java-v2/docs/TeamInfoResponse.md +++ b/sdks/java-v2/docs/TeamInfoResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `teamId` | ```String``` | The id of a team | | | `teamParent` | [```TeamParentResponse```](TeamParentResponse.md) | | | | `name` | ```String``` | The name of a team | | diff --git a/sdks/java-v2/docs/TeamInviteResponse.md b/sdks/java-v2/docs/TeamInviteResponse.md index 317bec3b0..c23aa4ed7 100644 --- a/sdks/java-v2/docs/TeamInviteResponse.md +++ b/sdks/java-v2/docs/TeamInviteResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `emailAddress` | ```String``` | Email address of the user invited to this team. | | | `teamId` | ```String``` | Id of the team. | | | `role` | ```String``` | Role of the user invited to this team. | | diff --git a/sdks/java-v2/docs/TeamInvitesResponse.md b/sdks/java-v2/docs/TeamInvitesResponse.md index 5f0e66963..bdb648bb3 100644 --- a/sdks/java-v2/docs/TeamInvitesResponse.md +++ b/sdks/java-v2/docs/TeamInvitesResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `teamInvites` | [```List```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `teamInvites`*_required_ | [```List```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | | `warnings` | [```List```](WarningResponse.md) | | | diff --git a/sdks/java-v2/docs/TeamMemberResponse.md b/sdks/java-v2/docs/TeamMemberResponse.md index e35f8f660..eb42aa095 100644 --- a/sdks/java-v2/docs/TeamMemberResponse.md +++ b/sdks/java-v2/docs/TeamMemberResponse.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | Account id of the team member. | | | `emailAddress` | ```String``` | Email address of the team member. | | | `role` | ```String``` | The specific role a member has on the team. | | diff --git a/sdks/java-v2/docs/TeamMembersResponse.md b/sdks/java-v2/docs/TeamMembersResponse.md index d3e5e6775..785318277 100644 --- a/sdks/java-v2/docs/TeamMembersResponse.md +++ b/sdks/java-v2/docs/TeamMembersResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `teamMembers` | [```List```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `teamMembers`*_required_ | [```List```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | | | diff --git a/sdks/java-v2/docs/TeamParentResponse.md b/sdks/java-v2/docs/TeamParentResponse.md index 1a0d49c49..c6ba18a98 100644 --- a/sdks/java-v2/docs/TeamParentResponse.md +++ b/sdks/java-v2/docs/TeamParentResponse.md @@ -6,8 +6,8 @@ Information about the parent team if a team has one, set to `null` otherwise. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `teamId` | ```String``` | The id of a team | | | `name` | ```String``` | The name of a team | | diff --git a/sdks/java-v2/docs/TeamRemoveMemberRequest.md b/sdks/java-v2/docs/TeamRemoveMemberRequest.md index 79d3a4c1b..46f48538a 100644 --- a/sdks/java-v2/docs/TeamRemoveMemberRequest.md +++ b/sdks/java-v2/docs/TeamRemoveMemberRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Account id to remove from your Team. | | | `emailAddress` | ```String``` | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Email address of the Account to remove from your Team. | | | `newOwnerEmailAddress` | ```String``` | The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account.

**NOTE:** Only available for Enterprise plans. | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes ## Enum: NewRoleEnum -Name | Value +| Name | Value | ---- | ----- | MEMBER | "Member" | | DEVELOPER | "Developer" | diff --git a/sdks/java-v2/docs/TeamResponse.md b/sdks/java-v2/docs/TeamResponse.md index 26061033a..ca6344cfc 100644 --- a/sdks/java-v2/docs/TeamResponse.md +++ b/sdks/java-v2/docs/TeamResponse.md @@ -6,8 +6,8 @@ Contains information about your team and its members ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of your Team | | | `accounts` | [```List```](AccountResponse.md) | | | | `invitedAccounts` | [```List```](AccountResponse.md) | A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. | | diff --git a/sdks/java-v2/docs/TeamSubTeamsResponse.md b/sdks/java-v2/docs/TeamSubTeamsResponse.md index 1b618f8a7..636aa33eb 100644 --- a/sdks/java-v2/docs/TeamSubTeamsResponse.md +++ b/sdks/java-v2/docs/TeamSubTeamsResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `subTeams` | [```List```](SubTeamResponse.md) | Contains a list with sub teams. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `subTeams`*_required_ | [```List```](SubTeamResponse.md) | Contains a list with sub teams. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | | | diff --git a/sdks/java-v2/docs/TeamUpdateRequest.md b/sdks/java-v2/docs/TeamUpdateRequest.md index 545510d88..9df0fe1da 100644 --- a/sdks/java-v2/docs/TeamUpdateRequest.md +++ b/sdks/java-v2/docs/TeamUpdateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of your Team. | | diff --git a/sdks/java-v2/docs/TemplateAddUserRequest.md b/sdks/java-v2/docs/TemplateAddUserRequest.md index 5415106a3..74966192b 100644 --- a/sdks/java-v2/docs/TemplateAddUserRequest.md +++ b/sdks/java-v2/docs/TemplateAddUserRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The id of the Account to give access to the Template.
**NOTE:** The account id prevails if email address is also provided. | | | `emailAddress` | ```String``` | The email address of the Account to give access to the Template.
**NOTE:** The account id prevails if it is also provided. | | | `skipNotification` | ```Boolean``` | If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. | | diff --git a/sdks/java-v2/docs/TemplateApi.md b/sdks/java-v2/docs/TemplateApi.md index 0a2a4480b..a3394d6a1 100644 --- a/sdks/java-v2/docs/TemplateApi.md +++ b/sdks/java-v2/docs/TemplateApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**templateAddUser**](TemplateApi.md#templateAddUser) | **POST** /template/add_user/{template_id} | Add User to Template [**templateCreate**](TemplateApi.md#templateCreate) | **POST** /template/create | Create Template [**templateCreateEmbeddedDraft**](TemplateApi.md#templateCreateEmbeddedDraft) | **POST** /template/create_embedded_draft | Create Embedded Template Draft @@ -71,8 +71,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to give the Account access to. | **templateAddUserRequest** | [**TemplateAddUserRequest**](TemplateAddUserRequest.md)| | @@ -178,8 +178,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateCreateRequest** | [**TemplateCreateRequest**](TemplateCreateRequest.md)| | ### Return type @@ -284,8 +284,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateCreateEmbeddedDraftRequest** | [**TemplateCreateEmbeddedDraftRequest**](TemplateCreateEmbeddedDraftRequest.md)| | ### Return type @@ -356,8 +356,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to delete. | ### Return type @@ -433,8 +433,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template files to retrieve. | **fileType** | **String**| Set to `pdf` for a single merged document or `zip` for a collection of individual documents. | [optional] [enum: pdf, zip] @@ -510,8 +510,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template files to retrieve. | ### Return type @@ -586,8 +586,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the template files to retrieve. | **forceDownload** | **Integer**| By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. | [optional] [default to 1] @@ -661,8 +661,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to retrieve. | ### Return type @@ -740,8 +740,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **accountId** | **String**| Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. | [optional] **page** | **Integer**| Which page number of the Template List to return. Defaults to `1`. | [optional] [default to 1] **pageSize** | **Integer**| Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. | [optional] [default to 20] @@ -820,8 +820,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The id of the Template to remove the Account's access to. | **templateRemoveUserRequest** | [**TemplateRemoveUserRequest**](TemplateRemoveUserRequest.md)| | @@ -911,8 +911,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **templateId** | **String**| The ID of the template whose files to update. | **templateUpdateFilesRequest** | [**TemplateUpdateFilesRequest**](TemplateUpdateFilesRequest.md)| | diff --git a/sdks/java-v2/docs/TemplateCreateEmbeddedDraftRequest.md b/sdks/java-v2/docs/TemplateCreateEmbeddedDraftRequest.md index be051c8ff..05f2497fc 100644 --- a/sdks/java-v2/docs/TemplateCreateEmbeddedDraftRequest.md +++ b/sdks/java-v2/docs/TemplateCreateEmbeddedDraftRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | diff --git a/sdks/java-v2/docs/TemplateCreateEmbeddedDraftResponse.md b/sdks/java-v2/docs/TemplateCreateEmbeddedDraftResponse.md index 2109e4f27..f25b48d33 100644 --- a/sdks/java-v2/docs/TemplateCreateEmbeddedDraftResponse.md +++ b/sdks/java-v2/docs/TemplateCreateEmbeddedDraftResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/TemplateCreateEmbeddedDraftResponseTemplate.md b/sdks/java-v2/docs/TemplateCreateEmbeddedDraftResponseTemplate.md index 7b7dc1e7b..770cce434 100644 --- a/sdks/java-v2/docs/TemplateCreateEmbeddedDraftResponseTemplate.md +++ b/sdks/java-v2/docs/TemplateCreateEmbeddedDraftResponseTemplate.md @@ -6,8 +6,8 @@ Template object with parameters: `template_id`, `edit_url`, `expires_at`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | | `editUrl` | ```String``` | Link to edit the template. | | | `expiresAt` | ```Integer``` | When the link expires. | | diff --git a/sdks/java-v2/docs/TemplateCreateRequest.md b/sdks/java-v2/docs/TemplateCreateRequest.md index 4d529fdb8..5f99510d9 100644 --- a/sdks/java-v2/docs/TemplateCreateRequest.md +++ b/sdks/java-v2/docs/TemplateCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `formFieldsPerDocument`*_required_ | [```List```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | | `signerRoles`*_required_ | [```List```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | diff --git a/sdks/java-v2/docs/TemplateCreateResponse.md b/sdks/java-v2/docs/TemplateCreateResponse.md index 6554466f2..3c7389668 100644 --- a/sdks/java-v2/docs/TemplateCreateResponse.md +++ b/sdks/java-v2/docs/TemplateCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/TemplateCreateResponseTemplate.md b/sdks/java-v2/docs/TemplateCreateResponseTemplate.md index ae09826fb..1dcd4bd79 100644 --- a/sdks/java-v2/docs/TemplateCreateResponseTemplate.md +++ b/sdks/java-v2/docs/TemplateCreateResponseTemplate.md @@ -6,8 +6,8 @@ Template object with parameters: `template_id`. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | diff --git a/sdks/java-v2/docs/TemplateEditResponse.md b/sdks/java-v2/docs/TemplateEditResponse.md index fe7f90761..88d225e68 100644 --- a/sdks/java-v2/docs/TemplateEditResponse.md +++ b/sdks/java-v2/docs/TemplateEditResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `templateId` | ```String``` | The id of the Template. | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templateId`*_required_ | ```String``` | The id of the Template. | | diff --git a/sdks/java-v2/docs/TemplateGetResponse.md b/sdks/java-v2/docs/TemplateGetResponse.md index 3e073bab8..2ee4867f0 100644 --- a/sdks/java-v2/docs/TemplateGetResponse.md +++ b/sdks/java-v2/docs/TemplateGetResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateResponse```](TemplateResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateResponse```](TemplateResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/TemplateListResponse.md b/sdks/java-v2/docs/TemplateListResponse.md index 83e54d785..92b720c58 100644 --- a/sdks/java-v2/docs/TemplateListResponse.md +++ b/sdks/java-v2/docs/TemplateListResponse.md @@ -6,10 +6,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `templates` | [```List```](TemplateResponse.md) | List of templates that the API caller has access to. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `templates`*_required_ | [```List```](TemplateResponse.md) | List of templates that the API caller has access to. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/TemplateRemoveUserRequest.md b/sdks/java-v2/docs/TemplateRemoveUserRequest.md index c2697022a..72a3a585a 100644 --- a/sdks/java-v2/docs/TemplateRemoveUserRequest.md +++ b/sdks/java-v2/docs/TemplateRemoveUserRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | | | `emailAddress` | ```String``` | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | | diff --git a/sdks/java-v2/docs/TemplateResponse.md b/sdks/java-v2/docs/TemplateResponse.md index 7811ccc0c..078685ff1 100644 --- a/sdks/java-v2/docs/TemplateResponse.md +++ b/sdks/java-v2/docs/TemplateResponse.md @@ -6,8 +6,8 @@ Contains information about the templates you and your team have created. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | | `title` | ```String``` | The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | | | `message` | ```String``` | The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | | diff --git a/sdks/java-v2/docs/TemplateResponseAccount.md b/sdks/java-v2/docs/TemplateResponseAccount.md index bf956bf0e..10c996408 100644 --- a/sdks/java-v2/docs/TemplateResponseAccount.md +++ b/sdks/java-v2/docs/TemplateResponseAccount.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `accountId` | ```String``` | The id of the Account. | | | `emailAddress` | ```String``` | The email address associated with the Account. | | | `isLocked` | ```Boolean``` | Returns `true` if the user has been locked out of their account by a team admin. | | diff --git a/sdks/java-v2/docs/TemplateResponseAccountQuota.md b/sdks/java-v2/docs/TemplateResponseAccountQuota.md index 2ef4344da..ad94c2493 100644 --- a/sdks/java-v2/docs/TemplateResponseAccountQuota.md +++ b/sdks/java-v2/docs/TemplateResponseAccountQuota.md @@ -6,8 +6,8 @@ An array of the designated CC roles that must be specified when sending a Signat ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templatesLeft` | ```Integer``` | API templates remaining. | | | `apiSignatureRequestsLeft` | ```Integer``` | API signature requests remaining. | | | `documentsLeft` | ```Integer``` | Signature requests remaining. | | diff --git a/sdks/java-v2/docs/TemplateResponseCCRole.md b/sdks/java-v2/docs/TemplateResponseCCRole.md index 1701c9739..64069b826 100644 --- a/sdks/java-v2/docs/TemplateResponseCCRole.md +++ b/sdks/java-v2/docs/TemplateResponseCCRole.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of the Role. | | diff --git a/sdks/java-v2/docs/TemplateResponseDocument.md b/sdks/java-v2/docs/TemplateResponseDocument.md index e0a090d3b..65da85d42 100644 --- a/sdks/java-v2/docs/TemplateResponseDocument.md +++ b/sdks/java-v2/docs/TemplateResponseDocument.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | Name of the associated file. | | | `index` | ```Integer``` | Document ordering, the lowest index is displayed first and the highest last (0-based indexing). | | | `fieldGroups` | [```List```](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldBase.md b/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldBase.md index 33ba5cdce..edd461727 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldBase.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldBase.md @@ -6,8 +6,8 @@ An array of Form Field objects containing the name and type of each named field. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | | | | `apiId` | ```String``` | The unique ID for this field. | | | `name` | ```String``` | The name of the Custom Field. | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldCheckbox.md b/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldCheckbox.md index f69fa79e6..dbde79072 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldCheckbox.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentCustomFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldText.md b/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldText.md index 9fa8d7aac..ccaf19394 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldText.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentCustomFieldText.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentCustomFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | | | `avgTextLength` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `isMultiline` | ```Boolean``` | Whether this form field is multiline text. | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFieldGroup.md b/sdks/java-v2/docs/TemplateResponseDocumentFieldGroup.md index 568bd52ab..03b5ffbb8 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFieldGroup.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFieldGroup.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of the form field group. | | | `rule` | [```TemplateResponseDocumentFieldGroupRule```](TemplateResponseDocumentFieldGroupRule.md) | | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFieldGroupRule.md b/sdks/java-v2/docs/TemplateResponseDocumentFieldGroupRule.md index 48b234ac6..e0f4dcc8a 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFieldGroupRule.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFieldGroupRule.md @@ -6,8 +6,8 @@ The rule used to validate checkboxes in the form field group. See [checkbox fiel ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `requirement` | ```String``` | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | | | `groupLabel` | ```String``` | Name of the group | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldBase.md b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldBase.md index 00696c3d2..656070ad4 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldBase.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldBase.md @@ -6,8 +6,8 @@ An array of Form Field objects containing the name and type of each named field. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | | | | `apiId` | ```String``` | A unique id for the form field. | | | `name` | ```String``` | The name of the form field. | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldCheckbox.md b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldCheckbox.md index 95a9c47cd..83d36e0f1 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldCheckbox.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldDateSigned.md b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldDateSigned.md index 4aeb9b383..5ba66eff9 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldDateSigned.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldDateSigned.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldDropdown.md b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldDropdown.md index f4abfa605..b4f2030fc 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldDropdown.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldDropdown.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldHyperlink.md b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldHyperlink.md index c59fa688f..0cf89df5e 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldHyperlink.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldHyperlink.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | | `avgTextLength` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `isMultiline` | ```Boolean``` | Whether this form field is multiline text. | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldInitials.md b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldInitials.md index 487fde46b..707d67ee2 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldInitials.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldInitials.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldRadio.md b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldRadio.md index d08e6501d..b83d96d53 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldRadio.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldRadio.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldSignature.md b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldSignature.md index 08173e8a6..8be298793 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldSignature.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldSignature.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldText.md b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldText.md index a7eec6d4b..3581d3855 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentFormFieldText.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentFormFieldText.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | | | `avgTextLength` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `isMultiline` | ```Boolean``` | Whether this form field is multiline text. | | @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Enum: ValidationTypeEnum -Name | Value +| Name | Value | ---- | ----- | NUMBERS_ONLY | "numbers_only" | | LETTERS_ONLY | "letters_only" | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldBase.md b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldBase.md index 18c56b865..4be3cf070 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldBase.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldBase.md @@ -6,8 +6,8 @@ An array describing static overlay fields. **NOTE:** Only available for certain ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | | | | `apiId` | ```String``` | A unique id for the static field. | | | `name` | ```String``` | The name of the static field. | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldCheckbox.md b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldCheckbox.md index d33f03d6c..6cd94853c 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldCheckbox.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldCheckbox.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldDateSigned.md b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldDateSigned.md index 5e0eaa675..d5c530d8b 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldDateSigned.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldDateSigned.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldDropdown.md b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldDropdown.md index bb9f131dc..53505315e 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldDropdown.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldDropdown.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldHyperlink.md b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldHyperlink.md index a38e229fb..930658b69 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldHyperlink.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldHyperlink.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldInitials.md b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldInitials.md index 202640121..67d755703 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldInitials.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldInitials.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldRadio.md b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldRadio.md index 7a140face..ed32ccca6 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldRadio.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldRadio.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldSignature.md b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldSignature.md index e9a037282..61f8902f8 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldSignature.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldSignature.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldText.md b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldText.md index 4135e5f7d..3dced017f 100644 --- a/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldText.md +++ b/sdks/java-v2/docs/TemplateResponseDocumentStaticFieldText.md @@ -6,8 +6,8 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | ```String``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | | diff --git a/sdks/java-v2/docs/TemplateResponseFieldAvgTextLength.md b/sdks/java-v2/docs/TemplateResponseFieldAvgTextLength.md index c1fda157a..bb66f3057 100644 --- a/sdks/java-v2/docs/TemplateResponseFieldAvgTextLength.md +++ b/sdks/java-v2/docs/TemplateResponseFieldAvgTextLength.md @@ -6,8 +6,8 @@ Average text length in this field. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `numLines` | ```Integer``` | Number of lines. | | | `numCharsPerLine` | ```Integer``` | Number of characters per line. | | diff --git a/sdks/java-v2/docs/TemplateResponseSignerRole.md b/sdks/java-v2/docs/TemplateResponseSignerRole.md index b95231dde..15b48cf17 100644 --- a/sdks/java-v2/docs/TemplateResponseSignerRole.md +++ b/sdks/java-v2/docs/TemplateResponseSignerRole.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `name` | ```String``` | The name of the Role. | | | `order` | ```Integer``` | If signer order is assigned this is the 0-based index for this role. | | diff --git a/sdks/java-v2/docs/TemplateUpdateFilesRequest.md b/sdks/java-v2/docs/TemplateUpdateFilesRequest.md index 2bebedb2e..8671b87f8 100644 --- a/sdks/java-v2/docs/TemplateUpdateFilesRequest.md +++ b/sdks/java-v2/docs/TemplateUpdateFilesRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId` | ```String``` | Client id of the app you're using to update this template. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to use for the template.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | diff --git a/sdks/java-v2/docs/TemplateUpdateFilesResponse.md b/sdks/java-v2/docs/TemplateUpdateFilesResponse.md index 127b29541..70930e1c8 100644 --- a/sdks/java-v2/docs/TemplateUpdateFilesResponse.md +++ b/sdks/java-v2/docs/TemplateUpdateFilesResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `template` | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `template`*_required_ | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | diff --git a/sdks/java-v2/docs/TemplateUpdateFilesResponseTemplate.md b/sdks/java-v2/docs/TemplateUpdateFilesResponseTemplate.md index 9c198aaa7..6289a9953 100644 --- a/sdks/java-v2/docs/TemplateUpdateFilesResponseTemplate.md +++ b/sdks/java-v2/docs/TemplateUpdateFilesResponseTemplate.md @@ -6,8 +6,8 @@ Contains template id ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `templateId` | ```String``` | The id of the Template. | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/UnclaimedDraftApi.md b/sdks/java-v2/docs/UnclaimedDraftApi.md index fbdf78216..4d6d12451 100644 --- a/sdks/java-v2/docs/UnclaimedDraftApi.md +++ b/sdks/java-v2/docs/UnclaimedDraftApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| [**unclaimedDraftCreate**](UnclaimedDraftApi.md#unclaimedDraftCreate) | **POST** /unclaimed_draft/create | Create Unclaimed Draft [**unclaimedDraftCreateEmbedded**](UnclaimedDraftApi.md#unclaimedDraftCreateEmbedded) | **POST** /unclaimed_draft/create_embedded | Create Embedded Unclaimed Draft [**unclaimedDraftCreateEmbeddedWithTemplate**](UnclaimedDraftApi.md#unclaimedDraftCreateEmbeddedWithTemplate) | **POST** /unclaimed_draft/create_embedded_with_template | Create Embedded Unclaimed Draft with Template @@ -95,8 +95,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **unclaimedDraftCreateRequest** | [**UnclaimedDraftCreateRequest**](UnclaimedDraftCreateRequest.md)| | ### Return type @@ -177,8 +177,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **unclaimedDraftCreateEmbeddedRequest** | [**UnclaimedDraftCreateEmbeddedRequest**](UnclaimedDraftCreateEmbeddedRequest.md)| | ### Return type @@ -270,8 +270,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **unclaimedDraftCreateEmbeddedWithTemplateRequest** | [**UnclaimedDraftCreateEmbeddedWithTemplateRequest**](UnclaimedDraftCreateEmbeddedWithTemplateRequest.md)| | ### Return type @@ -350,8 +350,8 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| **signatureRequestId** | **String**| The ID of the signature request to edit and resend. | **unclaimedDraftEditAndResendRequest** | [**UnclaimedDraftEditAndResendRequest**](UnclaimedDraftEditAndResendRequest.md)| | diff --git a/sdks/java-v2/docs/UnclaimedDraftCreateEmbeddedRequest.md b/sdks/java-v2/docs/UnclaimedDraftCreateEmbeddedRequest.md index 60eebef2c..aab362d77 100644 --- a/sdks/java-v2/docs/UnclaimedDraftCreateEmbeddedRequest.md +++ b/sdks/java-v2/docs/UnclaimedDraftCreateEmbeddedRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `requesterEmailAddress`*_required_ | ```String``` | The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | @@ -49,7 +49,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | SEND_DOCUMENT | "send_document" | | REQUEST_SIGNATURE | "request_signature" | diff --git a/sdks/java-v2/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md b/sdks/java-v2/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md index 52b517517..03ad8b9e5 100644 --- a/sdks/java-v2/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +++ b/sdks/java-v2/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `requesterEmailAddress`*_required_ | ```String``` | The email address of the user that should be designated as the requester of this draft. | | | `templateIds`*_required_ | ```List``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | | diff --git a/sdks/java-v2/docs/UnclaimedDraftCreateRequest.md b/sdks/java-v2/docs/UnclaimedDraftCreateRequest.md index cd8249aa1..f23c6f4ba 100644 --- a/sdks/java-v2/docs/UnclaimedDraftCreateRequest.md +++ b/sdks/java-v2/docs/UnclaimedDraftCreateRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `type`*_required_ | [```TypeEnum```](#TypeEnum) | The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. | | | `files` | ```List``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | @@ -37,7 +37,7 @@ Name | Type | Description | Notes ## Enum: TypeEnum -Name | Value +| Name | Value | ---- | ----- | SEND_DOCUMENT | "send_document" | | REQUEST_SIGNATURE | "request_signature" | diff --git a/sdks/java-v2/docs/UnclaimedDraftCreateResponse.md b/sdks/java-v2/docs/UnclaimedDraftCreateResponse.md index 65ed7f98e..d2d3a7c4a 100644 --- a/sdks/java-v2/docs/UnclaimedDraftCreateResponse.md +++ b/sdks/java-v2/docs/UnclaimedDraftCreateResponse.md @@ -6,9 +6,9 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -| `unclaimedDraft` | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +| `unclaimedDraft`*_required_ | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | | `warnings` | [```List```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/java-v2/docs/UnclaimedDraftEditAndResendRequest.md b/sdks/java-v2/docs/UnclaimedDraftEditAndResendRequest.md index daefa5a1e..8eb306a31 100644 --- a/sdks/java-v2/docs/UnclaimedDraftEditAndResendRequest.md +++ b/sdks/java-v2/docs/UnclaimedDraftEditAndResendRequest.md @@ -6,8 +6,8 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `clientId`*_required_ | ```String``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `editorOptions` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `isForEmbeddedSigning` | ```Boolean``` | The request created from this draft will also be signable in embedded mode if set to `true`. | | diff --git a/sdks/java-v2/docs/UnclaimedDraftResponse.md b/sdks/java-v2/docs/UnclaimedDraftResponse.md index ab1858d8e..ab470a27d 100644 --- a/sdks/java-v2/docs/UnclaimedDraftResponse.md +++ b/sdks/java-v2/docs/UnclaimedDraftResponse.md @@ -6,8 +6,8 @@ A group of documents that a user can take ownership of via the claim URL. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `signatureRequestId` | ```String``` | The ID of the signature request that is represented by this UnclaimedDraft. | | | `claimUrl` | ```String``` | The URL to be used to claim this UnclaimedDraft. | | | `signingRedirectUrl` | ```String``` | The URL you want signers redirected to after they successfully sign. | | diff --git a/sdks/java-v2/docs/WarningResponse.md b/sdks/java-v2/docs/WarningResponse.md index b041bb35c..50cad9b58 100644 --- a/sdks/java-v2/docs/WarningResponse.md +++ b/sdks/java-v2/docs/WarningResponse.md @@ -6,8 +6,8 @@ A list of warnings. ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| | `warningMsg`*_required_ | ```String``` | Warning message | | | `warningName`*_required_ | ```String``` | Warning name | | diff --git a/sdks/java-v2/gradle.properties b/sdks/java-v2/gradle.properties index 9fb39c443..27fa3e3af 100644 --- a/sdks/java-v2/gradle.properties +++ b/sdks/java-v2/gradle.properties @@ -6,7 +6,7 @@ #target = android GROUP=com.dropbox.sign POM_ARTIFACT_ID=dropbox-sign -VERSION_NAME=2.1-dev +VERSION_NAME=2.2-dev POM_NAME=Dropbox Sign Java SDK POM_DESCRIPTION=Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! diff --git a/sdks/java-v2/gradle/wrapper/gradle-wrapper.jar b/sdks/java-v2/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 7454180f2..000000000 Binary files a/sdks/java-v2/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/sdks/java-v2/gradle/wrapper/gradle-wrapper.properties b/sdks/java-v2/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 774fae876..000000000 --- a/sdks/java-v2/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/sdks/java-v2/gradlew b/sdks/java-v2/gradlew index 005bcde04..9d0ce634c 100755 --- a/sdks/java-v2/gradlew +++ b/sdks/java-v2/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi +fi else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/sdks/java-v2/gradlew.bat b/sdks/java-v2/gradlew.bat index 6a68175eb..25da30dbd 100644 --- a/sdks/java-v2/gradlew.bat +++ b/sdks/java-v2/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/sdks/java-v2/openapi-config.yaml b/sdks/java-v2/openapi-config.yaml index 36135d101..b6d8ef988 100644 --- a/sdks/java-v2/openapi-config.yaml +++ b/sdks/java-v2/openapi-config.yaml @@ -3,10 +3,8 @@ additionalProperties: library: jersey3 openApiNullable: false java8: true - # TODO preferably remove threetenbp (https://github.com/OpenAPITools/openapi-generator/pull/10025) - threetenbp: true useJakartaEe: true - swagger1AnnotationLibrary: true + swagger1AnnotationLibrary: false invokerPackage: com.dropbox.sign apiPackage: com.dropbox.sign.api modelPackage: com.dropbox.sign.model @@ -20,7 +18,7 @@ additionalProperties: groupId: com.dropbox.sign artifactId: dropbox-sign artifactName: Dropbox Sign Java SDK - artifactVersion: "2.1-dev" + artifactVersion: "2.2-dev" artifactUrl: https://github.com/hellosign/dropbox-sign-java artifactDescription: Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! scmConnection: scm:git:git://github.com/hellosign/dropbox-sign-java.git @@ -28,14 +26,11 @@ additionalProperties: scmUrl: https://github.com/hellosign/dropbox-sign-java licenseName: MIT License licenseUrl: https://www.opensource.org/licenses/mit-license.php - + useCustomTemplateCode: true files: EventCallbackHelper.mustache: templateType: SupportingFiles destinationFilename: src/main/java/com/dropbox/sign/EventCallbackHelper.java - CustomInstantDeserializer.mustache: - templateType: SupportingFiles - destinationFilename: src/main/java/com/dropbox/sign/CustomInstantDeserializer.java VERSION.mustache: templateType: SupportingFiles destinationFilename: VERSION diff --git a/sdks/java-v2/pom.xml b/sdks/java-v2/pom.xml index 1a4319e2d..bea89462f 100644 --- a/sdks/java-v2/pom.xml +++ b/sdks/java-v2/pom.xml @@ -5,7 +5,7 @@ dropbox-sign jar dropbox-sign - 2.1-dev + 2.2-dev https://github.com/hellosign/dropbox-sign-java Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! @@ -58,12 +58,12 @@ maven-surefire-plugin 3.0.0-M5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -268,9 +268,9 @@ - io.swagger - swagger-annotations - ${swagger-annotations-version} + commons-codec + commons-codec + 1.15 @@ -323,11 +323,6 @@ jackson-datatype-jsr310 ${jackson-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -341,8 +336,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -355,14 +350,12 @@ UTF-8 - 1.6.6 - 3.0.4 - 2.13.4 - 2.13.4.2 + 3.1.1 + 2.17.1 + 2.17.1 0.2.6 - 2.9.10 - 2.1.0 - 4.13.1 + 2.1.1 + 5.10.0 2.21.0 3.12.4 diff --git a/sdks/java-v2/run-build b/sdks/java-v2/run-build index 8bcce9f71..1e1cfec3e 100755 --- a/sdks/java-v2/run-build +++ b/sdks/java-v2/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/v5.4.0/modules/openapi-generator/src/main/resources/Java +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/Java set -e @@ -9,7 +9,7 @@ WORKING_DIR="/app/java" docker run --rm \ -v "${DIR}/:/local" \ - openapitools/openapi-generator-cli:v7.0.1 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/ApiClient.java b/sdks/java-v2/src/main/java/com/dropbox/sign/ApiClient.java index 67d6f7e2f..2e78822f3 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/ApiClient.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/ApiClient.java @@ -1,3 +1,16 @@ +/* + * 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; import jakarta.ws.rs.client.Client; @@ -51,7 +64,7 @@ import java.util.Date; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.threeten.bp.OffsetDateTime; +import java.time.OffsetDateTime; import java.net.URLEncoder; @@ -66,13 +79,12 @@ import com.dropbox.sign.auth.HttpBasicAuth; import com.dropbox.sign.auth.HttpBearerAuth; import com.dropbox.sign.auth.ApiKeyAuth; - import com.dropbox.sign.model.ErrorResponse; /** *

ApiClient class.

*/ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiClient extends JavaTimeFormatter { private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); @@ -94,7 +106,7 @@ public class ApiClient extends JavaTimeFormatter { protected Map> operationServers; { - Map> operationServers = new LinkedHashMap<>(); + Map> operationServers = new HashMap<>(); operationServers.put("OAuthApi.oauthTokenGenerate", new ArrayList<>(Arrays.asList( new ServerConfiguration( "https://app.hellosign.com", @@ -147,7 +159,7 @@ public ApiClient(Map authMap) { this.dateFormat = new RFC3339DateFormat(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/2.1-dev/java"); + setUserAgent("OpenAPI-Generator/2.2-dev/java"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap<>(); @@ -197,7 +209,7 @@ public Client getHttpClient() { *

Setter for the field httpClient.

* * @param httpClient a {@link jakarta.ws.rs.client.Client} object. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -217,7 +229,7 @@ public String getBasePath() { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -237,7 +249,7 @@ public List getServers() { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -258,7 +270,7 @@ public Integer getServerIndex() { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -279,7 +291,7 @@ public Map getServerVariables() { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -316,7 +328,7 @@ public Authentication getAuthentication(String authName) { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -332,7 +344,7 @@ public ApiClient setUsername(String username) { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -348,7 +360,7 @@ public ApiClient setPassword(String password) { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -363,11 +375,49 @@ public ApiClient setApiKey(String apiKey) { throw new RuntimeException("No API key authentication configured!"); } + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + * @return a {@link ApiClient} object. + */ + public ApiClient configureApiKeys(Map secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.getOrDefault(name, name); + String secret = secrets.get(name); + if (secret != null) { + ((ApiKeyAuth) auth).setApiKey(secret); + } + } + } + return this; + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + * @return a {@link ApiClient} object. + */ + public ApiClient setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + /** * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -383,7 +433,7 @@ public ApiClient setBearerToken(String bearerToken) { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -405,7 +455,7 @@ public String getUserAgent(){ * * @param key The header's key * @param value The header's value - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -417,7 +467,7 @@ public ApiClient addDefaultHeader(String key, String value) { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -437,7 +487,7 @@ public ClientConfig getClientConfig() { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -459,7 +509,7 @@ public boolean isDebugging() { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -483,7 +533,7 @@ public String getTempFolderPath() { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -505,7 +555,7 @@ public int getConnectTimeout() { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -528,7 +578,7 @@ public int getReadTimeout() { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -549,7 +599,7 @@ public DateFormat getDateFormat() { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link com.dropbox.sign.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -595,9 +645,9 @@ public String parameterToString(Object param) { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { + } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -623,9 +673,9 @@ public List parameterToPairs(String collectionFormat, String name, Object // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/ApiException.java b/sdks/java-v2/src/main/java/com/dropbox/sign/ApiException.java index bf2ea9a35..2d61576a1 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/ApiException.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/ApiException.java @@ -13,15 +13,17 @@ package com.dropbox.sign; -import com.dropbox.sign.model.ErrorResponse; import java.util.Map; import java.util.List; +import com.dropbox.sign.model.ErrorResponse; /** * API Exception */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/Configuration.java b/sdks/java-v2/src/main/java/com/dropbox/sign/Configuration.java index 8d952f179..78b62840f 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/Configuration.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/Configuration.java @@ -13,8 +13,10 @@ package com.dropbox.sign; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Configuration { + public static final String VERSION = "2.2-dev"; + private static ApiClient defaultApiClient = new ApiClient(); /** diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/CustomInstantDeserializer.java b/sdks/java-v2/src/main/java/com/dropbox/sign/CustomInstantDeserializer.java deleted file mode 100644 index a58fea422..000000000 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package com.dropbox.sign; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.DateTimeUtils; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/EventCallbackHelper.java b/sdks/java-v2/src/main/java/com/dropbox/sign/EventCallbackHelper.java index e28824f7a..2470e2ba2 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/EventCallbackHelper.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/EventCallbackHelper.java @@ -18,7 +18,7 @@ import org.apache.commons.codec.digest.HmacAlgorithms; import org.apache.commons.codec.digest.HmacUtils; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class EventCallbackHelper { public static final String EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback"; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/JSON.java b/sdks/java-v2/src/main/java/com/dropbox/sign/JSON.java index 6f8a99b60..68a3518c5 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/JSON.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/JSON.java @@ -1,11 +1,22 @@ +/* + * 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; -import org.threeten.bp.*; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import com.dropbox.sign.model.*; import java.text.DateFormat; @@ -16,26 +27,21 @@ import jakarta.ws.rs.core.GenericType; import jakarta.ws.rs.ext.ContextResolver; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class JSON implements ContextResolver { private ObjectMapper mapper; public JSON() { - ThreeTenModule threeTenModule = new ThreeTenModule(); - threeTenModule.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - threeTenModule.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - threeTenModule.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); mapper = JsonMapper.builder() .serializationInclusion(JsonInclude.Include.NON_NULL) .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) .defaultDateFormat(new RFC3339DateFormat()) .addModule(new JavaTimeModule()) - .addModule(threeTenModule) .build(); } @@ -173,7 +179,6 @@ Class getClassForElement(JsonNode node, Set> visitedClasses) { */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { - // This handles the 'allOf' use case with single parent inheritance. return true; } if (visitedClasses.contains(modelClass)) { @@ -184,9 +189,9 @@ public static boolean isInstanceOf(Class modelClass, Object inst, Set descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -203,7 +208,7 @@ public static boolean isInstanceOf(Class modelClass, Object inst, Set, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -223,7 +228,7 @@ public static void registerDiscriminator(Class modelClass, String discriminat * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/JavaTimeFormatter.java b/sdks/java-v2/src/main/java/com/dropbox/sign/JavaTimeFormatter.java index f6d2369f3..f91775be0 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/JavaTimeFormatter.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/JavaTimeFormatter.java @@ -12,15 +12,15 @@ package com.dropbox.sign; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/Pair.java b/sdks/java-v2/src/main/java/com/dropbox/sign/Pair.java index 895bda468..271555c5e 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/Pair.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/Pair.java @@ -13,7 +13,7 @@ package com.dropbox.sign; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Pair { private String name = ""; private String value = ""; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/RFC3339DateFormat.java b/sdks/java-v2/src/main/java/com/dropbox/sign/RFC3339DateFormat.java index 6187eb387..df3000348 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/RFC3339DateFormat.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/RFC3339DateFormat.java @@ -18,9 +18,11 @@ import java.text.FieldPosition; import java.text.ParsePosition; import java.util.Date; +import java.text.DecimalFormat; import java.util.GregorianCalendar; import java.util.TimeZone; +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); @@ -31,6 +33,7 @@ public class RFC3339DateFormat extends DateFormat { public RFC3339DateFormat() { this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); } @Override @@ -52,4 +55,4 @@ public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fie public Object clone() { return super.clone(); } -} \ No newline at end of file +} diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/ServerConfiguration.java b/sdks/java-v2/src/main/java/com/dropbox/sign/ServerConfiguration.java index f275a1400..cb85f1c74 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/ServerConfiguration.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/ServerConfiguration.java @@ -1,3 +1,16 @@ +/* + * 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; import java.util.Map; @@ -5,6 +18,7 @@ /** * Representing a Server configuration. */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ServerConfiguration { public String URL; public String description; @@ -39,10 +53,10 @@ public String URL(Map variables) { if (variables != null && variables.containsKey(name)) { value = variables.get(name); if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/ServerVariable.java b/sdks/java-v2/src/main/java/com/dropbox/sign/ServerVariable.java index d38fd305e..c40ffb456 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/ServerVariable.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/ServerVariable.java @@ -1,3 +1,16 @@ +/* + * 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; import java.util.HashSet; @@ -5,6 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/StringUtil.java b/sdks/java-v2/src/main/java/com/dropbox/sign/StringUtil.java index 6a2704919..f3bd08f2b 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/StringUtil.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/api/AccountApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/AccountApi.java index f199883f7..9c7be32d9 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/AccountApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/AccountApi.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class AccountApi { private ApiClient apiClient; @@ -85,47 +85,33 @@ public AccountCreateResponse accountCreate(AccountCreateRequest accountCreateReq */ public ApiResponse accountCreateWithHttpInfo(AccountCreateRequest accountCreateRequest) throws ApiException { - Object localVarPostBody = accountCreateRequest; - - // verify the required parameter 'accountCreateRequest' is set + // Check required parameters if (accountCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'accountCreateRequest' when calling accountCreate"); } - - // create path and map variables - String localVarPath = "/account/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = accountCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AccountApi.accountCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "AccountApi.accountCreate", + "/account/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : accountCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Account @@ -201,44 +187,34 @@ public ApiResponse accountGetWithHttpInfo(String accountId) */ public ApiResponse accountGetWithHttpInfo(String accountId, String emailAddress) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/account"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "email_address", emailAddress)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AccountApi.accountGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "AccountApi.accountGet", + "/account", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Update Account @@ -273,47 +249,33 @@ public AccountGetResponse accountUpdate(AccountUpdateRequest accountUpdateReques */ public ApiResponse accountUpdateWithHttpInfo(AccountUpdateRequest accountUpdateRequest) throws ApiException { - Object localVarPostBody = accountUpdateRequest; - - // verify the required parameter 'accountUpdateRequest' is set + // Check required parameters if (accountUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'accountUpdateRequest' when calling accountUpdate"); } - - // create path and map variables - String localVarPath = "/account"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = accountUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AccountApi.accountUpdate", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "AccountApi.accountUpdate", + "/account", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : accountUpdateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Verify Account @@ -348,46 +310,32 @@ public AccountVerifyResponse accountVerify(AccountVerifyRequest accountVerifyReq */ public ApiResponse accountVerifyWithHttpInfo(AccountVerifyRequest accountVerifyRequest) throws ApiException { - Object localVarPostBody = accountVerifyRequest; - - // verify the required parameter 'accountVerifyRequest' is set + // Check required parameters if (accountVerifyRequest == null) { throw new ApiException(400, "Missing the required parameter 'accountVerifyRequest' when calling accountVerify"); } - - // create path and map variables - String localVarPath = "/account/verify"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = accountVerifyRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("AccountApi.accountVerify", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "AccountApi.accountVerify", + "/account/verify", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : accountVerifyRequest, + 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/api/ApiAppApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/ApiAppApi.java index bd03c341c..affb3cceb 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/ApiAppApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/ApiAppApi.java @@ -20,7 +20,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiAppApi { private ApiClient apiClient; @@ -83,47 +83,33 @@ public ApiAppGetResponse apiAppCreate(ApiAppCreateRequest apiAppCreateRequest) t */ public ApiResponse apiAppCreateWithHttpInfo(ApiAppCreateRequest apiAppCreateRequest) throws ApiException { - Object localVarPostBody = apiAppCreateRequest; - - // verify the required parameter 'apiAppCreateRequest' is set + // Check required parameters if (apiAppCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'apiAppCreateRequest' when calling apiAppCreate"); } - - // create path and map variables - String localVarPath = "/api_app"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = apiAppCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("ApiAppApi.apiAppCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "ApiAppApi.apiAppCreate", + "/api_app", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : apiAppCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Delete API App @@ -157,46 +143,36 @@ public void apiAppDelete(String clientId) throws ApiException { */ public ApiResponse apiAppDeleteWithHttpInfo(String clientId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'clientId' is set + // Check required parameters if (clientId == null) { throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppDelete"); } - - // create path and map variables - String localVarPath = "/api_app/{client_id}" - .replaceAll("\\{" + "client_id" + "\\}", apiClient.escapeString(clientId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("ApiAppApi.apiAppDelete", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "ApiAppApi.apiAppDelete", + localVarPath, + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); } /** * Get API App @@ -231,48 +207,37 @@ public ApiAppGetResponse apiAppGet(String clientId) throws ApiException { */ public ApiResponse apiAppGetWithHttpInfo(String clientId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'clientId' is set + // Check required parameters if (clientId == null) { throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppGet"); } - - // create path and map variables - String localVarPath = "/api_app/{client_id}" - .replaceAll("\\{" + "client_id" + "\\}", apiClient.escapeString(clientId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("ApiAppApi.apiAppGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "ApiAppApi.apiAppGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List API Apps @@ -354,44 +319,34 @@ public ApiResponse apiAppListWithHttpInfo(Integer page, Inte if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api_app/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("ApiAppApi.apiAppList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "ApiAppApi.apiAppList", + "/api_app/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Update API App @@ -428,52 +383,39 @@ public ApiAppGetResponse apiAppUpdate(String clientId, ApiAppUpdateRequest apiAp */ public ApiResponse apiAppUpdateWithHttpInfo(String clientId, ApiAppUpdateRequest apiAppUpdateRequest) throws ApiException { - Object localVarPostBody = apiAppUpdateRequest; - - // verify the required parameter 'clientId' is set + // Check required parameters if (clientId == null) { throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppUpdate"); } - - // verify the required parameter 'apiAppUpdateRequest' is set if (apiAppUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'apiAppUpdateRequest' when calling apiAppUpdate"); } - - // create path and map variables - String localVarPath = "/api_app/{client_id}" - .replaceAll("\\{" + "client_id" + "\\}", apiClient.escapeString(clientId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + // Path parameters + String localVarPath = "/api_app/{client_id}" + .replaceAll("\\{client_id}", apiClient.escapeString(clientId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = apiAppUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("ApiAppApi.apiAppUpdate", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "ApiAppApi.apiAppUpdate", + localVarPath, + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : apiAppUpdateRequest, + 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/api/BulkSendJobApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java index e3550d18f..ba55d1951 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class BulkSendJobApi { private ApiClient apiClient; @@ -130,50 +130,43 @@ public ApiResponse bulkSendJobGetWithHttpInfo(String bul if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // verify the required parameter 'bulkSendJobId' is set + // Check required parameters if (bulkSendJobId == null) { throw new ApiException(400, "Missing the required parameter 'bulkSendJobId' when calling bulkSendJobGet"); } - - // create path and map variables - String localVarPath = "/bulk_send_job/{bulk_send_job_id}" - .replaceAll("\\{" + "bulk_send_job_id" + "\\}", apiClient.escapeString(bulkSendJobId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/bulk_send_job/{bulk_send_job_id}" + .replaceAll("\\{bulk_send_job_id}", apiClient.escapeString(bulkSendJobId.toString())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("BulkSendJobApi.bulkSendJobGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "BulkSendJobApi.bulkSendJobGet", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Bulk Send Jobs @@ -255,43 +248,33 @@ public ApiResponse bulkSendJobListWithHttpInfo(Integer if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/bulk_send_job/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("BulkSendJobApi.bulkSendJobList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "BulkSendJobApi.bulkSendJobList", + "/bulk_send_job/list", + "GET", + localVarQueryParams, + null, + 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/api/EmbeddedApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/EmbeddedApi.java index 8f541c376..595d0dfd6 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/EmbeddedApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/EmbeddedApi.java @@ -19,7 +19,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class EmbeddedApi { private ApiClient apiClient; @@ -84,53 +84,40 @@ public EmbeddedEditUrlResponse embeddedEditUrl(String templateId, EmbeddedEditUr */ public ApiResponse embeddedEditUrlWithHttpInfo(String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { - Object localVarPostBody = embeddedEditUrlRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling embeddedEditUrl"); } - - // verify the required parameter 'embeddedEditUrlRequest' is set if (embeddedEditUrlRequest == null) { throw new ApiException(400, "Missing the required parameter 'embeddedEditUrlRequest' when calling embeddedEditUrl"); } - - // create path and map variables - String localVarPath = "/embedded/edit_url/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/embedded/edit_url/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = embeddedEditUrlRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("EmbeddedApi.embeddedEditUrl", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "EmbeddedApi.embeddedEditUrl", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : embeddedEditUrlRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Embedded Sign URL @@ -165,47 +152,36 @@ public EmbeddedSignUrlResponse embeddedSignUrl(String signatureId) throws ApiExc */ public ApiResponse embeddedSignUrlWithHttpInfo(String signatureId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureId' is set + // Check required parameters if (signatureId == null) { throw new ApiException(400, "Missing the required parameter 'signatureId' when calling embeddedSignUrl"); } - - // create path and map variables - String localVarPath = "/embedded/sign_url/{signature_id}" - .replaceAll("\\{" + "signature_id" + "\\}", apiClient.escapeString(signatureId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/embedded/sign_url/{signature_id}" + .replaceAll("\\{signature_id}", apiClient.escapeString(signatureId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("EmbeddedApi.embeddedSignUrl", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "EmbeddedApi.embeddedSignUrl", + localVarPath, + "GET", + new ArrayList<>(), + null, + 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/api/FaxLineApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxLineApi.java new file mode 100644 index 000000000..17558c6c9 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/FaxLineApi.java @@ -0,0 +1,661 @@ +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.FaxLineAddUserRequest; +import com.dropbox.sign.model.FaxLineAreaCodeGetResponse; +import com.dropbox.sign.model.FaxLineCreateRequest; +import com.dropbox.sign.model.FaxLineDeleteRequest; +import com.dropbox.sign.model.FaxLineListResponse; +import com.dropbox.sign.model.FaxLineRemoveUserRequest; +import com.dropbox.sign.model.FaxLineResponse; + +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 FaxLineApi { + private ApiClient apiClient; + + public FaxLineApi() { + this(Configuration.getDefaultApiClient()); + } + + public FaxLineApi(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; + } + + /** + * Add Fax Line User + * Grants a user access to the specified Fax Line. + * @param faxLineAddUserRequest (required) + * @return FaxLineResponse + * @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 FaxLineResponse faxLineAddUser(FaxLineAddUserRequest faxLineAddUserRequest) throws ApiException { + return faxLineAddUserWithHttpInfo(faxLineAddUserRequest).getData(); + } + + + /** + * Add Fax Line User + * Grants a user access to the specified Fax Line. + * @param faxLineAddUserRequest (required) + * @return ApiResponse<FaxLineResponse> + * @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 faxLineAddUserWithHttpInfo(FaxLineAddUserRequest faxLineAddUserRequest) throws ApiException { + + // Check required parameters + if (faxLineAddUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineAddUserRequest' when calling faxLineAddUser"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineAddUserRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineAddUser", + "/fax_line/add_user", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : faxLineAddUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Get Available Fax Line Area Codes + * Returns a response with the area codes available for a given state/provice and city. + * @param country Filter area codes by country. (required) + * @param state Filter area codes by state. (optional) + * @param province Filter area codes by province. (optional) + * @param city Filter area codes by city. (optional) + * @return FaxLineAreaCodeGetResponse + * @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 FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state, String province, String city) throws ApiException { + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country) throws ApiException { + String state = null; + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country) throws ApiException { + String state = null; + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state) throws ApiException { + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country, String state) throws ApiException { + String province = null; + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGet(String, String, String, String) + */ + public FaxLineAreaCodeGetResponse faxLineAreaCodeGet(String country, String state, String province) throws ApiException { + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city).getData(); + } + + /** + * @see FaxLineApi#faxLineAreaCodeGetWithHttpInfo(String, String, String, String) + */ + public ApiResponse faxLineAreaCodeGetWithHttpInfo(String country, String state, String province) throws ApiException { + String city = null; + + return faxLineAreaCodeGetWithHttpInfo(country, state, province, city); + } + + + /** + * Get Available Fax Line Area Codes + * Returns a response with the area codes available for a given state/provice and city. + * @param country Filter area codes by country. (required) + * @param state Filter area codes by state. (optional) + * @param province Filter area codes by province. (optional) + * @param city Filter area codes by city. (optional) + * @return ApiResponse<FaxLineAreaCodeGetResponse> + * @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 faxLineAreaCodeGetWithHttpInfo(String country, String state, String province, String city) throws ApiException { + + // Check required parameters + if (country == null) { + throw new ApiException(400, "Missing the required parameter 'country' when calling faxLineAreaCodeGet"); + } + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "country", country) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "state", state)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "province", province)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "city", city)); + + 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( + "FaxLineApi.faxLineAreaCodeGet", + "/fax_line/area_codes", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Purchase Fax Line + * Purchases a new Fax Line. + * @param faxLineCreateRequest (required) + * @return FaxLineResponse + * @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 FaxLineResponse faxLineCreate(FaxLineCreateRequest faxLineCreateRequest) throws ApiException { + return faxLineCreateWithHttpInfo(faxLineCreateRequest).getData(); + } + + + /** + * Purchase Fax Line + * Purchases a new Fax Line. + * @param faxLineCreateRequest (required) + * @return ApiResponse<FaxLineResponse> + * @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 faxLineCreateWithHttpInfo(FaxLineCreateRequest faxLineCreateRequest) throws ApiException { + + // Check required parameters + if (faxLineCreateRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineCreateRequest' when calling faxLineCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineCreate", + "/fax_line/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : faxLineCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Delete Fax Line + * Deletes the specified Fax Line from the subscription. + * @param faxLineDeleteRequest (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void faxLineDelete(FaxLineDeleteRequest faxLineDeleteRequest) throws ApiException { + faxLineDeleteWithHttpInfo(faxLineDeleteRequest); + } + + + /** + * Delete Fax Line + * Deletes the specified Fax Line from the subscription. + * @param faxLineDeleteRequest (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse faxLineDeleteWithHttpInfo(FaxLineDeleteRequest faxLineDeleteRequest) throws ApiException { + + // Check required parameters + if (faxLineDeleteRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineDeleteRequest' when calling faxLineDelete"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineDeleteRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineDelete", + "/fax_line", + "DELETE", + new ArrayList<>(), + isFileTypeFound ? null : faxLineDeleteRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); + } + /** + * Get Fax Line + * Returns the properties and settings of a Fax Line. + * @param number The Fax Line number. (required) + * @return FaxLineResponse + * @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 FaxLineResponse faxLineGet(String number) throws ApiException { + return faxLineGetWithHttpInfo(number).getData(); + } + + + /** + * Get Fax Line + * Returns the properties and settings of a Fax Line. + * @param number The Fax Line number. (required) + * @return ApiResponse<FaxLineResponse> + * @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 faxLineGetWithHttpInfo(String number) throws ApiException { + + // Check required parameters + if (number == null) { + throw new ApiException(400, "Missing the required parameter 'number' when calling faxLineGet"); + } + + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "number", number) + ); + + 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( + "FaxLineApi.faxLineGet", + "/fax_line", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * List Fax Lines + * Returns the properties and settings of multiple Fax Lines. + * @param accountId Account ID (optional) + * @param page Page (optional, default to 1) + * @param pageSize Page size (optional, default to 20) + * @param showTeamLines Show team lines (optional) + * @return FaxLineListResponse + * @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 FaxLineListResponse faxLineList(String accountId, Integer page, Integer pageSize, Boolean showTeamLines) throws ApiException { + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + /** + * @see FaxLineApi#faxLineList(String, Integer, Integer, Boolean) + */ + public FaxLineListResponse faxLineList(String accountId, Integer page, Integer pageSize) throws ApiException { + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines).getData(); + } + + /** + * @see FaxLineApi#faxLineListWithHttpInfo(String, Integer, Integer, Boolean) + */ + public ApiResponse faxLineListWithHttpInfo(String accountId, Integer page, Integer pageSize) throws ApiException { + Boolean showTeamLines = null; + + return faxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + } + + + /** + * List Fax Lines + * Returns the properties and settings of multiple Fax Lines. + * @param accountId Account ID (optional) + * @param page Page (optional, default to 1) + * @param pageSize Page size (optional, default to 20) + * @param showTeamLines Show team lines (optional) + * @return ApiResponse<FaxLineListResponse> + * @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 faxLineListWithHttpInfo(String accountId, Integer page, Integer pageSize, Boolean showTeamLines) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "show_team_lines", showTeamLines)); + + 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( + "FaxLineApi.faxLineList", + "/fax_line/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); + } + /** + * Remove Fax Line Access + * Removes a user's access to the specified Fax Line. + * @param faxLineRemoveUserRequest (required) + * @return FaxLineResponse + * @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 FaxLineResponse faxLineRemoveUser(FaxLineRemoveUserRequest faxLineRemoveUserRequest) throws ApiException { + return faxLineRemoveUserWithHttpInfo(faxLineRemoveUserRequest).getData(); + } + + + /** + * Remove Fax Line Access + * Removes a user's access to the specified Fax Line. + * @param faxLineRemoveUserRequest (required) + * @return ApiResponse<FaxLineResponse> + * @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 faxLineRemoveUserWithHttpInfo(FaxLineRemoveUserRequest faxLineRemoveUserRequest) throws ApiException { + + // Check required parameters + if (faxLineRemoveUserRequest == null) { + throw new ApiException(400, "Missing the required parameter 'faxLineRemoveUserRequest' when calling faxLineRemoveUser"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = faxLineRemoveUserRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "FaxLineApi.faxLineRemoveUser", + "/fax_line/remove_user", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : faxLineRemoveUserRequest, + 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/api/OAuthApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/OAuthApi.java index cbd0ce0c6..be092da04 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/OAuthApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/OAuthApi.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class OAuthApi { private ApiClient apiClient; @@ -79,47 +79,32 @@ public OAuthTokenResponse oauthTokenGenerate(OAuthTokenGenerateRequest oauthToke */ public ApiResponse oauthTokenGenerateWithHttpInfo(OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { - Object localVarPostBody = oauthTokenGenerateRequest; - - // verify the required parameter 'oauthTokenGenerateRequest' is set + // Check required parameters if (oauthTokenGenerateRequest == null) { throw new ApiException(400, "Missing the required parameter 'oauthTokenGenerateRequest' when calling oauthTokenGenerate"); } - - // create path and map variables - String localVarPath = "/oauth/token"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = oauthTokenGenerateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("OAuthApi.oauthTokenGenerate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "OAuthApi.oauthTokenGenerate", + "/oauth/token", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : oauthTokenGenerateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + null, + localVarReturnType, + false + ); } /** * OAuth Token Refresh @@ -152,46 +137,31 @@ public OAuthTokenResponse oauthTokenRefresh(OAuthTokenRefreshRequest oauthTokenR */ public ApiResponse oauthTokenRefreshWithHttpInfo(OAuthTokenRefreshRequest oauthTokenRefreshRequest) throws ApiException { - Object localVarPostBody = oauthTokenRefreshRequest; - - // verify the required parameter 'oauthTokenRefreshRequest' is set + // Check required parameters if (oauthTokenRefreshRequest == null) { throw new ApiException(400, "Missing the required parameter 'oauthTokenRefreshRequest' when calling oauthTokenRefresh"); } - - // create path and map variables - String localVarPath = "/oauth/token?refresh"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = oauthTokenRefreshRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("OAuthApi.oauthTokenRefresh", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "OAuthApi.oauthTokenRefresh", + "/oauth/token?refresh", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : oauthTokenRefreshRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + null, + localVarReturnType, + false + ); } } \ No newline at end of file diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/api/ReportApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/ReportApi.java index 240028259..ae343558c 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/ReportApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/ReportApi.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ReportApi { private ApiClient apiClient; @@ -81,46 +81,32 @@ public ReportCreateResponse reportCreate(ReportCreateRequest reportCreateRequest */ public ApiResponse reportCreateWithHttpInfo(ReportCreateRequest reportCreateRequest) throws ApiException { - Object localVarPostBody = reportCreateRequest; - - // verify the required parameter 'reportCreateRequest' is set + // Check required parameters if (reportCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'reportCreateRequest' when calling reportCreate"); } - - // create path and map variables - String localVarPath = "/report/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = reportCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("ReportApi.reportCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "ReportApi.reportCreate", + "/report/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : reportCreateRequest, + 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/api/SignatureRequestApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java index 9ee38a8f1..78058b107 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java @@ -30,7 +30,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class SignatureRequestApi { private ApiClient apiClient; @@ -93,47 +93,33 @@ public BulkSendJobSendResponse signatureRequestBulkCreateEmbeddedWithTemplate(Si */ public ApiResponse signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestBulkCreateEmbeddedWithTemplateRequest; - - // verify the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' is set + // Check required parameters if (signatureRequestBulkCreateEmbeddedWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' when calling signatureRequestBulkCreateEmbeddedWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/bulk_create_embedded_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestBulkCreateEmbeddedWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - + 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("SignatureRequestApi.signatureRequestBulkCreateEmbeddedWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestBulkCreateEmbeddedWithTemplate", + "/signature_request/bulk_create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestBulkCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Bulk Send with Template @@ -168,47 +154,33 @@ public BulkSendJobSendResponse signatureRequestBulkSendWithTemplate(SignatureReq */ public ApiResponse signatureRequestBulkSendWithTemplateWithHttpInfo(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestBulkSendWithTemplateRequest; - - // verify the required parameter 'signatureRequestBulkSendWithTemplateRequest' is set + // Check required parameters if (signatureRequestBulkSendWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestBulkSendWithTemplateRequest' when calling signatureRequestBulkSendWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/bulk_send_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestBulkSendWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestBulkSendWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestBulkSendWithTemplate", + "/signature_request/bulk_send_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestBulkSendWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Cancel Incomplete Signature Request @@ -242,46 +214,36 @@ public void signatureRequestCancel(String signatureRequestId) throws ApiExceptio */ public ApiResponse signatureRequestCancelWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestCancel"); } - - // create path and map variables - String localVarPath = "/signature_request/cancel/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/cancel/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestCancel", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCancel", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); } /** * Create Embedded Signature Request @@ -316,47 +278,33 @@ public SignatureRequestGetResponse signatureRequestCreateEmbedded(SignatureReque */ public ApiResponse signatureRequestCreateEmbeddedWithHttpInfo(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) throws ApiException { - Object localVarPostBody = signatureRequestCreateEmbeddedRequest; - - // verify the required parameter 'signatureRequestCreateEmbeddedRequest' is set + // Check required parameters if (signatureRequestCreateEmbeddedRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestCreateEmbeddedRequest' when calling signatureRequestCreateEmbedded"); } - - // create path and map variables - String localVarPath = "/signature_request/create_embedded"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestCreateEmbeddedRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestCreateEmbedded", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCreateEmbedded", + "/signature_request/create_embedded", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestCreateEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Embedded Signature Request with Template @@ -391,47 +339,33 @@ public SignatureRequestGetResponse signatureRequestCreateEmbeddedWithTemplate(Si */ public ApiResponse signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestCreateEmbeddedWithTemplateRequest; - - // verify the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' is set + // Check required parameters if (signatureRequestCreateEmbeddedWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' when calling signatureRequestCreateEmbeddedWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/create_embedded_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestCreateEmbeddedWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestCreateEmbeddedWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestCreateEmbeddedWithTemplate", + "/signature_request/create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Download Files @@ -490,49 +424,42 @@ public ApiResponse signatureRequestFilesWithHttpInfo(String signatureReque if (fileType == null) { fileType = "pdf"; } - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFiles"); } - - // create path and map variables - String localVarPath = "/signature_request/files/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "file_type", fileType)); - - - - - final String[] localVarAccepts = { - "application/pdf", "application/zip", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/signature_request/files/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "file_type", fileType) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/zip", "application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestFiles", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFiles", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Download Files as Data Uri @@ -567,48 +494,37 @@ public FileResponseDataUri signatureRequestFilesAsDataUri(String signatureReques */ public ApiResponse signatureRequestFilesAsDataUriWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFilesAsDataUri"); } - - // create path and map variables - String localVarPath = "/signature_request/files_as_data_uri/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/files_as_data_uri/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestFilesAsDataUri", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFilesAsDataUri", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Download Files as File Url @@ -667,49 +583,42 @@ public ApiResponse signatureRequestFilesAsFileUrlWithHttpInfo(Stri if (forceDownload == null) { forceDownload = 1; } - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFilesAsFileUrl"); } - - // create path and map variables - String localVarPath = "/signature_request/files_as_file_url/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "force_download", forceDownload)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/signature_request/files_as_file_url/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "force_download", forceDownload) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestFilesAsFileUrl", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestFilesAsFileUrl", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Signature Request @@ -744,48 +653,37 @@ public SignatureRequestGetResponse signatureRequestGet(String signatureRequestId */ public ApiResponse signatureRequestGetWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestGet"); } - - // create path and map variables - String localVarPath = "/signature_request/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Signature Requests @@ -917,46 +815,36 @@ public ApiResponse signatureRequestListWithHttpInf if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/signature_request/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestList", + "/signature_request/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Release On-Hold Signature Request @@ -991,48 +879,37 @@ public SignatureRequestGetResponse signatureRequestReleaseHold(String signatureR */ public ApiResponse signatureRequestReleaseHoldWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestReleaseHold"); } - - // create path and map variables - String localVarPath = "/signature_request/release_hold/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/release_hold/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestReleaseHold", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestReleaseHold", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Send Request Reminder @@ -1069,53 +946,40 @@ public SignatureRequestGetResponse signatureRequestRemind(String signatureReques */ public ApiResponse signatureRequestRemindWithHttpInfo(String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) throws ApiException { - Object localVarPostBody = signatureRequestRemindRequest; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestRemind"); } - - // verify the required parameter 'signatureRequestRemindRequest' is set if (signatureRequestRemindRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestRemindRequest' when calling signatureRequestRemind"); } - - // create path and map variables - String localVarPath = "/signature_request/remind/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/signature_request/remind/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestRemindRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestRemind", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestRemind", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestRemindRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Remove Signature Request Access @@ -1149,46 +1013,36 @@ public void signatureRequestRemove(String signatureRequestId) throws ApiExceptio */ public ApiResponse signatureRequestRemoveWithHttpInfo(String signatureRequestId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestRemove"); } - - // create path and map variables - String localVarPath = "/signature_request/remove/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/signature_request/remove/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestRemove", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestRemove", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); } /** * Send Signature Request @@ -1223,47 +1077,33 @@ public SignatureRequestGetResponse signatureRequestSend(SignatureRequestSendRequ */ public ApiResponse signatureRequestSendWithHttpInfo(SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { - Object localVarPostBody = signatureRequestSendRequest; - - // verify the required parameter 'signatureRequestSendRequest' is set + // Check required parameters if (signatureRequestSendRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestSendRequest' when calling signatureRequestSend"); } - - // create path and map variables - String localVarPath = "/signature_request/send"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestSendRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestSend", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestSend", + "/signature_request/send", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestSendRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Send with Template @@ -1298,47 +1138,33 @@ public SignatureRequestGetResponse signatureRequestSendWithTemplate(SignatureReq */ public ApiResponse signatureRequestSendWithTemplateWithHttpInfo(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) throws ApiException { - Object localVarPostBody = signatureRequestSendWithTemplateRequest; - - // verify the required parameter 'signatureRequestSendWithTemplateRequest' is set + // Check required parameters if (signatureRequestSendWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestSendWithTemplateRequest' when calling signatureRequestSendWithTemplate"); } - - // create path and map variables - String localVarPath = "/signature_request/send_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestSendWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestSendWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestSendWithTemplate", + "/signature_request/send_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestSendWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Update Signature Request @@ -1375,52 +1201,39 @@ public SignatureRequestGetResponse signatureRequestUpdate(String signatureReques */ public ApiResponse signatureRequestUpdateWithHttpInfo(String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) throws ApiException { - Object localVarPostBody = signatureRequestUpdateRequest; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestUpdate"); } - - // verify the required parameter 'signatureRequestUpdateRequest' is set if (signatureRequestUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestUpdateRequest' when calling signatureRequestUpdate"); } - - // create path and map variables - String localVarPath = "/signature_request/update/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/signature_request/update/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = signatureRequestUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("SignatureRequestApi.signatureRequestUpdate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "SignatureRequestApi.signatureRequestUpdate", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : signatureRequestUpdateRequest, + 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/api/TeamApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/TeamApi.java index 8959061a1..b1b381146 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/TeamApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/TeamApi.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class TeamApi { private ApiClient apiClient; @@ -109,48 +109,38 @@ public ApiResponse teamAddMemberWithHttpInfo(TeamAddMemberReque */ public ApiResponse teamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest, String teamId) throws ApiException { - Object localVarPostBody = teamAddMemberRequest; - - // verify the required parameter 'teamAddMemberRequest' is set + // Check required parameters if (teamAddMemberRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamAddMemberRequest' when calling teamAddMember"); } - - // create path and map variables - String localVarPath = "/team/add_member"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "team_id", teamId)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "team_id", teamId) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamAddMemberRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamAddMember", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamAddMember", + "/team/add_member", + "PUT", + localVarQueryParams, + isFileTypeFound ? null : teamAddMemberRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Team @@ -185,47 +175,33 @@ public TeamGetResponse teamCreate(TeamCreateRequest teamCreateRequest) throws Ap */ public ApiResponse teamCreateWithHttpInfo(TeamCreateRequest teamCreateRequest) throws ApiException { - Object localVarPostBody = teamCreateRequest; - - // verify the required parameter 'teamCreateRequest' is set + // Check required parameters if (teamCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamCreateRequest' when calling teamCreate"); } - - // create path and map variables - String localVarPath = "/team/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamCreate", + "/team/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : teamCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Delete Team @@ -257,40 +233,27 @@ public void teamDelete() throws ApiException { */ public ApiResponse teamDeleteWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team/destroy"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("TeamApi.teamDelete", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "TeamApi.teamDelete", + "/team/destroy", + "DELETE", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); } /** * Get Team @@ -323,42 +286,28 @@ public TeamGetResponse teamGet() throws ApiException { */ public ApiResponse teamGetWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamGet", + "/team", + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Team Info @@ -412,43 +361,33 @@ public ApiResponse teamInfoWithHttpInfo() throws ApiExcepti */ public ApiResponse teamInfoWithHttpInfo(String teamId) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team/info"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "team_id", teamId)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "team_id", teamId) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamInfo", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamInfo", + "/team/info", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Team Invites @@ -502,43 +441,33 @@ public ApiResponse teamInvitesWithHttpInfo() throws ApiExce */ public ApiResponse teamInvitesWithHttpInfo(String emailAddress) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/team/invites"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "email_address", emailAddress)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "email_address", emailAddress) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamInvites", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamInvites", + "/team/invites", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Team Members @@ -622,50 +551,43 @@ public ApiResponse teamMembersWithHttpInfo(String teamId, I if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // verify the required parameter 'teamId' is set + // Check required parameters if (teamId == null) { throw new ApiException(400, "Missing the required parameter 'teamId' when calling teamMembers"); } - - // create path and map variables - String localVarPath = "/team/members/{team_id}" - .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/team/members/{team_id}" + .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamMembers", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamMembers", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Remove User from Team @@ -700,47 +622,33 @@ public TeamGetResponse teamRemoveMember(TeamRemoveMemberRequest teamRemoveMember */ public ApiResponse teamRemoveMemberWithHttpInfo(TeamRemoveMemberRequest teamRemoveMemberRequest) throws ApiException { - Object localVarPostBody = teamRemoveMemberRequest; - - // verify the required parameter 'teamRemoveMemberRequest' is set + // Check required parameters if (teamRemoveMemberRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamRemoveMemberRequest' when calling teamRemoveMember"); } - - // create path and map variables - String localVarPath = "/team/remove_member"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamRemoveMemberRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamRemoveMember", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamRemoveMember", + "/team/remove_member", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : teamRemoveMemberRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Sub Teams @@ -824,50 +732,43 @@ public ApiResponse teamSubTeamsWithHttpInfo(String teamId, if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // verify the required parameter 'teamId' is set + // Check required parameters if (teamId == null) { throw new ApiException(400, "Missing the required parameter 'teamId' when calling teamSubTeams"); } - - // create path and map variables - String localVarPath = "/team/sub_teams/{team_id}" - .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + // Path parameters + String localVarPath = "/team/sub_teams/{team_id}" + .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "page", page) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamSubTeams", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamSubTeams", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Update Team @@ -902,46 +803,32 @@ public TeamGetResponse teamUpdate(TeamUpdateRequest teamUpdateRequest) throws Ap */ public ApiResponse teamUpdateWithHttpInfo(TeamUpdateRequest teamUpdateRequest) throws ApiException { - Object localVarPostBody = teamUpdateRequest; - - // verify the required parameter 'teamUpdateRequest' is set + // Check required parameters if (teamUpdateRequest == null) { throw new ApiException(400, "Missing the required parameter 'teamUpdateRequest' when calling teamUpdate"); } - - // create path and map variables - String localVarPath = "/team"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = teamUpdateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TeamApi.teamUpdate", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TeamApi.teamUpdate", + "/team", + "PUT", + new ArrayList<>(), + isFileTypeFound ? null : teamUpdateRequest, + 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/api/TemplateApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java index e5ec86d40..ab67a5fa9 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/TemplateApi.java @@ -29,7 +29,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class TemplateApi { private ApiClient apiClient; @@ -94,53 +94,40 @@ public TemplateGetResponse templateAddUser(String templateId, TemplateAddUserReq */ public ApiResponse templateAddUserWithHttpInfo(String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { - Object localVarPostBody = templateAddUserRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateAddUser"); } - - // verify the required parameter 'templateAddUserRequest' is set if (templateAddUserRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateAddUserRequest' when calling templateAddUser"); } - - // create path and map variables - String localVarPath = "/template/add_user/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/template/add_user/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateAddUserRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateAddUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateAddUser", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateAddUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Template @@ -175,47 +162,33 @@ public TemplateCreateResponse templateCreate(TemplateCreateRequest templateCreat */ public ApiResponse templateCreateWithHttpInfo(TemplateCreateRequest templateCreateRequest) throws ApiException { - Object localVarPostBody = templateCreateRequest; - - // verify the required parameter 'templateCreateRequest' is set + // Check required parameters if (templateCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateCreateRequest' when calling templateCreate"); } - - // create path and map variables - String localVarPath = "/template/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateCreate", + "/template/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Embedded Template Draft @@ -250,47 +223,33 @@ public TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraft(TemplateC */ public ApiResponse templateCreateEmbeddedDraftWithHttpInfo(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) throws ApiException { - Object localVarPostBody = templateCreateEmbeddedDraftRequest; - - // verify the required parameter 'templateCreateEmbeddedDraftRequest' is set + // Check required parameters if (templateCreateEmbeddedDraftRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateCreateEmbeddedDraftRequest' when calling templateCreateEmbeddedDraft"); } - - // create path and map variables - String localVarPath = "/template/create_embedded_draft"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateCreateEmbeddedDraftRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateCreateEmbeddedDraft", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateCreateEmbeddedDraft", + "/template/create_embedded_draft", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateCreateEmbeddedDraftRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Delete Template @@ -324,46 +283,36 @@ public void templateDelete(String templateId) throws ApiException { */ public ApiResponse templateDeleteWithHttpInfo(String templateId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateDelete"); } - - // create path and map variables - String localVarPath = "/template/delete/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/template/delete/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - - return apiClient.invokeAPI("TemplateApi.templateDelete", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + return apiClient.invokeAPI( + "TemplateApi.templateDelete", + localVarPath, + "POST", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false + ); } /** * Get Template Files @@ -419,49 +368,42 @@ public ApiResponse templateFilesWithHttpInfo(String templateId) throws Api */ public ApiResponse templateFilesWithHttpInfo(String templateId, String fileType) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFiles"); } - - // create path and map variables - String localVarPath = "/template/files/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "file_type", fileType)); - - - - - final String[] localVarAccepts = { - "application/pdf", "application/zip", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/template/files/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "file_type", fileType) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/pdf", "application/zip", "application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateFiles", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateFiles", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Template Files as Data Uri @@ -496,48 +438,37 @@ public FileResponseDataUri templateFilesAsDataUri(String templateId) throws ApiE */ public ApiResponse templateFilesAsDataUriWithHttpInfo(String templateId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFilesAsDataUri"); } - - // create path and map variables - String localVarPath = "/template/files_as_data_uri/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/template/files_as_data_uri/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateFilesAsDataUri", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateFilesAsDataUri", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Template Files as File Url @@ -596,49 +527,42 @@ public ApiResponse templateFilesAsFileUrlWithHttpInfo(String templ if (forceDownload == null) { forceDownload = 1; } - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFilesAsFileUrl"); } - - // create path and map variables - String localVarPath = "/template/files_as_file_url/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "force_download", forceDownload)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + // Path parameters + String localVarPath = "/template/files_as_file_url/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - final String[] localVarContentTypes = { - - }; + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "force_download", forceDownload) + ); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateFilesAsFileUrl", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateFilesAsFileUrl", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Get Template @@ -673,48 +597,37 @@ public TemplateGetResponse templateGet(String templateId) throws ApiException { */ public ApiResponse templateGetWithHttpInfo(String templateId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateGet"); } - - // create path and map variables - String localVarPath = "/template/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; + // Path parameters + String localVarPath = "/template/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateGet", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateGet", + localVarPath, + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * List Templates @@ -846,46 +759,36 @@ public ApiResponse templateListWithHttpInfo(String account if (pageSize == null) { pageSize = 20; } - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/template/list"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("", "account_id", accountId) + ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = new HashMap(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateList", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateList", + "/template/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Remove User from Template @@ -922,53 +825,40 @@ public TemplateGetResponse templateRemoveUser(String templateId, TemplateRemoveU */ public ApiResponse templateRemoveUserWithHttpInfo(String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) throws ApiException { - Object localVarPostBody = templateRemoveUserRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateRemoveUser"); } - - // verify the required parameter 'templateRemoveUserRequest' is set if (templateRemoveUserRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateRemoveUserRequest' when calling templateRemoveUser"); } - - // create path and map variables - String localVarPath = "/template/remove_user/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/template/remove_user/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateRemoveUserRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateRemoveUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateRemoveUser", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateRemoveUserRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Update Template Files @@ -1005,52 +895,39 @@ public TemplateUpdateFilesResponse templateUpdateFiles(String templateId, Templa */ public ApiResponse templateUpdateFilesWithHttpInfo(String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) throws ApiException { - Object localVarPostBody = templateUpdateFilesRequest; - - // verify the required parameter 'templateId' is set + // Check required parameters if (templateId == null) { throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateUpdateFiles"); } - - // verify the required parameter 'templateUpdateFilesRequest' is set if (templateUpdateFilesRequest == null) { throw new ApiException(400, "Missing the required parameter 'templateUpdateFilesRequest' when calling templateUpdateFiles"); } - - // create path and map variables - String localVarPath = "/template/update_files/{template_id}" - .replaceAll("\\{" + "template_id" + "\\}", apiClient.escapeString(templateId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + // Path parameters + String localVarPath = "/template/update_files/{template_id}" + .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = templateUpdateFilesRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("TemplateApi.templateUpdateFiles", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "TemplateApi.templateUpdateFiles", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : templateUpdateFilesRequest, + 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/api/UnclaimedDraftApi.java b/sdks/java-v2/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java index 647482cc2..b37599a2d 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class UnclaimedDraftApi { private ApiClient apiClient; @@ -84,47 +84,33 @@ public UnclaimedDraftCreateResponse unclaimedDraftCreate(UnclaimedDraftCreateReq */ public ApiResponse unclaimedDraftCreateWithHttpInfo(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftCreateRequest; - - // verify the required parameter 'unclaimedDraftCreateRequest' is set + // Check required parameters if (unclaimedDraftCreateRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateRequest' when calling unclaimedDraftCreate"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/create"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftCreateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftCreate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreate", + "/unclaimed_draft/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Embedded Unclaimed Draft @@ -159,47 +145,33 @@ public UnclaimedDraftCreateResponse unclaimedDraftCreateEmbedded(UnclaimedDraftC */ public ApiResponse unclaimedDraftCreateEmbeddedWithHttpInfo(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftCreateEmbeddedRequest; - - // verify the required parameter 'unclaimedDraftCreateEmbeddedRequest' is set + // Check required parameters if (unclaimedDraftCreateEmbeddedRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateEmbeddedRequest' when calling unclaimedDraftCreateEmbedded"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/create_embedded"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftCreateEmbeddedRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftCreateEmbedded", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreateEmbedded", + "/unclaimed_draft/create_embedded", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateEmbeddedRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Create Embedded Unclaimed Draft with Template @@ -234,47 +206,33 @@ public UnclaimedDraftCreateResponse unclaimedDraftCreateEmbeddedWithTemplate(Unc */ public ApiResponse unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftCreateEmbeddedWithTemplateRequest; - - // verify the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' is set + // Check required parameters if (unclaimedDraftCreateEmbeddedWithTemplateRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' when calling unclaimedDraftCreateEmbeddedWithTemplate"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/create_embedded_with_template"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "multipart/form-data" - }; + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftCreateEmbeddedWithTemplateRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftCreateEmbeddedWithTemplate", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftCreateEmbeddedWithTemplate", + "/unclaimed_draft/create_embedded_with_template", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftCreateEmbeddedWithTemplateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false + ); } /** * Edit and Resend Unclaimed Draft @@ -311,52 +269,39 @@ public UnclaimedDraftCreateResponse unclaimedDraftEditAndResend(String signature */ public ApiResponse unclaimedDraftEditAndResendWithHttpInfo(String signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) throws ApiException { - Object localVarPostBody = unclaimedDraftEditAndResendRequest; - - // verify the required parameter 'signatureRequestId' is set + // Check required parameters if (signatureRequestId == null) { throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling unclaimedDraftEditAndResend"); } - - // verify the required parameter 'unclaimedDraftEditAndResendRequest' is set if (unclaimedDraftEditAndResendRequest == null) { throw new ApiException(400, "Missing the required parameter 'unclaimedDraftEditAndResendRequest' when calling unclaimedDraftEditAndResend"); } - - // create path and map variables - String localVarPath = "/unclaimed_draft/edit_and_resend/{signature_request_id}" - .replaceAll("\\{" + "signature_request_id" + "\\}", apiClient.escapeString(signatureRequestId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; + // Path parameters + String localVarPath = "/unclaimed_draft/edit_and_resend/{signature_request_id}" + .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = unclaimedDraftEditAndResendRequest.createFormData(); boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key", "oauth2" }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; GenericType localVarReturnType = new GenericType() {}; - - return apiClient.invokeAPI("UnclaimedDraftApi.unclaimedDraftEditAndResend", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "UnclaimedDraftApi.unclaimedDraftEditAndResend", + localVarPath, + "POST", + new ArrayList<>(), + isFileTypeFound ? null : unclaimedDraftEditAndResendRequest, + 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/auth/ApiKeyAuth.java b/sdks/java-v2/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java index 15f5dc723..e68272c32 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java b/sdks/java-v2/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java index c3d436251..3afe97bae 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java b/sdks/java-v2/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java index 17a335c7d..8f3273d39 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java index ae29f1626..759bf81d1 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java @@ -24,7 +24,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -46,7 +46,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java index b3c713c0e..9f12a6edc 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,8 +38,8 @@ AccountCreateRequest.JSON_PROPERTY_CLIENT_SECRET, AccountCreateRequest.JSON_PROPERTY_LOCALE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountCreateRequest { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -78,12 +76,11 @@ public AccountCreateRequest emailAddress(String emailAddress) { return this; } - /** + /** * The email address which will be associated with the new Account. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address which will be associated with the new Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -104,12 +101,11 @@ public AccountCreateRequest clientId(String clientId) { return this; } - /** + /** * Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization)") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,12 +126,11 @@ public AccountCreateRequest clientSecret(String clientSecret) { return this; } - /** + /** * Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) * @return clientSecret - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization)") @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +151,11 @@ public AccountCreateRequest locale(String locale) { return this; } - /** + /** * The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. * @return locale - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") @JsonProperty(JSON_PROPERTY_LOCALE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java index b44bd3f1a..08fd77369 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -44,8 +42,8 @@ AccountCreateResponse.JSON_PROPERTY_OAUTH_DATA, AccountCreateResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountCreateResponse { public static final String JSON_PROPERTY_ACCOUNT = "account"; private AccountResponse account; @@ -54,7 +52,7 @@ public class AccountCreateResponse { private OAuthTokenResponse oauthData; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public AccountCreateResponse() { } @@ -79,14 +77,13 @@ public AccountCreateResponse account(AccountResponse account) { return this; } - /** + /** * Get account * @return account - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public AccountResponse getAccount() { return account; @@ -94,7 +91,7 @@ public AccountResponse getAccount() { @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setAccount(AccountResponse account) { this.account = account; } @@ -105,12 +102,11 @@ public AccountCreateResponse oauthData(OAuthTokenResponse oauthData) { return this; } - /** + /** * Get oauthData * @return oauthData - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +135,11 @@ public AccountCreateResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountGetResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountGetResponse.java index 498a5c969..2a2fabc60 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountGetResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountGetResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ AccountGetResponse.JSON_PROPERTY_ACCOUNT, AccountGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountGetResponse { public static final String JSON_PROPERTY_ACCOUNT = "account"; private AccountResponse account; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public AccountGetResponse() { } @@ -74,14 +72,13 @@ public AccountGetResponse account(AccountResponse account) { return this; } - /** + /** * Get account * @return account - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public AccountResponse getAccount() { return account; @@ -89,7 +86,7 @@ public AccountResponse getAccount() { @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setAccount(AccountResponse account) { this.account = account; } @@ -108,12 +105,11 @@ public AccountGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponse.java index 0a327b98c..6f431abf6 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponse.java @@ -24,12 +24,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -49,8 +47,8 @@ AccountResponse.JSON_PROPERTY_LOCALE, AccountResponse.JSON_PROPERTY_USAGE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountResponse { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -108,12 +106,11 @@ public AccountResponse accountId(String accountId) { return this; } - /** + /** * The ID of the Account * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The ID of the Account") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +131,11 @@ public AccountResponse emailAddress(String emailAddress) { return this; } - /** + /** * The email address associated with the Account. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address associated with the Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +156,11 @@ public AccountResponse isLocked(Boolean isLocked) { return this; } - /** + /** * Returns `true` if the user has been locked out of their account by a team admin. * @return isLocked - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has been locked out of their account by a team admin.") @JsonProperty(JSON_PROPERTY_IS_LOCKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,12 +181,11 @@ public AccountResponse isPaidHs(Boolean isPaidHs) { return this; } - /** + /** * Returns `true` if the user has a paid Dropbox Sign account. * @return isPaidHs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid Dropbox Sign account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -212,12 +206,11 @@ public AccountResponse isPaidHf(Boolean isPaidHf) { return this; } - /** + /** * Returns `true` if the user has a paid HelloFax account. * @return isPaidHf - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid HelloFax account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HF) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -238,12 +231,11 @@ public AccountResponse quotas(AccountResponseQuotas quotas) { return this; } - /** + /** * Get quotas * @return quotas - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_QUOTAS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -264,12 +256,11 @@ public AccountResponse callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL that Dropbox Sign events will `POST` to. * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL that Dropbox Sign events will `POST` to.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -290,12 +281,11 @@ public AccountResponse roleCode(String roleCode) { return this; } - /** + /** * The membership role for the team. * @return roleCode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The membership role for the team.") @JsonProperty(JSON_PROPERTY_ROLE_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -316,12 +306,11 @@ public AccountResponse teamId(String teamId) { return this; } - /** + /** * The id of the team account belongs to. * @return teamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the team account belongs to.") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -342,12 +331,11 @@ public AccountResponse locale(String locale) { return this; } - /** + /** * The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. * @return locale - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") @JsonProperty(JSON_PROPERTY_LOCALE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -368,12 +356,11 @@ public AccountResponse usage(AccountResponseUsage usage) { return this; } - /** + /** * Get usage * @return usage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_USAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java index cd1fcbf91..04c1fe763 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Details concerning remaining monthly quotas. */ -@ApiModel(description = "Details concerning remaining monthly quotas.") @JsonPropertyOrder({ AccountResponseQuotas.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, AccountResponseQuotas.JSON_PROPERTY_DOCUMENTS_LEFT, @@ -43,8 +40,8 @@ AccountResponseQuotas.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT, AccountResponseQuotas.JSON_PROPERTY_NUM_FAX_PAGES_LEFT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountResponseQuotas { public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = "api_signature_requests_left"; private Integer apiSignatureRequestsLeft; @@ -87,12 +84,11 @@ public AccountResponseQuotas apiSignatureRequestsLeft(Integer apiSignatureReques return this; } - /** + /** * API signature requests remaining. * @return apiSignatureRequestsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "API signature requests remaining.") @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,12 +109,11 @@ public AccountResponseQuotas documentsLeft(Integer documentsLeft) { return this; } - /** + /** * Signature requests remaining. * @return documentsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signature requests remaining.") @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +134,11 @@ public AccountResponseQuotas templatesTotal(Integer templatesTotal) { return this; } - /** + /** * Total API templates allowed. * @return templatesTotal - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Total API templates allowed.") @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +159,11 @@ public AccountResponseQuotas templatesLeft(Integer templatesLeft) { return this; } - /** + /** * API templates remaining. * @return templatesLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "API templates remaining.") @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +184,11 @@ public AccountResponseQuotas smsVerificationsLeft(Integer smsVerificationsLeft) return this; } - /** + /** * SMS verifications remaining. * @return smsVerificationsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "SMS verifications remaining.") @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +209,11 @@ public AccountResponseQuotas numFaxPagesLeft(Integer numFaxPagesLeft) { return this; } - /** + /** * Number of fax pages left * @return numFaxPagesLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of fax pages left") @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java index ac1979e1e..741d5e58c 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java @@ -22,24 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Details concerning monthly usage */ -@ApiModel(description = "Details concerning monthly usage") @JsonPropertyOrder({ AccountResponseUsage.JSON_PROPERTY_FAX_PAGES_SENT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountResponseUsage { public static final String JSON_PROPERTY_FAX_PAGES_SENT = "fax_pages_sent"; private Integer faxPagesSent; @@ -67,12 +64,11 @@ public AccountResponseUsage faxPagesSent(Integer faxPagesSent) { return this; } - /** + /** * Number of fax pages sent * @return faxPagesSent - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of fax pages sent") @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java index 06ffd2398..f1bede2ea 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ AccountUpdateRequest.JSON_PROPERTY_CALLBACK_URL, AccountUpdateRequest.JSON_PROPERTY_LOCALE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountUpdateRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -74,12 +72,11 @@ public AccountUpdateRequest accountId(String accountId) { return this; } - /** + /** * The ID of the Account * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The ID of the Account") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,12 +97,11 @@ public AccountUpdateRequest callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL that Dropbox Sign should POST events to. * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL that Dropbox Sign should POST events to.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,12 +122,11 @@ public AccountUpdateRequest locale(String locale) { return this; } - /** + /** * The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. * @return locale - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") @JsonProperty(JSON_PROPERTY_LOCALE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java index 579f0995a..ef7ce84e0 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ AccountVerifyRequest.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountVerifyRequest { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -66,12 +64,11 @@ public AccountVerifyRequest emailAddress(String emailAddress) { return this; } - /** + /** * Email address to run the verification for. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Email address to run the verification for.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java index 2f958c7da..a703a42dd 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ AccountVerifyResponse.JSON_PROPERTY_ACCOUNT, AccountVerifyResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountVerifyResponse { public static final String JSON_PROPERTY_ACCOUNT = "account"; private AccountVerifyResponseAccount account; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public AccountVerifyResponse() { } @@ -74,12 +72,11 @@ public AccountVerifyResponse account(AccountVerifyResponseAccount account) { return this; } - /** + /** * Get account * @return account - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +105,11 @@ public AccountVerifyResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java index 57e21a61c..38b66db62 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ AccountVerifyResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AccountVerifyResponseAccount { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -66,12 +64,11 @@ public AccountVerifyResponseAccount emailAddress(String emailAddress) { return this; } - /** + /** * The email address associated with the Account. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address associated with the Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java index 20643b0c9..2b2cf1cd4 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java @@ -28,12 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -49,8 +47,8 @@ ApiAppCreateRequest.JSON_PROPERTY_OPTIONS, ApiAppCreateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppCreateRequest { public static final String JSON_PROPERTY_DOMAINS = "domains"; private List domains = new ArrayList<>(); @@ -104,12 +102,11 @@ public ApiAppCreateRequest addDomainsItem(String domainsItem) { return this; } - /** + /** * The domain names the ApiApp will be associated with. * @return domains - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The domain names the ApiApp will be associated with.") @JsonProperty(JSON_PROPERTY_DOMAINS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -130,12 +127,11 @@ public ApiAppCreateRequest name(String name) { return this; } - /** + /** * The name you want to assign to the ApiApp. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name you want to assign to the ApiApp.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -156,12 +152,11 @@ public ApiAppCreateRequest callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL at which the ApiApp should receive event callbacks. * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL at which the ApiApp should receive event callbacks.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -182,12 +177,11 @@ public ApiAppCreateRequest customLogoFile(File customLogoFile) { return this; } - /** + /** * An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) * @return customLogoFile - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)") @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -208,12 +202,11 @@ public ApiAppCreateRequest oauth(SubOAuth oauth) { return this; } - /** + /** * Get oauth * @return oauth - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,12 +227,11 @@ public ApiAppCreateRequest options(SubOptions options) { return this; } - /** + /** * Get options * @return options - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -260,12 +252,11 @@ public ApiAppCreateRequest whiteLabelingOptions(SubWhiteLabelingOptions whiteLab return this; } - /** + /** * Get whiteLabelingOptions * @return whiteLabelingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java index 2865068f7..a2d69e9c8 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ ApiAppGetResponse.JSON_PROPERTY_API_APP, ApiAppGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppGetResponse { public static final String JSON_PROPERTY_API_APP = "api_app"; private ApiAppResponse apiApp; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public ApiAppGetResponse() { } @@ -74,14 +72,13 @@ public ApiAppGetResponse apiApp(ApiAppResponse apiApp) { return this; } - /** + /** * Get apiApp * @return apiApp - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_API_APP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ApiAppResponse getApiApp() { return apiApp; @@ -89,7 +86,7 @@ public ApiAppResponse getApiApp() { @JsonProperty(JSON_PROPERTY_API_APP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setApiApp(ApiAppResponse apiApp) { this.apiApp = apiApp; } @@ -108,12 +105,11 @@ public ApiAppGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java index 80190dd97..7abb53610 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ ApiAppListResponse.JSON_PROPERTY_LIST_INFO, ApiAppListResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppListResponse { public static final String JSON_PROPERTY_API_APPS = "api_apps"; - private List apiApps; + private List apiApps = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public ApiAppListResponse() { } @@ -87,14 +85,13 @@ public ApiAppListResponse addApiAppsItem(ApiAppResponse apiAppsItem) { return this; } - /** + /** * Contains information about API Apps. * @return apiApps - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains information about API Apps.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_API_APPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getApiApps() { return apiApps; @@ -102,7 +99,7 @@ public List getApiApps() { @JsonProperty(JSON_PROPERTY_API_APPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setApiApps(List apiApps) { this.apiApps = apiApps; } @@ -113,14 +110,13 @@ public ApiAppListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public ApiAppListResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponse.java index 89559d85e..ee5f12eaf 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponse.java @@ -28,19 +28,16 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about an API App. */ -@ApiModel(description = "Contains information about an API App.") @JsonPropertyOrder({ ApiAppResponse.JSON_PROPERTY_CALLBACK_URL, ApiAppResponse.JSON_PROPERTY_CLIENT_ID, @@ -53,8 +50,8 @@ ApiAppResponse.JSON_PROPERTY_OWNER_ACCOUNT, ApiAppResponse.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponse { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -66,7 +63,7 @@ public class ApiAppResponse { private Integer createdAt; public static final String JSON_PROPERTY_DOMAINS = "domains"; - private List domains; + private List domains = null; public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -109,12 +106,11 @@ public ApiAppResponse callbackUrl(String callbackUrl) { return this; } - /** + /** * The app's callback URL (for events) * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The app's callback URL (for events)") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,12 +131,11 @@ public ApiAppResponse clientId(String clientId) { return this; } - /** + /** * The app's client id * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The app's client id") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,12 +156,11 @@ public ApiAppResponse createdAt(Integer createdAt) { return this; } - /** + /** * The time that the app was created * @return createdAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The time that the app was created") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -195,12 +189,11 @@ public ApiAppResponse addDomainsItem(String domainsItem) { return this; } - /** + /** * The domain name(s) associated with the app * @return domains - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The domain name(s) associated with the app") @JsonProperty(JSON_PROPERTY_DOMAINS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -221,12 +214,11 @@ public ApiAppResponse name(String name) { return this; } - /** + /** * The name of the app * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the app") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,12 +239,11 @@ public ApiAppResponse isApproved(Boolean isApproved) { return this; } - /** + /** * Boolean to indicate if the app has been approved * @return isApproved - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate if the app has been approved") @JsonProperty(JSON_PROPERTY_IS_APPROVED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -273,12 +264,11 @@ public ApiAppResponse oauth(ApiAppResponseOAuth oauth) { return this; } - /** + /** * Get oauth * @return oauth - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,12 +289,11 @@ public ApiAppResponse options(ApiAppResponseOptions options) { return this; } - /** + /** * Get options * @return options - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -325,12 +314,11 @@ public ApiAppResponse ownerAccount(ApiAppResponseOwnerAccount ownerAccount) { return this; } - /** + /** * Get ownerAccount * @return ownerAccount - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -351,12 +339,11 @@ public ApiAppResponse whiteLabelingOptions(ApiAppResponseWhiteLabelingOptions wh return this; } - /** + /** * Get whiteLabelingOptions * @return whiteLabelingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java index c3893a094..b071e4067 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java @@ -24,27 +24,24 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An object describing the app's OAuth properties, or null if OAuth is not configured for the app. */ -@ApiModel(description = "An object describing the app's OAuth properties, or null if OAuth is not configured for the app.") @JsonPropertyOrder({ ApiAppResponseOAuth.JSON_PROPERTY_CALLBACK_URL, ApiAppResponseOAuth.JSON_PROPERTY_SECRET, ApiAppResponseOAuth.JSON_PROPERTY_SCOPES, ApiAppResponseOAuth.JSON_PROPERTY_CHARGES_USERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseOAuth { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -53,7 +50,7 @@ public class ApiAppResponseOAuth { private String secret; public static final String JSON_PROPERTY_SCOPES = "scopes"; - private List scopes; + private List scopes = null; public static final String JSON_PROPERTY_CHARGES_USERS = "charges_users"; private Boolean chargesUsers; @@ -81,12 +78,11 @@ public ApiAppResponseOAuth callbackUrl(String callbackUrl) { return this; } - /** + /** * The app's OAuth callback URL. * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The app's OAuth callback URL.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,12 +103,11 @@ public ApiAppResponseOAuth secret(String secret) { return this; } - /** + /** * The app's OAuth secret, or null if the app does not belong to user. * @return secret - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The app's OAuth secret, or null if the app does not belong to user.") @JsonProperty(JSON_PROPERTY_SECRET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -141,12 +136,11 @@ public ApiAppResponseOAuth addScopesItem(String scopesItem) { return this; } - /** + /** * Array of OAuth scopes used by the app. * @return scopes - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Array of OAuth scopes used by the app.") @JsonProperty(JSON_PROPERTY_SCOPES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -167,12 +161,11 @@ public ApiAppResponseOAuth chargesUsers(Boolean chargesUsers) { return this; } - /** + /** * Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. * @return chargesUsers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests.") @JsonProperty(JSON_PROPERTY_CHARGES_USERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java index a908c76a1..2cffd69d5 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java @@ -22,24 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An object with options that override account settings. */ -@ApiModel(description = "An object with options that override account settings.") @JsonPropertyOrder({ ApiAppResponseOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseOptions { public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; private Boolean canInsertEverywhere; @@ -67,12 +64,11 @@ public ApiAppResponseOptions canInsertEverywhere(Boolean canInsertEverywhere) { return this; } - /** + /** * Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document * @return canInsertEverywhere - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document") @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java index 8101f361a..80f95b50a 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An object describing the app's owner */ -@ApiModel(description = "An object describing the app's owner") @JsonPropertyOrder({ ApiAppResponseOwnerAccount.JSON_PROPERTY_ACCOUNT_ID, ApiAppResponseOwnerAccount.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseOwnerAccount { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -71,12 +68,11 @@ public ApiAppResponseOwnerAccount accountId(String accountId) { return this; } - /** + /** * The owner account's ID * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The owner account's ID") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public ApiAppResponseOwnerAccount emailAddress(String emailAddress) { return this; } - /** + /** * The owner account's email address * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The owner account's email address") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java index 02de95f28..44b6f6e1e 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An object with options to customize the app's signer page */ -@ApiModel(description = "An object with options to customize the app's signer page") @JsonPropertyOrder({ ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, @@ -51,8 +48,8 @@ ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR1, ApiAppResponseWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2 }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppResponseWhiteLabelingOptions { public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; private String headerBackgroundColor; @@ -119,12 +116,11 @@ public ApiAppResponseWhiteLabelingOptions headerBackgroundColor(String headerBac return this; } - /** + /** * Get headerBackgroundColor * @return headerBackgroundColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -145,12 +141,11 @@ public ApiAppResponseWhiteLabelingOptions legalVersion(String legalVersion) { return this; } - /** + /** * Get legalVersion * @return legalVersion - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -171,12 +166,11 @@ public ApiAppResponseWhiteLabelingOptions linkColor(String linkColor) { return this; } - /** + /** * Get linkColor * @return linkColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LINK_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -197,12 +191,11 @@ public ApiAppResponseWhiteLabelingOptions pageBackgroundColor(String pageBackgro return this; } - /** + /** * Get pageBackgroundColor * @return pageBackgroundColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,12 +216,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonColor(String primaryButto return this; } - /** + /** * Get primaryButtonColor * @return primaryButtonColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,12 +241,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonColorHover(String primary return this; } - /** + /** * Get primaryButtonColorHover * @return primaryButtonColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -275,12 +266,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonTextColor(String primaryB return this; } - /** + /** * Get primaryButtonTextColor * @return primaryButtonTextColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -301,12 +291,11 @@ public ApiAppResponseWhiteLabelingOptions primaryButtonTextColorHover(String pri return this; } - /** + /** * Get primaryButtonTextColorHover * @return primaryButtonTextColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -327,12 +316,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonColor(String secondaryB return this; } - /** + /** * Get secondaryButtonColor * @return secondaryButtonColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -353,12 +341,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonColorHover(String secon return this; } - /** + /** * Get secondaryButtonColorHover * @return secondaryButtonColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -379,12 +366,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColor(String second return this; } - /** + /** * Get secondaryButtonTextColor * @return secondaryButtonTextColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -405,12 +391,11 @@ public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColorHover(String s return this; } - /** + /** * Get secondaryButtonTextColorHover * @return secondaryButtonTextColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -431,12 +416,11 @@ public ApiAppResponseWhiteLabelingOptions textColor1(String textColor1) { return this; } - /** + /** * Get textColor1 * @return textColor1 - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -457,12 +441,11 @@ public ApiAppResponseWhiteLabelingOptions textColor2(String textColor2) { return this; } - /** + /** * Get textColor2 * @return textColor2 - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java index 681cbea51..c4a484995 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java @@ -28,12 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -49,8 +47,8 @@ ApiAppUpdateRequest.JSON_PROPERTY_OPTIONS, ApiAppUpdateRequest.JSON_PROPERTY_WHITE_LABELING_OPTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiAppUpdateRequest { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -59,7 +57,7 @@ public class ApiAppUpdateRequest { private File customLogoFile; public static final String JSON_PROPERTY_DOMAINS = "domains"; - private List domains; + private List domains = null; public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -96,12 +94,11 @@ public ApiAppUpdateRequest callbackUrl(String callbackUrl) { return this; } - /** + /** * The URL at which the API App should receive event callbacks. * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL at which the API App should receive event callbacks.") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -122,12 +119,11 @@ public ApiAppUpdateRequest customLogoFile(File customLogoFile) { return this; } - /** + /** * An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) * @return customLogoFile - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)") @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +152,11 @@ public ApiAppUpdateRequest addDomainsItem(String domainsItem) { return this; } - /** + /** * The domain names the ApiApp will be associated with. * @return domains - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The domain names the ApiApp will be associated with.") @JsonProperty(JSON_PROPERTY_DOMAINS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -182,12 +177,11 @@ public ApiAppUpdateRequest name(String name) { return this; } - /** + /** * The name you want to assign to the ApiApp. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name you want to assign to the ApiApp.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -208,12 +202,11 @@ public ApiAppUpdateRequest oauth(SubOAuth oauth) { return this; } - /** + /** * Get oauth * @return oauth - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OAUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,12 +227,11 @@ public ApiAppUpdateRequest options(SubOptions options) { return this; } - /** + /** * Get options * @return options - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -260,12 +252,11 @@ public ApiAppUpdateRequest whiteLabelingOptions(SubWhiteLabelingOptions whiteLab return this; } - /** + /** * Get whiteLabelingOptions * @return whiteLabelingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java index 5af7a002c..af9c33736 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java @@ -28,12 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -46,8 +44,8 @@ BulkSendJobGetResponse.JSON_PROPERTY_SIGNATURE_REQUESTS, BulkSendJobGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobGetResponse { public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; private BulkSendJobResponse bulkSendJob; @@ -56,10 +54,10 @@ public class BulkSendJobGetResponse { private ListInfoResponse listInfo; public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; - private List signatureRequests; + private List signatureRequests = new ArrayList<>(); public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public BulkSendJobGetResponse() { } @@ -84,14 +82,13 @@ public BulkSendJobGetResponse bulkSendJob(BulkSendJobResponse bulkSendJob) { return this; } - /** + /** * Get bulkSendJob * @return bulkSendJob - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public BulkSendJobResponse getBulkSendJob() { return bulkSendJob; @@ -99,7 +96,7 @@ public BulkSendJobResponse getBulkSendJob() { @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBulkSendJob(BulkSendJobResponse bulkSendJob) { this.bulkSendJob = bulkSendJob; } @@ -110,14 +107,13 @@ public BulkSendJobGetResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -125,7 +121,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -144,14 +140,13 @@ public BulkSendJobGetResponse addSignatureRequestsItem(BulkSendJobGetResponseSig return this; } - /** + /** * Contains information about the Signature Requests sent in bulk. * @return signatureRequests - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains information about the Signature Requests sent in bulk.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getSignatureRequests() { return signatureRequests; @@ -159,7 +154,7 @@ public List getSignatureRequests() { @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSignatureRequests(List signatureRequests) { this.signatureRequests = signatureRequests; } @@ -178,12 +173,11 @@ public BulkSendJobGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java index 5690b490d..76c5b3120 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java @@ -28,12 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -67,8 +65,8 @@ BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_SIGNATURES, BulkSendJobGetResponseSignatureRequests.JSON_PROPERTY_BULK_SEND_JOB_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobGetResponseSignatureRequests { public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; private Boolean testMode = false; @@ -119,7 +117,7 @@ public class BulkSendJobGetResponseSignatureRequests { private String detailsUrl; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; private String signingRedirectUrl; @@ -128,19 +126,19 @@ public class BulkSendJobGetResponseSignatureRequests { private String finalCopyUri; public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds; + private List templateIds = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; - private List responseData; + private List responseData = null; public static final String JSON_PROPERTY_SIGNATURES = "signatures"; - private List signatures; + private List signatures = null; public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; private String bulkSendJobId; @@ -168,12 +166,11 @@ public BulkSendJobGetResponseSignatureRequests testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -194,12 +191,11 @@ public BulkSendJobGetResponseSignatureRequests signatureRequestId(String signatu return this; } - /** + /** * The id of the SignatureRequest. * @return signatureRequestId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -220,12 +216,11 @@ public BulkSendJobGetResponseSignatureRequests requesterEmailAddress(String requ return this; } - /** + /** * The email address of the initiator of the SignatureRequest. * @return requesterEmailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address of the initiator of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,12 +241,11 @@ public BulkSendJobGetResponseSignatureRequests title(String title) { return this; } - /** + /** * The title the specified Account uses for the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title the specified Account uses for the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -272,12 +266,11 @@ public BulkSendJobGetResponseSignatureRequests originalTitle(String originalTitl return this; } - /** + /** * Default Label for account. * @return originalTitle - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Default Label for account.") @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -298,12 +291,11 @@ public BulkSendJobGetResponseSignatureRequests subject(String subject) { return this; } - /** + /** * The subject in the email that was initially sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -324,12 +316,11 @@ public BulkSendJobGetResponseSignatureRequests message(String message) { return this; } - /** + /** * The custom message in the email that was initially sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -350,12 +341,11 @@ public BulkSendJobGetResponseSignatureRequests metadata(Object metadata) { return this; } - /** + /** * The metadata attached to the signature request. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The metadata attached to the signature request.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,12 +366,11 @@ public BulkSendJobGetResponseSignatureRequests createdAt(Integer createdAt) { return this; } - /** + /** * Time the signature request was created. * @return createdAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Time the signature request was created.") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -402,12 +391,11 @@ public BulkSendJobGetResponseSignatureRequests expiresAt(Integer expiresAt) { return this; } - /** + /** * The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -428,12 +416,11 @@ public BulkSendJobGetResponseSignatureRequests isComplete(Boolean isComplete) { return this; } - /** + /** * Whether or not the SignatureRequest has been fully executed by all signers. * @return isComplete - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been fully executed by all signers.") @JsonProperty(JSON_PROPERTY_IS_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -454,12 +441,11 @@ public BulkSendJobGetResponseSignatureRequests isDeclined(Boolean isDeclined) { return this; } - /** + /** * Whether or not the SignatureRequest has been declined by a signer. * @return isDeclined - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been declined by a signer.") @JsonProperty(JSON_PROPERTY_IS_DECLINED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -480,12 +466,11 @@ public BulkSendJobGetResponseSignatureRequests hasError(Boolean hasError) { return this; } - /** + /** * Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). * @return hasError - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).") @JsonProperty(JSON_PROPERTY_HAS_ERROR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -506,12 +491,11 @@ public BulkSendJobGetResponseSignatureRequests filesUrl(String filesUrl) { return this; } - /** + /** * The URL where a copy of the request's documents can be downloaded. * @return filesUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL where a copy of the request's documents can be downloaded.") @JsonProperty(JSON_PROPERTY_FILES_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -532,12 +516,11 @@ public BulkSendJobGetResponseSignatureRequests signingUrl(String signingUrl) { return this; } - /** + /** * The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. * @return signingUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.") @JsonProperty(JSON_PROPERTY_SIGNING_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -558,12 +541,11 @@ public BulkSendJobGetResponseSignatureRequests detailsUrl(String detailsUrl) { return this; } - /** + /** * The URL where the requester and the signers can view the current status of the SignatureRequest. * @return detailsUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL where the requester and the signers can view the current status of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_DETAILS_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -592,12 +574,11 @@ public BulkSendJobGetResponseSignatureRequests addCcEmailAddressesItem(String cc return this; } - /** + /** * A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -618,12 +599,11 @@ public BulkSendJobGetResponseSignatureRequests signingRedirectUrl(String signing return this; } - /** + /** * The URL you want the signer redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want the signer redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -644,12 +624,11 @@ public BulkSendJobGetResponseSignatureRequests finalCopyUri(String finalCopyUri) return this; } - /** + /** * The path where the completed document can be downloaded * @return finalCopyUri - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The path where the completed document can be downloaded") @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -678,12 +657,11 @@ public BulkSendJobGetResponseSignatureRequests addTemplateIdsItem(String templat return this; } - /** + /** * Templates IDs used in this SignatureRequest (if any). * @return templateIds - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Templates IDs used in this SignatureRequest (if any).") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -712,12 +690,11 @@ public BulkSendJobGetResponseSignatureRequests addCustomFieldsItem(SignatureRequ return this; } - /** + /** * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -746,12 +723,11 @@ public BulkSendJobGetResponseSignatureRequests addAttachmentsItem(SignatureReque return this; } - /** + /** * Signer attachments. * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signer attachments.") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -780,12 +756,11 @@ public BulkSendJobGetResponseSignatureRequests addResponseDataItem(SignatureRequ return this; } - /** + /** * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. * @return responseData - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -814,12 +789,11 @@ public BulkSendJobGetResponseSignatureRequests addSignaturesItem(SignatureReques return this; } - /** + /** * An array of signature objects, 1 for each signer. * @return signatures - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of signature objects, 1 for each signer.") @JsonProperty(JSON_PROPERTY_SIGNATURES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -840,12 +814,11 @@ public BulkSendJobGetResponseSignatureRequests bulkSendJobId(String bulkSendJobI return this; } - /** + /** * The id of the BulkSendJob. * @return bulkSendJobId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the BulkSendJob.") @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java index 7680094c8..c550b3164 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ BulkSendJobListResponse.JSON_PROPERTY_LIST_INFO, BulkSendJobListResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobListResponse { public static final String JSON_PROPERTY_BULK_SEND_JOBS = "bulk_send_jobs"; - private List bulkSendJobs; + private List bulkSendJobs = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public BulkSendJobListResponse() { } @@ -87,14 +85,13 @@ public BulkSendJobListResponse addBulkSendJobsItem(BulkSendJobResponse bulkSendJ return this; } - /** + /** * Contains a list of BulkSendJobs that the API caller has access to. * @return bulkSendJobs - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains a list of BulkSendJobs that the API caller has access to.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getBulkSendJobs() { return bulkSendJobs; @@ -102,7 +99,7 @@ public List getBulkSendJobs() { @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBulkSendJobs(List bulkSendJobs) { this.bulkSendJobs = bulkSendJobs; } @@ -113,14 +110,13 @@ public BulkSendJobListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public BulkSendJobListResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java index 7c96eb83c..88f0eec99 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java @@ -22,27 +22,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. */ -@ApiModel(description = "Contains information about the BulkSendJob such as when it was created and how many signature requests are queued.") @JsonPropertyOrder({ BulkSendJobResponse.JSON_PROPERTY_BULK_SEND_JOB_ID, BulkSendJobResponse.JSON_PROPERTY_TOTAL, BulkSendJobResponse.JSON_PROPERTY_IS_CREATOR, BulkSendJobResponse.JSON_PROPERTY_CREATED_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobResponse { public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; private String bulkSendJobId; @@ -79,12 +76,11 @@ public BulkSendJobResponse bulkSendJobId(String bulkSendJobId) { return this; } - /** + /** * The id of the BulkSendJob. * @return bulkSendJobId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the BulkSendJob.") @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public BulkSendJobResponse total(Integer total) { return this; } - /** + /** * The total amount of Signature Requests queued for sending. * @return total - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The total amount of Signature Requests queued for sending.") @JsonProperty(JSON_PROPERTY_TOTAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public BulkSendJobResponse isCreator(Boolean isCreator) { return this; } - /** + /** * True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. * @return isCreator - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member.") @JsonProperty(JSON_PROPERTY_IS_CREATOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public BulkSendJobResponse createdAt(Integer createdAt) { return this; } - /** + /** * Time that the BulkSendJob was created. * @return createdAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Time that the BulkSendJob was created.") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java index 24849226e..b3be77254 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ BulkSendJobSendResponse.JSON_PROPERTY_BULK_SEND_JOB, BulkSendJobSendResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BulkSendJobSendResponse { public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; private BulkSendJobResponse bulkSendJob; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public BulkSendJobSendResponse() { } @@ -74,14 +72,13 @@ public BulkSendJobSendResponse bulkSendJob(BulkSendJobResponse bulkSendJob) { return this; } - /** + /** * Get bulkSendJob * @return bulkSendJob - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public BulkSendJobResponse getBulkSendJob() { return bulkSendJob; @@ -89,7 +86,7 @@ public BulkSendJobResponse getBulkSendJob() { @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBulkSendJob(BulkSendJobResponse bulkSendJob) { this.bulkSendJob = bulkSendJob; } @@ -108,12 +105,11 @@ public BulkSendJobSendResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java index ec213e918..103eb03ec 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -50,14 +48,14 @@ EmbeddedEditUrlRequest.JSON_PROPERTY_SHOW_PROGRESS_STEPPER, EmbeddedEditUrlRequest.JSON_PROPERTY_TEST_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedEditUrlRequest { public static final String JSON_PROPERTY_ALLOW_EDIT_CCS = "allow_edit_ccs"; private Boolean allowEditCcs = false; public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles; + private List ccRoles = null; public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; private SubEditorOptions editorOptions; @@ -69,7 +67,7 @@ public class EmbeddedEditUrlRequest { private Boolean forceSubjectMessage = false; public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - private List mergeFields; + private List mergeFields = null; public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; private Boolean previewOnly = false; @@ -106,12 +104,11 @@ public EmbeddedEditUrlRequest allowEditCcs(Boolean allowEditCcs) { return this; } - /** + /** * This allows the requester to enable/disable to add or change CC roles when editing the template. * @return allowEditCcs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable/disable to add or change CC roles when editing the template.") @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -140,12 +137,11 @@ public EmbeddedEditUrlRequest addCcRolesItem(String ccRolesItem) { return this; } - /** + /** * The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. * @return ccRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request.") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,12 +162,11 @@ public EmbeddedEditUrlRequest editorOptions(SubEditorOptions editorOptions) { return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -192,12 +187,11 @@ public EmbeddedEditUrlRequest forceSignerRoles(Boolean forceSignerRoles) { return this; } - /** + /** * Provide users the ability to review/edit the template signer roles. * @return forceSignerRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template signer roles.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -218,12 +212,11 @@ public EmbeddedEditUrlRequest forceSubjectMessage(Boolean forceSubjectMessage) { return this; } - /** + /** * Provide users the ability to review/edit the template subject and message. * @return forceSubjectMessage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -252,12 +245,11 @@ public EmbeddedEditUrlRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) return this; } - /** + /** * Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`. * @return mergeFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`.") @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -278,12 +270,11 @@ public EmbeddedEditUrlRequest previewOnly(Boolean previewOnly) { return this; } - /** + /** * This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set). * @return previewOnly - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set).") @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -304,12 +295,11 @@ public EmbeddedEditUrlRequest showPreview(Boolean showPreview) { return this; } - /** + /** * This allows the requester to enable the editor/preview experience. * @return showPreview - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the editor/preview experience.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -330,12 +320,11 @@ public EmbeddedEditUrlRequest showProgressStepper(Boolean showProgressStepper) { return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -356,12 +345,11 @@ public EmbeddedEditUrlRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java index 00021102c..cf7faf9d5 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ EmbeddedEditUrlResponse.JSON_PROPERTY_EMBEDDED, EmbeddedEditUrlResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedEditUrlResponse { public static final String JSON_PROPERTY_EMBEDDED = "embedded"; private EmbeddedEditUrlResponseEmbedded embedded; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public EmbeddedEditUrlResponse() { } @@ -74,14 +72,13 @@ public EmbeddedEditUrlResponse embedded(EmbeddedEditUrlResponseEmbedded embedded return this; } - /** + /** * Get embedded * @return embedded - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public EmbeddedEditUrlResponseEmbedded getEmbedded() { return embedded; @@ -89,7 +86,7 @@ public EmbeddedEditUrlResponseEmbedded getEmbedded() { @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setEmbedded(EmbeddedEditUrlResponseEmbedded embedded) { this.embedded = embedded; } @@ -108,12 +105,11 @@ public EmbeddedEditUrlResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java index b14b255df..c990405ef 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An embedded template object. */ -@ApiModel(description = "An embedded template object.") @JsonPropertyOrder({ EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EDIT_URL, EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedEditUrlResponseEmbedded { public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; private String editUrl; @@ -71,12 +68,11 @@ public EmbeddedEditUrlResponseEmbedded editUrl(String editUrl) { return this; } - /** + /** * A template url that can be opened in an iFrame. * @return editUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A template url that can be opened in an iFrame.") @JsonProperty(JSON_PROPERTY_EDIT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public EmbeddedEditUrlResponseEmbedded expiresAt(Integer expiresAt) { return this; } - /** + /** * The specific time that the the `edit_url` link expires, in epoch. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The specific time that the the `edit_url` link expires, in epoch.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java index a15b37df6..3455fe0cb 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ EmbeddedSignUrlResponse.JSON_PROPERTY_EMBEDDED, EmbeddedSignUrlResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedSignUrlResponse { public static final String JSON_PROPERTY_EMBEDDED = "embedded"; private EmbeddedSignUrlResponseEmbedded embedded; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public EmbeddedSignUrlResponse() { } @@ -74,14 +72,13 @@ public EmbeddedSignUrlResponse embedded(EmbeddedSignUrlResponseEmbedded embedded return this; } - /** + /** * Get embedded * @return embedded - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public EmbeddedSignUrlResponseEmbedded getEmbedded() { return embedded; @@ -89,7 +86,7 @@ public EmbeddedSignUrlResponseEmbedded getEmbedded() { @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setEmbedded(EmbeddedSignUrlResponseEmbedded embedded) { this.embedded = embedded; } @@ -108,12 +105,11 @@ public EmbeddedSignUrlResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java index a9af85030..f88dd631f 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An object that contains necessary information to set up embedded signing. */ -@ApiModel(description = "An object that contains necessary information to set up embedded signing.") @JsonPropertyOrder({ EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_SIGN_URL, EmbeddedSignUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EmbeddedSignUrlResponseEmbedded { public static final String JSON_PROPERTY_SIGN_URL = "sign_url"; private String signUrl; @@ -71,12 +68,11 @@ public EmbeddedSignUrlResponseEmbedded signUrl(String signUrl) { return this; } - /** + /** * A signature url that can be opened in an iFrame. * @return signUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A signature url that can be opened in an iFrame.") @JsonProperty(JSON_PROPERTY_SIGN_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public EmbeddedSignUrlResponseEmbedded expiresAt(Integer expiresAt) { return this; } - /** + /** * The specific time that the the `sign_url` link expires, in epoch. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The specific time that the the `sign_url` link expires, in epoch.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ErrorResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ErrorResponse.java index 1441520b8..ea26e455d 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ErrorResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ErrorResponse.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ @JsonPropertyOrder({ ErrorResponse.JSON_PROPERTY_ERROR }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorResponse { public static final String JSON_PROPERTY_ERROR = "error"; private ErrorResponseError error; @@ -67,12 +65,11 @@ public ErrorResponse error(ErrorResponseError error) { return this; } - /** + /** * Get error * @return error - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_ERROR) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ErrorResponseError.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ErrorResponseError.java index fadf27211..2c7277014 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ErrorResponseError.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ErrorResponseError.java @@ -22,26 +22,23 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about an error that occurred. */ -@ApiModel(description = "Contains information about an error that occurred.") @JsonPropertyOrder({ ErrorResponseError.JSON_PROPERTY_ERROR_MSG, ErrorResponseError.JSON_PROPERTY_ERROR_NAME, ErrorResponseError.JSON_PROPERTY_ERROR_PATH }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorResponseError { public static final String JSON_PROPERTY_ERROR_MSG = "error_msg"; private String errorMsg; @@ -75,12 +72,11 @@ public ErrorResponseError errorMsg(String errorMsg) { return this; } - /** + /** * Message describing an error. * @return errorMsg - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Message describing an error.") @JsonProperty(JSON_PROPERTY_ERROR_MSG) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -101,12 +97,11 @@ public ErrorResponseError errorName(String errorName) { return this; } - /** + /** * Name of the error. * @return errorName - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the error.") @JsonProperty(JSON_PROPERTY_ERROR_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -127,12 +122,11 @@ public ErrorResponseError errorPath(String errorPath) { return this; } - /** + /** * Path at which an error occurred. * @return errorPath - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Path at which an error occurred.") @JsonProperty(JSON_PROPERTY_ERROR_PATH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java index 3208b464a..0307d55a3 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -44,8 +42,8 @@ EventCallbackRequest.JSON_PROPERTY_SIGNATURE_REQUEST, EventCallbackRequest.JSON_PROPERTY_TEMPLATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EventCallbackRequest { public static final String JSON_PROPERTY_EVENT = "event"; private EventCallbackRequestEvent event; @@ -82,12 +80,11 @@ public EventCallbackRequest event(EventCallbackRequestEvent event) { return this; } - /** + /** * Get event * @return event - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_EVENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +105,11 @@ public EventCallbackRequest account(AccountResponse account) { return this; } - /** + /** * Get account * @return account - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +130,11 @@ public EventCallbackRequest signatureRequest(SignatureRequestResponse signatureR return this; } - /** + /** * Get signatureRequest * @return signatureRequest - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +155,11 @@ public EventCallbackRequest template(TemplateResponse template) { return this; } - /** + /** * Get template * @return template - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEMPLATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java index c8d5e7c87..583482a11 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java @@ -23,27 +23,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Basic information about the event that occurred. */ -@ApiModel(description = "Basic information about the event that occurred.") @JsonPropertyOrder({ EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TIME, EventCallbackRequestEvent.JSON_PROPERTY_EVENT_TYPE, EventCallbackRequestEvent.JSON_PROPERTY_EVENT_HASH, EventCallbackRequestEvent.JSON_PROPERTY_EVENT_METADATA }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EventCallbackRequestEvent { public static final String JSON_PROPERTY_EVENT_TIME = "event_time"; private String eventTime; @@ -157,12 +154,11 @@ public EventCallbackRequestEvent eventTime(String eventTime) { return this; } - /** + /** * Time the event was created (using Unix time). * @return eventTime - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Time the event was created (using Unix time).") @JsonProperty(JSON_PROPERTY_EVENT_TIME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -183,12 +179,11 @@ public EventCallbackRequestEvent eventType(EventTypeEnum eventType) { return this; } - /** + /** * Type of callback event that was triggered. * @return eventType - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Type of callback event that was triggered.") @JsonProperty(JSON_PROPERTY_EVENT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,12 +204,11 @@ public EventCallbackRequestEvent eventHash(String eventHash) { return this; } - /** + /** * Generated hash used to verify source of event data. * @return eventHash - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Generated hash used to verify source of event data.") @JsonProperty(JSON_PROPERTY_EVENT_HASH) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -235,12 +229,11 @@ public EventCallbackRequestEvent eventMetadata(EventCallbackRequestEventMetadata return this; } - /** + /** * Get eventMetadata * @return eventMetadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EVENT_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java index f0bea0630..b832ff192 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java @@ -22,27 +22,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Specific metadata about the event. */ -@ApiModel(description = "Specific metadata about the event.") @JsonPropertyOrder({ EventCallbackRequestEventMetadata.JSON_PROPERTY_RELATED_SIGNATURE_ID, EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID, EventCallbackRequestEventMetadata.JSON_PROPERTY_REPORTED_FOR_APP_ID, EventCallbackRequestEventMetadata.JSON_PROPERTY_EVENT_MESSAGE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EventCallbackRequestEventMetadata { public static final String JSON_PROPERTY_RELATED_SIGNATURE_ID = "related_signature_id"; private String relatedSignatureId; @@ -79,12 +76,11 @@ public EventCallbackRequestEventMetadata relatedSignatureId(String relatedSignat return this; } - /** + /** * Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. * @return relatedSignatureId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events.") @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public EventCallbackRequestEventMetadata reportedForAccountId(String reportedFor return this; } - /** + /** * Account ID the event was reported for. * @return reportedForAccountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Account ID the event was reported for.") @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public EventCallbackRequestEventMetadata reportedForAppId(String reportedForAppI return this; } - /** + /** * App ID the event was reported for. * @return reportedForAppId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "App ID the event was reported for.") @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public EventCallbackRequestEventMetadata eventMessage(String eventMessage) { return this; } - /** + /** * Message about a declined or failed (due to error) signature flow. * @return eventMessage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Message about a declined or failed (due to error) signature flow.") @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java new file mode 100644 index 000000000..99f972a27 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java @@ -0,0 +1,278 @@ +/* + * 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; +/** + * FaxLineAddUserRequest + */ +@JsonPropertyOrder({ + FaxLineAddUserRequest.JSON_PROPERTY_NUMBER, + FaxLineAddUserRequest.JSON_PROPERTY_ACCOUNT_ID, + FaxLineAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineAddUserRequest { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public FaxLineAddUserRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineAddUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineAddUserRequest.class); + } + + static public FaxLineAddUserRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineAddUserRequest.class + ); + } + + public FaxLineAddUserRequest number(String number) { + this.number = number; + return this; + } + + /** + * The Fax Line number. + * @return number + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(String number) { + this.number = number; + } + + + public FaxLineAddUserRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Account ID + * @return accountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public FaxLineAddUserRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address + * @return emailAddress + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this FaxLineAddUserRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineAddUserRequest faxLineAddUserRequest = (FaxLineAddUserRequest) o; + return Objects.equals(this.number, faxLineAddUserRequest.number) && + Objects.equals(this.accountId, faxLineAddUserRequest.accountId) && + Objects.equals(this.emailAddress, faxLineAddUserRequest.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(number, accountId, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineAddUserRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } + + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } + } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } + + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } + } + } 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/FaxLineAreaCodeGetCountryEnum.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java new file mode 100644 index 000000000..d6ef80861 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java @@ -0,0 +1,65 @@ +/* + * 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.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FaxLineAreaCodeGetCountryEnum + */ +public enum FaxLineAreaCodeGetCountryEnum { + + CA("CA"), + + US("US"), + + UK("UK"); + + private String value; + + FaxLineAreaCodeGetCountryEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetCountryEnum fromValue(String value) { + for (FaxLineAreaCodeGetCountryEnum b : FaxLineAreaCodeGetCountryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java new file mode 100644 index 000000000..3c0b91340 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java @@ -0,0 +1,85 @@ +/* + * 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.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FaxLineAreaCodeGetProvinceEnum + */ +public enum FaxLineAreaCodeGetProvinceEnum { + + AB("AB"), + + BC("BC"), + + MB("MB"), + + NB("NB"), + + NL("NL"), + + NT("NT"), + + NS("NS"), + + NU("NU"), + + ON("ON"), + + PE("PE"), + + QC("QC"), + + SK("SK"), + + YT("YT"); + + private String value; + + FaxLineAreaCodeGetProvinceEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetProvinceEnum fromValue(String value) { + for (FaxLineAreaCodeGetProvinceEnum b : FaxLineAreaCodeGetProvinceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java new file mode 100644 index 000000000..b4b2bbb03 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java @@ -0,0 +1,188 @@ +/* + * 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.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; +/** + * FaxLineAreaCodeGetResponse + */ +@JsonPropertyOrder({ + FaxLineAreaCodeGetResponse.JSON_PROPERTY_AREA_CODES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineAreaCodeGetResponse { + public static final String JSON_PROPERTY_AREA_CODES = "area_codes"; + private List areaCodes = new ArrayList<>(); + + public FaxLineAreaCodeGetResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineAreaCodeGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineAreaCodeGetResponse.class); + } + + static public FaxLineAreaCodeGetResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineAreaCodeGetResponse.class + ); + } + + public FaxLineAreaCodeGetResponse areaCodes(List areaCodes) { + this.areaCodes = areaCodes; + return this; + } + + public FaxLineAreaCodeGetResponse addAreaCodesItem(Integer areaCodesItem) { + if (this.areaCodes == null) { + this.areaCodes = new ArrayList<>(); + } + this.areaCodes.add(areaCodesItem); + return this; + } + + /** + * Get areaCodes + * @return areaCodes + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AREA_CODES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getAreaCodes() { + return areaCodes; + } + + + @JsonProperty(JSON_PROPERTY_AREA_CODES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAreaCodes(List areaCodes) { + this.areaCodes = areaCodes; + } + + + /** + * Return true if this FaxLineAreaCodeGetResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineAreaCodeGetResponse faxLineAreaCodeGetResponse = (FaxLineAreaCodeGetResponse) o; + return Objects.equals(this.areaCodes, faxLineAreaCodeGetResponse.areaCodes); + } + + @Override + public int hashCode() { + return Objects.hash(areaCodes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineAreaCodeGetResponse {\n"); + sb.append(" areaCodes: ").append(toIndentedString(areaCodes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (areaCodes != null) { + if (isFileTypeOrListOfFiles(areaCodes)) { + fileTypeFound = true; + } + + if (areaCodes.getClass().equals(java.io.File.class) || + areaCodes.getClass().equals(Integer.class) || + areaCodes.getClass().equals(String.class) || + areaCodes.getClass().isEnum()) { + map.put("area_codes", areaCodes); + } else if (isListOfFile(areaCodes)) { + for(int i = 0; i< getListSize(areaCodes); i++) { + map.put("area_codes[" + i + "]", getFromList(areaCodes, i)); + } + } + else { + map.put("area_codes", JSON.getDefault().getMapper().writeValueAsString(areaCodes)); + } + } + } 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/FaxLineAreaCodeGetStateEnum.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java new file mode 100644 index 000000000..c0e5ae4d7 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java @@ -0,0 +1,161 @@ +/* + * 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.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FaxLineAreaCodeGetStateEnum + */ +public enum FaxLineAreaCodeGetStateEnum { + + AK("AK"), + + AL("AL"), + + AR("AR"), + + AZ("AZ"), + + CA("CA"), + + CO("CO"), + + CT("CT"), + + DC("DC"), + + DE("DE"), + + FL("FL"), + + GA("GA"), + + HI("HI"), + + IA("IA"), + + ID("ID"), + + IL("IL"), + + IN("IN"), + + KS("KS"), + + KY("KY"), + + LA("LA"), + + MA("MA"), + + MD("MD"), + + ME("ME"), + + MI("MI"), + + MN("MN"), + + MO("MO"), + + MS("MS"), + + MT("MT"), + + NC("NC"), + + ND("ND"), + + NE("NE"), + + NH("NH"), + + NJ("NJ"), + + NM("NM"), + + NV("NV"), + + NY("NY"), + + OH("OH"), + + OK("OK"), + + OR("OR"), + + PA("PA"), + + RI("RI"), + + SC("SC"), + + SD("SD"), + + TN("TN"), + + TX("TX"), + + UT("UT"), + + VA("VA"), + + VT("VT"), + + WA("WA"), + + WI("WI"), + + WV("WV"), + + WY("WY"); + + private String value; + + FaxLineAreaCodeGetStateEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FaxLineAreaCodeGetStateEnum fromValue(String value) { + for (FaxLineAreaCodeGetStateEnum b : FaxLineAreaCodeGetStateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java new file mode 100644 index 000000000..7d23eac13 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java @@ -0,0 +1,365 @@ +/* + * 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; +/** + * FaxLineCreateRequest + */ +@JsonPropertyOrder({ + FaxLineCreateRequest.JSON_PROPERTY_AREA_CODE, + FaxLineCreateRequest.JSON_PROPERTY_COUNTRY, + FaxLineCreateRequest.JSON_PROPERTY_CITY, + FaxLineCreateRequest.JSON_PROPERTY_ACCOUNT_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineCreateRequest { + public static final String JSON_PROPERTY_AREA_CODE = "area_code"; + private Integer areaCode; + + /** + * Country + */ + public enum CountryEnum { + CA("CA"), + + US("US"), + + UK("UK"); + + private String value; + + CountryEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CountryEnum fromValue(String value) { + for (CountryEnum b : CountryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_COUNTRY = "country"; + private CountryEnum country; + + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public FaxLineCreateRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineCreateRequest.class); + } + + static public FaxLineCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineCreateRequest.class + ); + } + + public FaxLineCreateRequest areaCode(Integer areaCode) { + this.areaCode = areaCode; + return this; + } + + /** + * Area code + * @return areaCode + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AREA_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getAreaCode() { + return areaCode; + } + + + @JsonProperty(JSON_PROPERTY_AREA_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAreaCode(Integer areaCode) { + this.areaCode = areaCode; + } + + + public FaxLineCreateRequest country(CountryEnum country) { + this.country = country; + return this; + } + + /** + * Country + * @return country + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public CountryEnum getCountry() { + return country; + } + + + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCountry(CountryEnum country) { + this.country = country; + } + + + public FaxLineCreateRequest city(String city) { + this.city = city; + return this; + } + + /** + * City + * @return city + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCity() { + return city; + } + + + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCity(String city) { + this.city = city; + } + + + public FaxLineCreateRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Account ID + * @return accountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + /** + * Return true if this FaxLineCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineCreateRequest faxLineCreateRequest = (FaxLineCreateRequest) o; + return Objects.equals(this.areaCode, faxLineCreateRequest.areaCode) && + Objects.equals(this.country, faxLineCreateRequest.country) && + Objects.equals(this.city, faxLineCreateRequest.city) && + Objects.equals(this.accountId, faxLineCreateRequest.accountId); + } + + @Override + public int hashCode() { + return Objects.hash(areaCode, country, city, accountId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineCreateRequest {\n"); + sb.append(" areaCode: ").append(toIndentedString(areaCode)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (areaCode != null) { + if (isFileTypeOrListOfFiles(areaCode)) { + fileTypeFound = true; + } + + if (areaCode.getClass().equals(java.io.File.class) || + areaCode.getClass().equals(Integer.class) || + areaCode.getClass().equals(String.class) || + areaCode.getClass().isEnum()) { + map.put("area_code", areaCode); + } else if (isListOfFile(areaCode)) { + for(int i = 0; i< getListSize(areaCode); i++) { + map.put("area_code[" + i + "]", getFromList(areaCode, i)); + } + } + else { + map.put("area_code", JSON.getDefault().getMapper().writeValueAsString(areaCode)); + } + } + if (country != null) { + if (isFileTypeOrListOfFiles(country)) { + fileTypeFound = true; + } + + if (country.getClass().equals(java.io.File.class) || + country.getClass().equals(Integer.class) || + country.getClass().equals(String.class) || + country.getClass().isEnum()) { + map.put("country", country); + } else if (isListOfFile(country)) { + for(int i = 0; i< getListSize(country); i++) { + map.put("country[" + i + "]", getFromList(country, i)); + } + } + else { + map.put("country", JSON.getDefault().getMapper().writeValueAsString(country)); + } + } + if (city != null) { + if (isFileTypeOrListOfFiles(city)) { + fileTypeFound = true; + } + + if (city.getClass().equals(java.io.File.class) || + city.getClass().equals(Integer.class) || + city.getClass().equals(String.class) || + city.getClass().isEnum()) { + map.put("city", city); + } else if (isListOfFile(city)) { + for(int i = 0; i< getListSize(city); i++) { + map.put("city[" + i + "]", getFromList(city, i)); + } + } + else { + map.put("city", JSON.getDefault().getMapper().writeValueAsString(city)); + } + } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } + + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } + } + } 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/FaxLineDeleteRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java new file mode 100644 index 000000000..c7876dd3f --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java @@ -0,0 +1,178 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineDeleteRequest + */ +@JsonPropertyOrder({ + FaxLineDeleteRequest.JSON_PROPERTY_NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineDeleteRequest { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public FaxLineDeleteRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineDeleteRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineDeleteRequest.class); + } + + static public FaxLineDeleteRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineDeleteRequest.class + ); + } + + public FaxLineDeleteRequest number(String number) { + this.number = number; + return this; + } + + /** + * The Fax Line number. + * @return number + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(String number) { + this.number = number; + } + + + /** + * Return true if this FaxLineDeleteRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineDeleteRequest faxLineDeleteRequest = (FaxLineDeleteRequest) o; + return Objects.equals(this.number, faxLineDeleteRequest.number); + } + + @Override + public int hashCode() { + return Objects.hash(number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineDeleteRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + } 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/FaxLineListResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java new file mode 100644 index 000000000..33163a28c --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java @@ -0,0 +1,291 @@ +/* + * 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.FaxLineResponseFaxLine; +import com.dropbox.sign.model.ListInfoResponse; +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; +/** + * FaxLineListResponse + */ +@JsonPropertyOrder({ + FaxLineListResponse.JSON_PROPERTY_LIST_INFO, + FaxLineListResponse.JSON_PROPERTY_FAX_LINES, + FaxLineListResponse.JSON_PROPERTY_WARNINGS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineListResponse { + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_FAX_LINES = "fax_lines"; + private List faxLines = new ArrayList<>(); + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private WarningResponse warnings; + + public FaxLineListResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineListResponse.class); + } + + static public FaxLineListResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineListResponse.class + ); + } + + public FaxLineListResponse 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; + } + + + public FaxLineListResponse faxLines(List faxLines) { + this.faxLines = faxLines; + return this; + } + + public FaxLineListResponse addFaxLinesItem(FaxLineResponseFaxLine faxLinesItem) { + if (this.faxLines == null) { + this.faxLines = new ArrayList<>(); + } + this.faxLines.add(faxLinesItem); + return this; + } + + /** + * Get faxLines + * @return faxLines + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_LINES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getFaxLines() { + return faxLines; + } + + + @JsonProperty(JSON_PROPERTY_FAX_LINES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxLines(List faxLines) { + this.faxLines = faxLines; + } + + + public FaxLineListResponse warnings(WarningResponse warnings) { + this.warnings = warnings; + return this; + } + + /** + * Get warnings + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WarningResponse getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(WarningResponse warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxLineListResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineListResponse faxLineListResponse = (FaxLineListResponse) o; + return Objects.equals(this.listInfo, faxLineListResponse.listInfo) && + Objects.equals(this.faxLines, faxLineListResponse.faxLines) && + Objects.equals(this.warnings, faxLineListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(listInfo, faxLines, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineListResponse {\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" faxLines: ").append(toIndentedString(faxLines)).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 (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)); + } + } + if (faxLines != null) { + if (isFileTypeOrListOfFiles(faxLines)) { + fileTypeFound = true; + } + + if (faxLines.getClass().equals(java.io.File.class) || + faxLines.getClass().equals(Integer.class) || + faxLines.getClass().equals(String.class) || + faxLines.getClass().isEnum()) { + map.put("fax_lines", faxLines); + } else if (isListOfFile(faxLines)) { + for(int i = 0; i< getListSize(faxLines); i++) { + map.put("fax_lines[" + i + "]", getFromList(faxLines, i)); + } + } + else { + map.put("fax_lines", JSON.getDefault().getMapper().writeValueAsString(faxLines)); + } + } + 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/FaxLineRemoveUserRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java new file mode 100644 index 000000000..747853a52 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java @@ -0,0 +1,278 @@ +/* + * 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; +/** + * FaxLineRemoveUserRequest + */ +@JsonPropertyOrder({ + FaxLineRemoveUserRequest.JSON_PROPERTY_NUMBER, + FaxLineRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, + FaxLineRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineRemoveUserRequest { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public FaxLineRemoveUserRequest() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineRemoveUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineRemoveUserRequest.class); + } + + static public FaxLineRemoveUserRequest init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineRemoveUserRequest.class + ); + } + + public FaxLineRemoveUserRequest number(String number) { + this.number = number; + return this; + } + + /** + * The Fax Line number. + * @return number + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(String number) { + this.number = number; + } + + + public FaxLineRemoveUserRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Account ID + * @return accountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountId() { + return accountId; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public FaxLineRemoveUserRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address + * @return emailAddress + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmailAddress() { + return emailAddress; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + + /** + * Return true if this FaxLineRemoveUserRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineRemoveUserRequest faxLineRemoveUserRequest = (FaxLineRemoveUserRequest) o; + return Objects.equals(this.number, faxLineRemoveUserRequest.number) && + Objects.equals(this.accountId, faxLineRemoveUserRequest.accountId) && + Objects.equals(this.emailAddress, faxLineRemoveUserRequest.emailAddress); + } + + @Override + public int hashCode() { + return Objects.hash(number, accountId, emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineRemoveUserRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + if (accountId != null) { + if (isFileTypeOrListOfFiles(accountId)) { + fileTypeFound = true; + } + + if (accountId.getClass().equals(java.io.File.class) || + accountId.getClass().equals(Integer.class) || + accountId.getClass().equals(String.class) || + accountId.getClass().isEnum()) { + map.put("account_id", accountId); + } else if (isListOfFile(accountId)) { + for(int i = 0; i< getListSize(accountId); i++) { + map.put("account_id[" + i + "]", getFromList(accountId, i)); + } + } + else { + map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + } + } + if (emailAddress != null) { + if (isFileTypeOrListOfFiles(emailAddress)) { + fileTypeFound = true; + } + + if (emailAddress.getClass().equals(java.io.File.class) || + emailAddress.getClass().equals(Integer.class) || + emailAddress.getClass().equals(String.class) || + emailAddress.getClass().isEnum()) { + map.put("email_address", emailAddress); + } else if (isListOfFile(emailAddress)) { + for(int i = 0; i< getListSize(emailAddress); i++) { + map.put("email_address[" + i + "]", getFromList(emailAddress, i)); + } + } + else { + map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + } + } + } 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/FaxLineResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineResponse.java new file mode 100644 index 000000000..8fae8caf7 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineResponse.java @@ -0,0 +1,230 @@ +/* + * Dropbox Sign API + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.dropbox.sign.model; + +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.dropbox.sign.model.FaxLineResponseFaxLine; +import com.dropbox.sign.model.WarningResponse; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; + + +import com.dropbox.sign.ApiException; +/** + * FaxLineResponse + */ +@JsonPropertyOrder({ + FaxLineResponse.JSON_PROPERTY_FAX_LINE, + FaxLineResponse.JSON_PROPERTY_WARNINGS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineResponse { + public static final String JSON_PROPERTY_FAX_LINE = "fax_line"; + private FaxLineResponseFaxLine faxLine; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private WarningResponse warnings; + + public FaxLineResponse() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineResponse.class); + } + + static public FaxLineResponse init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineResponse.class + ); + } + + public FaxLineResponse faxLine(FaxLineResponseFaxLine faxLine) { + this.faxLine = faxLine; + return this; + } + + /** + * Get faxLine + * @return faxLine + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FAX_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public FaxLineResponseFaxLine getFaxLine() { + return faxLine; + } + + + @JsonProperty(JSON_PROPERTY_FAX_LINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFaxLine(FaxLineResponseFaxLine faxLine) { + this.faxLine = faxLine; + } + + + public FaxLineResponse warnings(WarningResponse warnings) { + this.warnings = warnings; + return this; + } + + /** + * Get warnings + * @return warnings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WarningResponse getWarnings() { + return warnings; + } + + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(WarningResponse warnings) { + this.warnings = warnings; + } + + + /** + * Return true if this FaxLineResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineResponse faxLineResponse = (FaxLineResponse) o; + return Objects.equals(this.faxLine, faxLineResponse.faxLine) && + Objects.equals(this.warnings, faxLineResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(faxLine, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineResponse {\n"); + sb.append(" faxLine: ").append(toIndentedString(faxLine)).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 (faxLine != null) { + if (isFileTypeOrListOfFiles(faxLine)) { + fileTypeFound = true; + } + + if (faxLine.getClass().equals(java.io.File.class) || + faxLine.getClass().equals(Integer.class) || + faxLine.getClass().equals(String.class) || + faxLine.getClass().isEnum()) { + map.put("fax_line", faxLine); + } else if (isListOfFile(faxLine)) { + for(int i = 0; i< getListSize(faxLine); i++) { + map.put("fax_line[" + i + "]", getFromList(faxLine, i)); + } + } + else { + map.put("fax_line", JSON.getDefault().getMapper().writeValueAsString(faxLine)); + } + } + 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/FaxLineResponseFaxLine.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java new file mode 100644 index 000000000..9b6b8c893 --- /dev/null +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java @@ -0,0 +1,339 @@ +/* + * 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.AccountResponse; +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; +/** + * FaxLineResponseFaxLine + */ +@JsonPropertyOrder({ + FaxLineResponseFaxLine.JSON_PROPERTY_NUMBER, + FaxLineResponseFaxLine.JSON_PROPERTY_CREATED_AT, + FaxLineResponseFaxLine.JSON_PROPERTY_UPDATED_AT, + FaxLineResponseFaxLine.JSON_PROPERTY_ACCOUNTS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown=true) +public class FaxLineResponseFaxLine { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Integer updatedAt; + + public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; + private List accounts = null; + + public FaxLineResponseFaxLine() { + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + * @param jsonData String of JSON data representing target object + */ + static public FaxLineResponseFaxLine init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineResponseFaxLine.class); + } + + static public FaxLineResponseFaxLine init(HashMap data) throws Exception { + return new ObjectMapper().readValue( + new ObjectMapper().writeValueAsString(data), + FaxLineResponseFaxLine.class + ); + } + + public FaxLineResponseFaxLine number(String number) { + this.number = number; + return this; + } + + /** + * Number + * @return number + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(String number) { + this.number = number; + } + + + public FaxLineResponseFaxLine createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Created at + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + + public FaxLineResponseFaxLine updatedAt(Integer updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Updated at + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Integer updatedAt) { + this.updatedAt = updatedAt; + } + + + public FaxLineResponseFaxLine accounts(List accounts) { + this.accounts = accounts; + return this; + } + + public FaxLineResponseFaxLine addAccountsItem(AccountResponse accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); + } + this.accounts.add(accountsItem); + return this; + } + + /** + * Get accounts + * @return accounts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAccounts() { + return accounts; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccounts(List accounts) { + this.accounts = accounts; + } + + + /** + * Return true if this FaxLineResponseFaxLine object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FaxLineResponseFaxLine faxLineResponseFaxLine = (FaxLineResponseFaxLine) o; + return Objects.equals(this.number, faxLineResponseFaxLine.number) && + Objects.equals(this.createdAt, faxLineResponseFaxLine.createdAt) && + Objects.equals(this.updatedAt, faxLineResponseFaxLine.updatedAt) && + Objects.equals(this.accounts, faxLineResponseFaxLine.accounts); + } + + @Override + public int hashCode() { + return Objects.hash(number, createdAt, updatedAt, accounts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FaxLineResponseFaxLine {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (number != null) { + if (isFileTypeOrListOfFiles(number)) { + fileTypeFound = true; + } + + if (number.getClass().equals(java.io.File.class) || + number.getClass().equals(Integer.class) || + number.getClass().equals(String.class) || + number.getClass().isEnum()) { + map.put("number", number); + } else if (isListOfFile(number)) { + for(int i = 0; i< getListSize(number); i++) { + map.put("number[" + i + "]", getFromList(number, i)); + } + } + else { + map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + } + } + 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 (updatedAt != null) { + if (isFileTypeOrListOfFiles(updatedAt)) { + fileTypeFound = true; + } + + if (updatedAt.getClass().equals(java.io.File.class) || + updatedAt.getClass().equals(Integer.class) || + updatedAt.getClass().equals(String.class) || + updatedAt.getClass().isEnum()) { + map.put("updated_at", updatedAt); + } else if (isListOfFile(updatedAt)) { + for(int i = 0; i< getListSize(updatedAt); i++) { + map.put("updated_at[" + i + "]", getFromList(updatedAt, i)); + } + } + else { + map.put("updated_at", JSON.getDefault().getMapper().writeValueAsString(updatedAt)); + } + } + if (accounts != null) { + if (isFileTypeOrListOfFiles(accounts)) { + fileTypeFound = true; + } + + if (accounts.getClass().equals(java.io.File.class) || + accounts.getClass().equals(Integer.class) || + accounts.getClass().equals(String.class) || + accounts.getClass().isEnum()) { + map.put("accounts", accounts); + } else if (isListOfFile(accounts)) { + for(int i = 0; i< getListSize(accounts); i++) { + map.put("accounts[" + i + "]", getFromList(accounts, i)); + } + } + else { + map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); + } + } + } 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/FileResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FileResponse.java index 1c779e909..01908c972 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FileResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FileResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ FileResponse.JSON_PROPERTY_FILE_URL, FileResponse.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileResponse { public static final String JSON_PROPERTY_FILE_URL = "file_url"; private String fileUrl; @@ -70,14 +68,13 @@ public FileResponse fileUrl(String fileUrl) { return this; } - /** + /** * URL to the file. * @return fileUrl - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "URL to the file.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_FILE_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getFileUrl() { return fileUrl; @@ -85,7 +82,7 @@ public String getFileUrl() { @JsonProperty(JSON_PROPERTY_FILE_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } @@ -96,14 +93,13 @@ public FileResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * When the link expires. * @return expiresAt - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "When the link expires.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public Integer getExpiresAt() { return expiresAt; @@ -111,7 +107,7 @@ public Integer getExpiresAt() { @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setExpiresAt(Integer expiresAt) { this.expiresAt = expiresAt; } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java index 9a5905621..1ef6cdb22 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ FileResponseDataUri.JSON_PROPERTY_DATA_URI }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileResponseDataUri { public static final String JSON_PROPERTY_DATA_URI = "data_uri"; private String dataUri; @@ -66,14 +64,13 @@ public FileResponseDataUri dataUri(String dataUri) { return this; } - /** + /** * File as base64 encoded string. * @return dataUri - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "File as base64 encoded string.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_DATA_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getDataUri() { return dataUri; @@ -81,7 +78,7 @@ public String getDataUri() { @JsonProperty(JSON_PROPERTY_DATA_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setDataUri(String dataUri) { this.dataUri = dataUri; } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ListInfoResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ListInfoResponse.java index 9e5a3ca91..5a8e00cc2 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ListInfoResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ListInfoResponse.java @@ -22,27 +22,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains pagination information about the data returned. */ -@ApiModel(description = "Contains pagination information about the data returned.") @JsonPropertyOrder({ ListInfoResponse.JSON_PROPERTY_NUM_PAGES, ListInfoResponse.JSON_PROPERTY_NUM_RESULTS, ListInfoResponse.JSON_PROPERTY_PAGE, ListInfoResponse.JSON_PROPERTY_PAGE_SIZE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ListInfoResponse { public static final String JSON_PROPERTY_NUM_PAGES = "num_pages"; private Integer numPages; @@ -79,12 +76,11 @@ public ListInfoResponse numPages(Integer numPages) { return this; } - /** + /** * Total number of pages available. * @return numPages - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Total number of pages available.") @JsonProperty(JSON_PROPERTY_NUM_PAGES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public ListInfoResponse numResults(Integer numResults) { return this; } - /** + /** * Total number of objects available. * @return numResults - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Total number of objects available.") @JsonProperty(JSON_PROPERTY_NUM_RESULTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public ListInfoResponse page(Integer page) { return this; } - /** + /** * Number of the page being returned. * @return page - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of the page being returned.") @JsonProperty(JSON_PROPERTY_PAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public ListInfoResponse pageSize(Integer pageSize) { return this; } - /** + /** * Objects returned per page. * @return pageSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Objects returned per page.") @JsonProperty(JSON_PROPERTY_PAGE_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java index 1c4c9ad76..176c0ee1e 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -41,8 +39,8 @@ OAuthTokenGenerateRequest.JSON_PROPERTY_GRANT_TYPE, OAuthTokenGenerateRequest.JSON_PROPERTY_STATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OAuthTokenGenerateRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -82,12 +80,11 @@ public OAuthTokenGenerateRequest clientId(String clientId) { return this; } - /** + /** * The client id of the app requesting authorization. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The client id of the app requesting authorization.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +105,11 @@ public OAuthTokenGenerateRequest clientSecret(String clientSecret) { return this; } - /** + /** * The secret token of your app. * @return clientSecret - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The secret token of your app.") @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -134,12 +130,11 @@ public OAuthTokenGenerateRequest code(String code) { return this; } - /** + /** * The code passed to your callback when the user granted access. * @return code - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The code passed to your callback when the user granted access.") @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -160,12 +155,11 @@ public OAuthTokenGenerateRequest grantType(String grantType) { return this; } - /** + /** * When generating a new token use `authorization_code`. * @return grantType - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "When generating a new token use `authorization_code`.") @JsonProperty(JSON_PROPERTY_GRANT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -186,12 +180,11 @@ public OAuthTokenGenerateRequest state(String state) { return this; } - /** + /** * Same as the state you specified earlier. * @return state - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Same as the state you specified earlier.") @JsonProperty(JSON_PROPERTY_STATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java index d2b351ebf..28eb1cdfb 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ OAuthTokenRefreshRequest.JSON_PROPERTY_GRANT_TYPE, OAuthTokenRefreshRequest.JSON_PROPERTY_REFRESH_TOKEN }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OAuthTokenRefreshRequest { public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; private String grantType = "refresh_token"; @@ -70,12 +68,11 @@ public OAuthTokenRefreshRequest grantType(String grantType) { return this; } - /** + /** * When refreshing an existing token use `refresh_token`. * @return grantType - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "When refreshing an existing token use `refresh_token`.") @JsonProperty(JSON_PROPERTY_GRANT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public OAuthTokenRefreshRequest refreshToken(String refreshToken) { return this; } - /** + /** * The token provided when you got the expired access token. * @return refreshToken - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The token provided when you got the expired access token.") @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java index 2fdc60ec7..94e707373 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -41,8 +39,8 @@ OAuthTokenResponse.JSON_PROPERTY_EXPIRES_IN, OAuthTokenResponse.JSON_PROPERTY_STATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OAuthTokenResponse { public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; private String accessToken; @@ -82,12 +80,11 @@ public OAuthTokenResponse accessToken(String accessToken) { return this; } - /** + /** * Get accessToken * @return accessToken - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +105,11 @@ public OAuthTokenResponse tokenType(String tokenType) { return this; } - /** + /** * Get tokenType * @return tokenType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +130,11 @@ public OAuthTokenResponse refreshToken(String refreshToken) { return this; } - /** + /** * Get refreshToken * @return refreshToken - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +155,11 @@ public OAuthTokenResponse expiresIn(Integer expiresIn) { return this; } - /** + /** * Number of seconds until the `access_token` expires. Uses epoch time. * @return expiresIn - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of seconds until the `access_token` expires. Uses epoch time.") @JsonProperty(JSON_PROPERTY_EXPIRES_IN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,12 +180,11 @@ public OAuthTokenResponse state(String state) { return this; } - /** + /** * Get state * @return state - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_STATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java index 219f6f555..bef5001e6 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java @@ -24,12 +24,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -41,8 +39,8 @@ ReportCreateRequest.JSON_PROPERTY_REPORT_TYPE, ReportCreateRequest.JSON_PROPERTY_START_DATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReportCreateRequest { public static final String JSON_PROPERTY_END_DATE = "end_date"; private String endDate; @@ -111,12 +109,11 @@ public ReportCreateRequest endDate(String endDate) { return this; } - /** + /** * The (inclusive) end date for the report data in `MM/DD/YYYY` format. * @return endDate - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The (inclusive) end date for the report data in `MM/DD/YYYY` format.") @JsonProperty(JSON_PROPERTY_END_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -145,12 +142,11 @@ public ReportCreateRequest addReportTypeItem(ReportTypeEnum reportTypeItem) { return this; } - /** + /** * The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). * @return reportType - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).") @JsonProperty(JSON_PROPERTY_REPORT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -171,12 +167,11 @@ public ReportCreateRequest startDate(String startDate) { return this; } - /** + /** * The (inclusive) start date for the report data in `MM/DD/YYYY` format. * @return startDate - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The (inclusive) start date for the report data in `MM/DD/YYYY` format.") @JsonProperty(JSON_PROPERTY_START_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java index 280c7a7e8..3a042b474 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ ReportCreateResponse.JSON_PROPERTY_REPORT, ReportCreateResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReportCreateResponse { public static final String JSON_PROPERTY_REPORT = "report"; private ReportResponse report; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public ReportCreateResponse() { } @@ -74,14 +72,13 @@ public ReportCreateResponse report(ReportResponse report) { return this; } - /** + /** * Get report * @return report - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_REPORT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ReportResponse getReport() { return report; @@ -89,7 +86,7 @@ public ReportResponse getReport() { @JsonProperty(JSON_PROPERTY_REPORT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setReport(ReportResponse report) { this.report = report; } @@ -108,12 +105,11 @@ public ReportCreateResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportResponse.java index 1044758b4..7491ccb4d 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/ReportResponse.java @@ -24,27 +24,24 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about the report request. */ -@ApiModel(description = "Contains information about the report request.") @JsonPropertyOrder({ ReportResponse.JSON_PROPERTY_SUCCESS, ReportResponse.JSON_PROPERTY_START_DATE, ReportResponse.JSON_PROPERTY_END_DATE, ReportResponse.JSON_PROPERTY_REPORT_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReportResponse { public static final String JSON_PROPERTY_SUCCESS = "success"; private String success; @@ -91,7 +88,7 @@ public static ReportTypeEnum fromValue(String value) { } public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; - private List reportType; + private List reportType = null; public ReportResponse() { } @@ -116,12 +113,11 @@ public ReportResponse success(String success) { return this; } - /** + /** * A message indicating the requested operation's success * @return success - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A message indicating the requested operation's success") @JsonProperty(JSON_PROPERTY_SUCCESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,12 +138,11 @@ public ReportResponse startDate(String startDate) { return this; } - /** + /** * The (inclusive) start date for the report data in MM/DD/YYYY format. * @return startDate - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The (inclusive) start date for the report data in MM/DD/YYYY format.") @JsonProperty(JSON_PROPERTY_START_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,12 +163,11 @@ public ReportResponse endDate(String endDate) { return this; } - /** + /** * The (inclusive) end date for the report data in MM/DD/YYYY format. * @return endDate - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The (inclusive) end date for the report data in MM/DD/YYYY format.") @JsonProperty(JSON_PROPERTY_END_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -202,12 +196,11 @@ public ReportResponse addReportTypeItem(ReportTypeEnum reportTypeItem) { return this; } - /** + /** * The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). * @return reportType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).") @JsonProperty(JSON_PROPERTY_REPORT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java index 62f470f0f..0e3b1ce06 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java @@ -30,12 +30,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -57,8 +55,8 @@ SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TEST_MODE, SignatureRequestBulkCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -70,22 +68,22 @@ public class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { private File signerFile; public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; - private List signerList; + private List signerList = null; public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; private Boolean allowDecline = false; public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs; + private List ccs = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; private String signingRedirectUrl; @@ -130,12 +128,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addTemplateIdsItem( return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -156,12 +153,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest clientId(String cli return this; } - /** + /** * Client id of the app you're using to create this embedded signature request. Used for security purposes. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this embedded signature request. Used for security purposes.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -182,12 +178,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerFile(File sig return this; } - /** + /** * `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` * @return signerFile - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```") @JsonProperty(JSON_PROPERTY_SIGNER_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -216,12 +211,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addSignerListItem(S return this; } - /** + /** * `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. * @return signerList - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.") @JsonProperty(JSON_PROPERTY_SIGNER_LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -242,12 +236,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest allowDecline(Boolea return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -276,12 +269,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCcsItem(SubCC cc return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -310,12 +302,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCustomFieldsItem return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -336,12 +327,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest message(String mess return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -370,12 +360,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest putMetadataItem(Str return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -396,12 +385,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signingRedirectUrl( return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -422,12 +410,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest subject(String subj return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -448,12 +435,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest testMode(Boolean te return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -474,12 +460,11 @@ public SignatureRequestBulkCreateEmbeddedWithTemplateRequest title(String title) return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java index c4cf32efe..f25da057d 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java @@ -30,12 +30,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -57,8 +55,8 @@ SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, SignatureRequestBulkSendWithTemplateRequest.JSON_PROPERTY_TITLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestBulkSendWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -67,25 +65,25 @@ public class SignatureRequestBulkSendWithTemplateRequest { private File signerFile; public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; - private List signerList; + private List signerList = null; public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; private Boolean allowDecline = false; public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs; + private List ccs = null; public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; private String signingRedirectUrl; @@ -130,12 +128,11 @@ public SignatureRequestBulkSendWithTemplateRequest addTemplateIdsItem(String tem return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -156,12 +153,11 @@ public SignatureRequestBulkSendWithTemplateRequest signerFile(File signerFile) { return this; } - /** + /** * `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` * @return signerFile - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```") @JsonProperty(JSON_PROPERTY_SIGNER_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,12 +186,11 @@ public SignatureRequestBulkSendWithTemplateRequest addSignerListItem(SubBulkSign return this; } - /** + /** * `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. * @return signerList - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.") @JsonProperty(JSON_PROPERTY_SIGNER_LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -216,12 +211,11 @@ public SignatureRequestBulkSendWithTemplateRequest allowDecline(Boolean allowDec return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -250,12 +244,11 @@ public SignatureRequestBulkSendWithTemplateRequest addCcsItem(SubCC ccsItem) { return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -276,12 +269,11 @@ public SignatureRequestBulkSendWithTemplateRequest clientId(String clientId) { return this; } - /** + /** * The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -310,12 +302,11 @@ public SignatureRequestBulkSendWithTemplateRequest addCustomFieldsItem(SubCustom return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -336,12 +327,11 @@ public SignatureRequestBulkSendWithTemplateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -370,12 +360,11 @@ public SignatureRequestBulkSendWithTemplateRequest putMetadataItem(String key, O return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -396,12 +385,11 @@ public SignatureRequestBulkSendWithTemplateRequest signingRedirectUrl(String sig return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -422,12 +410,11 @@ public SignatureRequestBulkSendWithTemplateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -448,12 +435,11 @@ public SignatureRequestBulkSendWithTemplateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -474,12 +460,11 @@ public SignatureRequestBulkSendWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java index b3f66803a..14fdbca17 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java @@ -36,12 +36,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -74,23 +72,23 @@ SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, SignatureRequestCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestCreateEmbeddedRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; - private List groupedSigners; + private List groupedSigners = null; public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; private Boolean allowDecline = false; @@ -99,25 +97,25 @@ public class SignatureRequestCreateEmbeddedRequest { private Boolean allowReassign = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; private SubFieldOptions fieldOptions; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument; + private List formFieldsPerDocument = null; public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; private Boolean hideTextTags = false; @@ -126,7 +124,7 @@ public class SignatureRequestCreateEmbeddedRequest { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -172,12 +170,11 @@ public SignatureRequestCreateEmbeddedRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to create this embedded signature request. Used for security purposes. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this embedded signature request. Used for security purposes.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -206,12 +203,11 @@ public SignatureRequestCreateEmbeddedRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -240,12 +236,11 @@ public SignatureRequestCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -274,12 +269,11 @@ public SignatureRequestCreateEmbeddedRequest addSignersItem(SubSignatureRequestS return this; } - /** + /** * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -308,12 +302,11 @@ public SignatureRequestCreateEmbeddedRequest addGroupedSignersItem(SubSignatureR return this; } - /** + /** * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return groupedSigners - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -334,12 +327,11 @@ public SignatureRequestCreateEmbeddedRequest allowDecline(Boolean allowDecline) return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -360,12 +352,11 @@ public SignatureRequestCreateEmbeddedRequest allowReassign(Boolean allowReassign return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -394,12 +385,11 @@ public SignatureRequestCreateEmbeddedRequest addAttachmentsItem(SubAttachment at return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -428,12 +418,11 @@ public SignatureRequestCreateEmbeddedRequest addCcEmailAddressesItem(String ccEm return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -462,12 +451,11 @@ public SignatureRequestCreateEmbeddedRequest addCustomFieldsItem(SubCustomField return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -488,12 +476,11 @@ public SignatureRequestCreateEmbeddedRequest fieldOptions(SubFieldOptions fieldO return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -522,12 +509,11 @@ public SignatureRequestCreateEmbeddedRequest addFormFieldGroupsItem(SubFormField return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -556,12 +542,11 @@ public SignatureRequestCreateEmbeddedRequest addFormFieldRulesItem(SubFormFieldR return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -590,12 +575,11 @@ public SignatureRequestCreateEmbeddedRequest addFormFieldsPerDocumentItem(SubFor return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -616,12 +600,11 @@ public SignatureRequestCreateEmbeddedRequest hideTextTags(Boolean hideTextTags) return this; } - /** + /** * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. * @return hideTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -642,12 +625,11 @@ public SignatureRequestCreateEmbeddedRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -676,12 +658,11 @@ public SignatureRequestCreateEmbeddedRequest putMetadataItem(String key, Object return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -702,12 +683,11 @@ public SignatureRequestCreateEmbeddedRequest signingOptions(SubSigningOptions si return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -728,12 +708,11 @@ public SignatureRequestCreateEmbeddedRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -754,12 +733,11 @@ public SignatureRequestCreateEmbeddedRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -780,12 +758,11 @@ public SignatureRequestCreateEmbeddedRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -806,12 +783,11 @@ public SignatureRequestCreateEmbeddedRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. * @return useTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -832,12 +808,11 @@ public SignatureRequestCreateEmbeddedRequest populateAutoFillFields(Boolean popu return this; } - /** + /** * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. * @return populateAutoFillFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -858,12 +833,11 @@ public SignatureRequestCreateEmbeddedRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java index d6eed2a21..82e075ace 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java @@ -31,12 +31,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -60,8 +58,8 @@ SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_TITLE, SignatureRequestCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestCreateEmbeddedWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -76,22 +74,22 @@ public class SignatureRequestCreateEmbeddedWithTemplateRequest { private Boolean allowDecline = false; public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs; + private List ccs = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -139,12 +137,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addTemplateIdsItem(Stri return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -165,12 +162,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest clientId(String clientI return this; } - /** + /** * Client id of the app you're using to create this embedded signature request. Used for security purposes. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this embedded signature request. Used for security purposes.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -199,12 +195,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addSignersItem(SubSigna return this; } - /** + /** * Add Signers to your Templated-based Signature Request. * @return signers - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Add Signers to your Templated-based Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -225,12 +220,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest allowDecline(Boolean al return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -259,12 +253,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsIte return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,12 +286,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addCustomFieldsItem(Sub return this; } - /** + /** * An array defining values and options for custom fields. Required when a custom field exists in the Template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array defining values and options for custom fields. Required when a custom field exists in the Template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -327,12 +319,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addFilesItem(File files return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -361,12 +352,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest addFileUrlsItem(String return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -387,12 +377,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest message(String message) return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -421,12 +410,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest putMetadataItem(String return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -447,12 +435,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest signingOptions(SubSigni return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -473,12 +460,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest subject(String subject) return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -499,12 +485,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest testMode(Boolean testMo return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -525,12 +510,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -551,12 +535,11 @@ public SignatureRequestCreateEmbeddedWithTemplateRequest populateAutoFillFields( return this; } - /** + /** * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. * @return populateAutoFillFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java index 18be6d56a..6f1fe1d68 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ SignatureRequestGetResponse.JSON_PROPERTY_SIGNATURE_REQUEST, SignatureRequestGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestGetResponse { public static final String JSON_PROPERTY_SIGNATURE_REQUEST = "signature_request"; private SignatureRequestResponse signatureRequest; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public SignatureRequestGetResponse() { } @@ -74,14 +72,13 @@ public SignatureRequestGetResponse signatureRequest(SignatureRequestResponse sig return this; } - /** + /** * Get signatureRequest * @return signatureRequest - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public SignatureRequestResponse getSignatureRequest() { return signatureRequest; @@ -89,7 +86,7 @@ public SignatureRequestResponse getSignatureRequest() { @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSignatureRequest(SignatureRequestResponse signatureRequest) { this.signatureRequest = signatureRequest; } @@ -108,12 +105,11 @@ public SignatureRequestGetResponse addWarningsItem(WarningResponse warningsItem) return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java index 4a469da6a..cbb3d1fb1 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ SignatureRequestListResponse.JSON_PROPERTY_LIST_INFO, SignatureRequestListResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestListResponse { public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; - private List signatureRequests; + private List signatureRequests = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public SignatureRequestListResponse() { } @@ -87,14 +85,13 @@ public SignatureRequestListResponse addSignatureRequestsItem(SignatureRequestRes return this; } - /** + /** * Contains information about signature requests. * @return signatureRequests - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains information about signature requests.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getSignatureRequests() { return signatureRequests; @@ -102,7 +99,7 @@ public List getSignatureRequests() { @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSignatureRequests(List signatureRequests) { this.signatureRequests = signatureRequests; } @@ -113,14 +110,13 @@ public SignatureRequestListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public SignatureRequestListResponse addWarningsItem(WarningResponse warningsItem return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java index ed9ed1a2e..b736aa7de 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SignatureRequestRemindRequest.JSON_PROPERTY_EMAIL_ADDRESS, SignatureRequestRemindRequest.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestRemindRequest { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -70,12 +68,11 @@ public SignatureRequestRemindRequest emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer to send a reminder to. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer to send a reminder to.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public SignatureRequestRemindRequest name(String name) { return this; } - /** + /** * The name of the signer to send a reminder to. Include if two or more signers share an email address. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the signer to send a reminder to. Include if two or more signers share an email address.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java index 4576e2459..c041d42a9 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java @@ -28,19 +28,16 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about a signature request. */ -@ApiModel(description = "Contains information about a signature request.") @JsonPropertyOrder({ SignatureRequestResponse.JSON_PROPERTY_TEST_MODE, SignatureRequestResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, @@ -68,8 +65,8 @@ SignatureRequestResponse.JSON_PROPERTY_SIGNATURES, SignatureRequestResponse.JSON_PROPERTY_BULK_SEND_JOB_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestResponse { public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; private Boolean testMode = false; @@ -120,7 +117,7 @@ public class SignatureRequestResponse { private String detailsUrl; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; private String signingRedirectUrl; @@ -129,19 +126,19 @@ public class SignatureRequestResponse { private String finalCopyUri; public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds; + private List templateIds = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; - private List responseData; + private List responseData = null; public static final String JSON_PROPERTY_SIGNATURES = "signatures"; - private List signatures; + private List signatures = null; public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; private String bulkSendJobId; @@ -169,12 +166,11 @@ public SignatureRequestResponse testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -195,12 +191,11 @@ public SignatureRequestResponse signatureRequestId(String signatureRequestId) { return this; } - /** + /** * The id of the SignatureRequest. * @return signatureRequestId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -221,12 +216,11 @@ public SignatureRequestResponse requesterEmailAddress(String requesterEmailAddre return this; } - /** + /** * The email address of the initiator of the SignatureRequest. * @return requesterEmailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address of the initiator of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -247,12 +241,11 @@ public SignatureRequestResponse title(String title) { return this; } - /** + /** * The title the specified Account uses for the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title the specified Account uses for the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -273,12 +266,11 @@ public SignatureRequestResponse originalTitle(String originalTitle) { return this; } - /** + /** * Default Label for account. * @return originalTitle - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Default Label for account.") @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -299,12 +291,11 @@ public SignatureRequestResponse subject(String subject) { return this; } - /** + /** * The subject in the email that was initially sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -325,12 +316,11 @@ public SignatureRequestResponse message(String message) { return this; } - /** + /** * The custom message in the email that was initially sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that was initially sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -351,12 +341,11 @@ public SignatureRequestResponse metadata(Object metadata) { return this; } - /** + /** * The metadata attached to the signature request. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The metadata attached to the signature request.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -377,12 +366,11 @@ public SignatureRequestResponse createdAt(Integer createdAt) { return this; } - /** + /** * Time the signature request was created. * @return createdAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Time the signature request was created.") @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -403,12 +391,11 @@ public SignatureRequestResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -429,12 +416,11 @@ public SignatureRequestResponse isComplete(Boolean isComplete) { return this; } - /** + /** * Whether or not the SignatureRequest has been fully executed by all signers. * @return isComplete - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been fully executed by all signers.") @JsonProperty(JSON_PROPERTY_IS_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -455,12 +441,11 @@ public SignatureRequestResponse isDeclined(Boolean isDeclined) { return this; } - /** + /** * Whether or not the SignatureRequest has been declined by a signer. * @return isDeclined - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not the SignatureRequest has been declined by a signer.") @JsonProperty(JSON_PROPERTY_IS_DECLINED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -481,12 +466,11 @@ public SignatureRequestResponse hasError(Boolean hasError) { return this; } - /** + /** * Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). * @return hasError - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).") @JsonProperty(JSON_PROPERTY_HAS_ERROR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -507,12 +491,11 @@ public SignatureRequestResponse filesUrl(String filesUrl) { return this; } - /** + /** * The URL where a copy of the request's documents can be downloaded. * @return filesUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL where a copy of the request's documents can be downloaded.") @JsonProperty(JSON_PROPERTY_FILES_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -533,12 +516,11 @@ public SignatureRequestResponse signingUrl(String signingUrl) { return this; } - /** + /** * The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. * @return signingUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.") @JsonProperty(JSON_PROPERTY_SIGNING_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -559,12 +541,11 @@ public SignatureRequestResponse detailsUrl(String detailsUrl) { return this; } - /** + /** * The URL where the requester and the signers can view the current status of the SignatureRequest. * @return detailsUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL where the requester and the signers can view the current status of the SignatureRequest.") @JsonProperty(JSON_PROPERTY_DETAILS_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -593,12 +574,11 @@ public SignatureRequestResponse addCcEmailAddressesItem(String ccEmailAddressesI return this; } - /** + /** * A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -619,12 +599,11 @@ public SignatureRequestResponse signingRedirectUrl(String signingRedirectUrl) { return this; } - /** + /** * The URL you want the signer redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want the signer redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -645,12 +624,11 @@ public SignatureRequestResponse finalCopyUri(String finalCopyUri) { return this; } - /** + /** * The path where the completed document can be downloaded * @return finalCopyUri - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The path where the completed document can be downloaded") @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -679,12 +657,11 @@ public SignatureRequestResponse addTemplateIdsItem(String templateIdsItem) { return this; } - /** + /** * Templates IDs used in this SignatureRequest (if any). * @return templateIds - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Templates IDs used in this SignatureRequest (if any).") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -713,12 +690,11 @@ public SignatureRequestResponse addCustomFieldsItem(SignatureRequestResponseCust return this; } - /** + /** * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -747,12 +723,11 @@ public SignatureRequestResponse addAttachmentsItem(SignatureRequestResponseAttac return this; } - /** + /** * Signer attachments. * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signer attachments.") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -781,12 +756,11 @@ public SignatureRequestResponse addResponseDataItem(SignatureRequestResponseData return this; } - /** + /** * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. * @return responseData - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -815,12 +789,11 @@ public SignatureRequestResponse addSignaturesItem(SignatureRequestResponseSignat return this; } - /** + /** * An array of signature objects, 1 for each signer. * @return signatures - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of signature objects, 1 for each signer.") @JsonProperty(JSON_PROPERTY_SIGNATURES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -841,12 +814,11 @@ public SignatureRequestResponse bulkSendJobId(String bulkSendJobId) { return this; } - /** + /** * The ID of the Bulk Send job which sent the signature request, if applicable. * @return bulkSendJobId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The ID of the Bulk Send job which sent the signature request, if applicable.") @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java index 39ce14003..125fc6666 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Signer attachments. */ -@ApiModel(description = "Signer attachments.") @JsonPropertyOrder({ SignatureRequestResponseAttachment.JSON_PROPERTY_ID, SignatureRequestResponseAttachment.JSON_PROPERTY_SIGNER, @@ -43,8 +40,8 @@ SignatureRequestResponseAttachment.JSON_PROPERTY_INSTRUCTIONS, SignatureRequestResponseAttachment.JSON_PROPERTY_UPLOADED_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestResponseAttachment { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -87,12 +84,11 @@ public SignatureRequestResponseAttachment id(String id) { return this; } - /** + /** * The unique ID for this attachment. * @return id - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The unique ID for this attachment.") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -112,13 +108,16 @@ public SignatureRequestResponseAttachment signer(String signer) { this.signer = signer; return this; } + public SignatureRequestResponseAttachment signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } - /** + /** * The Signer this attachment is assigned to. * @return signer - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The Signer this attachment is assigned to.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -133,18 +132,21 @@ public void setSigner(String signer) { this.signer = signer; } + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + public SignatureRequestResponseAttachment name(String name) { this.name = name; return this; } - /** + /** * The name of this attachment. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of this attachment.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -165,12 +167,11 @@ public SignatureRequestResponseAttachment required(Boolean required) { return this; } - /** + /** * A boolean value denoting if this attachment is required. * @return required - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A boolean value denoting if this attachment is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -191,12 +192,11 @@ public SignatureRequestResponseAttachment instructions(String instructions) { return this; } - /** + /** * Instructions for Signer. * @return instructions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Instructions for Signer.") @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +217,11 @@ public SignatureRequestResponseAttachment uploadedAt(Integer uploadedAt) { return this; } - /** + /** * Timestamp when attachment was uploaded by Signer. * @return uploadedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Timestamp when attachment was uploaded by Signer.") @JsonProperty(JSON_PROPERTY_UPLOADED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java index 4117ca607..fca222226 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` */ -@ApiModel(description = "An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") @JsonPropertyOrder({ SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_TYPE, SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_NAME, @@ -45,8 +42,11 @@ SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_API_ID, SignatureRequestResponseCustomFieldBase.JSON_PROPERTY_EDITOR }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldCheckbox.class, name = "checkbox"), @@ -92,12 +92,11 @@ public SignatureRequestResponseCustomFieldBase type(String type) { return this; } - /** + /** * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -118,12 +117,11 @@ public SignatureRequestResponseCustomFieldBase name(String name) { return this; } - /** + /** * The name of the Custom Field. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the Custom Field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -144,12 +142,11 @@ public SignatureRequestResponseCustomFieldBase required(Boolean required) { return this; } - /** + /** * A boolean value denoting if this field is required. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A boolean value denoting if this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -170,12 +167,11 @@ public SignatureRequestResponseCustomFieldBase apiId(String apiId) { return this; } - /** + /** * The unique ID for this field. * @return apiId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The unique ID for this field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,12 +192,11 @@ public SignatureRequestResponseCustomFieldBase editor(String editor) { return this; } - /** + /** * The name of the Role that is able to edit this field. * @return editor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the Role that is able to edit this field.") @JsonProperty(JSON_PROPERTY_EDITOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java index e40cd61a2..9943467c8 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java @@ -26,25 +26,25 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SignatureRequestResponseCustomFieldBase`. */ -@ApiModel(description = "This class extends `SignatureRequestResponseCustomFieldBase`.") @JsonPropertyOrder({ SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_TYPE, SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestResponseCustomFieldBase { @@ -77,12 +77,11 @@ public SignatureRequestResponseCustomFieldCheckbox type(String type) { return this; } - /** + /** * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -103,12 +102,11 @@ public SignatureRequestResponseCustomFieldCheckbox value(Boolean value) { return this; } - /** + /** * A true/false for checkbox fields * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A true/false for checkbox fields") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java index 5a1af3da0..9c7e628a0 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java @@ -26,25 +26,25 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SignatureRequestResponseCustomFieldBase`. */ -@ApiModel(description = "This class extends `SignatureRequestResponseCustomFieldBase`.") @JsonPropertyOrder({ SignatureRequestResponseCustomFieldText.JSON_PROPERTY_TYPE, SignatureRequestResponseCustomFieldText.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCustomFieldBase { @@ -77,12 +77,11 @@ public SignatureRequestResponseCustomFieldText type(String type) { return this; } - /** + /** * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -103,12 +102,11 @@ public SignatureRequestResponseCustomFieldText value(String value) { return this; } - /** + /** * A text string for text fields * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A text string for text fields") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java index 9dc1e0c11..c4ae5b305 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java @@ -16,12 +16,10 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java index b2c03dd9b..54788629e 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. */ -@ApiModel(description = "An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") @JsonPropertyOrder({ SignatureRequestResponseDataBase.JSON_PROPERTY_API_ID, SignatureRequestResponseDataBase.JSON_PROPERTY_SIGNATURE_ID, @@ -45,8 +42,11 @@ SignatureRequestResponseDataBase.JSON_PROPERTY_REQUIRED, SignatureRequestResponseDataBase.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = SignatureRequestResponseDataValueCheckbox.class, name = "checkbox"), @@ -99,12 +99,11 @@ public SignatureRequestResponseDataBase apiId(String apiId) { return this; } - /** + /** * The unique ID for this field. * @return apiId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The unique ID for this field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,12 +124,11 @@ public SignatureRequestResponseDataBase signatureId(String signatureId) { return this; } - /** + /** * The ID of the signature to which this response is linked. * @return signatureId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The ID of the signature to which this response is linked.") @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,12 +149,11 @@ public SignatureRequestResponseDataBase name(String name) { return this; } - /** + /** * The name of the form field. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the form field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -177,12 +174,11 @@ public SignatureRequestResponseDataBase required(Boolean required) { return this; } - /** + /** * A boolean value denoting if this field is required. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A boolean value denoting if this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -203,12 +199,11 @@ public SignatureRequestResponseDataBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java index 388b25d21..b2e629584 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java @@ -16,12 +16,10 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java index 882ddc5ea..ed72505f3 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueCheckbox type(String type) { return this; } - /** + /** * A yes/no checkbox * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A yes/no checkbox") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueCheckbox value(Boolean value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java index f1cdac6cd..386212b8b 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueCheckboxMerge type(String type) { return this; } - /** + /** * A checkbox field that has default value set by the api * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A checkbox field that has default value set by the api") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueCheckboxMerge value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java index 6090fb712..c793034df 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueDateSigned type(String type) { return this; } - /** + /** * A date * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A date") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueDateSigned value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java index 02ef72b78..9f72ae3d4 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueDropdown type(String type) { return this; } - /** + /** * An input field for dropdowns * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An input field for dropdowns") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueDropdown value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java index f4ac26626..cab08d907 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueInitials.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueInitials.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueInitials type(String type) { return this; } - /** + /** * An input field for initials * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An input field for initials") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueInitials value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java index 8337d4b78..a3176945b 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueRadio.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueRadio.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueRadio type(String type) { return this; } - /** + /** * An input field for radios * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An input field for radios") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueRadio value(Boolean value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java index b8e57aeb0..79eb3b4a9 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueSignature.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueSignature.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueSignature type(String type) { return this; } - /** + /** * A signature input field * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A signature input field") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueSignature value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java index ba47f5ddb..47f82d4d1 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueText.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueText.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueText type(String type) { return this; } - /** + /** * A text input field * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A text input field") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueText value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java index 2b53fcee9..c25f4b10e 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java @@ -26,12 +26,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,11 @@ SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_TYPE, SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_VALUE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase { @@ -76,12 +77,11 @@ public SignatureRequestResponseDataValueTextMerge type(String type) { return this; } - /** + /** * A text field that has default text set by the api * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A text field that has default text set by the api") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,12 +102,11 @@ public SignatureRequestResponseDataValueTextMerge value(String value) { return this; } - /** + /** * The value of the form field. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The value of the form field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java index b9b25cc05..16e202047 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An array of signature objects, 1 for each signer. */ -@ApiModel(description = "An array of signature objects, 1 for each signer.") @JsonPropertyOrder({ SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNATURE_ID, SignatureRequestResponseSignatures.JSON_PROPERTY_SIGNER_GROUP_GUID, @@ -56,8 +53,8 @@ SignatureRequestResponseSignatures.JSON_PROPERTY_REASSIGNED_FROM, SignatureRequestResponseSignatures.JSON_PROPERTY_ERROR }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestResponseSignatures { public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; private String signatureId; @@ -139,12 +136,11 @@ public SignatureRequestResponseSignatures signatureId(String signatureId) { return this; } - /** + /** * Signature identifier. * @return signatureId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signature identifier.") @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +161,11 @@ public SignatureRequestResponseSignatures signerGroupGuid(String signerGroupGuid return this; } - /** + /** * Signer Group GUID * @return signerGroupGuid - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signer Group GUID") @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +186,11 @@ public SignatureRequestResponseSignatures signerEmailAddress(String signerEmailA return this; } - /** + /** * The email address of the signer. * @return signerEmailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +211,11 @@ public SignatureRequestResponseSignatures signerName(String signerName) { return this; } - /** + /** * The name of the signer. * @return signerName - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_SIGNER_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -243,12 +236,11 @@ public SignatureRequestResponseSignatures signerRole(String signerRole) { return this; } - /** + /** * The role of the signer. * @return signerRole - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The role of the signer.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -269,12 +261,11 @@ public SignatureRequestResponseSignatures order(Integer order) { return this; } - /** + /** * If signer order is assigned this is the 0-based index for this signer. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "If signer order is assigned this is the 0-based index for this signer.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -295,12 +286,11 @@ public SignatureRequestResponseSignatures statusCode(String statusCode) { return this; } - /** + /** * The current status of the signature. eg: awaiting_signature, signed, declined. * @return statusCode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The current status of the signature. eg: awaiting_signature, signed, declined.") @JsonProperty(JSON_PROPERTY_STATUS_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -321,12 +311,11 @@ public SignatureRequestResponseSignatures declineReason(String declineReason) { return this; } - /** + /** * The reason provided by the signer for declining the request. * @return declineReason - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The reason provided by the signer for declining the request.") @JsonProperty(JSON_PROPERTY_DECLINE_REASON) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -347,12 +336,11 @@ public SignatureRequestResponseSignatures signedAt(Integer signedAt) { return this; } - /** + /** * Time that the document was signed or null. * @return signedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Time that the document was signed or null.") @JsonProperty(JSON_PROPERTY_SIGNED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -373,12 +361,11 @@ public SignatureRequestResponseSignatures lastViewedAt(Integer lastViewedAt) { return this; } - /** + /** * The time that the document was last viewed by this signer or null. * @return lastViewedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The time that the document was last viewed by this signer or null.") @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -399,12 +386,11 @@ public SignatureRequestResponseSignatures lastRemindedAt(Integer lastRemindedAt) return this; } - /** + /** * The time the last reminder email was sent to the signer or null. * @return lastRemindedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The time the last reminder email was sent to the signer or null.") @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -425,12 +411,11 @@ public SignatureRequestResponseSignatures hasPin(Boolean hasPin) { return this; } - /** + /** * Boolean to indicate whether this signature requires a PIN to access. * @return hasPin - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate whether this signature requires a PIN to access.") @JsonProperty(JSON_PROPERTY_HAS_PIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -451,12 +436,11 @@ public SignatureRequestResponseSignatures hasSmsAuth(Boolean hasSmsAuth) { return this; } - /** + /** * Boolean to indicate whether this signature has SMS authentication enabled. * @return hasSmsAuth - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate whether this signature has SMS authentication enabled.") @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -477,12 +461,11 @@ public SignatureRequestResponseSignatures hasSmsDelivery(Boolean hasSmsDelivery) return this; } - /** + /** * Boolean to indicate whether this signature has SMS delivery enabled. * @return hasSmsDelivery - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean to indicate whether this signature has SMS delivery enabled.") @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -503,12 +486,11 @@ public SignatureRequestResponseSignatures smsPhoneNumber(String smsPhoneNumber) return this; } - /** + /** * The SMS phone number used for authentication or signature request delivery. * @return smsPhoneNumber - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The SMS phone number used for authentication or signature request delivery.") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -529,12 +511,11 @@ public SignatureRequestResponseSignatures reassignedBy(String reassignedBy) { return this; } - /** + /** * Email address of original signer who reassigned to this signer. * @return reassignedBy - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Email address of original signer who reassigned to this signer.") @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -555,12 +536,11 @@ public SignatureRequestResponseSignatures reassignmentReason(String reassignment return this; } - /** + /** * Reason provided by original signer who reassigned to this signer. * @return reassignmentReason - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Reason provided by original signer who reassigned to this signer.") @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -581,12 +561,11 @@ public SignatureRequestResponseSignatures reassignedFrom(String reassignedFrom) return this; } - /** + /** * Previous signature identifier. * @return reassignedFrom - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Previous signature identifier.") @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -607,12 +586,11 @@ public SignatureRequestResponseSignatures error(String error) { return this; } - /** + /** * Error message pertaining to this signer, or null. * @return error - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Error message pertaining to this signer, or null.") @JsonProperty(JSON_PROPERTY_ERROR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java index 47d505701..160f345aa 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java @@ -36,12 +36,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -76,20 +74,20 @@ SignatureRequestSendRequest.JSON_PROPERTY_USE_TEXT_TAGS, SignatureRequestSendRequest.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestSendRequest { public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; - private List groupedSigners; + private List groupedSigners = null; public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; private Boolean allowDecline = false; @@ -98,33 +96,34 @@ public class SignatureRequestSendRequest { private Boolean allowReassign = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; private SubFieldOptions fieldOptions; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument; + private List formFieldsPerDocument = null; public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; private Boolean hideTextTags = false; public static final String JSON_PROPERTY_IS_QUALIFIED_SIGNATURE = "is_qualified_signature"; + @Deprecated private Boolean isQualifiedSignature = false; public static final String JSON_PROPERTY_IS_EID = "is_eid"; @@ -134,7 +133,7 @@ public class SignatureRequestSendRequest { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -188,12 +187,11 @@ public SignatureRequestSendRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -222,12 +220,11 @@ public SignatureRequestSendRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,12 +253,11 @@ public SignatureRequestSendRequest addSignersItem(SubSignatureRequestSigner sign return this; } - /** + /** * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -290,12 +286,11 @@ public SignatureRequestSendRequest addGroupedSignersItem(SubSignatureRequestGrou return this; } - /** + /** * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. * @return groupedSigners - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -316,12 +311,11 @@ public SignatureRequestSendRequest allowDecline(Boolean allowDecline) { return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -342,12 +336,11 @@ public SignatureRequestSendRequest allowReassign(Boolean allowReassign) { return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,12 +369,11 @@ public SignatureRequestSendRequest addAttachmentsItem(SubAttachment attachmentsI return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -410,12 +402,11 @@ public SignatureRequestSendRequest addCcEmailAddressesItem(String ccEmailAddress return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -436,12 +427,11 @@ public SignatureRequestSendRequest clientId(String clientId) { return this; } - /** + /** * The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -470,12 +460,11 @@ public SignatureRequestSendRequest addCustomFieldsItem(SubCustomField customFiel return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -496,12 +485,11 @@ public SignatureRequestSendRequest fieldOptions(SubFieldOptions fieldOptions) { return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -530,12 +518,11 @@ public SignatureRequestSendRequest addFormFieldGroupsItem(SubFormFieldGroup form return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -564,12 +551,11 @@ public SignatureRequestSendRequest addFormFieldRulesItem(SubFormFieldRule formFi return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -598,12 +584,11 @@ public SignatureRequestSendRequest addFormFieldsPerDocumentItem(SubFormFieldsPer return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -624,12 +609,11 @@ public SignatureRequestSendRequest hideTextTags(Boolean hideTextTags) { return this; } - /** + /** * Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. * @return hideTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -645,19 +629,19 @@ public void setHideTextTags(Boolean hideTextTags) { } + @Deprecated public SignatureRequestSendRequest isQualifiedSignature(Boolean isQualifiedSignature) { this.isQualifiedSignature = isQualifiedSignature; return this; } - /** + /** * Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br> **NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. * @return isQualifiedSignature * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -666,6 +650,7 @@ public Boolean getIsQualifiedSignature() { } + @Deprecated @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIsQualifiedSignature(Boolean isQualifiedSignature) { @@ -678,12 +663,11 @@ public SignatureRequestSendRequest isEid(Boolean isEid) { return this; } - /** + /** * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. * @return isEid - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_EID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -704,12 +688,11 @@ public SignatureRequestSendRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -738,12 +721,11 @@ public SignatureRequestSendRequest putMetadataItem(String key, Object metadataIt return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -764,12 +746,11 @@ public SignatureRequestSendRequest signingOptions(SubSigningOptions signingOptio return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -790,12 +771,11 @@ public SignatureRequestSendRequest signingRedirectUrl(String signingRedirectUrl) return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -816,12 +796,11 @@ public SignatureRequestSendRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -842,12 +821,11 @@ public SignatureRequestSendRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -868,12 +846,11 @@ public SignatureRequestSendRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -894,12 +871,11 @@ public SignatureRequestSendRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. * @return useTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -920,12 +896,11 @@ public SignatureRequestSendRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java index ea993ebb9..c498d8723 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java @@ -31,19 +31,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * */ -@ApiModel(description = "") @JsonPropertyOrder({ SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEMPLATE_IDS, SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_SIGNERS, @@ -63,8 +60,8 @@ SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TEST_MODE, SignatureRequestSendWithTemplateRequest.JSON_PROPERTY_TITLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestSendWithTemplateRequest { public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; private List templateIds = new ArrayList<>(); @@ -76,21 +73,22 @@ public class SignatureRequestSendWithTemplateRequest { private Boolean allowDecline = false; public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs; + private List ccs = null; public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_IS_QUALIFIED_SIGNATURE = "is_qualified_signature"; + @Deprecated private Boolean isQualifiedSignature = false; public static final String JSON_PROPERTY_IS_EID = "is_eid"; @@ -100,7 +98,7 @@ public class SignatureRequestSendWithTemplateRequest { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -148,12 +146,11 @@ public SignatureRequestSendWithTemplateRequest addTemplateIdsItem(String templat return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. * @return templateIds - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -182,12 +179,11 @@ public SignatureRequestSendWithTemplateRequest addSignersItem(SubSignatureReques return this; } - /** + /** * Add Signers to your Templated-based Signature Request. * @return signers - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Add Signers to your Templated-based Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -208,12 +204,11 @@ public SignatureRequestSendWithTemplateRequest allowDecline(Boolean allowDecline return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -242,12 +237,11 @@ public SignatureRequestSendWithTemplateRequest addCcsItem(SubCC ccsItem) { return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -268,12 +262,11 @@ public SignatureRequestSendWithTemplateRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -302,12 +295,11 @@ public SignatureRequestSendWithTemplateRequest addCustomFieldsItem(SubCustomFiel return this; } - /** + /** * An array defining values and options for custom fields. Required when a custom field exists in the Template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array defining values and options for custom fields. Required when a custom field exists in the Template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -336,12 +328,11 @@ public SignatureRequestSendWithTemplateRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -370,12 +361,11 @@ public SignatureRequestSendWithTemplateRequest addFileUrlsItem(String fileUrlsIt return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -391,19 +381,19 @@ public void setFileUrls(List fileUrls) { } + @Deprecated public SignatureRequestSendWithTemplateRequest isQualifiedSignature(Boolean isQualifiedSignature) { this.isQualifiedSignature = isQualifiedSignature; return this; } - /** + /** * Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br> **NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. * @return isQualifiedSignature * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -412,6 +402,7 @@ public Boolean getIsQualifiedSignature() { } + @Deprecated @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIsQualifiedSignature(Boolean isQualifiedSignature) { @@ -424,12 +415,11 @@ public SignatureRequestSendWithTemplateRequest isEid(Boolean isEid) { return this; } - /** + /** * Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. * @return isEid - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.") @JsonProperty(JSON_PROPERTY_IS_EID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -450,12 +440,11 @@ public SignatureRequestSendWithTemplateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -484,12 +473,11 @@ public SignatureRequestSendWithTemplateRequest putMetadataItem(String key, Objec return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -510,12 +498,11 @@ public SignatureRequestSendWithTemplateRequest signingOptions(SubSigningOptions return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -536,12 +523,11 @@ public SignatureRequestSendWithTemplateRequest signingRedirectUrl(String signing return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -562,12 +548,11 @@ public SignatureRequestSendWithTemplateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -588,12 +573,11 @@ public SignatureRequestSendWithTemplateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -614,12 +598,11 @@ public SignatureRequestSendWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java index df0f1acbe..e5b31ad56 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,8 +38,8 @@ SignatureRequestUpdateRequest.JSON_PROPERTY_NAME, SignatureRequestUpdateRequest.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SignatureRequestUpdateRequest { public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; private String signatureId; @@ -78,12 +76,11 @@ public SignatureRequestUpdateRequest signatureId(String signatureId) { return this; } - /** + /** * The signature ID for the recipient. * @return signatureId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The signature ID for the recipient.") @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -104,12 +101,11 @@ public SignatureRequestUpdateRequest emailAddress(String emailAddress) { return this; } - /** + /** * The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,12 +126,11 @@ public SignatureRequestUpdateRequest name(String name) { return this; } - /** + /** * The new name for the recipient. **NOTE:** Optional if `email_address` is provided. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The new name for the recipient. **NOTE:** Optional if `email_address` is provided.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +151,11 @@ public SignatureRequestUpdateRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubAttachment.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubAttachment.java index a95c90506..47c26c174 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubAttachment.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubAttachment.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,8 +38,8 @@ SubAttachment.JSON_PROPERTY_INSTRUCTIONS, SubAttachment.JSON_PROPERTY_REQUIRED }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubAttachment { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -78,12 +76,11 @@ public SubAttachment name(String name) { return this; } - /** + /** * The name of attachment. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of attachment.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -104,12 +101,11 @@ public SubAttachment signerIndex(Integer signerIndex) { return this; } - /** + /** * The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. * @return signerIndex - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment.") @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -130,12 +126,11 @@ public SubAttachment instructions(String instructions) { return this; } - /** + /** * The instructions for uploading the attachment. * @return instructions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The instructions for uploading the attachment.") @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -156,12 +151,11 @@ public SubAttachment required(Boolean required) { return this; } - /** + /** * Determines if the attachment must be uploaded. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Determines if the attachment must be uploaded.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java index a708a1d90..670dd4bb4 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ SubBulkSignerList.JSON_PROPERTY_CUSTOM_FIELDS, SubBulkSignerList.JSON_PROPERTY_SIGNERS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubBulkSignerList { public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public SubBulkSignerList() { } @@ -82,12 +80,11 @@ public SubBulkSignerList addCustomFieldsItem(SubBulkSignerListCustomField custom return this; } - /** + /** * An array of custom field values. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of custom field values.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,12 +113,11 @@ public SubBulkSignerList addSignersItem(SubSignatureRequestTemplateSigner signer return this; } - /** + /** * Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java index 1c00daf81..f2b250c2d 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SubBulkSignerListCustomField.JSON_PROPERTY_NAME, SubBulkSignerListCustomField.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubBulkSignerListCustomField { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -70,12 +68,11 @@ public SubBulkSignerListCustomField name(String name) { return this; } - /** + /** * The name of the custom field. Must be the field's `name` or `api_id`. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the custom field. Must be the field's `name` or `api_id`.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public SubBulkSignerListCustomField value(String value) { return this; } - /** + /** * The value of the custom field. * @return value - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The value of the custom field.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubCC.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubCC.java index e70c752f0..1edd1df1e 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubCC.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubCC.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SubCC.JSON_PROPERTY_ROLE, SubCC.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubCC { public static final String JSON_PROPERTY_ROLE = "role"; private String role; @@ -70,12 +68,11 @@ public SubCC role(String role) { return this; } - /** + /** * Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. * @return role - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,12 +93,11 @@ public SubCC emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the CC recipient. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the CC recipient.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubCustomField.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubCustomField.java index 036e1eda9..027d857aa 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubCustomField.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubCustomField.java @@ -22,27 +22,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. */ -@ApiModel(description = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonPropertyOrder({ SubCustomField.JSON_PROPERTY_NAME, SubCustomField.JSON_PROPERTY_EDITOR, SubCustomField.JSON_PROPERTY_REQUIRED, SubCustomField.JSON_PROPERTY_VALUE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubCustomField { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -79,12 +76,11 @@ public SubCustomField name(String name) { return this; } - /** + /** * The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -105,12 +101,11 @@ public SubCustomField editor(String editor) { return this; } - /** + /** * Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. * @return editor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable.") @JsonProperty(JSON_PROPERTY_EDITOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public SubCustomField required(Boolean required) { return this; } - /** + /** * Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public SubCustomField value(String value) { return this; } - /** + /** * The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing. * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing.") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorOptions.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorOptions.java index 16d7823cf..0d2542d3e 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorOptions.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubEditorOptions.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This allows the requester to specify editor options when a preparing a document */ -@ApiModel(description = "This allows the requester to specify editor options when a preparing a document") @JsonPropertyOrder({ SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_SIGNERS, SubEditorOptions.JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubEditorOptions { public static final String JSON_PROPERTY_ALLOW_EDIT_SIGNERS = "allow_edit_signers"; private Boolean allowEditSigners = false; @@ -71,12 +68,11 @@ public SubEditorOptions allowEditSigners(Boolean allowEditSigners) { return this; } - /** + /** * Allows requesters to edit the list of signers * @return allowEditSigners - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows requesters to edit the list of signers") @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public SubEditorOptions allowEditDocuments(Boolean allowEditDocuments) { return this; } - /** + /** * Allows requesters to edit documents, including delete and add * @return allowEditDocuments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows requesters to edit documents, including delete and add") @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFieldOptions.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFieldOptions.java index 20006ccff..186faba37 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFieldOptions.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFieldOptions.java @@ -22,24 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This allows the requester to specify field options for a signature request. */ -@ApiModel(description = "This allows the requester to specify field options for a signature request.") @JsonPropertyOrder({ SubFieldOptions.JSON_PROPERTY_DATE_FORMAT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFieldOptions { /** * Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. @@ -110,12 +107,11 @@ public SubFieldOptions dateFormat(DateFormatEnum dateFormat) { return this; } - /** + /** * Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. * @return dateFormat - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher.") @JsonProperty(JSON_PROPERTY_DATE_FORMAT) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java index a671ea3b0..80dd46eb5 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ SubFormFieldGroup.JSON_PROPERTY_GROUP_LABEL, SubFormFieldGroup.JSON_PROPERTY_REQUIREMENT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldGroup { public static final String JSON_PROPERTY_GROUP_ID = "group_id"; private String groupId; @@ -74,12 +72,11 @@ public SubFormFieldGroup groupId(String groupId) { return this; } - /** + /** * ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. * @return groupId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_GROUP_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,12 +97,11 @@ public SubFormFieldGroup groupLabel(String groupLabel) { return this; } - /** + /** * Name of the group * @return groupLabel - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Name of the group") @JsonProperty(JSON_PROPERTY_GROUP_LABEL) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -126,12 +122,11 @@ public SubFormFieldGroup requirement(String requirement) { return this; } - /** + /** * Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. * @return requirement - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.") @JsonProperty(JSON_PROPERTY_REQUIREMENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java index 72651a954..629d8f492 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -44,8 +42,8 @@ SubFormFieldRule.JSON_PROPERTY_TRIGGERS, SubFormFieldRule.JSON_PROPERTY_ACTIONS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldRule { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -82,12 +80,11 @@ public SubFormFieldRule id(String id) { return this; } - /** + /** * Must be unique across all defined rules. * @return id - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must be unique across all defined rules.") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +105,11 @@ public SubFormFieldRule triggerOperator(String triggerOperator) { return this; } - /** + /** * Currently only `AND` is supported. Support for `OR` is being worked on. * @return triggerOperator - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Currently only `AND` is supported. Support for `OR` is being worked on.") @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -142,12 +138,11 @@ public SubFormFieldRule addTriggersItem(SubFormFieldRuleTrigger triggersItem) { return this; } - /** + /** * An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. * @return triggers - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed.") @JsonProperty(JSON_PROPERTY_TRIGGERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -176,12 +171,11 @@ public SubFormFieldRule addActionsItem(SubFormFieldRuleAction actionsItem) { return this; } - /** + /** * An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule. * @return actions - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule.") @JsonProperty(JSON_PROPERTY_ACTIONS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java index 564baaaab..7aebfc1c6 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -40,8 +38,8 @@ SubFormFieldRuleAction.JSON_PROPERTY_FIELD_ID, SubFormFieldRuleAction.JSON_PROPERTY_GROUP_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldRuleAction { public static final String JSON_PROPERTY_HIDDEN = "hidden"; private Boolean hidden; @@ -113,12 +111,11 @@ public SubFormFieldRuleAction hidden(Boolean hidden) { return this; } - /** + /** * `true` to hide the target field when rule is satisfied, otherwise `false`. * @return hidden - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "`true` to hide the target field when rule is satisfied, otherwise `false`.") @JsonProperty(JSON_PROPERTY_HIDDEN) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -139,12 +136,11 @@ public SubFormFieldRuleAction type(TypeEnum type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -165,12 +161,11 @@ public SubFormFieldRuleAction fieldId(String fieldId) { return this; } - /** + /** * **field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer. * @return fieldId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer.") @JsonProperty(JSON_PROPERTY_FIELD_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +186,11 @@ public SubFormFieldRuleAction groupId(String groupId) { return this; } - /** + /** * **group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer. * @return groupId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer.") @JsonProperty(JSON_PROPERTY_GROUP_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java index e3c7bf282..466d6192f 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java @@ -24,12 +24,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ SubFormFieldRuleTrigger.JSON_PROPERTY_VALUE, SubFormFieldRuleTrigger.JSON_PROPERTY_VALUES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubFormFieldRuleTrigger { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -96,7 +94,7 @@ public static OperatorEnum fromValue(String value) { private String value; public static final String JSON_PROPERTY_VALUES = "values"; - private List values; + private List values = null; public SubFormFieldRuleTrigger() { } @@ -121,12 +119,11 @@ public SubFormFieldRuleTrigger id(String id) { return this; } - /** + /** * Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. * @return id - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer.") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -147,12 +144,11 @@ public SubFormFieldRuleTrigger operator(OperatorEnum operator) { return this; } - /** + /** * Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value * @return operator - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value") @JsonProperty(JSON_PROPERTY_OPERATOR) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -173,12 +169,11 @@ public SubFormFieldRuleTrigger value(String value) { return this; } - /** + /** * **value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` * @return value - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1`") @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -207,12 +202,11 @@ public SubFormFieldRuleTrigger addValuesItem(String valuesItem) { return this; } - /** + /** * **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none` * @return values - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`") @JsonProperty(JSON_PROPERTY_VALUES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java index 519b3a27b..a0a521746 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` */ -@ApiModel(description = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonPropertyOrder({ SubFormFieldsPerDocumentBase.JSON_PROPERTY_DOCUMENT_INDEX, SubFormFieldsPerDocumentBase.JSON_PROPERTY_API_ID, @@ -51,8 +48,11 @@ SubFormFieldsPerDocumentBase.JSON_PROPERTY_NAME, SubFormFieldsPerDocumentBase.JSON_PROPERTY_PAGE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = SubFormFieldsPerDocumentCheckbox.class, name = "checkbox"), @@ -124,12 +124,11 @@ public SubFormFieldsPerDocumentBase documentIndex(Integer documentIndex) { return this; } - /** + /** * Represents the integer index of the `file` or `file_url` document the field should be attached to. * @return documentIndex - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Represents the integer index of the `file` or `file_url` document the field should be attached to.") @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -150,12 +149,11 @@ public SubFormFieldsPerDocumentBase apiId(String apiId) { return this; } - /** + /** * An identifier for the field that is unique across all documents in the request. * @return apiId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An identifier for the field that is unique across all documents in the request.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -176,12 +174,11 @@ public SubFormFieldsPerDocumentBase height(Integer height) { return this; } - /** + /** * Size of the field in pixels. * @return height - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Size of the field in pixels.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -202,12 +199,11 @@ public SubFormFieldsPerDocumentBase required(Boolean required) { return this; } - /** + /** * Whether this field is required. * @return required - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Whether this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -232,12 +228,11 @@ public SubFormFieldsPerDocumentBase signer(Integer signer) { return this; } - /** + /** * Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. * @return signer - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -262,12 +257,11 @@ public SubFormFieldsPerDocumentBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -288,12 +282,11 @@ public SubFormFieldsPerDocumentBase width(Integer width) { return this; } - /** + /** * Size of the field in pixels. * @return width - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Size of the field in pixels.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -314,12 +307,11 @@ public SubFormFieldsPerDocumentBase x(Integer x) { return this; } - /** + /** * Location coordinates of the field in pixels. * @return x - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Location coordinates of the field in pixels.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -340,12 +332,11 @@ public SubFormFieldsPerDocumentBase y(Integer y) { return this; } - /** + /** * Location coordinates of the field in pixels. * @return y - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Location coordinates of the field in pixels.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -366,12 +357,11 @@ public SubFormFieldsPerDocumentBase name(String name) { return this; } - /** + /** * Display name for the field. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Display name for the field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -392,12 +382,11 @@ public SubFormFieldsPerDocumentBase page(Integer page) { return this; } - /** + /** * Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. * @return page - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.") @JsonProperty(JSON_PROPERTY_PAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java index 87b00d29b..25cc889d0 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java @@ -26,26 +26,26 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_IS_CHECKED, SubFormFieldsPerDocumentCheckbox.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase { @@ -81,12 +81,11 @@ public SubFormFieldsPerDocumentCheckbox type(String type) { return this; } - /** + /** * A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,12 +106,11 @@ public SubFormFieldsPerDocumentCheckbox isChecked(Boolean isChecked) { return this; } - /** + /** * `true` for checking the checkbox field by default, otherwise `false`. * @return isChecked - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "`true` for checking the checkbox field by default, otherwise `false`.") @JsonProperty(JSON_PROPERTY_IS_CHECKED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -133,12 +131,11 @@ public SubFormFieldsPerDocumentCheckbox group(String group) { return this; } - /** + /** * String referencing group defined in `form_field_groups` parameter. * @return group - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "String referencing group defined in `form_field_groups` parameter.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java index 09f6472eb..ea0b0dfc6 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentCheckboxMerge.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase { @@ -73,12 +73,11 @@ public SubFormFieldsPerDocumentCheckboxMerge type(String type) { return this; } - /** + /** * A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java index 4f5a7bff1..ff673233e 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java @@ -26,26 +26,26 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_FAMILY, SubFormFieldsPerDocumentDateSigned.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase { @@ -76,17 +76,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -144,12 +144,11 @@ public SubFormFieldsPerDocumentDateSigned type(String type) { return this; } - /** + /** * A date. Use the `SubFormFieldsPerDocumentDateSigned` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A date. Use the `SubFormFieldsPerDocumentDateSigned` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -170,12 +169,11 @@ public SubFormFieldsPerDocumentDateSigned fontFamily(FontFamilyEnum fontFamily) return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,12 +194,11 @@ public SubFormFieldsPerDocumentDateSigned fontSize(Integer fontSize) { return this; } - /** + /** * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. * @return fontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java index 40281f6ae..ce35e13ab 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java @@ -28,19 +28,16 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_OPTIONS, @@ -48,8 +45,11 @@ SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_FAMILY, SubFormFieldsPerDocumentDropdown.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase { @@ -86,17 +86,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -154,12 +154,11 @@ public SubFormFieldsPerDocumentDropdown type(String type) { return this; } - /** + /** * An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -188,12 +187,11 @@ public SubFormFieldsPerDocumentDropdown addOptionsItem(String optionsItem) { return this; } - /** + /** * Array of string values representing dropdown values. * @return options - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Array of string values representing dropdown values.") @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -214,12 +212,11 @@ public SubFormFieldsPerDocumentDropdown content(String content) { return this; } - /** + /** * Selected value in `options` array. Value must exist in array. * @return content - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Selected value in `options` array. Value must exist in array.") @JsonProperty(JSON_PROPERTY_CONTENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -240,12 +237,11 @@ public SubFormFieldsPerDocumentDropdown fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -266,12 +262,11 @@ public SubFormFieldsPerDocumentDropdown fontSize(Integer fontSize) { return this; } - /** + /** * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. * @return fontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java index 3b3eb6893..f557d5af4 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java @@ -16,12 +16,10 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.fasterxml.jackson.annotation.JsonCreator; @@ -52,17 +50,17 @@ public enum SubFormFieldsPerDocumentFontEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java index 761acfc75..44cb48384 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java @@ -26,19 +26,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_CONTENT, @@ -46,8 +43,11 @@ SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_FAMILY, SubFormFieldsPerDocumentHyperlink.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase { @@ -84,17 +84,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -152,12 +152,11 @@ public SubFormFieldsPerDocumentHyperlink type(String type) { return this; } - /** + /** * A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -178,12 +177,11 @@ public SubFormFieldsPerDocumentHyperlink content(String content) { return this; } - /** + /** * Link Text. * @return content - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Link Text.") @JsonProperty(JSON_PROPERTY_CONTENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -204,12 +202,11 @@ public SubFormFieldsPerDocumentHyperlink contentUrl(String contentUrl) { return this; } - /** + /** * Link URL. * @return contentUrl - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Link URL.") @JsonProperty(JSON_PROPERTY_CONTENT_URL) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -230,12 +227,11 @@ public SubFormFieldsPerDocumentHyperlink fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,12 +252,11 @@ public SubFormFieldsPerDocumentHyperlink fontSize(Integer fontSize) { return this; } - /** + /** * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. * @return fontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java index 14732cf88..886c59fe8 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentInitials.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase { @@ -73,12 +73,11 @@ public SubFormFieldsPerDocumentInitials type(String type) { return this; } - /** + /** * An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java index 3fb7c50df..b21b9da60 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java @@ -26,26 +26,26 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentRadio.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentRadio.JSON_PROPERTY_GROUP, SubFormFieldsPerDocumentRadio.JSON_PROPERTY_IS_CHECKED }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase { @@ -81,12 +81,11 @@ public SubFormFieldsPerDocumentRadio type(String type) { return this; } - /** + /** * An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,12 +106,11 @@ public SubFormFieldsPerDocumentRadio group(String group) { return this; } - /** + /** * String referencing group defined in `form_field_groups` parameter. * @return group - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "String referencing group defined in `form_field_groups` parameter.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -133,12 +131,11 @@ public SubFormFieldsPerDocumentRadio isChecked(Boolean isChecked) { return this; } - /** + /** * `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. * @return isChecked - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "`true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`.") @JsonProperty(JSON_PROPERTY_IS_CHECKED) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java index f58d01704..fb56d681c 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentSignature.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase { @@ -73,12 +73,11 @@ public SubFormFieldsPerDocumentSignature type(String type) { return this; } - /** + /** * A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A signature input field. Use the `SubFormFieldsPerDocumentSignature` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java index 983a100e7..385ec2893 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java @@ -26,19 +26,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentText.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentText.JSON_PROPERTY_PLACEHOLDER, @@ -52,8 +49,11 @@ SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_FAMILY, SubFormFieldsPerDocumentText.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase { @@ -159,17 +159,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -227,12 +227,11 @@ public SubFormFieldsPerDocumentText type(String type) { return this; } - /** + /** * A text input field. Use the `SubFormFieldsPerDocumentText` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A text input field. Use the `SubFormFieldsPerDocumentText` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -253,12 +252,11 @@ public SubFormFieldsPerDocumentText placeholder(String placeholder) { return this; } - /** + /** * Placeholder value for text field. * @return placeholder - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Placeholder value for text field.") @JsonProperty(JSON_PROPERTY_PLACEHOLDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -279,12 +277,11 @@ public SubFormFieldsPerDocumentText autoFillType(String autoFillType) { return this; } - /** + /** * Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. * @return autoFillType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values.") @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -305,12 +302,11 @@ public SubFormFieldsPerDocumentText linkId(String linkId) { return this; } - /** + /** * Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. * @return linkId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields.") @JsonProperty(JSON_PROPERTY_LINK_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -331,12 +327,11 @@ public SubFormFieldsPerDocumentText masked(Boolean masked) { return this; } - /** + /** * Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`. * @return masked - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`.") @JsonProperty(JSON_PROPERTY_MASKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -357,12 +352,11 @@ public SubFormFieldsPerDocumentText validationType(ValidationTypeEnum validation return this; } - /** + /** * Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value. * @return validationType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value.") @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -383,12 +377,11 @@ public SubFormFieldsPerDocumentText validationCustomRegex(String validationCusto return this; } - /** + /** * Get validationCustomRegex * @return validationCustomRegex - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -409,12 +402,11 @@ public SubFormFieldsPerDocumentText validationCustomRegexFormatLabel(String vali return this; } - /** + /** * Get validationCustomRegexFormatLabel * @return validationCustomRegexFormatLabel - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -435,12 +427,11 @@ public SubFormFieldsPerDocumentText content(String content) { return this; } - /** + /** * Content of a `me_now` text field * @return content - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Content of a `me_now` text field") @JsonProperty(JSON_PROPERTY_CONTENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -461,12 +452,11 @@ public SubFormFieldsPerDocumentText fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -487,12 +477,11 @@ public SubFormFieldsPerDocumentText fontSize(Integer fontSize) { return this; } - /** + /** * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. * @return fontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java index 3c6557098..799a0efee 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java @@ -26,26 +26,26 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `SubFormFieldsPerDocumentBase`. */ -@ApiModel(description = "This class extends `SubFormFieldsPerDocumentBase`.") @JsonPropertyOrder({ SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_TYPE, SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_FAMILY, SubFormFieldsPerDocumentTextMerge.JSON_PROPERTY_FONT_SIZE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase { @@ -76,17 +76,17 @@ public enum FontFamilyEnum { ROBOTO("roboto"), - ROBOTOMONO("robotoMono"), + ROBOTO_MONO("robotoMono"), - NOTOSANS("notoSans"), + NOTO_SANS("notoSans"), - NOTOSERIF("notoSerif"), + NOTO_SERIF("notoSerif"), - NOTOCJK_JP_REGULAR("notoCJK-JP-Regular"), + NOTO_CJK_JP_REGULAR("notoCJK-JP-Regular"), - NOTOHEBREW_REGULAR("notoHebrew-Regular"), + NOTO_HEBREW_REGULAR("notoHebrew-Regular"), - NOTOSANTHAIMERGED("notoSanThaiMerged"); + NOTO_SAN_THAI_MERGED("notoSanThaiMerged"); private String value; @@ -144,12 +144,11 @@ public SubFormFieldsPerDocumentTextMerge type(String type) { return this; } - /** + /** * A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -170,12 +169,11 @@ public SubFormFieldsPerDocumentTextMerge fontFamily(FontFamilyEnum fontFamily) { return this; } - /** + /** * Font family for the field. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family for the field.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,12 +194,11 @@ public SubFormFieldsPerDocumentTextMerge fontSize(Integer fontSize) { return this; } - /** + /** * The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. * @return fontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") @JsonProperty(JSON_PROPERTY_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java index 8670fca10..2b9d9c00b 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java @@ -16,12 +16,10 @@ import java.util.Objects; import java.util.Map; import java.util.HashMap; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubMergeField.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubMergeField.java index f4ffce03f..cc612873d 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubMergeField.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubMergeField.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SubMergeField.JSON_PROPERTY_NAME, SubMergeField.JSON_PROPERTY_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubMergeField { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -105,12 +103,11 @@ public SubMergeField name(String name) { return this; } - /** + /** * The name of the merge field. Must be unique. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the merge field. Must be unique.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -131,12 +128,11 @@ public SubMergeField type(TypeEnum type) { return this; } - /** + /** * The type of merge field. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of merge field.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubOAuth.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubOAuth.java index 113f43e19..c9976269f 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubOAuth.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubOAuth.java @@ -24,25 +24,22 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * OAuth related parameters. */ -@ApiModel(description = "OAuth related parameters.") @JsonPropertyOrder({ SubOAuth.JSON_PROPERTY_CALLBACK_URL, SubOAuth.JSON_PROPERTY_SCOPES }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubOAuth { public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; private String callbackUrl; @@ -95,7 +92,7 @@ public static ScopesEnum fromValue(String value) { } public static final String JSON_PROPERTY_SCOPES = "scopes"; - private List scopes; + private List scopes = null; public SubOAuth() { } @@ -120,12 +117,11 @@ public SubOAuth callbackUrl(String callbackUrl) { return this; } - /** + /** * The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) * @return callbackUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided)") @JsonProperty(JSON_PROPERTY_CALLBACK_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,12 +150,11 @@ public SubOAuth addScopesItem(ScopesEnum scopesItem) { return this; } - /** + /** * A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). * @return scopes - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided).") @JsonProperty(JSON_PROPERTY_SCOPES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubOptions.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubOptions.java index dd1ad7a4a..73d5df621 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubOptions.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubOptions.java @@ -22,24 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Additional options supported by API App. */ -@ApiModel(description = "Additional options supported by API App.") @JsonPropertyOrder({ SubOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubOptions { public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; private Boolean canInsertEverywhere = false; @@ -67,12 +64,11 @@ public SubOptions canInsertEverywhere(Boolean canInsertEverywhere) { return this; } - /** + /** * Determines if signers can use \"Insert Everywhere\" when signing a document. * @return canInsertEverywhere - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Determines if signers can use \"Insert Everywhere\" when signing a document.") @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java index 4ca64bd21..2120ea67b 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java @@ -25,12 +25,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ SubSignatureRequestGroupedSigners.JSON_PROPERTY_SIGNERS, SubSignatureRequestGroupedSigners.JSON_PROPERTY_ORDER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSignatureRequestGroupedSigners { public static final String JSON_PROPERTY_GROUP = "group"; private String group; @@ -77,12 +75,11 @@ public SubSignatureRequestGroupedSigners group(String group) { return this; } - /** + /** * The name of the group. * @return group - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the group.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -111,12 +108,11 @@ public SubSignatureRequestGroupedSigners addSignersItem(SubSignatureRequestSigne return this; } - /** + /** * Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. * @return signers - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -137,12 +133,11 @@ public SubSignatureRequestGroupedSigners order(Integer order) { return this; } - /** + /** * The order the group is required to sign in. Use this instead of Signer-level `order`. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The order the group is required to sign in. Use this instead of Signer-level `order`.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java index d65c54e6f..d1900a147 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, SubSignatureRequestSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSignatureRequestSigner { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -121,12 +119,11 @@ public SubSignatureRequestSigner name(String name) { return this; } - /** + /** * The name of the signer. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -147,12 +144,11 @@ public SubSignatureRequestSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -173,12 +169,11 @@ public SubSignatureRequestSigner order(Integer order) { return this; } - /** + /** * The order the signer is required to sign in. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The order the signer is required to sign in.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +194,11 @@ public SubSignatureRequestSigner pin(String pin) { return this; } - /** + /** * The 4- to 12-character access code that will secure this signer's signature page. * @return pin - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The 4- to 12-character access code that will secure this signer's signature page.") @JsonProperty(JSON_PROPERTY_PIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +219,11 @@ public SubSignatureRequestSigner smsPhoneNumber(String smsPhoneNumber) { return this; } - /** + /** * An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. * @return smsPhoneNumber - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,12 +244,11 @@ public SubSignatureRequestSigner smsPhoneNumberType(SmsPhoneNumberTypeEnum smsPh return this; } - /** + /** * Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). * @return smsPhoneNumberType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java index 11a6a4383..53222fa5f 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER, SubSignatureRequestTemplateSigner.JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSignatureRequestTemplateSigner { public static final String JSON_PROPERTY_ROLE = "role"; private String role; @@ -121,12 +119,11 @@ public SubSignatureRequestTemplateSigner role(String role) { return this; } - /** + /** * Must match an existing role in chosen Template(s). It's case-sensitive. * @return role - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must match an existing role in chosen Template(s). It's case-sensitive.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -147,12 +144,11 @@ public SubSignatureRequestTemplateSigner name(String name) { return this; } - /** + /** * The name of the signer. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -173,12 +169,11 @@ public SubSignatureRequestTemplateSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -199,12 +194,11 @@ public SubSignatureRequestTemplateSigner pin(String pin) { return this; } - /** + /** * The 4- to 12-character access code that will secure this signer's signature page. * @return pin - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The 4- to 12-character access code that will secure this signer's signature page.") @JsonProperty(JSON_PROPERTY_PIN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +219,11 @@ public SubSignatureRequestTemplateSigner smsPhoneNumber(String smsPhoneNumber) { return this; } - /** + /** * An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. * @return smsPhoneNumber - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,12 +244,11 @@ public SubSignatureRequestTemplateSigner smsPhoneNumberType(SmsPhoneNumberTypeEn return this; } - /** + /** * Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). * @return smsPhoneNumberType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).") @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSigningOptions.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSigningOptions.java index e1bd35709..4e2c33cc5 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSigningOptions.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubSigningOptions.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings. */ -@ApiModel(description = "This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings.") @JsonPropertyOrder({ SubSigningOptions.JSON_PROPERTY_DEFAULT_TYPE, SubSigningOptions.JSON_PROPERTY_DRAW, @@ -42,8 +39,8 @@ SubSigningOptions.JSON_PROPERTY_TYPE, SubSigningOptions.JSON_PROPERTY_UPLOAD }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubSigningOptions { /** * The default type shown (limited to the listed types) @@ -122,12 +119,11 @@ public SubSigningOptions defaultType(DefaultTypeEnum defaultType) { return this; } - /** + /** * The default type shown (limited to the listed types) * @return defaultType - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The default type shown (limited to the listed types)") @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -148,12 +144,11 @@ public SubSigningOptions draw(Boolean draw) { return this; } - /** + /** * Allows drawing the signature * @return draw - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows drawing the signature") @JsonProperty(JSON_PROPERTY_DRAW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -174,12 +169,11 @@ public SubSigningOptions phone(Boolean phone) { return this; } - /** + /** * Allows using a smartphone to email the signature * @return phone - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows using a smartphone to email the signature") @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -200,12 +194,11 @@ public SubSigningOptions type(Boolean type) { return this; } - /** + /** * Allows typing the signature * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows typing the signature") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -226,12 +219,11 @@ public SubSigningOptions upload(Boolean upload) { return this; } - /** + /** * Allows uploading the signature * @return upload - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows uploading the signature") @JsonProperty(JSON_PROPERTY_UPLOAD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubTeamResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubTeamResponse.java index 25c9564fd..e653cbb13 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubTeamResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubTeamResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SubTeamResponse.JSON_PROPERTY_TEAM_ID, SubTeamResponse.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubTeamResponse { public static final String JSON_PROPERTY_TEAM_ID = "team_id"; private String teamId; @@ -70,12 +68,11 @@ public SubTeamResponse teamId(String teamId) { return this; } - /** + /** * The id of a team * @return teamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of a team") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public SubTeamResponse name(String name) { return this; } - /** + /** * The name of a team * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of a team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubTemplateRole.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubTemplateRole.java index 8661e026f..081d88d24 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubTemplateRole.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubTemplateRole.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ SubTemplateRole.JSON_PROPERTY_NAME, SubTemplateRole.JSON_PROPERTY_ORDER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubTemplateRole { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -70,12 +68,11 @@ public SubTemplateRole name(String name) { return this; } - /** + /** * The role name of the signer that will be displayed when the template is used to create a signature request. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The role name of the signer that will be displayed when the template is used to create a signature request.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public SubTemplateRole order(Integer order) { return this; } - /** + /** * The order in which this signer role is required to sign. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The order in which this signer role is required to sign.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java index 3ea654fa1..bc3ea96e0 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ SubUnclaimedDraftSigner.JSON_PROPERTY_NAME, SubUnclaimedDraftSigner.JSON_PROPERTY_ORDER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubUnclaimedDraftSigner { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -74,12 +72,11 @@ public SubUnclaimedDraftSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,12 +97,11 @@ public SubUnclaimedDraftSigner name(String name) { return this; } - /** + /** * The name of the signer. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -126,12 +122,11 @@ public SubUnclaimedDraftSigner order(Integer order) { return this; } - /** + /** * The order the signer is required to sign in. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The order the signer is required to sign in.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java index 08c042571..2b7d02ca5 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_NAME, SubUnclaimedDraftTemplateSigner.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubUnclaimedDraftTemplateSigner { public static final String JSON_PROPERTY_ROLE = "role"; private String role; @@ -74,12 +72,11 @@ public SubUnclaimedDraftTemplateSigner role(String role) { return this; } - /** + /** * Must match an existing role in chosen Template(s). * @return role - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Must match an existing role in chosen Template(s).") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,12 +97,11 @@ public SubUnclaimedDraftTemplateSigner name(String name) { return this; } - /** + /** * The name of the signer filling the role of `role`. * @return name - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The name of the signer filling the role of `role`.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -126,12 +122,11 @@ public SubUnclaimedDraftTemplateSigner emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the signer filling the role of `role`. * @return emailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the signer filling the role of `role`.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java index 28fcf7894..4f0a57b1f 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. */ -@ApiModel(description = "An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more.") @JsonPropertyOrder({ SubWhiteLabelingOptions.JSON_PROPERTY_HEADER_BACKGROUND_COLOR, SubWhiteLabelingOptions.JSON_PROPERTY_LEGAL_VERSION, @@ -52,8 +49,8 @@ SubWhiteLabelingOptions.JSON_PROPERTY_TEXT_COLOR2, SubWhiteLabelingOptions.JSON_PROPERTY_RESET_TO_DEFAULT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SubWhiteLabelingOptions { public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; private String headerBackgroundColor = "#1A1A1A"; @@ -158,12 +155,11 @@ public SubWhiteLabelingOptions headerBackgroundColor(String headerBackgroundColo return this; } - /** + /** * Get headerBackgroundColor * @return headerBackgroundColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,12 +180,11 @@ public SubWhiteLabelingOptions legalVersion(LegalVersionEnum legalVersion) { return this; } - /** + /** * Get legalVersion * @return legalVersion - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,12 +205,11 @@ public SubWhiteLabelingOptions linkColor(String linkColor) { return this; } - /** + /** * Get linkColor * @return linkColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LINK_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -236,12 +230,11 @@ public SubWhiteLabelingOptions pageBackgroundColor(String pageBackgroundColor) { return this; } - /** + /** * Get pageBackgroundColor * @return pageBackgroundColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -262,12 +255,11 @@ public SubWhiteLabelingOptions primaryButtonColor(String primaryButtonColor) { return this; } - /** + /** * Get primaryButtonColor * @return primaryButtonColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -288,12 +280,11 @@ public SubWhiteLabelingOptions primaryButtonColorHover(String primaryButtonColor return this; } - /** + /** * Get primaryButtonColorHover * @return primaryButtonColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -314,12 +305,11 @@ public SubWhiteLabelingOptions primaryButtonTextColor(String primaryButtonTextCo return this; } - /** + /** * Get primaryButtonTextColor * @return primaryButtonTextColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -340,12 +330,11 @@ public SubWhiteLabelingOptions primaryButtonTextColorHover(String primaryButtonT return this; } - /** + /** * Get primaryButtonTextColorHover * @return primaryButtonTextColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -366,12 +355,11 @@ public SubWhiteLabelingOptions secondaryButtonColor(String secondaryButtonColor) return this; } - /** + /** * Get secondaryButtonColor * @return secondaryButtonColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -392,12 +380,11 @@ public SubWhiteLabelingOptions secondaryButtonColorHover(String secondaryButtonC return this; } - /** + /** * Get secondaryButtonColorHover * @return secondaryButtonColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -418,12 +405,11 @@ public SubWhiteLabelingOptions secondaryButtonTextColor(String secondaryButtonTe return this; } - /** + /** * Get secondaryButtonTextColor * @return secondaryButtonTextColor - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,12 +430,11 @@ public SubWhiteLabelingOptions secondaryButtonTextColorHover(String secondaryBut return this; } - /** + /** * Get secondaryButtonTextColorHover * @return secondaryButtonTextColorHover - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -470,12 +455,11 @@ public SubWhiteLabelingOptions textColor1(String textColor1) { return this; } - /** + /** * Get textColor1 * @return textColor1 - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -496,12 +480,11 @@ public SubWhiteLabelingOptions textColor2(String textColor2) { return this; } - /** + /** * Get textColor2 * @return textColor2 - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -522,12 +505,11 @@ public SubWhiteLabelingOptions resetToDefault(Boolean resetToDefault) { return this; } - /** + /** * Resets white labeling options to defaults. Only useful when updating an API App. * @return resetToDefault - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Resets white labeling options to defaults. Only useful when updating an API App.") @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java index 6ef48ef81..d79399a8f 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ TeamAddMemberRequest.JSON_PROPERTY_EMAIL_ADDRESS, TeamAddMemberRequest.JSON_PROPERTY_ROLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamAddMemberRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -113,12 +111,11 @@ public TeamAddMemberRequest accountId(String accountId) { return this; } - /** + /** * `account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +136,11 @@ public TeamAddMemberRequest emailAddress(String emailAddress) { return this; } - /** + /** * `account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +161,11 @@ public TeamAddMemberRequest role(RoleEnum role) { return this; } - /** + /** * A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided. * @return role - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java index 37586e1a3..cb5c87e34 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ TeamCreateRequest.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamCreateRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name = "Untitled Team"; @@ -66,12 +64,11 @@ public TeamCreateRequest name(String name) { return this; } - /** + /** * The name of your Team. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of your Team.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java index 7bbe4ac15..f6a787003 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TeamGetInfoResponse.JSON_PROPERTY_TEAM, TeamGetInfoResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamGetInfoResponse { public static final String JSON_PROPERTY_TEAM = "team"; private TeamInfoResponse team; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TeamGetInfoResponse() { } @@ -74,14 +72,13 @@ public TeamGetInfoResponse team(TeamInfoResponse team) { return this; } - /** + /** * Get team * @return team - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TeamInfoResponse getTeam() { return team; @@ -89,7 +86,7 @@ public TeamInfoResponse getTeam() { @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeam(TeamInfoResponse team) { this.team = team; } @@ -108,12 +105,11 @@ public TeamGetInfoResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamGetResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamGetResponse.java index 710760fa8..f1670c185 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamGetResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamGetResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TeamGetResponse.JSON_PROPERTY_TEAM, TeamGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamGetResponse { public static final String JSON_PROPERTY_TEAM = "team"; private TeamResponse team; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TeamGetResponse() { } @@ -74,14 +72,13 @@ public TeamGetResponse team(TeamResponse team) { return this; } - /** + /** * Get team * @return team - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TeamResponse getTeam() { return team; @@ -89,7 +86,7 @@ public TeamResponse getTeam() { @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeam(TeamResponse team) { this.team = team; } @@ -108,12 +105,11 @@ public TeamGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java index 1d7a58daf..4a1e91ae2 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ TeamInfoResponse.JSON_PROPERTY_NUM_MEMBERS, TeamInfoResponse.JSON_PROPERTY_NUM_SUB_TEAMS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamInfoResponse { public static final String JSON_PROPERTY_TEAM_ID = "team_id"; private String teamId; @@ -83,12 +81,11 @@ public TeamInfoResponse teamId(String teamId) { return this; } - /** + /** * The id of a team * @return teamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of a team") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -109,12 +106,11 @@ public TeamInfoResponse teamParent(TeamParentResponse teamParent) { return this; } - /** + /** * Get teamParent * @return teamParent - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TEAM_PARENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -135,12 +131,11 @@ public TeamInfoResponse name(String name) { return this; } - /** + /** * The name of a team * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of a team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,12 +156,11 @@ public TeamInfoResponse numMembers(Integer numMembers) { return this; } - /** + /** * Number of members within a team * @return numMembers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of members within a team") @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -187,12 +181,11 @@ public TeamInfoResponse numSubTeams(Integer numSubTeams) { return this; } - /** + /** * Number of sub teams within a team * @return numSubTeams - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of sub teams within a team") @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java index a0d12b143..fb8aef51e 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,8 +40,8 @@ TeamInviteResponse.JSON_PROPERTY_REDEEMED_AT, TeamInviteResponse.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamInviteResponse { public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; private String emailAddress; @@ -86,12 +84,11 @@ public TeamInviteResponse emailAddress(String emailAddress) { return this; } - /** + /** * Email address of the user invited to this team. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Email address of the user invited to this team.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -112,12 +109,11 @@ public TeamInviteResponse teamId(String teamId) { return this; } - /** + /** * Id of the team. * @return teamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Id of the team.") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -138,12 +134,11 @@ public TeamInviteResponse role(String role) { return this; } - /** + /** * Role of the user invited to this team. * @return role - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Role of the user invited to this team.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -164,12 +159,11 @@ public TeamInviteResponse sentAt(Integer sentAt) { return this; } - /** + /** * Timestamp when the invitation was sent. * @return sentAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Timestamp when the invitation was sent.") @JsonProperty(JSON_PROPERTY_SENT_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -190,12 +184,11 @@ public TeamInviteResponse redeemedAt(Integer redeemedAt) { return this; } - /** + /** * Timestamp when the invitation was redeemed. * @return redeemedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Timestamp when the invitation was redeemed.") @JsonProperty(JSON_PROPERTY_REDEEMED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -216,12 +209,11 @@ public TeamInviteResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * Timestamp when the invitation is expiring. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Timestamp when the invitation is expiring.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java index f919eb574..b509eb0b9 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TeamInvitesResponse.JSON_PROPERTY_TEAM_INVITES, TeamInvitesResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamInvitesResponse { public static final String JSON_PROPERTY_TEAM_INVITES = "team_invites"; - private List teamInvites; + private List teamInvites = new ArrayList<>(); public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TeamInvitesResponse() { } @@ -82,14 +80,13 @@ public TeamInvitesResponse addTeamInvitesItem(TeamInviteResponse teamInvitesItem return this; } - /** + /** * Contains a list of team invites and their roles. * @return teamInvites - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains a list of team invites and their roles.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM_INVITES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTeamInvites() { return teamInvites; @@ -97,7 +94,7 @@ public List getTeamInvites() { @JsonProperty(JSON_PROPERTY_TEAM_INVITES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeamInvites(List teamInvites) { this.teamInvites = teamInvites; } @@ -116,12 +113,11 @@ public TeamInvitesResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * Get warnings * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java index 812f89d58..888e9a858 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ TeamMemberResponse.JSON_PROPERTY_EMAIL_ADDRESS, TeamMemberResponse.JSON_PROPERTY_ROLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamMemberResponse { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -74,12 +72,11 @@ public TeamMemberResponse accountId(String accountId) { return this; } - /** + /** * Account id of the team member. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Account id of the team member.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,12 +97,11 @@ public TeamMemberResponse emailAddress(String emailAddress) { return this; } - /** + /** * Email address of the team member. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Email address of the team member.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,12 +122,11 @@ public TeamMemberResponse role(String role) { return this; } - /** + /** * The specific role a member has on the team. * @return role - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The specific role a member has on the team.") @JsonProperty(JSON_PROPERTY_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java index 9792785a6..05fb9e496 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ TeamMembersResponse.JSON_PROPERTY_LIST_INFO, TeamMembersResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamMembersResponse { public static final String JSON_PROPERTY_TEAM_MEMBERS = "team_members"; - private List teamMembers; + private List teamMembers = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TeamMembersResponse() { } @@ -87,14 +85,13 @@ public TeamMembersResponse addTeamMembersItem(TeamMemberResponse teamMembersItem return this; } - /** + /** * Contains a list of team members and their roles for a specific team. * @return teamMembers - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains a list of team members and their roles for a specific team.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTeamMembers() { return teamMembers; @@ -102,7 +99,7 @@ public List getTeamMembers() { @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTeamMembers(List teamMembers) { this.teamMembers = teamMembers; } @@ -113,14 +110,13 @@ public TeamMembersResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public TeamMembersResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * Get warnings * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamParentResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamParentResponse.java index 2dd2948fe..482b58513 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamParentResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamParentResponse.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Information about the parent team if a team has one, set to `null` otherwise. */ -@ApiModel(description = "Information about the parent team if a team has one, set to `null` otherwise.") @JsonPropertyOrder({ TeamParentResponse.JSON_PROPERTY_TEAM_ID, TeamParentResponse.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamParentResponse { public static final String JSON_PROPERTY_TEAM_ID = "team_id"; private String teamId; @@ -71,12 +68,11 @@ public TeamParentResponse teamId(String teamId) { return this; } - /** + /** * The id of a team * @return teamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of a team") @JsonProperty(JSON_PROPERTY_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public TeamParentResponse name(String name) { return this; } - /** + /** * The name of a team * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of a team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java index 2c1606dc1..9303f6861 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -41,8 +39,8 @@ TeamRemoveMemberRequest.JSON_PROPERTY_NEW_TEAM_ID, TeamRemoveMemberRequest.JSON_PROPERTY_NEW_ROLE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamRemoveMemberRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -121,12 +119,11 @@ public TeamRemoveMemberRequest accountId(String accountId) { return this; } - /** + /** * **account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,12 +144,11 @@ public TeamRemoveMemberRequest emailAddress(String emailAddress) { return this; } - /** + /** * **account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "**account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,12 +169,11 @@ public TeamRemoveMemberRequest newOwnerEmailAddress(String newOwnerEmailAddress) return this; } - /** + /** * The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans. * @return newOwnerEmailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans.") @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +194,11 @@ public TeamRemoveMemberRequest newTeamId(String newTeamId) { return this; } - /** + /** * Id of the new Team. * @return newTeamId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Id of the new Team.") @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +219,11 @@ public TeamRemoveMemberRequest newRole(NewRoleEnum newRole) { return this; } - /** + /** * A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided. * @return newRole - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided.") @JsonProperty(JSON_PROPERTY_NEW_ROLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamResponse.java index fec132fcd..39a93c476 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamResponse.java @@ -25,39 +25,36 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about your team and its members */ -@ApiModel(description = "Contains information about your team and its members") @JsonPropertyOrder({ TeamResponse.JSON_PROPERTY_NAME, TeamResponse.JSON_PROPERTY_ACCOUNTS, TeamResponse.JSON_PROPERTY_INVITED_ACCOUNTS, TeamResponse.JSON_PROPERTY_INVITED_EMAILS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamResponse { public static final String JSON_PROPERTY_NAME = "name"; private String name; public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; - private List accounts; + private List accounts = null; public static final String JSON_PROPERTY_INVITED_ACCOUNTS = "invited_accounts"; - private List invitedAccounts; + private List invitedAccounts = null; public static final String JSON_PROPERTY_INVITED_EMAILS = "invited_emails"; - private List invitedEmails; + private List invitedEmails = null; public TeamResponse() { } @@ -82,12 +79,11 @@ public TeamResponse name(String name) { return this; } - /** + /** * The name of your Team * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of your Team") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,12 +112,11 @@ public TeamResponse addAccountsItem(AccountResponse accountsItem) { return this; } - /** + /** * Get accounts * @return accounts - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ACCOUNTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -150,12 +145,11 @@ public TeamResponse addInvitedAccountsItem(AccountResponse invitedAccountsItem) return this; } - /** + /** * A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. * @return invitedAccounts - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`.") @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,12 +178,11 @@ public TeamResponse addInvitedEmailsItem(String invitedEmailsItem) { return this; } - /** + /** * A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. * @return invitedEmails - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account.") @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java index 7be230b87..b8c7190e2 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ TeamSubTeamsResponse.JSON_PROPERTY_LIST_INFO, TeamSubTeamsResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamSubTeamsResponse { public static final String JSON_PROPERTY_SUB_TEAMS = "sub_teams"; - private List subTeams; + private List subTeams = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TeamSubTeamsResponse() { } @@ -87,14 +85,13 @@ public TeamSubTeamsResponse addSubTeamsItem(SubTeamResponse subTeamsItem) { return this; } - /** + /** * Contains a list with sub teams. * @return subTeams - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "Contains a list with sub teams.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getSubTeams() { return subTeams; @@ -102,7 +99,7 @@ public List getSubTeams() { @JsonProperty(JSON_PROPERTY_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setSubTeams(List subTeams) { this.subTeams = subTeams; } @@ -113,14 +110,13 @@ public TeamSubTeamsResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public TeamSubTeamsResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * Get warnings * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java index 3d38e8a74..aa668a228 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ TeamUpdateRequest.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TeamUpdateRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -66,12 +64,11 @@ public TeamUpdateRequest name(String name) { return this; } - /** + /** * The name of your Team. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of your Team.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java index 4acfa87d3..dc2bf3ae0 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ TemplateAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS, TemplateAddUserRequest.JSON_PROPERTY_SKIP_NOTIFICATION }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateAddUserRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -74,12 +72,11 @@ public TemplateAddUserRequest accountId(String accountId) { return this; } - /** + /** * The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,12 +97,11 @@ public TemplateAddUserRequest emailAddress(String emailAddress) { return this; } - /** + /** * The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -126,12 +122,11 @@ public TemplateAddUserRequest skipNotification(Boolean skipNotification) { return this; } - /** + /** * If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. * @return skipNotification - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java index f518478c4..8c6b2babe 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java @@ -35,12 +35,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -74,17 +72,17 @@ TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_TITLE, TemplateCreateEmbeddedDraftRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateEmbeddedDraftRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; private Boolean allowCcs = true; @@ -93,10 +91,10 @@ public class TemplateCreateEmbeddedDraftRequest { private Boolean allowReassign = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles; + private List ccRoles = null; public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; private SubEditorOptions editorOptions; @@ -111,22 +109,22 @@ public class TemplateCreateEmbeddedDraftRequest { private Boolean forceSubjectMessage = false; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument; + private List formFieldsPerDocument = null; public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - private List mergeFields; + private List mergeFields = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; private Boolean showPreview = false; @@ -135,7 +133,7 @@ public class TemplateCreateEmbeddedDraftRequest { private Boolean showProgressStepper = true; public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; - private List signerRoles; + private List signerRoles = null; public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; private Boolean skipMeNow = false; @@ -175,12 +173,11 @@ public TemplateCreateEmbeddedDraftRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,12 +206,11 @@ public TemplateCreateEmbeddedDraftRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -243,12 +239,11 @@ public TemplateCreateEmbeddedDraftRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -269,12 +264,11 @@ public TemplateCreateEmbeddedDraftRequest allowCcs(Boolean allowCcs) { return this; } - /** + /** * This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. * @return allowCcs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template.") @JsonProperty(JSON_PROPERTY_ALLOW_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -295,12 +289,11 @@ public TemplateCreateEmbeddedDraftRequest allowReassign(Boolean allowReassign) { return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -329,12 +322,11 @@ public TemplateCreateEmbeddedDraftRequest addAttachmentsItem(SubAttachment attac return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -363,12 +355,11 @@ public TemplateCreateEmbeddedDraftRequest addCcRolesItem(String ccRolesItem) { return this; } - /** + /** * The CC roles that must be assigned when using the template to send a signature request * @return ccRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The CC roles that must be assigned when using the template to send a signature request") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -389,12 +380,11 @@ public TemplateCreateEmbeddedDraftRequest editorOptions(SubEditorOptions editorO return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -415,12 +405,11 @@ public TemplateCreateEmbeddedDraftRequest fieldOptions(SubFieldOptions fieldOpti return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -441,12 +430,11 @@ public TemplateCreateEmbeddedDraftRequest forceSignerRoles(Boolean forceSignerRo return this; } - /** + /** * Provide users the ability to review/edit the template signer roles. * @return forceSignerRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template signer roles.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -467,12 +455,11 @@ public TemplateCreateEmbeddedDraftRequest forceSubjectMessage(Boolean forceSubje return this; } - /** + /** * Provide users the ability to review/edit the template subject and message. * @return forceSubjectMessage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -501,12 +488,11 @@ public TemplateCreateEmbeddedDraftRequest addFormFieldGroupsItem(SubFormFieldGro return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -535,12 +521,11 @@ public TemplateCreateEmbeddedDraftRequest addFormFieldRulesItem(SubFormFieldRule return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -569,12 +554,11 @@ public TemplateCreateEmbeddedDraftRequest addFormFieldsPerDocumentItem(SubFormFi return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -603,12 +587,11 @@ public TemplateCreateEmbeddedDraftRequest addMergeFieldsItem(SubMergeField merge return this; } - /** + /** * Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. * @return mergeFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.") @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -629,12 +612,11 @@ public TemplateCreateEmbeddedDraftRequest message(String message) { return this; } - /** + /** * The default template email message. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The default template email message.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -663,12 +645,11 @@ public TemplateCreateEmbeddedDraftRequest putMetadataItem(String key, Object met return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -689,12 +670,11 @@ public TemplateCreateEmbeddedDraftRequest showPreview(Boolean showPreview) { return this; } - /** + /** * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. * @return showPreview - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -715,12 +695,11 @@ public TemplateCreateEmbeddedDraftRequest showProgressStepper(Boolean showProgre return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -749,12 +728,11 @@ public TemplateCreateEmbeddedDraftRequest addSignerRolesItem(SubTemplateRole sig return this; } - /** + /** * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * @return signerRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -775,12 +753,11 @@ public TemplateCreateEmbeddedDraftRequest skipMeNow(Boolean skipMeNow) { return this; } - /** + /** * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. * @return skipMeNow - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -801,12 +778,11 @@ public TemplateCreateEmbeddedDraftRequest subject(String subject) { return this; } - /** + /** * The template title (alias). * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The template title (alias).") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -827,12 +803,11 @@ public TemplateCreateEmbeddedDraftRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -853,12 +828,11 @@ public TemplateCreateEmbeddedDraftRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -879,12 +853,11 @@ public TemplateCreateEmbeddedDraftRequest usePreexistingFields(Boolean usePreexi return this; } - /** + /** * Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). * @return usePreexistingFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java index 6acac5bf7..e3e730062 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_TEMPLATE, TemplateCreateEmbeddedDraftResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateEmbeddedDraftResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateCreateEmbeddedDraftResponseTemplate template; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TemplateCreateEmbeddedDraftResponse() { } @@ -74,14 +72,13 @@ public TemplateCreateEmbeddedDraftResponse template(TemplateCreateEmbeddedDraftR return this; } - /** + /** * Get template * @return template - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateCreateEmbeddedDraftResponseTemplate getTemplate() { return template; @@ -89,7 +86,7 @@ public TemplateCreateEmbeddedDraftResponseTemplate getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateCreateEmbeddedDraftResponseTemplate template) { this.template = template; } @@ -108,12 +105,11 @@ public TemplateCreateEmbeddedDraftResponse addWarningsItem(WarningResponse warni return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java index 235a381fb..f9c0286ac 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java @@ -25,27 +25,24 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Template object with parameters: `template_id`, `edit_url`, `expires_at`. */ -@ApiModel(description = "Template object with parameters: `template_id`, `edit_url`, `expires_at`.") @JsonPropertyOrder({ TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EDIT_URL, TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_EXPIRES_AT, TemplateCreateEmbeddedDraftResponseTemplate.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateEmbeddedDraftResponseTemplate { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -57,7 +54,8 @@ public class TemplateCreateEmbeddedDraftResponseTemplate { private Integer expiresAt; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + @Deprecated + private List warnings = null; public TemplateCreateEmbeddedDraftResponseTemplate() { } @@ -82,12 +80,11 @@ public TemplateCreateEmbeddedDraftResponseTemplate templateId(String templateId) return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +105,11 @@ public TemplateCreateEmbeddedDraftResponseTemplate editUrl(String editUrl) { return this; } - /** + /** * Link to edit the template. * @return editUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Link to edit the template.") @JsonProperty(JSON_PROPERTY_EDIT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,12 +130,11 @@ public TemplateCreateEmbeddedDraftResponseTemplate expiresAt(Integer expiresAt) return this; } - /** + /** * When the link expires. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When the link expires.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -155,6 +150,7 @@ public void setExpiresAt(Integer expiresAt) { } + @Deprecated public TemplateCreateEmbeddedDraftResponseTemplate warnings(List warnings) { this.warnings = warnings; return this; @@ -168,14 +164,13 @@ public TemplateCreateEmbeddedDraftResponseTemplate addWarningsItem(WarningRespon return this; } - /** + /** * A list of warnings. * @return warnings * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,6 +179,7 @@ public List getWarnings() { } + @Deprecated @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWarnings(List warnings) { diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java index 32fd9828c..b1ff55f4a 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java @@ -34,12 +34,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -66,8 +64,8 @@ TemplateCreateRequest.JSON_PROPERTY_TITLE, TemplateCreateRequest.JSON_PROPERTY_USE_PREEXISTING_FIELDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateRequest { public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; private List formFieldsPerDocument = new ArrayList<>(); @@ -76,19 +74,19 @@ public class TemplateCreateRequest { private List signerRoles = new ArrayList<>(); public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; private Boolean allowReassign = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles; + private List ccRoles = null; public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -97,19 +95,19 @@ public class TemplateCreateRequest { private SubFieldOptions fieldOptions; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - private List mergeFields; + private List mergeFields = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SUBJECT = "subject"; private String subject; @@ -154,12 +152,11 @@ public TemplateCreateRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocume return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -188,12 +185,11 @@ public TemplateCreateRequest addSignerRolesItem(SubTemplateRole signerRolesItem) return this; } - /** + /** * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * @return signerRoles - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -222,12 +218,11 @@ public TemplateCreateRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -256,12 +251,11 @@ public TemplateCreateRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -282,12 +276,11 @@ public TemplateCreateRequest allowReassign(Boolean allowReassign) { return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -316,12 +309,11 @@ public TemplateCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -350,12 +342,11 @@ public TemplateCreateRequest addCcRolesItem(String ccRolesItem) { return this; } - /** + /** * The CC roles that must be assigned when using the template to send a signature request * @return ccRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The CC roles that must be assigned when using the template to send a signature request") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,12 +367,11 @@ public TemplateCreateRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -402,12 +392,11 @@ public TemplateCreateRequest fieldOptions(SubFieldOptions fieldOptions) { return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -436,12 +425,11 @@ public TemplateCreateRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldG return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -470,12 +458,11 @@ public TemplateCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRul return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -504,12 +491,11 @@ public TemplateCreateRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { return this; } - /** + /** * Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. * @return mergeFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.") @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -530,12 +516,11 @@ public TemplateCreateRequest message(String message) { return this; } - /** + /** * The default template email message. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The default template email message.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -564,12 +549,11 @@ public TemplateCreateRequest putMetadataItem(String key, Object metadataItem) { return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -590,12 +574,11 @@ public TemplateCreateRequest subject(String subject) { return this; } - /** + /** * The template title (alias). * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The template title (alias).") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -616,12 +599,11 @@ public TemplateCreateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -642,12 +624,11 @@ public TemplateCreateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -668,12 +649,11 @@ public TemplateCreateRequest usePreexistingFields(Boolean usePreexistingFields) return this; } - /** + /** * Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). * @return usePreexistingFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java index 45b0b7d12..5d7d2c2cf 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TemplateCreateResponse.JSON_PROPERTY_TEMPLATE, TemplateCreateResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateCreateResponseTemplate template; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TemplateCreateResponse() { } @@ -74,14 +72,13 @@ public TemplateCreateResponse template(TemplateCreateResponseTemplate template) return this; } - /** + /** * Get template * @return template - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateCreateResponseTemplate getTemplate() { return template; @@ -89,7 +86,7 @@ public TemplateCreateResponseTemplate getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateCreateResponseTemplate template) { this.template = template; } @@ -108,12 +105,11 @@ public TemplateCreateResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java index 87c39c09e..6d668fd69 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java @@ -22,24 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Template object with parameters: `template_id`. */ -@ApiModel(description = "Template object with parameters: `template_id`.") @JsonPropertyOrder({ TemplateCreateResponseTemplate.JSON_PROPERTY_TEMPLATE_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateCreateResponseTemplate { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -67,12 +64,11 @@ public TemplateCreateResponseTemplate templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java index 92bc44ffb..f660ab209 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ TemplateEditResponse.JSON_PROPERTY_TEMPLATE_ID }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateEditResponse { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -66,14 +64,13 @@ public TemplateEditResponse templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getTemplateId() { return templateId; @@ -81,7 +78,7 @@ public String getTemplateId() { @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplateId(String templateId) { this.templateId = templateId; } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java index df15e5578..30a55e879 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ TemplateGetResponse.JSON_PROPERTY_TEMPLATE, TemplateGetResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateGetResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateResponse template; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TemplateGetResponse() { } @@ -74,14 +72,13 @@ public TemplateGetResponse template(TemplateResponse template) { return this; } - /** + /** * Get template * @return template - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateResponse getTemplate() { return template; @@ -89,7 +86,7 @@ public TemplateResponse getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateResponse template) { this.template = template; } @@ -108,12 +105,11 @@ public TemplateGetResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateListResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateListResponse.java index 54779e144..d3949c6aa 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateListResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateListResponse.java @@ -27,12 +27,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -44,17 +42,17 @@ TemplateListResponse.JSON_PROPERTY_LIST_INFO, TemplateListResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateListResponse { public static final String JSON_PROPERTY_TEMPLATES = "templates"; - private List templates; + private List templates = new ArrayList<>(); public static final String JSON_PROPERTY_LIST_INFO = "list_info"; private ListInfoResponse listInfo; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public TemplateListResponse() { } @@ -87,14 +85,13 @@ public TemplateListResponse addTemplatesItem(TemplateResponse templatesItem) { return this; } - /** + /** * List of templates that the API caller has access to. * @return templates - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "List of templates that the API caller has access to.") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getTemplates() { return templates; @@ -102,7 +99,7 @@ public List getTemplates() { @JsonProperty(JSON_PROPERTY_TEMPLATES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplates(List templates) { this.templates = templates; } @@ -113,14 +110,13 @@ public TemplateListResponse listInfo(ListInfoResponse listInfo) { return this; } - /** + /** * Get listInfo * @return listInfo - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public ListInfoResponse getListInfo() { return listInfo; @@ -128,7 +124,7 @@ public ListInfoResponse getListInfo() { @JsonProperty(JSON_PROPERTY_LIST_INFO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setListInfo(ListInfoResponse listInfo) { this.listInfo = listInfo; } @@ -147,12 +143,11 @@ public TemplateListResponse addWarningsItem(WarningResponse warningsItem) { return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java index aece8d198..0d9c88e63 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ TemplateRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, TemplateRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateRemoveUserRequest { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -70,12 +68,11 @@ public TemplateRemoveUserRequest accountId(String accountId) { return this; } - /** + /** * The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public TemplateRemoveUserRequest emailAddress(String emailAddress) { return this; } - /** + /** * The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponse.java index 96c2893d9..577975bea 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponse.java @@ -30,19 +30,16 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains information about the templates you and your team have created. */ -@ApiModel(description = "Contains information about the templates you and your team have created.") @JsonPropertyOrder({ TemplateResponse.JSON_PROPERTY_TEMPLATE_ID, TemplateResponse.JSON_PROPERTY_TITLE, @@ -60,8 +57,8 @@ TemplateResponse.JSON_PROPERTY_NAMED_FORM_FIELDS, TemplateResponse.JSON_PROPERTY_ACCOUNTS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponse { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; @@ -91,22 +88,24 @@ public class TemplateResponse { private Object metadata; public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; - private List signerRoles; + private List signerRoles = null; public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles; + private List ccRoles = null; public static final String JSON_PROPERTY_DOCUMENTS = "documents"; - private List documents; + private List documents = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + @Deprecated + private List customFields = null; public static final String JSON_PROPERTY_NAMED_FORM_FIELDS = "named_form_fields"; - private List namedFormFields; + @Deprecated + private List namedFormFields = null; public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; - private List accounts; + private List accounts = null; public TemplateResponse() { } @@ -131,12 +130,11 @@ public TemplateResponse templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +155,11 @@ public TemplateResponse title(String title) { return this; } - /** + /** * The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -183,12 +180,11 @@ public TemplateResponse message(String message) { return this; } - /** + /** * The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -209,12 +205,11 @@ public TemplateResponse updatedAt(Integer updatedAt) { return this; } - /** + /** * Time the template was last updated. * @return updatedAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Time the template was last updated.") @JsonProperty(JSON_PROPERTY_UPDATED_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -235,12 +230,11 @@ public TemplateResponse isEmbedded(Boolean isEmbedded) { return this; } - /** + /** * `true` if this template was created using an embedded flow, `false` if it was created on our website. * @return isEmbedded - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`true` if this template was created using an embedded flow, `false` if it was created on our website.") @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -261,12 +255,11 @@ public TemplateResponse isCreator(Boolean isCreator) { return this; } - /** + /** * `true` if you are the owner of this template, `false` if it's been shared with you by a team member. * @return isCreator - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "`true` if you are the owner of this template, `false` if it's been shared with you by a team member.") @JsonProperty(JSON_PROPERTY_IS_CREATOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -287,12 +280,11 @@ public TemplateResponse canEdit(Boolean canEdit) { return this; } - /** + /** * Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). * @return canEdit - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Indicates whether edit rights have been granted to you by the owner (always `true` if that's you).") @JsonProperty(JSON_PROPERTY_CAN_EDIT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -313,12 +305,11 @@ public TemplateResponse isLocked(Boolean isLocked) { return this; } - /** + /** * Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. * @return isLocked - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests.") @JsonProperty(JSON_PROPERTY_IS_LOCKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -339,12 +330,11 @@ public TemplateResponse metadata(Object metadata) { return this; } - /** + /** * The metadata attached to the template. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The metadata attached to the template.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -373,12 +363,11 @@ public TemplateResponse addSignerRolesItem(TemplateResponseSignerRole signerRole return this; } - /** + /** * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. * @return signerRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -407,12 +396,11 @@ public TemplateResponse addCcRolesItem(TemplateResponseCCRole ccRolesItem) { return this; } - /** + /** * An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. * @return ccRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.") @JsonProperty(JSON_PROPERTY_CC_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -441,12 +429,11 @@ public TemplateResponse addDocumentsItem(TemplateResponseDocument documentsItem) return this; } - /** + /** * An array describing each document associated with this Template. Includes form field data for each document. * @return documents - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array describing each document associated with this Template. Includes form field data for each document.") @JsonProperty(JSON_PROPERTY_DOCUMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -462,6 +449,7 @@ public void setDocuments(List documents) { } + @Deprecated public TemplateResponse customFields(List customFields) { this.customFields = customFields; return this; @@ -475,14 +463,13 @@ public TemplateResponse addCustomFieldsItem(TemplateResponseDocumentCustomFieldB return this; } - /** + /** * Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. * @return customFields * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -491,6 +478,7 @@ public List getCustomFields() { } + @Deprecated @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomFields(List customFields) { @@ -498,6 +486,7 @@ public void setCustomFields(List custom } + @Deprecated public TemplateResponse namedFormFields(List namedFormFields) { this.namedFormFields = namedFormFields; return this; @@ -511,14 +500,13 @@ public TemplateResponse addNamedFormFieldsItem(TemplateResponseDocumentFormField return this; } - /** + /** * Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. * @return namedFormFields * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.") @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -527,6 +515,7 @@ public List getNamedFormFields() { } + @Deprecated @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNamedFormFields(List namedFormFields) { @@ -547,12 +536,11 @@ public TemplateResponse addAccountsItem(TemplateResponseAccount accountsItem) { return this; } - /** + /** * An array of the Accounts that can use this Template. * @return accounts - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of the Accounts that can use this Template.") @JsonProperty(JSON_PROPERTY_ACCOUNTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java index bdb82f7be..53f50dd8a 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -43,8 +41,8 @@ TemplateResponseAccount.JSON_PROPERTY_IS_PAID_HF, TemplateResponseAccount.JSON_PROPERTY_QUOTAS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseAccount { public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; private String accountId; @@ -87,12 +85,11 @@ public TemplateResponseAccount accountId(String accountId) { return this; } - /** + /** * The id of the Account. * @return accountId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Account.") @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,12 +110,11 @@ public TemplateResponseAccount emailAddress(String emailAddress) { return this; } - /** + /** * The email address associated with the Account. * @return emailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address associated with the Account.") @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +135,11 @@ public TemplateResponseAccount isLocked(Boolean isLocked) { return this; } - /** + /** * Returns `true` if the user has been locked out of their account by a team admin. * @return isLocked - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has been locked out of their account by a team admin.") @JsonProperty(JSON_PROPERTY_IS_LOCKED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +160,11 @@ public TemplateResponseAccount isPaidHs(Boolean isPaidHs) { return this; } - /** + /** * Returns `true` if the user has a paid Dropbox Sign account. * @return isPaidHs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid Dropbox Sign account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +185,11 @@ public TemplateResponseAccount isPaidHf(Boolean isPaidHf) { return this; } - /** + /** * Returns `true` if the user has a paid HelloFax account. * @return isPaidHf - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Returns `true` if the user has a paid HelloFax account.") @JsonProperty(JSON_PROPERTY_IS_PAID_HF) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +210,11 @@ public TemplateResponseAccount quotas(TemplateResponseAccountQuota quotas) { return this; } - /** + /** * Get quotas * @return quotas - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_QUOTAS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java index 4d3e0b245..78b1f583d 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java @@ -22,27 +22,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. */ -@ApiModel(description = "An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.") @JsonPropertyOrder({ TemplateResponseAccountQuota.JSON_PROPERTY_TEMPLATES_LEFT, TemplateResponseAccountQuota.JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT, TemplateResponseAccountQuota.JSON_PROPERTY_DOCUMENTS_LEFT, TemplateResponseAccountQuota.JSON_PROPERTY_SMS_VERIFICATIONS_LEFT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseAccountQuota { public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; private Integer templatesLeft; @@ -79,12 +76,11 @@ public TemplateResponseAccountQuota templatesLeft(Integer templatesLeft) { return this; } - /** + /** * API templates remaining. * @return templatesLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "API templates remaining.") @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +101,11 @@ public TemplateResponseAccountQuota apiSignatureRequestsLeft(Integer apiSignatur return this; } - /** + /** * API signature requests remaining. * @return apiSignatureRequestsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "API signature requests remaining.") @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,12 +126,11 @@ public TemplateResponseAccountQuota documentsLeft(Integer documentsLeft) { return this; } - /** + /** * Signature requests remaining. * @return documentsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Signature requests remaining.") @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +151,11 @@ public TemplateResponseAccountQuota smsVerificationsLeft(Integer smsVerification return this; } - /** + /** * SMS verifications remaining. * @return smsVerificationsLeft - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "SMS verifications remaining.") @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java index 9654ebde2..4ed3eb946 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -37,8 +35,8 @@ @JsonPropertyOrder({ TemplateResponseCCRole.JSON_PROPERTY_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseCCRole { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -66,12 +64,11 @@ public TemplateResponseCCRole name(String name) { return this; } - /** + /** * The name of the Role. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the Role.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java index f8a399d49..040c68ccc 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java @@ -28,12 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -48,8 +46,8 @@ TemplateResponseDocument.JSON_PROPERTY_CUSTOM_FIELDS, TemplateResponseDocument.JSON_PROPERTY_STATIC_FIELDS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseDocument { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -58,16 +56,16 @@ public class TemplateResponseDocument { private Integer index; public static final String JSON_PROPERTY_FIELD_GROUPS = "field_groups"; - private List fieldGroups; + private List fieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELDS = "form_fields"; - private List formFields; + private List formFields = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_STATIC_FIELDS = "static_fields"; - private List staticFields; + private List staticFields = null; public TemplateResponseDocument() { } @@ -92,12 +90,11 @@ public TemplateResponseDocument name(String name) { return this; } - /** + /** * Name of the associated file. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Name of the associated file.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,12 +115,11 @@ public TemplateResponseDocument index(Integer index) { return this; } - /** + /** * Document ordering, the lowest index is displayed first and the highest last (0-based indexing). * @return index - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Document ordering, the lowest index is displayed first and the highest last (0-based indexing).") @JsonProperty(JSON_PROPERTY_INDEX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -152,12 +148,11 @@ public TemplateResponseDocument addFieldGroupsItem(TemplateResponseDocumentField return this; } - /** + /** * An array of Form Field Group objects. * @return fieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of Form Field Group objects.") @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,12 +181,11 @@ public TemplateResponseDocument addFormFieldsItem(TemplateResponseDocumentFormFi return this; } - /** + /** * An array of Form Field objects containing the name and type of each named field. * @return formFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of Form Field objects containing the name and type of each named field.") @JsonProperty(JSON_PROPERTY_FORM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -220,12 +214,11 @@ public TemplateResponseDocument addCustomFieldsItem(TemplateResponseDocumentCust return this; } - /** + /** * An array of Form Field objects containing the name and type of each named field. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array of Form Field objects containing the name and type of each named field.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -254,12 +247,11 @@ public TemplateResponseDocument addStaticFieldsItem(TemplateResponseDocumentStat return this; } - /** + /** * An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. * @return staticFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.") @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java index 692f0b60a..4797afd91 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An array of Form Field objects containing the name and type of each named field. */ -@ApiModel(description = "An array of Form Field objects containing the name and type of each named field.") @JsonPropertyOrder({ TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_TYPE, TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_API_ID, @@ -50,8 +47,11 @@ TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_REQUIRED, TemplateResponseDocumentCustomFieldBase.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldCheckbox.class, name = "checkbox"), @@ -112,12 +112,11 @@ public TemplateResponseDocumentCustomFieldBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -138,12 +137,11 @@ public TemplateResponseDocumentCustomFieldBase apiId(String apiId) { return this; } - /** + /** * The unique ID for this field. * @return apiId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The unique ID for this field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -164,12 +162,11 @@ public TemplateResponseDocumentCustomFieldBase name(String name) { return this; } - /** + /** * The name of the Custom Field. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the Custom Field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -189,13 +186,16 @@ public TemplateResponseDocumentCustomFieldBase signer(String signer) { this.signer = signer; return this; } + public TemplateResponseDocumentCustomFieldBase signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } - /** + /** * The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). * @return signer - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,18 +210,21 @@ public void setSigner(String signer) { this.signer = signer; } + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + public TemplateResponseDocumentCustomFieldBase x(Integer x) { this.x = x; return this; } - /** + /** * The horizontal offset in pixels for this form field. * @return x - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The horizontal offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -242,12 +245,11 @@ public TemplateResponseDocumentCustomFieldBase y(Integer y) { return this; } - /** + /** * The vertical offset in pixels for this form field. * @return y - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The vertical offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -268,12 +270,11 @@ public TemplateResponseDocumentCustomFieldBase width(Integer width) { return this; } - /** + /** * The width in pixels of this form field. * @return width - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The width in pixels of this form field.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -294,12 +295,11 @@ public TemplateResponseDocumentCustomFieldBase height(Integer height) { return this; } - /** + /** * The height in pixels of this form field. * @return height - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The height in pixels of this form field.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -320,12 +320,11 @@ public TemplateResponseDocumentCustomFieldBase required(Boolean required) { return this; } - /** + /** * Boolean showing whether or not this field is required. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean showing whether or not this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -346,12 +345,11 @@ public TemplateResponseDocumentCustomFieldBase group(String group) { return this; } - /** + /** * The name of the group this field is in. If this field is not a group, this defaults to `null`. * @return group - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the group this field is in. If this field is not a group, this defaults to `null`.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java index 2d0eb076b..353dd6ac0 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentCustomFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentCustomFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentCustomFieldCheckbox.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocumentCustomFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentCustomFieldCheckbox type(String type) { return this; } - /** + /** * The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java index 3d04f88ae..e9c2932d6 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java @@ -27,19 +27,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentCustomFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentCustomFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_TYPE, TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, @@ -47,8 +44,11 @@ TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, TemplateResponseDocumentCustomFieldText.JSON_PROPERTY_FONT_FAMILY }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCustomFieldBase { @@ -90,12 +90,11 @@ public TemplateResponseDocumentCustomFieldText type(String type) { return this; } - /** + /** * The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -116,12 +115,11 @@ public TemplateResponseDocumentCustomFieldText avgTextLength(TemplateResponseFie return this; } - /** + /** * Get avgTextLength * @return avgTextLength - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,12 +140,11 @@ public TemplateResponseDocumentCustomFieldText isMultiline(Boolean isMultiline) return this; } - /** + /** * Whether this form field is multiline text. * @return isMultiline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this form field is multiline text.") @JsonProperty(JSON_PROPERTY_IS_MULTILINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,12 +165,11 @@ public TemplateResponseDocumentCustomFieldText originalFontSize(Integer original return this; } - /** + /** * Original font size used in this form field's text. * @return originalFontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Original font size used in this form field's text.") @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -194,12 +190,11 @@ public TemplateResponseDocumentCustomFieldText fontFamily(String fontFamily) { return this; } - /** + /** * Font family used in this form field's text. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family used in this form field's text.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java index 29b81216a..3e724af45 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -39,8 +37,8 @@ TemplateResponseDocumentFieldGroup.JSON_PROPERTY_NAME, TemplateResponseDocumentFieldGroup.JSON_PROPERTY_RULE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseDocumentFieldGroup { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -71,12 +69,11 @@ public TemplateResponseDocumentFieldGroup name(String name) { return this; } - /** + /** * The name of the form field group. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the form field group.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +94,11 @@ public TemplateResponseDocumentFieldGroup rule(TemplateResponseDocumentFieldGrou return this; } - /** + /** * Get rule * @return rule - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_RULE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java index eb82d06e3..65aa63b0f 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping). */ -@ApiModel(description = "The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping).") @JsonPropertyOrder({ TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_REQUIREMENT, TemplateResponseDocumentFieldGroupRule.JSON_PROPERTY_GROUP_LABEL }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseDocumentFieldGroupRule { public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; private String requirement; @@ -71,12 +68,11 @@ public TemplateResponseDocumentFieldGroupRule requirement(String requirement) { return this; } - /** + /** * Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. * @return requirement - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.") @JsonProperty(JSON_PROPERTY_REQUIREMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public TemplateResponseDocumentFieldGroupRule groupLabel(String groupLabel) { return this; } - /** + /** * Name of the group * @return groupLabel - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Name of the group") @JsonProperty(JSON_PROPERTY_GROUP_LABEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java index 131577045..cbef92e0f 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An array of Form Field objects containing the name and type of each named field. */ -@ApiModel(description = "An array of Form Field objects containing the name and type of each named field.") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_TYPE, TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_API_ID, @@ -50,8 +47,11 @@ TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_REQUIRED, TemplateResponseDocumentFormFieldBase.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = TemplateResponseDocumentFormFieldCheckbox.class, name = "checkbox"), @@ -118,12 +118,11 @@ public TemplateResponseDocumentFormFieldBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -144,12 +143,11 @@ public TemplateResponseDocumentFormFieldBase apiId(String apiId) { return this; } - /** + /** * A unique id for the form field. * @return apiId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A unique id for the form field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -170,12 +168,11 @@ public TemplateResponseDocumentFormFieldBase name(String name) { return this; } - /** + /** * The name of the form field. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the form field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -195,13 +192,16 @@ public TemplateResponseDocumentFormFieldBase signer(String signer) { this.signer = signer; return this; } + public TemplateResponseDocumentFormFieldBase signer(Integer signer) { + this.signer = String.valueOf(signer); + return this; + } - /** + /** * The signer of the Form Field. * @return signer - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The signer of the Form Field.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -216,18 +216,21 @@ public void setSigner(String signer) { this.signer = signer; } + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + public TemplateResponseDocumentFormFieldBase x(Integer x) { this.x = x; return this; } - /** + /** * The horizontal offset in pixels for this form field. * @return x - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The horizontal offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -248,12 +251,11 @@ public TemplateResponseDocumentFormFieldBase y(Integer y) { return this; } - /** + /** * The vertical offset in pixels for this form field. * @return y - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The vertical offset in pixels for this form field.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -274,12 +276,11 @@ public TemplateResponseDocumentFormFieldBase width(Integer width) { return this; } - /** + /** * The width in pixels of this form field. * @return width - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The width in pixels of this form field.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -300,12 +301,11 @@ public TemplateResponseDocumentFormFieldBase height(Integer height) { return this; } - /** + /** * The height in pixels of this form field. * @return height - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The height in pixels of this form field.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -326,12 +326,11 @@ public TemplateResponseDocumentFormFieldBase required(Boolean required) { return this; } - /** + /** * Boolean showing whether or not this field is required. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean showing whether or not this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -352,12 +351,11 @@ public TemplateResponseDocumentFormFieldBase group(String group) { return this; } - /** + /** * The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. * @return group - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java index 6cb6e7240..8354a7a23 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldCheckbox.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldCheckbox type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java index 38bc2e006..202991168 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldDateSigned.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldDateSigned type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java index 03e40ea01..ca033ad09 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldDropdown type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java index 1ec973c70..acaa254b4 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java @@ -27,19 +27,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_TYPE, TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_AVG_TEXT_LENGTH, @@ -47,8 +44,11 @@ TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_ORIGINAL_FONT_SIZE, TemplateResponseDocumentFormFieldHyperlink.JSON_PROPERTY_FONT_FAMILY }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumentFormFieldBase { @@ -90,12 +90,11 @@ public TemplateResponseDocumentFormFieldHyperlink type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -116,12 +115,11 @@ public TemplateResponseDocumentFormFieldHyperlink avgTextLength(TemplateResponse return this; } - /** + /** * Get avgTextLength * @return avgTextLength - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,12 +140,11 @@ public TemplateResponseDocumentFormFieldHyperlink isMultiline(Boolean isMultilin return this; } - /** + /** * Whether this form field is multiline text. * @return isMultiline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this form field is multiline text.") @JsonProperty(JSON_PROPERTY_IS_MULTILINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -168,12 +165,11 @@ public TemplateResponseDocumentFormFieldHyperlink originalFontSize(Integer origi return this; } - /** + /** * Original font size used in this form field's text. * @return originalFontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Original font size used in this form field's text.") @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -194,12 +190,11 @@ public TemplateResponseDocumentFormFieldHyperlink fontFamily(String fontFamily) return this; } - /** + /** * Font family used in this form field's text. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family used in this form field's text.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java index ea21c91ee..749d70157 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldInitials.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldInitials type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java index 49aa6387f..aa71ef521 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldRadio.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldRadio type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java index e76bece67..9ff154afe 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldSignature.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumentFormFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentFormFieldSignature type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java index 1175d2445..db2192813 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java @@ -27,19 +27,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentFormFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentFormFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentFormFieldText.JSON_PROPERTY_TYPE, TemplateResponseDocumentFormFieldText.JSON_PROPERTY_AVG_TEXT_LENGTH, @@ -48,8 +45,11 @@ TemplateResponseDocumentFormFieldText.JSON_PROPERTY_FONT_FAMILY, TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentFormFieldBase { @@ -145,12 +145,11 @@ public TemplateResponseDocumentFormFieldText type(String type) { return this; } - /** + /** * The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -171,12 +170,11 @@ public TemplateResponseDocumentFormFieldText avgTextLength(TemplateResponseField return this; } - /** + /** * Get avgTextLength * @return avgTextLength - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -197,12 +195,11 @@ public TemplateResponseDocumentFormFieldText isMultiline(Boolean isMultiline) { return this; } - /** + /** * Whether this form field is multiline text. * @return isMultiline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this form field is multiline text.") @JsonProperty(JSON_PROPERTY_IS_MULTILINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,12 +220,11 @@ public TemplateResponseDocumentFormFieldText originalFontSize(Integer originalFo return this; } - /** + /** * Original font size used in this form field's text. * @return originalFontSize - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Original font size used in this form field's text.") @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,12 +245,11 @@ public TemplateResponseDocumentFormFieldText fontFamily(String fontFamily) { return this; } - /** + /** * Font family used in this form field's text. * @return fontFamily - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Font family used in this form field's text.") @JsonProperty(JSON_PROPERTY_FONT_FAMILY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -275,12 +270,11 @@ public TemplateResponseDocumentFormFieldText validationType(ValidationTypeEnum v return this; } - /** + /** * Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. * @return validationType - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.") @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java index 65aa3c5f8..4e1e98229 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java @@ -25,19 +25,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. */ -@ApiModel(description = "An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_TYPE, TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_API_ID, @@ -50,8 +47,11 @@ TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_REQUIRED, TemplateResponseDocumentStaticFieldBase.JSON_PROPERTY_GROUP }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = TemplateResponseDocumentStaticFieldCheckbox.class, name = "checkbox"), @@ -118,12 +118,11 @@ public TemplateResponseDocumentStaticFieldBase type(String type) { return this; } - /** + /** * Get type * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -144,12 +143,11 @@ public TemplateResponseDocumentStaticFieldBase apiId(String apiId) { return this; } - /** + /** * A unique id for the static field. * @return apiId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A unique id for the static field.") @JsonProperty(JSON_PROPERTY_API_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -170,12 +168,11 @@ public TemplateResponseDocumentStaticFieldBase name(String name) { return this; } - /** + /** * The name of the static field. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the static field.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,12 +193,11 @@ public TemplateResponseDocumentStaticFieldBase signer(String signer) { return this; } - /** + /** * The signer of the Static Field. * @return signer - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The signer of the Static Field.") @JsonProperty(JSON_PROPERTY_SIGNER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -222,12 +218,11 @@ public TemplateResponseDocumentStaticFieldBase x(Integer x) { return this; } - /** + /** * The horizontal offset in pixels for this static field. * @return x - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The horizontal offset in pixels for this static field.") @JsonProperty(JSON_PROPERTY_X) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -248,12 +243,11 @@ public TemplateResponseDocumentStaticFieldBase y(Integer y) { return this; } - /** + /** * The vertical offset in pixels for this static field. * @return y - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The vertical offset in pixels for this static field.") @JsonProperty(JSON_PROPERTY_Y) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -274,12 +268,11 @@ public TemplateResponseDocumentStaticFieldBase width(Integer width) { return this; } - /** + /** * The width in pixels of this static field. * @return width - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The width in pixels of this static field.") @JsonProperty(JSON_PROPERTY_WIDTH) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -300,12 +293,11 @@ public TemplateResponseDocumentStaticFieldBase height(Integer height) { return this; } - /** + /** * The height in pixels of this static field. * @return height - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The height in pixels of this static field.") @JsonProperty(JSON_PROPERTY_HEIGHT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -326,12 +318,11 @@ public TemplateResponseDocumentStaticFieldBase required(Boolean required) { return this; } - /** + /** * Boolean showing whether or not this field is required. * @return required - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Boolean showing whether or not this field is required.") @JsonProperty(JSON_PROPERTY_REQUIRED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -352,12 +343,11 @@ public TemplateResponseDocumentStaticFieldBase group(String group) { return this; } - /** + /** * The name of the group this field is in. If this field is not a group, this defaults to `null`. * @return group - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the group this field is in. If this field is not a group, this defaults to `null`.") @JsonProperty(JSON_PROPERTY_GROUP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java index aaac5190d..d23f85310 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldCheckbox.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldCheckbox type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java index 860bff838..8a19f3c5b 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldDateSigned.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldDateSigned type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java index f30dcac47..171417e43 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldDropdown.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldDropdown type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java index c245d458c..925996dee 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldHyperlink.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldHyperlink type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java index 59b7d5ecf..15e4b07aa 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldInitials.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldInitials type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java index 61f43e0e9..73f1fd8a4 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldRadio.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldRadio type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java index 58e90b562..6e472ecf9 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldSignature.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldSignature type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java index 96f7f1b81..877819958 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java @@ -26,24 +26,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * This class extends `TemplateResponseDocumentStaticFieldBase` */ -@ApiModel(description = "This class extends `TemplateResponseDocumentStaticFieldBase`") @JsonPropertyOrder({ TemplateResponseDocumentStaticFieldText.JSON_PROPERTY_TYPE }) -@JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@JsonIgnoreProperties( + allowSetters = true, // allows the type to be set during deserialization + ignoreUnknown = true +) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) public class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentStaticFieldBase { @@ -73,12 +73,11 @@ public TemplateResponseDocumentStaticFieldText type(String type) { return this; } - /** + /** * The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials` * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java index 5cc49e5e6..38f5acd25 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Average text length in this field. */ -@ApiModel(description = "Average text length in this field.") @JsonPropertyOrder({ TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_LINES, TemplateResponseFieldAvgTextLength.JSON_PROPERTY_NUM_CHARS_PER_LINE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseFieldAvgTextLength { public static final String JSON_PROPERTY_NUM_LINES = "num_lines"; private Integer numLines; @@ -71,12 +68,11 @@ public TemplateResponseFieldAvgTextLength numLines(Integer numLines) { return this; } - /** + /** * Number of lines. * @return numLines - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of lines.") @JsonProperty(JSON_PROPERTY_NUM_LINES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,12 +93,11 @@ public TemplateResponseFieldAvgTextLength numCharsPerLine(Integer numCharsPerLin return this; } - /** + /** * Number of characters per line. * @return numCharsPerLine - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Number of characters per line.") @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java index 4ab15afb0..45d786a89 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java @@ -22,12 +22,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ TemplateResponseSignerRole.JSON_PROPERTY_NAME, TemplateResponseSignerRole.JSON_PROPERTY_ORDER }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateResponseSignerRole { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -70,12 +68,11 @@ public TemplateResponseSignerRole name(String name) { return this; } - /** + /** * The name of the Role. * @return name - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The name of the Role.") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -96,12 +93,11 @@ public TemplateResponseSignerRole order(Integer order) { return this; } - /** + /** * If signer order is assigned this is the 0-based index for this role. * @return order - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "If signer order is assigned this is the 0-based index for this role.") @JsonProperty(JSON_PROPERTY_ORDER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java index 0635c9793..432b36800 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java @@ -25,12 +25,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -45,17 +43,17 @@ TemplateUpdateFilesRequest.JSON_PROPERTY_SUBJECT, TemplateUpdateFilesRequest.JSON_PROPERTY_TEST_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateUpdateFilesRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; @@ -89,12 +87,11 @@ public TemplateUpdateFilesRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app you're using to update this template. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Client id of the app you're using to update this template.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,12 +120,11 @@ public TemplateUpdateFilesRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,12 +153,11 @@ public TemplateUpdateFilesRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -183,12 +178,11 @@ public TemplateUpdateFilesRequest message(String message) { return this; } - /** + /** * The new default template email message. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The new default template email message.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -209,12 +203,11 @@ public TemplateUpdateFilesRequest subject(String subject) { return this; } - /** + /** * The new default template email subject. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The new default template email subject.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -235,12 +228,11 @@ public TemplateUpdateFilesRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java index e6be4c7c3..862c43122 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -38,8 +36,8 @@ @JsonPropertyOrder({ TemplateUpdateFilesResponse.JSON_PROPERTY_TEMPLATE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateUpdateFilesResponse { public static final String JSON_PROPERTY_TEMPLATE = "template"; private TemplateUpdateFilesResponseTemplate template; @@ -67,14 +65,13 @@ public TemplateUpdateFilesResponse template(TemplateUpdateFilesResponseTemplate return this; } - /** + /** * Get template * @return template - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public TemplateUpdateFilesResponseTemplate getTemplate() { return template; @@ -82,7 +79,7 @@ public TemplateUpdateFilesResponseTemplate getTemplate() { @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTemplate(TemplateUpdateFilesResponseTemplate template) { this.template = template; } diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java index 9b80dd39a..19dea91bd 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java @@ -25,31 +25,29 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * Contains template id */ -@ApiModel(description = "Contains template id") @JsonPropertyOrder({ TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_TEMPLATE_ID, TemplateUpdateFilesResponseTemplate.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TemplateUpdateFilesResponseTemplate { public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; private String templateId; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + @Deprecated + private List warnings = null; public TemplateUpdateFilesResponseTemplate() { } @@ -74,12 +72,11 @@ public TemplateUpdateFilesResponseTemplate templateId(String templateId) { return this; } - /** + /** * The id of the Template. * @return templateId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The id of the Template.") @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -95,6 +92,7 @@ public void setTemplateId(String templateId) { } + @Deprecated public TemplateUpdateFilesResponseTemplate warnings(List warnings) { this.warnings = warnings; return this; @@ -108,14 +106,13 @@ public TemplateUpdateFilesResponseTemplate addWarningsItem(WarningResponse warni return this; } - /** + /** * A list of warnings. * @return warnings * @deprecated - **/ + */ @Deprecated @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -124,6 +121,7 @@ public List getWarnings() { } + @Deprecated @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWarnings(List warnings) { diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java index a1fdaa9cb..5dd37a36f 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java @@ -36,19 +36,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * */ -@ApiModel(description = "") @JsonPropertyOrder({ UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_CLIENT_ID, UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS, @@ -87,8 +84,8 @@ UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, UnclaimedDraftCreateEmbeddedRequest.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateEmbeddedRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -97,10 +94,10 @@ public class UnclaimedDraftCreateEmbeddedRequest { private String requesterEmailAddress; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; private Boolean allowCcs = true; @@ -112,13 +109,13 @@ public class UnclaimedDraftCreateEmbeddedRequest { private Boolean allowReassign = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; private SubEditorOptions editorOptions; @@ -133,13 +130,13 @@ public class UnclaimedDraftCreateEmbeddedRequest { private Boolean forceSubjectMessage = false; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument; + private List formFieldsPerDocument = null; public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; private Boolean hideTextTags = false; @@ -154,7 +151,7 @@ public class UnclaimedDraftCreateEmbeddedRequest { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; private String requestingRedirectUrl; @@ -166,7 +163,7 @@ public class UnclaimedDraftCreateEmbeddedRequest { private Boolean showProgressStepper = true; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -256,12 +253,11 @@ public UnclaimedDraftCreateEmbeddedRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -282,12 +278,11 @@ public UnclaimedDraftCreateEmbeddedRequest requesterEmailAddress(String requeste return this; } - /** + /** * The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. * @return requesterEmailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -316,12 +311,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -350,12 +344,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -376,12 +369,11 @@ public UnclaimedDraftCreateEmbeddedRequest allowCcs(Boolean allowCcs) { return this; } - /** + /** * This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. * @return allowCcs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.") @JsonProperty(JSON_PROPERTY_ALLOW_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -402,12 +394,11 @@ public UnclaimedDraftCreateEmbeddedRequest allowDecline(Boolean allowDecline) { return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -428,12 +419,11 @@ public UnclaimedDraftCreateEmbeddedRequest allowReassign(Boolean allowReassign) return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -462,12 +452,11 @@ public UnclaimedDraftCreateEmbeddedRequest addAttachmentsItem(SubAttachment atta return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -496,12 +485,11 @@ public UnclaimedDraftCreateEmbeddedRequest addCcEmailAddressesItem(String ccEmai return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -530,12 +518,11 @@ public UnclaimedDraftCreateEmbeddedRequest addCustomFieldsItem(SubCustomField cu return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -556,12 +543,11 @@ public UnclaimedDraftCreateEmbeddedRequest editorOptions(SubEditorOptions editor return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -582,12 +568,11 @@ public UnclaimedDraftCreateEmbeddedRequest fieldOptions(SubFieldOptions fieldOpt return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -608,12 +593,11 @@ public UnclaimedDraftCreateEmbeddedRequest forceSignerPage(Boolean forceSignerPa return this; } - /** + /** * Provide users the ability to review/edit the signers. * @return forceSignerPage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the signers.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -634,12 +618,11 @@ public UnclaimedDraftCreateEmbeddedRequest forceSubjectMessage(Boolean forceSubj return this; } - /** + /** * Provide users the ability to review/edit the subject and message. * @return forceSubjectMessage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -668,12 +651,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFormFieldGroupsItem(SubFormFieldGr return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -702,12 +684,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFormFieldRulesItem(SubFormFieldRul return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -736,12 +717,11 @@ public UnclaimedDraftCreateEmbeddedRequest addFormFieldsPerDocumentItem(SubFormF return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -762,12 +742,11 @@ public UnclaimedDraftCreateEmbeddedRequest hideTextTags(Boolean hideTextTags) { return this; } - /** + /** * Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. * @return hideTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -788,12 +767,11 @@ public UnclaimedDraftCreateEmbeddedRequest holdRequest(Boolean holdRequest) { return this; } - /** + /** * The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. * @return holdRequest - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -814,12 +792,11 @@ public UnclaimedDraftCreateEmbeddedRequest isForEmbeddedSigning(Boolean isForEmb return this; } - /** + /** * The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. * @return isForEmbeddedSigning - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -840,12 +817,11 @@ public UnclaimedDraftCreateEmbeddedRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -874,12 +850,11 @@ public UnclaimedDraftCreateEmbeddedRequest putMetadataItem(String key, Object me return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -900,12 +875,11 @@ public UnclaimedDraftCreateEmbeddedRequest requestingRedirectUrl(String requesti return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature. * @return requestingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature.") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -926,12 +900,11 @@ public UnclaimedDraftCreateEmbeddedRequest showPreview(Boolean showPreview) { return this; } - /** + /** * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. * @return showPreview - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -952,12 +925,11 @@ public UnclaimedDraftCreateEmbeddedRequest showProgressStepper(Boolean showProgr return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -986,12 +958,11 @@ public UnclaimedDraftCreateEmbeddedRequest addSignersItem(SubUnclaimedDraftSigne return this; } - /** + /** * Add Signers to your Unclaimed Draft Signature Request. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Unclaimed Draft Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1012,12 +983,11 @@ public UnclaimedDraftCreateEmbeddedRequest signingOptions(SubSigningOptions sign return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1038,12 +1008,11 @@ public UnclaimedDraftCreateEmbeddedRequest signingRedirectUrl(String signingRedi return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1064,12 +1033,11 @@ public UnclaimedDraftCreateEmbeddedRequest skipMeNow(Boolean skipMeNow) { return this; } - /** + /** * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. * @return skipMeNow - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1090,12 +1058,11 @@ public UnclaimedDraftCreateEmbeddedRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1116,12 +1083,11 @@ public UnclaimedDraftCreateEmbeddedRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1142,12 +1108,11 @@ public UnclaimedDraftCreateEmbeddedRequest type(TypeEnum type) { return this; } - /** + /** * The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. * @return type - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1168,12 +1133,11 @@ public UnclaimedDraftCreateEmbeddedRequest usePreexistingFields(Boolean usePreex return this; } - /** + /** * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. * @return usePreexistingFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1194,12 +1158,11 @@ public UnclaimedDraftCreateEmbeddedRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. * @return useTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1220,12 +1183,11 @@ public UnclaimedDraftCreateEmbeddedRequest populateAutoFillFields(Boolean popula return this; } - /** + /** * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. * @return populateAutoFillFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1246,12 +1208,11 @@ public UnclaimedDraftCreateEmbeddedRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java index 2412383d0..7af776e67 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java @@ -33,12 +33,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -77,8 +75,8 @@ UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS, UnclaimedDraftCreateEmbeddedWithTemplateRequest.JSON_PROPERTY_ALLOW_CCS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -96,10 +94,10 @@ public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { private Boolean allowReassign = false; public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs; + private List ccs = null; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; private SubEditorOptions editorOptions; @@ -108,10 +106,10 @@ public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { private SubFieldOptions fieldOptions; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; private Boolean forceSignerRoles = false; @@ -129,7 +127,7 @@ public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; private Boolean previewOnly = false; @@ -144,7 +142,7 @@ public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { private Boolean showProgressStepper = true; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -193,12 +191,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest clientId(String clientId) return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -219,12 +216,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest requesterEmailAddress(Str return this; } - /** + /** * The email address of the user that should be designated as the requester of this draft. * @return requesterEmailAddress - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The email address of the user that should be designated as the requester of this draft.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -253,12 +249,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addTemplateIdsItem(String return this; } - /** + /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. * @return templateIds - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used.") @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -279,12 +274,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowDecline(Boolean allo return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -305,12 +299,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowReassign(Boolean all return this; } - /** + /** * Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher. * @return allowReassign - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -339,12 +332,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) return this; } - /** + /** * Add CC email recipients. Required when a CC role exists for the Template. * @return ccs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add CC email recipients. Required when a CC role exists for the Template.") @JsonProperty(JSON_PROPERTY_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -373,12 +365,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCustomFieldsItem(SubCu return this; } - /** + /** * An array defining values and options for custom fields. Required when a custom field exists in the Template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "An array defining values and options for custom fields. Required when a custom field exists in the Template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -399,12 +390,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest editorOptions(SubEditorOp return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -425,12 +415,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest fieldOptions(SubFieldOpti return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -459,12 +448,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFilesItem(File filesIt return this; } - /** + /** * Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -493,12 +481,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fi return this; } - /** + /** * Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -519,12 +506,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSignerRoles(Boolean return this; } - /** + /** * Provide users the ability to review/edit the template signer roles. * @return forceSignerRoles - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template signer roles.") @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -545,12 +531,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSubjectMessage(Boole return this; } - /** + /** * Provide users the ability to review/edit the template subject and message. * @return forceSubjectMessage - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Provide users the ability to review/edit the template subject and message.") @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -571,12 +556,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest holdRequest(Boolean holdR return this; } - /** + /** * The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. * @return holdRequest - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -597,12 +581,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest isForEmbeddedSigning(Bool return this; } - /** + /** * The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. * @return isForEmbeddedSigning - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -623,12 +606,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -657,12 +639,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest putMetadataItem(String ke return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -683,12 +664,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest previewOnly(Boolean previ return this; } - /** + /** * This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set). * @return previewOnly - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set).") @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -709,12 +689,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest requestingRedirectUrl(Str return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature. * @return requestingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature.") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -735,12 +714,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest showPreview(Boolean showP return this; } - /** + /** * This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. * @return showPreview - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -761,12 +739,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest showProgressStepper(Boole return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -795,12 +772,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest addSignersItem(SubUnclaim return this; } - /** + /** * Add Signers to your Templated-based Signature Request. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Templated-based Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -821,12 +797,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingOptions(SubSigning return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -847,12 +822,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingRedirectUrl(String return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -873,12 +847,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest skipMeNow(Boolean skipMeN return this; } - /** + /** * Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. * @return skipMeNow - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -899,12 +872,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -925,12 +897,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest testMode(Boolean testMode return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -951,12 +922,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest title(String title) { return this; } - /** + /** * The title you want to assign to the SignatureRequest. * @return title - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The title you want to assign to the SignatureRequest.") @JsonProperty(JSON_PROPERTY_TITLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -977,12 +947,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest populateAutoFillFields(Bo return this; } - /** + /** * Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. * @return populateAutoFillFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1003,12 +972,11 @@ public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowCcs(Boolean allowCcs return this; } - /** + /** * This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. * @return allowCcs - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.") @JsonProperty(JSON_PROPERTY_ALLOW_CCS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java index 6b0327dfd..9df838f68 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java @@ -35,19 +35,16 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * */ -@ApiModel(description = "") @JsonPropertyOrder({ UnclaimedDraftCreateRequest.JSON_PROPERTY_TYPE, UnclaimedDraftCreateRequest.JSON_PROPERTY_FILES, @@ -74,8 +71,8 @@ UnclaimedDraftCreateRequest.JSON_PROPERTY_USE_TEXT_TAGS, UnclaimedDraftCreateRequest.JSON_PROPERTY_EXPIRES_AT }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateRequest { /** * The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. @@ -116,37 +113,37 @@ public static TypeEnum fromValue(String value) { private TypeEnum type; public static final String JSON_PROPERTY_FILES = "files"; - private List files; + private List files = null; public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls; + private List fileUrls = null; public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; private Boolean allowDecline = false; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments; + private List attachments = null; public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses; + private List ccEmailAddresses = null; public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields; + private List customFields = null; public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; private SubFieldOptions fieldOptions; public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups; + private List formFieldGroups = null; public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules; + private List formFieldRules = null; public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument; + private List formFieldsPerDocument = null; public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; private Boolean hideTextTags = false; @@ -155,13 +152,13 @@ public static TypeEnum fromValue(String value) { private String message; public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = new HashMap<>(); + private Map metadata = null; public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; private Boolean showProgressStepper = true; public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers; + private List signers = null; public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; private SubSigningOptions signingOptions; @@ -207,12 +204,11 @@ public UnclaimedDraftCreateRequest type(TypeEnum type) { return this; } - /** + /** * The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. * @return type - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional.") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -241,12 +237,11 @@ public UnclaimedDraftCreateRequest addFilesItem(File filesItem) { return this; } - /** + /** * Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return files - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -275,12 +270,11 @@ public UnclaimedDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { return this; } - /** + /** * Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. * @return fileUrls - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") @JsonProperty(JSON_PROPERTY_FILE_URLS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -301,12 +295,11 @@ public UnclaimedDraftCreateRequest allowDecline(Boolean allowDecline) { return this; } - /** + /** * Allows signers to decline to sign a document if `true`. Defaults to `false`. * @return allowDecline - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Allows signers to decline to sign a document if `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -335,12 +328,11 @@ public UnclaimedDraftCreateRequest addAttachmentsItem(SubAttachment attachmentsI return this; } - /** + /** * A list describing the attachments * @return attachments - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list describing the attachments") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -369,12 +361,11 @@ public UnclaimedDraftCreateRequest addCcEmailAddressesItem(String ccEmailAddress return this; } - /** + /** * The email addresses that should be CCed. * @return ccEmailAddresses - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email addresses that should be CCed.") @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -395,12 +386,11 @@ public UnclaimedDraftCreateRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -429,12 +419,11 @@ public UnclaimedDraftCreateRequest addCustomFieldsItem(SubCustomField customFiel return this; } - /** + /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. * @return customFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -455,12 +444,11 @@ public UnclaimedDraftCreateRequest fieldOptions(SubFieldOptions fieldOptions) { return this; } - /** + /** * Get fieldOptions * @return fieldOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -489,12 +477,11 @@ public UnclaimedDraftCreateRequest addFormFieldGroupsItem(SubFormFieldGroup form return this; } - /** + /** * Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. * @return formFieldGroups - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -523,12 +510,11 @@ public UnclaimedDraftCreateRequest addFormFieldRulesItem(SubFormFieldRule formFi return this; } - /** + /** * Conditional Logic rules for fields defined in `form_fields_per_document`. * @return formFieldRules - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Conditional Logic rules for fields defined in `form_fields_per_document`.") @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -557,12 +543,11 @@ public UnclaimedDraftCreateRequest addFormFieldsPerDocumentItem(SubFormFieldsPer return this; } - /** + /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` * @return formFieldsPerDocument - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -583,12 +568,11 @@ public UnclaimedDraftCreateRequest hideTextTags(Boolean hideTextTags) { return this; } - /** + /** * Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. * @return hideTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.") @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -609,12 +593,11 @@ public UnclaimedDraftCreateRequest message(String message) { return this; } - /** + /** * The custom message in the email that will be sent to the signers. * @return message - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The custom message in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -643,12 +626,11 @@ public UnclaimedDraftCreateRequest putMetadataItem(String key, Object metadataIt return this; } - /** + /** * Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. * @return metadata - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -669,12 +651,11 @@ public UnclaimedDraftCreateRequest showProgressStepper(Boolean showProgressStepp return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -703,12 +684,11 @@ public UnclaimedDraftCreateRequest addSignersItem(SubUnclaimedDraftSigner signer return this; } - /** + /** * Add Signers to your Unclaimed Draft Signature Request. * @return signers - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Add Signers to your Unclaimed Draft Signature Request.") @JsonProperty(JSON_PROPERTY_SIGNERS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -729,12 +709,11 @@ public UnclaimedDraftCreateRequest signingOptions(SubSigningOptions signingOptio return this; } - /** + /** * Get signingOptions * @return signingOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -755,12 +734,11 @@ public UnclaimedDraftCreateRequest signingRedirectUrl(String signingRedirectUrl) return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -781,12 +759,11 @@ public UnclaimedDraftCreateRequest subject(String subject) { return this; } - /** + /** * The subject in the email that will be sent to the signers. * @return subject - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The subject in the email that will be sent to the signers.") @JsonProperty(JSON_PROPERTY_SUBJECT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -807,12 +784,11 @@ public UnclaimedDraftCreateRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -833,12 +809,11 @@ public UnclaimedDraftCreateRequest usePreexistingFields(Boolean usePreexistingFi return this; } - /** + /** * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. * @return usePreexistingFields - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -859,12 +834,11 @@ public UnclaimedDraftCreateRequest useTextTags(Boolean useTextTags) { return this; } - /** + /** * Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. * @return useTextTags - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -885,12 +859,11 @@ public UnclaimedDraftCreateRequest expiresAt(Integer expiresAt) { return this; } - /** + /** * When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java index 38c62b9da..b0477d0bc 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java @@ -26,12 +26,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -42,14 +40,14 @@ UnclaimedDraftCreateResponse.JSON_PROPERTY_UNCLAIMED_DRAFT, UnclaimedDraftCreateResponse.JSON_PROPERTY_WARNINGS }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftCreateResponse { public static final String JSON_PROPERTY_UNCLAIMED_DRAFT = "unclaimed_draft"; private UnclaimedDraftResponse unclaimedDraft; public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings; + private List warnings = null; public UnclaimedDraftCreateResponse() { } @@ -74,14 +72,13 @@ public UnclaimedDraftCreateResponse unclaimedDraft(UnclaimedDraftResponse unclai return this; } - /** + /** * Get unclaimedDraft * @return unclaimedDraft - **/ - @jakarta.annotation.Nullable - @ApiModelProperty(value = "") + */ + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public UnclaimedDraftResponse getUnclaimedDraft() { return unclaimedDraft; @@ -89,7 +86,7 @@ public UnclaimedDraftResponse getUnclaimedDraft() { @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setUnclaimedDraft(UnclaimedDraftResponse unclaimedDraft) { this.unclaimedDraft = unclaimedDraft; } @@ -108,12 +105,11 @@ public UnclaimedDraftCreateResponse addWarningsItem(WarningResponse warningsItem return this; } - /** + /** * A list of warnings. * @return warnings - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "A list of warnings.") @JsonProperty(JSON_PROPERTY_WARNINGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java index e85d4069d..5e4c63956 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java @@ -23,12 +23,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; @@ -45,8 +43,8 @@ UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_SIGNING_REDIRECT_URL, UnclaimedDraftEditAndResendRequest.JSON_PROPERTY_TEST_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftEditAndResendRequest { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -95,12 +93,11 @@ public UnclaimedDraftEditAndResendRequest clientId(String clientId) { return this; } - /** + /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. * @return clientId - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") @JsonProperty(JSON_PROPERTY_CLIENT_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -121,12 +118,11 @@ public UnclaimedDraftEditAndResendRequest editorOptions(SubEditorOptions editorO return this; } - /** + /** * Get editorOptions * @return editorOptions - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,12 +143,11 @@ public UnclaimedDraftEditAndResendRequest isForEmbeddedSigning(Boolean isForEmbe return this; } - /** + /** * The request created from this draft will also be signable in embedded mode if set to `true`. * @return isForEmbeddedSigning - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The request created from this draft will also be signable in embedded mode if set to `true`.") @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -173,12 +168,11 @@ public UnclaimedDraftEditAndResendRequest requesterEmailAddress(String requester return this; } - /** + /** * The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used. * @return requesterEmailAddress - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used.") @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -199,12 +193,11 @@ public UnclaimedDraftEditAndResendRequest requestingRedirectUrl(String requestin return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature. * @return requestingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature.") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -225,12 +218,11 @@ public UnclaimedDraftEditAndResendRequest showProgressStepper(Boolean showProgre return this; } - /** + /** * When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. * @return showProgressStepper - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,12 +243,11 @@ public UnclaimedDraftEditAndResendRequest signingRedirectUrl(String signingRedir return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -277,12 +268,11 @@ public UnclaimedDraftEditAndResendRequest testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java index cc849e0e3..a7212a2f2 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java @@ -22,19 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * A group of documents that a user can take ownership of via the claim URL. */ -@ApiModel(description = "A group of documents that a user can take ownership of via the claim URL.") @JsonPropertyOrder({ UnclaimedDraftResponse.JSON_PROPERTY_SIGNATURE_REQUEST_ID, UnclaimedDraftResponse.JSON_PROPERTY_CLAIM_URL, @@ -43,8 +40,8 @@ UnclaimedDraftResponse.JSON_PROPERTY_EXPIRES_AT, UnclaimedDraftResponse.JSON_PROPERTY_TEST_MODE }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UnclaimedDraftResponse { public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; private String signatureRequestId; @@ -87,12 +84,11 @@ public UnclaimedDraftResponse signatureRequestId(String signatureRequestId) { return this; } - /** + /** * The ID of the signature request that is represented by this UnclaimedDraft. * @return signatureRequestId - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The ID of the signature request that is represented by this UnclaimedDraft.") @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,12 +109,11 @@ public UnclaimedDraftResponse claimUrl(String claimUrl) { return this; } - /** + /** * The URL to be used to claim this UnclaimedDraft. * @return claimUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL to be used to claim this UnclaimedDraft.") @JsonProperty(JSON_PROPERTY_CLAIM_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +134,11 @@ public UnclaimedDraftResponse signingRedirectUrl(String signingRedirectUrl) { return this; } - /** + /** * The URL you want signers redirected to after they successfully sign. * @return signingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully sign.") @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,12 +159,11 @@ public UnclaimedDraftResponse requestingRedirectUrl(String requestingRedirectUrl return this; } - /** + /** * The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). * @return requestingRedirectUrl - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.).") @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,12 +184,11 @@ public UnclaimedDraftResponse expiresAt(Integer expiresAt) { return this; } - /** + /** * When the link expires. * @return expiresAt - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "When the link expires.") @JsonProperty(JSON_PROPERTY_EXPIRES_AT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,12 +209,11 @@ public UnclaimedDraftResponse testMode(Boolean testMode) { return this; } - /** + /** * Whether this is a test draft. Signature requests made from test drafts have no legal value. * @return testMode - **/ + */ @jakarta.annotation.Nullable - @ApiModelProperty(value = "Whether this is a test draft. Signature requests made from test drafts have no legal value.") @JsonProperty(JSON_PROPERTY_TEST_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdks/java-v2/src/main/java/com/dropbox/sign/model/WarningResponse.java b/sdks/java-v2/src/main/java/com/dropbox/sign/model/WarningResponse.java index 225e4c975..8be1d986d 100644 --- a/sdks/java-v2/src/main/java/com/dropbox/sign/model/WarningResponse.java +++ b/sdks/java-v2/src/main/java/com/dropbox/sign/model/WarningResponse.java @@ -22,25 +22,22 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; 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.JSON; import com.dropbox.sign.ApiException; /** * A list of warnings. */ -@ApiModel(description = "A list of warnings.") @JsonPropertyOrder({ WarningResponse.JSON_PROPERTY_WARNING_MSG, WarningResponse.JSON_PROPERTY_WARNING_NAME }) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") @JsonIgnoreProperties(ignoreUnknown=true) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class WarningResponse { public static final String JSON_PROPERTY_WARNING_MSG = "warning_msg"; private String warningMsg; @@ -71,12 +68,11 @@ public WarningResponse warningMsg(String warningMsg) { return this; } - /** + /** * Warning message * @return warningMsg - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Warning message") @JsonProperty(JSON_PROPERTY_WARNING_MSG) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -97,12 +93,11 @@ public WarningResponse warningName(String warningName) { return this; } - /** + /** * Warning name * @return warningName - **/ + */ @jakarta.annotation.Nonnull - @ApiModelProperty(required = true, value = "Warning name") @JsonProperty(JSON_PROPERTY_WARNING_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java index 903eb2c9c..8bd0c74f5 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java @@ -4,8 +4,10 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.dropbox.sign.model.EventCallbackRequest; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Files; import java.nio.file.Paths; @@ -35,9 +37,9 @@ public void testIsValid() throws Exception { EventCallbackRequest callbackEvent = EventCallbackRequest.init(content.toString()); - Assert.assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); - Assert.assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); - Assert.assertEquals( + assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); + assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); + assertEquals( EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK, EventCallbackHelper.getCallbackType(callbackEvent) ); @@ -55,9 +57,9 @@ public void testIsValid() throws Exception { EventCallbackRequest callbackEvent = EventCallbackRequest.init(content.toString()); - Assert.assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); - Assert.assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); - Assert.assertEquals( + assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); + assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); + assertEquals( EventCallbackHelper.EVENT_TYPE_APP_CALLBACK, EventCallbackHelper.getCallbackType(callbackEvent) ); diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/FixtureTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/FixtureTest.java index 2bef23851..d173e8d93 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/FixtureTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/FixtureTest.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Files; import java.nio.file.Paths; @@ -58,7 +58,7 @@ public void testFixture() throws Exception { JsonNode actual = mapper.readTree(serialized); // String comparison doesn't work due to json fields may be out of order - Assert.assertEquals(expected, actual); + assertEquals(expected, actual); } } } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java index 4dcbddee3..0ec09f9e9 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java @@ -4,8 +4,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Files; import java.nio.file.Paths; @@ -30,13 +31,13 @@ public void testSubFormFieldsPerDocumentBase() throws Exception { SubFormFieldsPerDocumentBase base = SubFormFieldsPerDocumentBase.init(expected.toString()); - Assert.assertTrue(Class.forName(packageNamePrefix + fieldName).isInstance(base)); + assertTrue(Class.forName(packageNamePrefix + fieldName).isInstance(base)); String serialized = mapper.writeValueAsString(base); JsonNode actual = mapper.readTree(serialized); // String comparison doesn't work due to json fields may be out of order - Assert.assertEquals(expected, actual); + assertEquals(expected, actual); } } @@ -57,7 +58,7 @@ public void testSignersAllowsInt() throws Exception { SubFormFieldsPerDocumentBase result = SubFormFieldsPerDocumentBase.init(data.toString()); - Assert.assertEquals(expected_signer, result.getSigner()); + assertEquals(expected_signer, result.getSigner()); } } @@ -78,7 +79,7 @@ public void testSignersAllowsString() throws Exception { SubFormFieldsPerDocumentBase result = SubFormFieldsPerDocumentBase.init(data.toString()); - Assert.assertEquals(expected_signer, result.getSigner()); + assertEquals(expected_signer, result.getSigner()); } } } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/api/AccountApiTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/api/AccountApiTest.java index 334e8d20b..04e0e64f9 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/api/AccountApiTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/api/AccountApiTest.java @@ -5,8 +5,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.stream.IntStream; @@ -24,7 +25,7 @@ public void accountCreateTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountCreateResponse response = accountApi.accountCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -36,7 +37,7 @@ public void accountGetTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountGetResponse response = accountApi.accountGet(null, "jack@example.com"); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -52,7 +53,7 @@ public void accountUpdateTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountGetResponse response = accountApi.accountUpdate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -68,7 +69,7 @@ public void accountVerifyTest() throws Exception { AccountApi accountApi = new AccountApi(apiClient); AccountVerifyResponse response = accountApi.accountVerify(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -85,10 +86,10 @@ public void testHttpCodeRange() throws Exception { ApiClient apiClient = TestHelper.setUpMock(value, expectedResponse); AccountApi accountApi = new AccountApi(apiClient); accountApi.accountVerify(request); - Assert.fail(); + fail(); } catch (ApiException e) { - Assert.assertEquals(value, e.getCode()); - Assert.assertEquals(expectedResponse, e.getErrorResponse()); + assertEquals(value, e.getCode()); + assertEquals(expectedResponse, e.getErrorResponse()); } }); } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java index ddaee9815..3c0d800a8 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; @@ -24,7 +25,7 @@ public void apiAppCreateTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppGetResponse response = api.apiAppCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -45,7 +46,7 @@ public void apiAppGetTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppGetResponse response = api.apiAppGet(clientId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -57,7 +58,7 @@ public void apiAppListTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppListResponse response = api.apiAppList(1, 20); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -76,6 +77,6 @@ public void apiAppUpdateTest() throws Exception { ApiAppApi api = new ApiAppApi(apiClient); ApiAppGetResponse response = api.apiAppUpdate(clientId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java index 08534d1f6..e70b32563 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class BulkSendJobApiTest { @Test @@ -18,7 +19,7 @@ public void bulkSendJobGetTest() throws Exception { BulkSendJobApi api = new BulkSendJobApi(apiClient); BulkSendJobGetResponse response = api.bulkSendJobGet(id); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -30,6 +31,6 @@ public void bulkSendJobListTest() throws Exception { BulkSendJobApi api = new BulkSendJobApi(apiClient); BulkSendJobListResponse response = api.bulkSendJobList(1, 20); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java index 6bb3ed84b..e52f45574 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class EmbeddedApiTest { @Test @@ -23,7 +24,7 @@ public void embeddedEditUrlTest() throws Exception { EmbeddedApi api = new EmbeddedApi(apiClient); EmbeddedEditUrlResponse response = api.embeddedEditUrl(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -37,6 +38,6 @@ public void embeddedSignUrlTest() throws Exception { EmbeddedApi api = new EmbeddedApi(apiClient); EmbeddedSignUrlResponse response = api.embeddedSignUrl(signatureId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/api/OAuthApiTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/api/OAuthApiTest.java index 2eb9518bf..fe95c51ee 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/api/OAuthApiTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/api/OAuthApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class OAuthApiTest { @Test @@ -21,7 +22,7 @@ public void oauthTokenGenerateTest() throws Exception { OAuthApi api = new OAuthApi(apiClient); OAuthTokenResponse response = api.oauthTokenGenerate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -37,6 +38,6 @@ public void oauthTokenRefreshTest() throws Exception { OAuthApi api = new OAuthApi(apiClient); OAuthTokenResponse response = api.oauthTokenRefresh(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/api/ReportApiTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/api/ReportApiTest.java index 0dde79690..65c4a9c00 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/api/ReportApiTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/api/ReportApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; public class ReportApiTest { @Test @@ -21,6 +22,6 @@ public void reportCreateTest() throws Exception { ReportApi api = new ReportApi(apiClient); ReportCreateResponse response = api.reportCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java index ed48f9c63..eadcbb2ee 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.mockito.Mockito; import static org.mockito.ArgumentMatchers.any; @@ -50,7 +51,7 @@ public void initAcceptsHashMap() throws Exception { ); assert data.getFormFieldsPerDocument() != null; - Assert.assertEquals( + assertEquals( "signature", data.getFormFieldsPerDocument().get(0).getType() ); @@ -70,7 +71,7 @@ public void signatureRequestBulkCreateEmbeddedWithTemplateTest() throws Exceptio SignatureRequestApi api = new SignatureRequestApi(apiClient); BulkSendJobSendResponse response = api.signatureRequestBulkCreateEmbeddedWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -87,7 +88,7 @@ public void signatureRequestBulkSendWithTemplateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); BulkSendJobSendResponse response = api.signatureRequestBulkSendWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -111,7 +112,7 @@ public void signatureRequestCreateEmbeddedTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestCreateEmbedded(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -128,7 +129,7 @@ public void signatureRequestCreateEmbeddedWithTemplateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestCreateEmbeddedWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -147,7 +148,7 @@ public void signatureRequestGetTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestGet(signatureRequestId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -166,7 +167,7 @@ public void signatureRequestListTest() throws Exception { null ); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -180,7 +181,7 @@ public void signatureRequestReleaseHoldTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestReleaseHold(signatureRequestId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -198,7 +199,7 @@ public void signatureRequestRemindTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestRemind(signatureRequestId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -222,7 +223,7 @@ public void signatureRequestSendTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestSend(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -299,7 +300,7 @@ public void signatureRequestSendWithTemplateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestSendWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -317,6 +318,6 @@ public void signatureRequestUpdateTest() throws Exception { SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestUpdate(signatureRequestId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/api/TeamApiTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/api/TeamApiTest.java index a97b2b791..bc9e77e13 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/api/TeamApiTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/api/TeamApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * API tests for TeamApi @@ -24,7 +25,7 @@ public void teamAddMemberTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamAddMember(request, null); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -40,7 +41,7 @@ public void teamCreateTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -58,7 +59,7 @@ public void teamGetTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamGet(); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -74,7 +75,7 @@ public void teamRemoveMemberTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamRemoveMember(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -90,6 +91,6 @@ public void teamUpdateTest() throws Exception { TeamApi api = new TeamApi(apiClient); TeamGetResponse response = api.teamUpdate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/api/TemplateApiTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/api/TemplateApiTest.java index d69a9664f..5c1d04b29 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/api/TemplateApiTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/api/TemplateApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; @@ -25,7 +26,7 @@ public void templateAddUserTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateGetResponse response = api.templateAddUser(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -42,7 +43,7 @@ public void templateCreateEmbeddedDraftTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateCreateEmbeddedDraftResponse response = api.templateCreateEmbeddedDraft(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -68,7 +69,7 @@ public void templateGetTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateGetResponse response = api.templateGet(templateId); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -82,7 +83,7 @@ public void templateListTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateListResponse response = api.templateList(accountId, 1, 20, null); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -100,7 +101,7 @@ public void templateRemoveUserTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateGetResponse response = api.templateRemoveUser(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -119,6 +120,6 @@ public void templateUpdateFilesTest() throws Exception { TemplateApi api = new TemplateApi(apiClient); TemplateUpdateFilesResponse response = api.templateUpdateFiles(templateId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v2/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java b/sdks/java-v2/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java index 6ee2b65ce..5d92e305f 100644 --- a/sdks/java-v2/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java +++ b/sdks/java-v2/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java @@ -4,8 +4,9 @@ import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; @@ -24,7 +25,7 @@ public void unclaimedDraftCreateTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftCreate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -41,7 +42,7 @@ public void unclaimedDraftCreateEmbeddedTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftCreateEmbedded(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -58,7 +59,7 @@ public void unclaimedDraftCreateEmbeddedWithTemplateTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftCreateEmbeddedWithTemplate(request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } @Test @@ -76,6 +77,6 @@ public void unclaimedDraftEditAndResendTest() throws Exception { UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); UnclaimedDraftCreateResponse response = api.unclaimedDraftEditAndResend(signatureRequestId, request); - Assert.assertEquals(expectedResponse, response); + assertEquals(expectedResponse, response); } } diff --git a/sdks/java-v2/templates/ApiClient.mustache b/sdks/java-v2/templates/ApiClient.mustache index 5191e6214..9cf548d44 100644 --- a/sdks/java-v2/templates/ApiClient.mustache +++ b/sdks/java-v2/templates/ApiClient.mustache @@ -1,25 +1,19 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; - -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} +{{#useJakartaEe}} +import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; +{{/useJakartaEe}} +{{^useJakartaEe}} import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; +{{/useJakartaEe}} import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; @@ -32,9 +26,9 @@ import com.sun.jersey.api.client.WebResource.Builder; import com.sun.jersey.multipart.FormDataMultiPart; import com.sun.jersey.multipart.file.FileDataBodyPart; -import javax.ws.rs.core.Cookie; -import javax.ws.rs.core.Response.Status.Family; -import javax.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Cookie; +import {{javaxPackage}}.ws.rs.core.Response.Status.Family; +import {{javaxPackage}}.ws.rs.core.MediaType; import java.util.Collection; import java.util.Collections; @@ -125,16 +119,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); @@ -144,8 +129,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -212,6 +197,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public ApiClient setBasePath(String basePath) { this.basePath = basePath; + this.serverIndex = null; return this; } @@ -552,7 +538,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { List params = new ArrayList(); // preconditions - if (name == null || name.isEmpty() || value == null) { + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { return params; } diff --git a/sdks/java-v2/templates/BeanValidationException.mustache b/sdks/java-v2/templates/BeanValidationException.mustache index 3fc5b8451..d8b0fa695 100644 --- a/sdks/java-v2/templates/BeanValidationException.mustache +++ b/sdks/java-v2/templates/BeanValidationException.mustache @@ -1,9 +1,11 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.ValidationException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ValidationException; public class BeanValidationException extends ValidationException { /** diff --git a/sdks/java-v2/templates/Configuration.mustache b/sdks/java-v2/templates/Configuration.mustache index cb425df35..8e9720e36 100644 --- a/sdks/java-v2/templates/Configuration.mustache +++ b/sdks/java-v2/templates/Configuration.mustache @@ -4,6 +4,8 @@ package {{invokerPackage}}; {{>generatedAnnotation}} public class Configuration { + public static final String VERSION = "{{{artifactVersion}}}"; + private static ApiClient defaultApiClient = new ApiClient(); /** diff --git a/sdks/java-v2/templates/CustomInstantDeserializer.mustache b/sdks/java-v2/templates/CustomInstantDeserializer.mustache index 5ebea810e..d4a3ca97e 100644 --- a/sdks/java-v2/templates/CustomInstantDeserializer.mustache +++ b/sdks/java-v2/templates/CustomInstantDeserializer.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.core.JsonParser; diff --git a/sdks/java-v2/templates/JSON.mustache b/sdks/java-v2/templates/JSON.mustache index 00c553067..1d0a81387 100644 --- a/sdks/java-v2/templates/JSON.mustache +++ b/sdks/java-v2/templates/JSON.mustache @@ -19,11 +19,6 @@ import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; @@ -36,11 +31,9 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/sdks/java-v2/templates/JavaTimeFormatter.mustache b/sdks/java-v2/templates/JavaTimeFormatter.mustache index 07d0eb6ce..f3fb34e55 100644 --- a/sdks/java-v2/templates/JavaTimeFormatter.mustache +++ b/sdks/java-v2/templates/JavaTimeFormatter.mustache @@ -1,16 +1,9 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{^threetenbp}} import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; -{{/threetenbp}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeParseException; -{{/threetenbp}} /** * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. diff --git a/sdks/java-v2/templates/README.mustache b/sdks/java-v2/templates/README.mustache index edbb58cba..72daeb22f 100644 --- a/sdks/java-v2/templates/README.mustache +++ b/sdks/java-v2/templates/README.mustache @@ -1,13 +1,60 @@ # {{artifactId}} +{{^useCustomTemplateCode}} +{{appName}} + +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +- Generator version: {{generatorVersion}} + +{{{appDescriptionWithNewLines}}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} +{{/useCustomTemplateCode}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) {{/infoUrl}} +{{^useCustomTemplateCode}} +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 1.8+ +{{#jersey2}} +2. Maven (3.8.3+)/Gradle (7.2+) +{{/jersey2}} +{{^jersey2}} +2. Maven/Gradle +{{/jersey2}} + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ## Migrating from legacy SDK This SDK is generated from our officially maintained [OpenAPI spec](https://github.com/hellosign/hellosign-openapi/blob/main/openapi.yaml). @@ -52,6 +99,7 @@ Run the following and everything is done for you: *Attention*: Any changes you have made to the SDK code that you have not made to the OAS file and/or the mustache template files _will be lost_ when you run this command. +{{/useCustomTemplateCode}} ### Maven users @@ -94,6 +142,7 @@ Then manually install the following JARs: - `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` - `target/lib/*.jar` +{{#useCustomTemplateCode}} ## Getting Started Please follow the [installation](#installation) instruction and execute the following Java code: @@ -104,62 +153,111 @@ REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Java_CODE ``` {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} {{#jersey2}} - ## Using a Proxy - - To add a HTTP proxy for the API client, use `ClientConfig`: - - ```java - {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} - import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; - import org.glassfish.jersey.client.ClientConfig; - import org.glassfish.jersey.client.ClientProperties; - import {{{invokerPackage}}}.*; - import {{{package}}}.{{{classname}}}; - - ... - - ApiClient defaultClient = Configuration.getDefaultApiClient(); - ClientConfig clientConfig = defaultClient.getClientConfig(); - clientConfig.connectorProvider(new ApacheConnectorProvider()); - clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); - clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); - clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); - defaultClient.setClientConfig(clientConfig); - - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - ``` +{{^useCustomTemplateCode}} +## Usage +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +## Using a Proxy +{{/useCustomTemplateCode}} + +To add a HTTP proxy for the API client, use `ClientConfig`: +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import {{{invokerPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +... + +ApiClient defaultClient = Configuration.getDefaultApiClient(); +ClientConfig clientConfig = defaultClient.getClientConfig(); +clientConfig.connectorProvider(new ApacheConnectorProvider()); +clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); +clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); +clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); +defaultClient.setClientConfig(clientConfig); + +{{{classname}}} apiInstance = new {{{classname}}}(defaultClient); +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` {{/jersey2}} -{{#jersey3}} - ## Using a Proxy - - To add a HTTP proxy for the API client, use `ClientConfig`: - - ```java - {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} - import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; - import org.glassfish.jersey.client.ClientConfig; - import org.glassfish.jersey.client.ClientProperties; - import {{{invokerPackage}}}.*; - import {{{package}}}.{{{classname}}}; - - ... - - ApiClient defaultClient = Configuration.getDefaultApiClient(); - ClientConfig clientConfig = defaultClient.getClientConfig(); - clientConfig.connectorProvider(new ApacheConnectorProvider()); - clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); - clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); - clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); - defaultClient.setClientConfig(clientConfig); +{{^useCustomTemplateCode}} +## Getting Started - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - ``` +Please follow the [installation](#installation) instruction and execute the following Java code: -{{/jersey3}} +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import {{{invokerPackage}}}.*; +import {{{invokerPackage}}}.auth.*; +import {{{modelPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +public class {{{classname}}}Example { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}} + // Configure HTTP signature authorization: {{{name}}} + HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}"); + // All the HTTP signature parameters below should be customized to your environment. + // Configure the keyId + {{{name}}}.setKeyId("YOUR KEY ID"); + // Configure the signature algorithm + {{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019); + // Configure the specific cryptographic algorithm + {{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256); + // Configure the cryptographic algorithm parameters, if applicable + {{{name}}}.setAlgorithmParameterSpec(null); + // Set the cryptographic digest algorithm. + {{{name}}}.setDigestAlgorithm("SHA-256"); + // Set the HTTP headers that should be included in the HTTP signature. + {{{name}}}.setHeaders(Arrays.asList("date", "host")); + // Set the private key used to sign the HTTP messages + {{{name}}}.setPrivateKey();{{/isHttpSignature}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` +{{/useCustomTemplateCode}} ## Documentation for API Endpoints @@ -175,11 +273,14 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}} @@ -187,10 +288,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth @@ -212,6 +321,7 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} +{{#useCustomTemplateCode}} ## About this package This Java package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -249,3 +359,4 @@ mvn clean deploy ``` Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. +{{/useCustomTemplateCode}} diff --git a/sdks/java-v2/templates/RFC3339DateFormat.mustache b/sdks/java-v2/templates/RFC3339DateFormat.mustache index 46c7bb46d..d35040f05 100644 --- a/sdks/java-v2/templates/RFC3339DateFormat.mustache +++ b/sdks/java-v2/templates/RFC3339DateFormat.mustache @@ -7,9 +7,11 @@ import java.text.DateFormat; import java.text.FieldPosition; import java.text.ParsePosition; import java.util.Date; +import java.text.DecimalFormat; import java.util.GregorianCalendar; import java.util.TimeZone; +{{>generatedAnnotation}} public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); @@ -20,6 +22,7 @@ public class RFC3339DateFormat extends DateFormat { public RFC3339DateFormat() { this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); } @Override @@ -41,4 +44,4 @@ public class RFC3339DateFormat extends DateFormat { public Object clone() { return super.clone(); } -} \ No newline at end of file +} diff --git a/sdks/java-v2/templates/ServerConfiguration.mustache b/sdks/java-v2/templates/ServerConfiguration.mustache index e21b63391..728400427 100644 --- a/sdks/java-v2/templates/ServerConfiguration.mustache +++ b/sdks/java-v2/templates/ServerConfiguration.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.Map; @@ -5,6 +7,7 @@ import java.util.Map; /** * Representing a Server configuration. */ +{{>generatedAnnotation}} public class ServerConfiguration { public String URL; public String description; @@ -39,10 +42,10 @@ public class ServerConfiguration { if (variables != null && variables.containsKey(name)) { value = variables.get(name); if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); } } - url = url.replaceAll("\\{" + name + "\\}", value); + url = url.replace("{" + name + "}", value); } return url; } diff --git a/sdks/java-v2/templates/ServerVariable.mustache b/sdks/java-v2/templates/ServerVariable.mustache index 1978b1eb9..41246a7ac 100644 --- a/sdks/java-v2/templates/ServerVariable.mustache +++ b/sdks/java-v2/templates/ServerVariable.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.HashSet; @@ -5,6 +7,7 @@ import java.util.HashSet; /** * Representing a Server Variable for server URL template substitution. */ +{{>generatedAnnotation}} public class ServerVariable { public String description; public String defaultValue; diff --git a/sdks/java-v2/templates/additionalOneOfTypeAnnotations.mustache b/sdks/java-v2/templates/additionalOneOfTypeAnnotations.mustache new file mode 100644 index 000000000..283f8f91e --- /dev/null +++ b/sdks/java-v2/templates/additionalOneOfTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalOneOfTypeAnnotations}}{{{.}}} +{{/additionalOneOfTypeAnnotations}} \ No newline at end of file diff --git a/sdks/java-v2/templates/api.mustache b/sdks/java-v2/templates/api.mustache index 28b18e2d1..8ce0ae1c4 100644 --- a/sdks/java-v2/templates/api.mustache +++ b/sdks/java-v2/templates/api.mustache @@ -13,12 +13,10 @@ import {{invokerPackage}}.Pair; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} {{>generatedAnnotation}} {{#operations}} @@ -46,7 +44,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} {{#returnType}} * @return {{.}} @@ -76,11 +74,11 @@ public class {{classname}} { .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#queryParams}} {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); diff --git a/sdks/java-v2/templates/apiException.mustache b/sdks/java-v2/templates/apiException.mustache index 5b450c9ba..894486729 100644 --- a/sdks/java-v2/templates/apiException.mustache +++ b/sdks/java-v2/templates/apiException.mustache @@ -7,6 +7,8 @@ import java.util.List; {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; @@ -37,7 +39,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us } public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); } public ApiException(int code, String message) { @@ -77,4 +79,13 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } + + @Override + public String toString() { + return "ApiException{" + + "code=" + code + + ", responseHeaders=" + responseHeaders + + ", responseBody='" + responseBody + '\'' + + '}'; + } } diff --git a/sdks/java-v2/templates/api_doc.mustache b/sdks/java-v2/templates/api_doc.mustache index 78783f194..5ab8c9d93 100644 --- a/sdks/java-v2/templates/api_doc.mustache +++ b/sdks/java-v2/templates/api_doc.mustache @@ -4,10 +4,18 @@ All URIs are relative to *{{basePath}}* +{{^useCustomTemplateCode}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} | +{{/operation}}{{/operations}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} Method | HTTP request | Description ------------- | ------------- | ------------- {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} {{/operation}}{{/operations}} +{{/useCustomTemplateCode}} {{#operations}} {{#operation}} @@ -75,11 +83,20 @@ public class Example { ### Parameters +{{^useCustomTemplateCode}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} {{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} +{{/useCustomTemplateCode}} ### Return type diff --git a/sdks/java-v2/templates/api_test.mustache b/sdks/java-v2/templates/api_test.mustache index b3a544d4c..155f46e40 100644 --- a/sdks/java-v2/templates/api_test.mustache +++ b/sdks/java-v2/templates/api_test.mustache @@ -5,21 +5,21 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} /** * API tests for {{classname}} */ -public class {{classname}}Test { +class {{classname}}Test { private final {{classname}} api = new {{classname}}(); @@ -38,7 +38,7 @@ public class {{classname}}Test { * if the Api call fails */ @Test - public void {{operationId}}Test() throws ApiException { + void {{operationId}}Test() throws ApiException { //{{#allParams}} //{{{dataType}}} {{paramName}} = null; //{{/allParams}} diff --git a/sdks/java-v2/templates/auth/HttpBasicAuth.mustache b/sdks/java-v2/templates/auth/HttpBasicAuth.mustache index 4d362cbaf..b5c72de6e 100644 --- a/sdks/java-v2/templates/auth/HttpBasicAuth.mustache +++ b/sdks/java-v2/templates/auth/HttpBasicAuth.mustache @@ -4,21 +4,12 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; -{{^java8}} -import com.migcomponents.migbase64.Base64; -{{/java8}} -{{#java8}} import java.util.Base64; import java.nio.charset.StandardCharsets; -{{/java8}} import java.util.Map; import java.util.List; -{{^java8}} -import java.io.UnsupportedEncodingException; -{{/java8}} - {{>generatedAnnotation}} public class HttpBasicAuth implements Authentication { private String username; @@ -46,15 +37,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); -{{^java8}} - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } -{{/java8}} -{{#java8}} headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); -{{/java8}} } } diff --git a/sdks/java-v2/templates/auth/HttpBearerAuth.mustache b/sdks/java-v2/templates/auth/HttpBearerAuth.mustache index 322281f87..6ed21107d 100644 --- a/sdks/java-v2/templates/auth/HttpBearerAuth.mustache +++ b/sdks/java-v2/templates/auth/HttpBearerAuth.mustache @@ -4,13 +4,15 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; -import java.util.Map; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; {{>generatedAnnotation}} public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -22,7 +24,7 @@ public class HttpBearerAuth implements Authentication { * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** @@ -31,12 +33,22 @@ public class HttpBearerAuth implements Authentication { * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if(bearerToken == null) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { return; } diff --git a/sdks/java-v2/templates/auth/OAuthFlow.mustache b/sdks/java-v2/templates/auth/OAuthFlow.mustache index 05bbf28dd..7a4252662 100644 --- a/sdks/java-v2/templates/auth/OAuthFlow.mustache +++ b/sdks/java-v2/templates/auth/OAuthFlow.mustache @@ -2,10 +2,13 @@ package {{invokerPackage}}.auth; +/** + * OAuth flows that are supported by this client + */ {{>generatedAnnotation}} public enum OAuthFlow { - accessCode, //called authorizationCode in OpenAPI 3.0 - implicit, - password, - application //called clientCredentials in OpenAPI 3.0 + ACCESS_CODE, //called authorizationCode in OpenAPI 3.0 + IMPLICIT, + PASSWORD, + APPLICATION //called clientCredentials in OpenAPI 3.0 } diff --git a/sdks/java-v2/templates/beanValidation.mustache b/sdks/java-v2/templates/beanValidation.mustache index 1bc9afa8f..47f7109e5 100644 --- a/sdks/java-v2/templates/beanValidation.mustache +++ b/sdks/java-v2/templates/beanValidation.mustache @@ -1,5 +1,7 @@ {{#required}} +{{^isReadOnly}} @NotNull +{{/isReadOnly}} {{/required}} {{#isContainer}} {{^isPrimitiveType}} diff --git a/sdks/java-v2/templates/beanValidationQueryParams.mustache b/sdks/java-v2/templates/beanValidationQueryParams.mustache index c4ff01d7e..0f99bffde 100644 --- a/sdks/java-v2/templates/beanValidationQueryParams.mustache +++ b/sdks/java-v2/templates/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull {{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/sdks/java-v2/templates/build.gradle.mustache b/sdks/java-v2/templates/build.gradle.mustache index d9718c1e5..06f9bd5e9 100644 --- a/sdks/java-v2/templates/build.gradle.mustache +++ b/sdks/java-v2/templates/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -126,18 +114,18 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.12.5" - jackson_databind_version = "2.10.5.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} + {{#useBeanValidation}} + bean_validation_version = "3.0.2" + {{/useBeanValidation}} jersey_version = "1.19.4" jodatime_version = "2.9.9" - junit_version = "4.13.1" + junit_version = "5.10.2" } dependencies { @@ -155,15 +143,26 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + {{#useBeanValidation}} + implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + {{/useBeanValidation}} testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + } diff --git a/sdks/java-v2/templates/generatedAnnotation.mustache b/sdks/java-v2/templates/generatedAnnotation.mustache index 875d7b97a..e05689d5f 100644 --- a/sdks/java-v2/templates/generatedAnnotation.mustache +++ b/sdks/java-v2/templates/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/sdks/java-v2/templates/gitignore.mustache b/sdks/java-v2/templates/gitignore.mustache index b6717f0ee..7973a3bc5 100644 --- a/sdks/java-v2/templates/gitignore.mustache +++ b/sdks/java-v2/templates/gitignore.mustache @@ -8,8 +8,10 @@ *.war *.ear +{{^useCustomTemplateCode}} # exclude jar for gradle wrapper !gradle/wrapper/*.jar +{{/useCustomTemplateCode}} # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* @@ -18,12 +20,13 @@ hs_err_pid* **/target target .gradle -build/ +build +{{#useCustomTemplateCode}} .composer vendor - -# Intellij .idea/ - .openapi-generator +.github/workflows/maven.yml +gradle +{{/useCustomTemplateCode}} diff --git a/sdks/java-v2/templates/gradle-wrapper.properties.mustache b/sdks/java-v2/templates/gradle-wrapper.properties.mustache index 774fae876..552ae67dd 100644 --- a/sdks/java-v2/templates/gradle-wrapper.properties.mustache +++ b/sdks/java-v2/templates/gradle-wrapper.properties.mustache @@ -1,5 +1,12 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +{{^useCustomTemplateCode}} +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +{{/useCustomTemplateCode}} +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sdks/java-v2/templates/gradle.properties.mustache b/sdks/java-v2/templates/gradle.properties.mustache index d445b39c4..101f52b9b 100644 --- a/sdks/java-v2/templates/gradle.properties.mustache +++ b/sdks/java-v2/templates/gradle.properties.mustache @@ -4,6 +4,7 @@ # Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties # For example, uncomment below to build for Android #target = android +{{#useCustomTemplateCode}} GROUP={{groupId}} POM_ARTIFACT_ID={{artifactId}} VERSION_NAME={{artifactVersion}} @@ -30,6 +31,7 @@ RELEASE_SIGNING_ENABLED=true SONATYPE_CONNECT_TIMEOUT_SECONDS=300 SONATYPE_CLOSE_TIMEOUT_SECONDS=900 +{{/useCustomTemplateCode}} {{#gradleProperties}} {{{.}}} {{/gradleProperties}} diff --git a/sdks/java-v2/templates/gradlew.bat.mustache b/sdks/java-v2/templates/gradlew.bat.mustache index 6a68175eb..25da30dbd 100644 --- a/sdks/java-v2/templates/gradlew.bat.mustache +++ b/sdks/java-v2/templates/gradlew.bat.mustache @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/sdks/java-v2/templates/gradlew.mustache b/sdks/java-v2/templates/gradlew.mustache index 005bcde04..9d0ce634c 100644 --- a/sdks/java-v2/templates/gradlew.mustache +++ b/sdks/java-v2/templates/gradlew.mustache @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi +fi else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/sdks/java-v2/templates/jackson_annotations.mustache b/sdks/java-v2/templates/jackson_annotations.mustache index ccde126f5..4fbaf983b 100644 --- a/sdks/java-v2/templates/jackson_annotations.mustache +++ b/sdks/java-v2/templates/jackson_annotations.mustache @@ -6,14 +6,9 @@ }} @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) - {{#withXml}} - {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - {{#isXmlWrapped}} - // items.xmlName={{items.xmlName}} - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/withXml}} \ No newline at end of file +{{#withXml}} + @JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isContainer}} + @JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}}) + {{/isContainer}} +{{/withXml}} \ No newline at end of file diff --git a/sdks/java-v2/templates/javaBuilder.mustache b/sdks/java-v2/templates/javaBuilder.mustache new file mode 100644 index 000000000..c02730081 --- /dev/null +++ b/sdks/java-v2/templates/javaBuilder.mustache @@ -0,0 +1,82 @@ +public static class Builder {{#parentModel}}extends {{classname}}.Builder {{/parentModel}}{ + + private {{classname}} instance; + + public Builder() { + this(new {{classname}}()); + } + + protected Builder({{classname}} instance) { + {{#parentModel}} + super(instance); + {{/parentModel}} + this.instance = instance; + } + + {{#vars}} + public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.instance.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.instance.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{#vendorExtensions.x-is-jackson-optional-nullable}} + public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + this.instance.{{name}} = {{name}}; + return this; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{/vars}} + +{{#parentVars}} + public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { // inherited: {{isInherited}} + super.{{name}}({{name}}); + return this; + } + {{#vendorExtensions.x-is-jackson-optional-nullable}} + public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + this.instance.{{name}} = {{name}}; + return this; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{/parentVars}} + + /** + * returns a built {{classname}} instance. + * + * The builder is not reusable. + */ + public {{classname}} build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused{{#parentModel}} + super.build();{{/parentModel}} + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static {{classname}}.Builder builder() { + return new {{classname}}.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public {{classname}}.Builder toBuilder() { + return new {{classname}}.Builder(){{#allVars}} + .{{name}}({{getter}}()){{/allVars}}; + } diff --git a/sdks/java-v2/templates/libraries/apache-httpclient/ApiClient.mustache b/sdks/java-v2/templates/libraries/apache-httpclient/ApiClient.mustache index 371f8ee72..a00c6dc45 100644 --- a/sdks/java-v2/templates/libraries/apache-httpclient/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/apache-httpclient/ApiClient.mustache @@ -1,52 +1,42 @@ {{>licenseInfo}} package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; - -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} -import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JavaType; - -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.HttpStatus; -import org.apache.http.NameValuePair; -import org.apache.http.ParseException; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.RequestBuilder; -import org.apache.http.client.protocol.HttpClientContext; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.FileEntity; -import org.apache.http.entity.StringEntity; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.impl.client.BasicCookieStore; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.cookie.BasicClientCookie; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.util.EntityUtils; -import org.apache.http.cookie.Cookie; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} + +import org.apache.hc.client5.http.cookie.BasicCookieStore; +import org.apache.hc.client5.http.cookie.Cookie; +import org.apache.hc.client5.http.entity.UrlEncodedFormEntity; +import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder; +import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; +import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse; +import org.apache.hc.client5.http.impl.classic.HttpClients; +import org.apache.hc.client5.http.impl.cookie.BasicClientCookie; +import org.apache.hc.client5.http.protocol.HttpClientContext; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.Header; +import org.apache.hc.core5.http.HttpEntity; +import org.apache.hc.core5.http.HttpResponse; +import org.apache.hc.core5.http.HttpStatus; +import org.apache.hc.core5.http.NameValuePair; +import org.apache.hc.core5.http.ParseException; +import org.apache.hc.core5.http.io.entity.ByteArrayEntity; +import org.apache.hc.core5.http.io.entity.EntityUtils; +import org.apache.hc.core5.http.io.entity.FileEntity; +import org.apache.hc.core5.http.io.entity.StringEntity; +import org.apache.hc.core5.http.io.support.ClassicRequestBuilder; +import org.apache.hc.core5.http.message.BasicNameValuePair; import java.util.Collection; import java.util.Collections; @@ -58,7 +48,9 @@ import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.function.Supplier; import java.util.TimeZone; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -68,6 +60,9 @@ import java.io.File; import java.io.InputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.charset.UnsupportedCharsetException; import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.nio.file.Paths; @@ -131,8 +126,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private Map authentications; - private int statusCode; - private Map> responseHeaders; + private Map lastStatusCodeByThread = new ConcurrentHashMap<>(); + private Map>> lastResponseHeadersByThread = new ConcurrentHashMap<>(); private DateFormat dateFormat; @@ -150,16 +145,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} + {{#openApiNullable}} + objectMapper.registerModule(new JsonNullableModule()); + {{/openApiNullable}} objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); @@ -169,8 +158,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -200,6 +189,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the object mapper. + * + * @param objectMapper object mapper * @return API client */ public ApiClient setObjectMapper(ObjectMapper objectMapper) { @@ -212,6 +204,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the HTTP client. + * + * @param httpClient HTTP client * @return API client */ public ApiClient setHttpClient(CloseableHttpClient httpClient) { @@ -224,6 +219,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the base path. + * + * @param basePath base path * @return API client */ public ApiClient setBasePath(String basePath) { @@ -237,6 +235,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the server. + * + * @param servers a list of server configuration * @return API client */ public ApiClient setServers(List servers) { @@ -249,6 +250,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the server index. + * + * @param serverIndex server index * @return API client */ public ApiClient setServerIndex(Integer serverIndex) { @@ -261,6 +265,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** + * Sets the server variables. + * + * @param serverVariables server variables * @return API client */ public ApiClient setServerVariables(Map serverVariables) { @@ -270,18 +277,21 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** * Gets the status code of the previous request + * * @return Status code */ + @Deprecated public int getStatusCode() { - return statusCode; + return lastStatusCodeByThread.get(Thread.currentThread().getId()); } /** * Gets the response headers of the previous request * @return Response headers */ + @Deprecated public Map> getResponseHeaders() { - return responseHeaders; + return lastResponseHeadersByThread.get(Thread.currentThread().getId()); } /** @@ -329,6 +339,20 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RuntimeException("No Bearer authentication configured!"); } + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier the token supplier function + */ + public void setBearerToken(Supplier tokenSupplier) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } {{/hasHttpBearerMethods}} {{#hasHttpBasicMethods}} @@ -580,9 +604,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { List params = new ArrayList(); // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params; + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } - params.add(new Pair(name, parameterToString(value))); + params.add(new Pair(name, escapeString(parameterToString(value)))); return params; } @@ -600,7 +626,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { List params = new ArrayList(); // preconditions - if (name == null || name.isEmpty() || value == null) { + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { return params; } @@ -707,7 +733,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** - * Transform response headers into map + * Transforms response headers into map. + * + * @param headers HTTP headers + * @return a map of string array */ protected Map> transformResponseHeaders(Header[] headers) { Map> headersMap = new HashMap<>(); @@ -730,7 +759,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private ContentType getContentType(String headerValue) throws ApiException { try { return ContentType.parse(headerValue); - } catch (ParseException e) { + } catch (UnsupportedCharsetException e) { throw new ApiException("Could not parse content type " + headerValue); } } @@ -759,7 +788,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String mimeType = contentType.getMimeType(); if (isJsonMime(mimeType)) { try { - return new StringEntity(objectMapper.writeValueAsString(obj), contentType); + return new StringEntity(objectMapper.writeValueAsString(obj), contentType.withCharset(StandardCharsets.UTF_8)); } catch (JsonProcessingException e) { throw new ApiException(e); } @@ -772,7 +801,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else if (value instanceof byte[]) { multiPartBuilder.addBinaryBody(paramEntry.getKey(), (byte[]) value); } else { - multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue())); + Charset charset = contentType.getCharset(); + if (charset != null) { + ContentType customContentType = ContentType.create(ContentType.TEXT_PLAIN.getMimeType(), charset); + multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue()), + customContentType); + } else { + multiPartBuilder.addTextBody(paramEntry.getKey(), parameterToString(paramEntry.getValue())); + } } } return multiPartBuilder.build(); @@ -781,11 +817,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { for (Entry paramEntry : formParams.entrySet()) { formValues.add(new BasicNameValuePair(paramEntry.getKey(), parameterToString(paramEntry.getValue()))); } - try { - return new UrlEncodedFormEntity(formValues); - } catch (UnsupportedEncodingException e) { - throw new ApiException(e); - } + return new UrlEncodedFormEntity(formValues, contentType.getCharset()); } else { // Handle files with unknown content type if (obj instanceof File) { @@ -798,9 +830,17 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** - * Deserialize response content + * Deserialize response body to Java object according to the Content-Type. + * + * @param Type + * @param response Response + * @param valueType Return type + * @return Deserialized object + * @throws ApiException API exception + * @throws IOException IO exception */ - public T deserialize(HttpResponse response, TypeReference valueType) throws ApiException, IOException { + @SuppressWarnings("unchecked") + public T deserialize(CloseableHttpResponse response, TypeReference valueType) throws ApiException, IOException, ParseException { if (valueType == null) { return null; } @@ -814,18 +854,29 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String mimeType = getResponseMimeType(response); if (mimeType == null || isJsonMime(mimeType)) { // Assume json if no mime type - return objectMapper.readValue(entity.getContent(), valueType); + // convert input stream to string + String content = EntityUtils.toString(entity); + + if ("".equals(content)) { // returns null for empty body + return null; + } + + return objectMapper.readValue(content, valueType); + } else if (mimeType.toLowerCase().startsWith("text/")) { + // convert input stream to string + return (T) EntityUtils.toString(entity); } else { + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); throw new ApiException( "Deserialization for content type '" + mimeType + "' not supported for type '" + valueType + "'", - response.getStatusLine().getStatusCode(), + response.getCode(), responseHeaders, EntityUtils.toString(entity) ); } } - private File downloadFileFromResponse(HttpResponse response) throws IOException { + private File downloadFileFromResponse(CloseableHttpResponse response) throws IOException { Header contentDispositionHeader = response.getFirstHeader("Content-Disposition"); String contentDisposition = contentDispositionHeader == null ? null : contentDispositionHeader.getValue(); File file = prepareDownloadFile(contentDisposition); @@ -868,14 +919,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } /** - * Build full URL by concatenating base path, the given sub path and query parameters. + * Returns the URL of the client as defined by the server (if exists) or the base path. * - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL + * @return The URL for the client. */ - private String buildUrl(String path, List queryParams, List collectionQueryParams) { + public String getBaseURL() { String baseURL; if (serverIndex != null) { if (serverIndex < 0 || serverIndex >= servers.size()) { @@ -887,6 +935,20 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { baseURL = basePath; } + return baseURL; + } + + /** + * Build full URL by concatenating base URL, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param urlQueryDeepObject URL query string of the deep object parameters + * @return The full URL + */ + private String buildUrl(String path, List queryParams, List collectionQueryParams, String urlQueryDeepObject) { + String baseURL = getBaseURL(); final StringBuilder url = new StringBuilder(); url.append(baseURL).append(path); @@ -903,7 +965,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { url.append("&"); } String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + // query parameter value already escaped as part of parameterToPair + url.append(escapeString(param.getName())).append("=").append(value); } } } @@ -925,6 +988,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } + if (urlQueryDeepObject != null && urlQueryDeepObject.length() > 0) { + url.append(url.toString().contains("?") ? "&" : "?"); + url.append(urlQueryDeepObject); + } + return url.toString(); } @@ -943,13 +1011,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return cookie; } - protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException { - statusCode = response.getStatusLine().getStatusCode(); + protected T processResponse(CloseableHttpResponse response, TypeReference returnType) throws ApiException, IOException, ParseException { + int statusCode = response.getCode(); + lastStatusCodeByThread.put(Thread.currentThread().getId(), statusCode); if (statusCode == HttpStatus.SC_NO_CONTENT) { return null; } - responseHeaders = transformResponseHeaders(response.getAllHeaders()); + Map> responseHeaders = transformResponseHeaders(response.getHeaders()); + lastResponseHeadersByThread.put(Thread.currentThread().getId(), responseHeaders); + if (isSuccessfulStatus(statusCode)) { return this.deserialize(response, returnType); } else { @@ -966,6 +1037,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param method The request method, one of "GET", "POST", "PUT", and "DELETE" * @param queryParams The query parameters * @param collectionQueryParams The collection query parameters + * @param urlQueryDeepObject A URL query string for deep object parameters * @param body The request body object - if it is not binary, otherwise null * @param headerParams The header parameters * @param cookieParams The cookie parameters @@ -982,6 +1054,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String method, List queryParams, List collectionQueryParams, + String urlQueryDeepObject, Object body, Map headerParams, Map cookieParams, @@ -995,16 +1068,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - final String url = buildUrl(path, queryParams, collectionQueryParams); + final String url = buildUrl(path, queryParams, collectionQueryParams, urlQueryDeepObject); - RequestBuilder builder = RequestBuilder.create(method); + ClassicRequestBuilder builder = ClassicRequestBuilder.create(method); builder.setUri(url); - RequestConfig config = RequestConfig.custom() - .setConnectionRequestTimeout(connectionTimeout) - .build(); - builder.setConfig(config); - if (accept != null) { builder.addHeader("Accept", accept); } @@ -1038,11 +1106,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { throw new ApiException("method " + method + " does not support a request body"); } + } else { + // for empty body + builder.setEntity(new StringEntity("", contentTypeObj)); } try (CloseableHttpResponse response = httpClient.execute(builder.build(), context)) { return processResponse(response, returnType); - } catch (IOException e) { + } catch (IOException | ParseException e) { throw new ApiException(e); } } diff --git a/sdks/java-v2/templates/libraries/apache-httpclient/BaseApi.mustache b/sdks/java-v2/templates/libraries/apache-httpclient/BaseApi.mustache new file mode 100644 index 000000000..8b48de086 --- /dev/null +++ b/sdks/java-v2/templates/libraries/apache-httpclient/BaseApi.mustache @@ -0,0 +1,110 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import com.fasterxml.jackson.core.type.TypeReference; + +import java.util.Collections; +import java.util.Map; + +{{>generatedAnnotation}} +public abstract class BaseApi { + + protected ApiClient apiClient; + + public BaseApi() { + this(Configuration.getDefaultApiClient()); + } + + public BaseApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method) throws ApiException { + invokeAPI(url, method, null, null, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param additionalHeaders Additional headers for the request. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method, Map additionalHeaders) throws ApiException { + invokeAPI(url, method, null, null, additionalHeaders); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method, Object request) throws ApiException { + invokeAPI(url, method, request, null, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param additionalHeaders Additional headers for the request. + * @throws ApiException if fails to make API call. + */ + public void invokeAPI(String url, String method, Object request, Map additionalHeaders) throws ApiException { + invokeAPI(url, method, request, null, additionalHeaders); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param returnType The return type. + * @return The API response in the specified type. + * @throws ApiException if fails to make API call. + */ + public T invokeAPI(String url, String method, TypeReference returnType) throws ApiException { + return invokeAPI(url, method, null, returnType, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @return The API response in the specified type. + * @throws ApiException if fails to make API call. + */ + public T invokeAPI(String url, String method, Object request, TypeReference returnType) throws ApiException { + return invokeAPI(url, method, request, returnType, Collections.emptyMap()); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @param additionalHeaders Additional headers for the request. + * @return The API response in the specified type. + * @throws ApiException if fails to make API call. + */ + public abstract T invokeAPI(String url, String method, Object request, TypeReference returnType, Map additionalHeaders) throws ApiException; +} diff --git a/sdks/java-v2/templates/libraries/apache-httpclient/README.mustache b/sdks/java-v2/templates/libraries/apache-httpclient/README.mustache index 9082f626b..b50e7db08 100644 --- a/sdks/java-v2/templates/libraries/apache-httpclient/README.mustache +++ b/sdks/java-v2/templates/libraries/apache-httpclient/README.mustache @@ -8,6 +8,8 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} + {{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} {{#infoUrl}} @@ -20,7 +22,7 @@ Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ +1. Java 1.8+ 2. Maven/Gradle ## Installation @@ -158,11 +160,14 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}} @@ -170,10 +175,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth diff --git a/sdks/java-v2/templates/libraries/apache-httpclient/api.mustache b/sdks/java-v2/templates/libraries/apache-httpclient/api.mustache index 44122a1e0..27b456417 100644 --- a/sdks/java-v2/templates/libraries/apache-httpclient/api.mustache +++ b/sdks/java-v2/templates/libraries/apache-httpclient/api.mustache @@ -5,49 +5,75 @@ import com.fasterxml.jackson.core.type.TypeReference; import {{invokerPackage}}.ApiException; import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.BaseApi; import {{invokerPackage}}.Configuration; +{{#models.0}} import {{modelPackage}}.*; +{{/models.0}} import {{invokerPackage}}.Pair; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +import java.util.StringJoiner; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} {{>generatedAnnotation}} {{#operations}} -public class {{classname}} { - private ApiClient apiClient; +public class {{classname}} extends BaseApi { public {{classname}}() { - this(Configuration.getDefaultApiClient()); + super(Configuration.getDefaultApiClient()); } public {{classname}}(ApiClient apiClient) { - this.apiClient = apiClient; + super(apiClient); } - public ApiClient getApiClient() { - return apiClient; + {{#operation}} + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} + {{/allParams}} + {{#returnType}} + * @return {{returnType}} + {{/returnType}} + * @throws ApiException if fails to make API call + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{#returnType}}return {{/returnType}}this.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}Collections.emptyMap()); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - {{#operation}} /** * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} + * @param additionalHeaders additionalHeaders for this call {{#returnType}} * @return {{returnType}} {{/returnType}} @@ -63,7 +89,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Map additionalHeaders) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -75,21 +101,58 @@ public class {{classname}} { String localVarPath = "{{{path}}}"{{#pathParams}} .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; - // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#queryParams}} + {{#isDeepObject}} + localVarQueryParameterBaseName = "{{{baseName}}}"; + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + localVarQueryStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i))); + } + {{/isArray}} + {{^isArray}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}")); + {{/isArray}} + {{/isDeepObject}} + {{^isDeepObject}} + {{#isExplode}} + {{#hasVars}} + {{#vars}} + {{#isArray}} + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{^isArray}} + localVarQueryParams.addAll(apiClient.parameterToPair("{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{/vars}} + {{/hasVars}} + {{^hasVars}} + {{#isModel}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString()); + {{/isModel}} + {{^isModel}} + {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{/isModel}} + {{/hasVars}} + {{/isExplode}} + {{^isExplode}} {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{/isExplode}} + {{/isDeepObject}} {{/queryParams}} - {{#headerParams}}if ({{paramName}} != null) localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); {{/headerParams}} + localVarHeaderParams.putAll(additionalHeaders); + {{#cookieParams}}if ({{paramName}} != null) localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); {{/cookieParams}} @@ -121,6 +184,7 @@ public class {{classname}} { "{{httpMethod}}", localVarQueryParams, localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, localVarCookieParams, @@ -131,6 +195,49 @@ public class {{classname}} { {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}} ); } + + {{#-last}} + @Override + public T invokeAPI(String url, String method, Object request, TypeReference returnType, Map additionalHeaders) throws ApiException { + String localVarPath = url.replace(apiClient.getBaseURL(), ""); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarHeaderParams.putAll(additionalHeaders); + + final String[] localVarAccepts = { + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + + return apiClient.invokeAPI( + localVarPath, + method, + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + request, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + returnType + ); + } + {{/-last}} {{/operation}} } {{/operations}} diff --git a/sdks/java-v2/templates/libraries/apache-httpclient/api_test.mustache b/sdks/java-v2/templates/libraries/apache-httpclient/api_test.mustache index 8071e035f..b4393ea82 100644 --- a/sdks/java-v2/templates/libraries/apache-httpclient/api_test.mustache +++ b/sdks/java-v2/templates/libraries/apache-httpclient/api_test.mustache @@ -5,21 +5,26 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); diff --git a/sdks/java-v2/templates/libraries/apache-httpclient/build.gradle.mustache b/sdks/java-v2/templates/libraries/apache-httpclient/build.gradle.mustache index 5ae33f37e..f18581f08 100644 --- a/sdks/java-v2/templates/libraries/apache-httpclient/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/apache-httpclient/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -125,26 +113,22 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" - jackson_databind_version = "2.10.5.1" + swagger_annotations_version = "1.6.6" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} - httpclient_version = "4.5.13" + httpclient_version = "5.1.3" jodatime_version = "2.9.9" - junit_version = "4.13.1" + junit_version = "4.13.2" } dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation "org.apache.httpcomponents:httpclient:$httpclient_version" - implementation "org.apache.httpcomponents:httpmime:$httpclient_version" + implementation "org.apache.httpcomponents.client5:httpclient5:$httpclient_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" @@ -155,15 +139,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "junit:junit:$junit_version" } diff --git a/sdks/java-v2/templates/libraries/apache-httpclient/pom.mustache b/sdks/java-v2/templates/libraries/apache-httpclient/pom.mustache index 89c3f5ffa..74a70a3ea 100644 --- a/sdks/java-v2/templates/libraries/apache-httpclient/pom.mustache +++ b/sdks/java-v2/templates/libraries/apache-httpclient/pom.mustache @@ -43,8 +43,10 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.10.1 + 1.8 + 1.8 true 128m 512m @@ -58,7 +60,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.1.0 enforce-maven @@ -78,17 +80,17 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.2.5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods - pertest + 10 @@ -110,11 +112,10 @@ org.apache.maven.plugins maven-jar-plugin - 2.2 + 3.3.0 - jar test-jar @@ -126,7 +127,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.10 + 3.3.0 add_sources @@ -154,33 +155,13 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} - - org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.4.1 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -194,7 +175,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.2.1 attach-sources @@ -215,7 +196,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 sign-artifacts @@ -232,11 +213,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -248,13 +238,8 @@ - org.apache.httpcomponents - httpclient - ${httpclient-version} - - - org.apache.httpcomponents - httpmime + org.apache.httpcomponents.client5 + httpclient5 ${httpclient-version} @@ -272,78 +257,77 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} + {{^useJakartaEe}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + {{/useJakartaEe}} + {{#useJakartaEe}} + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{/useJakartaEe}} {{#withXml}} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + {{/withXml}} {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + {{/joda}} - {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} - {{^java8}} - - - com.brsanthu - migbase64 - 2.2 - - {{/java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + {{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + {{/useBeanValidation}} {{#performBeanValidation}} - - - org.hibernate - hibernate-validator - 5.4.1.Final - + + + org.hibernate + hibernate-validator + 5.4.3.Final + {{/performBeanValidation}} {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - + + + com.google.android + android + 4.1.1.4 + provided + {{/parcelableModel}} + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} jakarta.annotation jakarta.annotation-api @@ -352,25 +336,35 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.5.21 - 4.5.13 - 2.12.1 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 5.2.1 + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 1.0.0 - 4.13.1 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 5.10.2 diff --git a/sdks/java-v2/templates/libraries/feign/ApiClient.mustache b/sdks/java-v2/templates/libraries/feign/ApiClient.mustache index 5c4e78970..9a5b9bcd0 100644 --- a/sdks/java-v2/templates/libraries/feign/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/feign/ApiClient.mustache @@ -1,41 +1,47 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.LinkedHashMap; import java.util.Map; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.logging.Logger; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} +{{#jackson}} import feign.okhttp.OkHttpClient; - import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} +{{/jackson}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} +{{#jackson}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} +{{/jackson}} import feign.Feign; import feign.RequestInterceptor; import feign.form.FormEncoder; +{{#jackson}} import feign.jackson.JacksonDecoder; import feign.jackson.JacksonEncoder; +{{/jackson}} +{{#gson}} +import feign.gson.GsonDecoder; +import feign.gson.GsonEncoder; +{{/gson}} import feign.slf4j.Slf4jLogger; import {{invokerPackage}}.auth.HttpBasicAuth; import {{invokerPackage}}.auth.HttpBearerAuth; import {{invokerPackage}}.auth.ApiKeyAuth; +{{#jackson}} import {{invokerPackage}}.ApiResponseDecoder; +{{/jackson}} {{#hasOAuthMethods}} import {{invokerPackage}}.auth.ApiErrorDecoder; @@ -53,14 +59,17 @@ public class ApiClient { public interface Api {} + {{#jackson}} protected ObjectMapper objectMapper; + {{/jackson}} private String basePath = "{{{basePath}}}"; private Map apiAuthorizations; private Feign.Builder feignBuilder; public ApiClient() { - objectMapper = createObjectMapper(); apiAuthorizations = new LinkedHashMap(); + {{#jackson}} + objectMapper = createObjectMapper(); feignBuilder = Feign.builder() .client(new OkHttpClient()) .encoder(new FormEncoder(new JacksonEncoder(objectMapper))) @@ -70,6 +79,17 @@ public class ApiClient { .retryer(new Retryer.Default(0, 0, 2)) {{/hasOAuthMethods}} .logger(new Slf4jLogger()); + {{/jackson}} + {{#gson}} + feignBuilder = Feign.builder() + .encoder(new FormEncoder(new GsonEncoder())) + .decoder(new GsonDecoder()) + {{#hasOAuthMethods}} + .errorDecoder(new ApiErrorDecoder()) + .retryer(new Retryer.Default(0, 0, 2)) + {{/hasOAuthMethods}} + .logger(new Slf4jLogger()); + {{/gson}} } public ApiClient(String[] authNames) { @@ -77,26 +97,26 @@ public class ApiClient { for(String authName : authNames) { log.log(Level.FINE, "Creating authentication {0}", authName); {{#hasAuthMethods}} - RequestInterceptor auth; + RequestInterceptor auth = null; {{#authMethods}}if ("{{name}}".equals(authName)) { - {{#isBasic}} {{#isBasicBasic}} auth = new HttpBasicAuth(); {{/isBasicBasic}} - {{^isBasicBasic}} + {{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}} - {{/isBasic}} + {{/isBasicBearer}} {{#isApiKey}} auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); {{/isApiKey}} {{#isOAuth}} - auth = buildOauthRequestInterceptor(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); + auth = buildOauthRequestInterceptor(OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, "{{{authorizationUrl}}}", "{{{tokenUrl}}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - addAuthorization(authName, auth); + if (auth != null) { + addAuthorization(authName, auth); + } {{/hasAuthMethods}} {{^hasAuthMethods}} throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); @@ -148,6 +168,7 @@ public class ApiClient { return this; } + {{#jackson}} private ObjectMapper createObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); @@ -159,29 +180,21 @@ public class ApiClient { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); objectMapper.registerModule(jnm); {{/openApiNullable}} return objectMapper; } + {{/jackson}} {{#hasOAuthMethods}} private RequestInterceptor buildOauthRequestInterceptor(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { switch (flow) { - case password: + case PASSWORD: return new OauthPasswordGrant(tokenUrl, scopes); - case application: + case APPLICATION: return new OauthClientCredentialsGrant(authorizationUrl, tokenUrl, scopes); default: throw new RuntimeException("Oauth flow \"" + flow + "\" is not implemented"); @@ -189,6 +202,8 @@ public class ApiClient { } {{/hasOAuthMethods}} + + {{#jackson}} public ObjectMapper getObjectMapper(){ return objectMapper; } @@ -196,6 +211,7 @@ public class ApiClient { public void setObjectMapper(ObjectMapper objectMapper) { this.objectMapper = objectMapper; } + {{/jackson}} /** * Creates a feign client for given API interface. @@ -252,6 +268,15 @@ public class ApiClient { apiAuthorization.setBearerToken(bearerToken); } + /** + * Helper method to configure the supplier of bearer tokens. + * @param tokenSupplier the supplier of bearer tokens. + */ + public void setBearerToken(Supplier tokenSupplier) { + HttpBearerAuth apiAuthorization = getAuthorization(HttpBearerAuth.class); + apiAuthorization.setBearerToken(tokenSupplier); + } + /** * Helper method to configure the first api key found * @param apiKey API key @@ -274,8 +299,8 @@ public class ApiClient { {{#hasOAuthMethods}} /** * Helper method to configure the client credentials for Oauth - * @param username Username - * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setClientCredentials(String clientId, String clientSecret) { OauthClientCredentialsGrant authorization = getAuthorization(OauthClientCredentialsGrant.class); @@ -286,6 +311,8 @@ public class ApiClient { * Helper method to configure the username/password for Oauth password grant * @param username Username * @param password Password + * @param clientId Client ID + * @param clientSecret Client secret */ public void setOauthPassword(String username, String password, String clientId, String clientSecret) { OauthPasswordGrant apiAuthorization = getAuthorization(OauthPasswordGrant.class); @@ -314,7 +341,7 @@ public class ApiClient { /** * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Acesss token listener + * @param accessTokenListener Access token listener */ public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { OAuth apiAuthorization = getAuthorization(OAuth.class); diff --git a/sdks/java-v2/templates/libraries/feign/ApiResponseDecoder.mustache b/sdks/java-v2/templates/libraries/feign/ApiResponseDecoder.mustache index ef171de94..9062b648c 100644 --- a/sdks/java-v2/templates/libraries/feign/ApiResponseDecoder.mustache +++ b/sdks/java-v2/templates/libraries/feign/ApiResponseDecoder.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.databind.ObjectMapper; @@ -22,17 +24,16 @@ public class ApiResponseDecoder extends JacksonDecoder { @Override public Object decode(Response response, Type type) throws IOException { - Map> responseHeaders = Collections.unmodifiableMap(response.headers()); //Detects if the type is an instance of the parameterized class ApiResponse - Type responseBodyType; - if (Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { + if (type instanceof ParameterizedType && Types.getRawType(type).isAssignableFrom(ApiResponse.class)) { //The ApiResponse class has a single type parameter, the Dto class itself - responseBodyType = ((ParameterizedType) type).getActualTypeArguments()[0]; + Type responseBodyType = ((ParameterizedType) type).getActualTypeArguments()[0]; Object body = super.decode(response, responseBodyType); - return new ApiResponse(response.status(), responseHeaders, body); + Map> responseHeaders = Collections.unmodifiableMap(response.headers()); + return new ApiResponse<>(response.status(), responseHeaders, body); } else { //The response is not encapsulated in the ApiResponse, decode the Dto as normal return super.decode(response, type); } } -} \ No newline at end of file +} diff --git a/sdks/java-v2/templates/libraries/feign/EncodingUtils.mustache b/sdks/java-v2/templates/libraries/feign/EncodingUtils.mustache index 705eb6aa9..2312fc631 100644 --- a/sdks/java-v2/templates/libraries/feign/EncodingUtils.mustache +++ b/sdks/java-v2/templates/libraries/feign/EncodingUtils.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.UnsupportedEncodingException; diff --git a/sdks/java-v2/templates/libraries/feign/ParamExpander.mustache b/sdks/java-v2/templates/libraries/feign/ParamExpander.mustache index 2f5095d00..88f0ae22c 100644 --- a/sdks/java-v2/templates/libraries/feign/ParamExpander.mustache +++ b/sdks/java-v2/templates/libraries/feign/ParamExpander.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import feign.Param; diff --git a/sdks/java-v2/templates/libraries/feign/additional_properties.mustache b/sdks/java-v2/templates/libraries/feign/additional_properties.mustache new file mode 100644 index 000000000..8e7182792 --- /dev/null +++ b/sdks/java-v2/templates/libraries/feign/additional_properties.mustache @@ -0,0 +1,45 @@ +{{#additionalPropertiesType}} + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public {{{.}}} getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } +{{/additionalPropertiesType}} diff --git a/sdks/java-v2/templates/libraries/feign/api.mustache b/sdks/java-v2/templates/libraries/feign/api.mustache index c49407000..af05d6595 100644 --- a/sdks/java-v2/templates/libraries/feign/api.mustache +++ b/sdks/java-v2/templates/libraries/feign/api.mustache @@ -10,12 +10,15 @@ import {{modelPackage}}.ApiResponse; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import feign.*; {{>generatedAnnotation}} @@ -44,12 +47,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ -{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", -{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} +{{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", +{{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); /** * {{summary}} @@ -74,12 +77,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ -{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", -{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} +{{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", +{{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#hasQueryParams}} @@ -119,12 +122,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ -{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", -{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} +{{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", +{{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); + {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams); /** * {{summary}} @@ -159,12 +162,12 @@ public interface {{classname}} extends ApiClient.Api { {{/isDeprecated}} @RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}") @Headers({ - {{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}", - {{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}} + {{#vendorExtensions.x-content-type}} "Content-Type: {{vendorExtensions.x-content-type}}", + {{/vendorExtensions.x-content-type}} "Accept: {{#vendorExtensions.x-accepts}}{{.}}{{^-last}},{{/-last}}{{/vendorExtensions.x-accepts}}",{{#headerParams}} "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); + ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams); /** diff --git a/sdks/java-v2/templates/libraries/feign/api_test.mustache b/sdks/java-v2/templates/libraries/feign/api_test.mustache index a7f5bb0b3..1db841158 100644 --- a/sdks/java-v2/templates/libraries/feign/api_test.mustache +++ b/sdks/java-v2/templates/libraries/feign/api_test.mustache @@ -6,13 +6,18 @@ import {{invokerPackage}}.ApiClient; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.BeforeEach; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/sdks/java-v2/templates/libraries/feign/auth/ApiErrorDecoder.mustache b/sdks/java-v2/templates/libraries/feign/auth/ApiErrorDecoder.mustache index da87f2563..aeea7f97e 100644 --- a/sdks/java-v2/templates/libraries/feign/auth/ApiErrorDecoder.mustache +++ b/sdks/java-v2/templates/libraries/feign/auth/ApiErrorDecoder.mustache @@ -1,5 +1,9 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; +import java.util.Date; + import feign.Response; import feign.RetryableException; import feign.codec.ErrorDecoder; @@ -18,7 +22,7 @@ public class ApiErrorDecoder implements ErrorDecoder { Exception httpException = defaultErrorDecoder.decode(methodKey, response); if (response.status() == 401 || response.status() == 403) { return new RetryableException(response.status(), "Received status " + response.status() + " trying to renew access token", - response.request().httpMethod(), httpException, null, response.request()); + response.request().httpMethod(), httpException, (Date) null, response.request()); } return httpException; } diff --git a/sdks/java-v2/templates/libraries/feign/auth/ApiKeyAuth.mustache b/sdks/java-v2/templates/libraries/feign/auth/ApiKeyAuth.mustache index c03fe5c0b..bf7e32c1a 100644 --- a/sdks/java-v2/templates/libraries/feign/auth/ApiKeyAuth.mustache +++ b/sdks/java-v2/templates/libraries/feign/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import feign.RequestInterceptor; diff --git a/sdks/java-v2/templates/libraries/feign/auth/DefaultApi20Impl.mustache b/sdks/java-v2/templates/libraries/feign/auth/DefaultApi20Impl.mustache index 72b0a0049..0c178ae6a 100644 --- a/sdks/java-v2/templates/libraries/feign/auth/DefaultApi20Impl.mustache +++ b/sdks/java-v2/templates/libraries/feign/auth/DefaultApi20Impl.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.builder.api.DefaultApi20; diff --git a/sdks/java-v2/templates/libraries/feign/auth/HttpBasicAuth.mustache b/sdks/java-v2/templates/libraries/feign/auth/HttpBasicAuth.mustache index c308131e8..d95589b6f 100644 --- a/sdks/java-v2/templates/libraries/feign/auth/HttpBasicAuth.mustache +++ b/sdks/java-v2/templates/libraries/feign/auth/HttpBasicAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import feign.RequestInterceptor; diff --git a/sdks/java-v2/templates/libraries/feign/auth/HttpBearerAuth.mustache b/sdks/java-v2/templates/libraries/feign/auth/HttpBearerAuth.mustache index 2240a5518..466c1b2ad 100644 --- a/sdks/java-v2/templates/libraries/feign/auth/HttpBearerAuth.mustache +++ b/sdks/java-v2/templates/libraries/feign/auth/HttpBearerAuth.mustache @@ -1,14 +1,18 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import feign.RequestInterceptor; import feign.RequestTemplate; +import java.util.Optional; +import java.util.function.Supplier; /** * An interceptor that adds the request header needed to use HTTP bearer authentication. */ public class HttpBearerAuth implements RequestInterceptor { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -16,21 +20,35 @@ public class HttpBearerAuth implements RequestInterceptor { /** * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void apply(RequestTemplate template) { - if(bearerToken == null) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { return; } diff --git a/sdks/java-v2/templates/libraries/feign/auth/OAuth.mustache b/sdks/java-v2/templates/libraries/feign/auth/OAuth.mustache index e60829656..8309a1f75 100644 --- a/sdks/java-v2/templates/libraries/feign/auth/OAuth.mustache +++ b/sdks/java-v2/templates/libraries/feign/auth/OAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.model.OAuth2AccessToken; @@ -10,6 +12,9 @@ import java.util.Collection; {{>generatedAnnotation}} public abstract class OAuth implements RequestInterceptor { + //https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4 + static final int LEEWAY_SECONDS = 10; + static final int MILLIS_PER_SECOND = 1000; public interface AccessTokenListener { @@ -17,7 +22,7 @@ public abstract class OAuth implements RequestInterceptor { } private volatile String accessToken; - private Long expirationTimeMillis; + private Long expirationTimeSeconds; private AccessTokenListener accessTokenListener; protected OAuth20Service service; @@ -39,6 +44,7 @@ public abstract class OAuth implements RequestInterceptor { } String accessToken = getAccessToken(); if (accessToken != null) { + template.removeHeader("Authorization"); template.header("Authorization", "Bearer " + accessToken); } } @@ -73,7 +79,7 @@ public abstract class OAuth implements RequestInterceptor { public synchronized String getAccessToken() { // If first time, get the token - if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { + if (expirationTimeSeconds == null || System.currentTimeMillis() >= expirationTimeSeconds * MILLIS_PER_SECOND) { updateAccessToken(); } return accessToken; @@ -86,7 +92,7 @@ public abstract class OAuth implements RequestInterceptor { */ public synchronized void setAccessToken(String accessToken, Integer expiresIn) { this.accessToken = accessToken; - this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; + this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SECONDS; } -} \ No newline at end of file +} diff --git a/sdks/java-v2/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache b/sdks/java-v2/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache index ef22c2116..3b8c3421a 100644 --- a/sdks/java-v2/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache +++ b/sdks/java-v2/templates/libraries/feign/auth/OauthClientCredentialsGrant.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.builder.ServiceBuilder; @@ -21,7 +23,7 @@ public class OauthClientCredentialsGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.application; + return OAuthFlow.APPLICATION; } /** diff --git a/sdks/java-v2/templates/libraries/feign/auth/OauthPasswordGrant.mustache b/sdks/java-v2/templates/libraries/feign/auth/OauthPasswordGrant.mustache index 870c3755a..b51ee9161 100644 --- a/sdks/java-v2/templates/libraries/feign/auth/OauthPasswordGrant.mustache +++ b/sdks/java-v2/templates/libraries/feign/auth/OauthPasswordGrant.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import com.github.scribejava.core.builder.ServiceBuilder; @@ -24,7 +26,7 @@ public class OauthPasswordGrant extends OAuth { @Override protected OAuthFlow getFlow() { - return OAuthFlow.password; + return OAuthFlow.PASSWORD; } /** @@ -45,4 +47,4 @@ public class OauthPasswordGrant extends OAuth { .defaultScope(scopes) .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); } -} \ No newline at end of file +} diff --git a/sdks/java-v2/templates/libraries/feign/build.gradle.mustache b/sdks/java-v2/templates/libraries/feign/build.gradle.mustache index c9bf7c357..8af1cb136 100644 --- a/sdks/java-v2/templates/libraries/feign/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/feign/build.gradle.mustache @@ -57,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -101,17 +101,16 @@ test { } ext { - swagger_annotations_version = "1.5.24" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + swagger_annotations_version = "1.6.11" + {{#jackson}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + {{/jackson}} {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} - feign_version = "10.11" + feign_version = "10.12" feign_form_version = "3.8.0" junit_version = "5.7.0" scribejava_version = "8.0.0" @@ -121,25 +120,24 @@ dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.github.openfeign:feign-core:$feign_version" + {{#jackson}} implementation "io.github.openfeign:feign-jackson:$feign_version" + {{/jackson}} implementation "io.github.openfeign:feign-slf4j:$feign_version" implementation "io.github.openfeign:feign-okhttp:$feign_version" implementation "io.github.openfeign.form:feign-form:$feign_form_version" + {{#jackson}} + {{#joda}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" + {{/joda}} implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{/jackson}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#joda}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" - {{/joda}} - {{#java8}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} implementation "com.brsanthu:migbase64:2.2" implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" @@ -147,7 +145,7 @@ dependencies { testImplementation "org.junit.jupiter:junit-jupiter:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" - testImplementation "com.github.tomakehurst:wiremock-jre8:2.27.2" + testImplementation "com.github.tomakehurst:wiremock-jre8:2.35.1" testImplementation "org.hamcrest:hamcrest:2.2" testImplementation "commons-io:commons-io:2.8.0" testImplementation "ch.qos.logback:logback-classic:1.2.3" diff --git a/sdks/java-v2/templates/libraries/feign/build.sbt.mustache b/sdks/java-v2/templates/libraries/feign/build.sbt.mustache index f2912f0df..9af32c270 100644 --- a/sdks/java-v2/templates/libraries/feign/build.sbt.mustache +++ b/sdks/java-v2/templates/libraries/feign/build.sbt.mustache @@ -9,24 +9,28 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", + "io.swagger" % "swagger-annotations" % "1.6.11" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", - "io.github.openfeign" % "feign-core" % "10.11" % "compile", - "io.github.openfeign" % "feign-jackson" % "10.11" % "compile", - "io.github.openfeign" % "feign-slf4j" % "10.11" % "compile", + "io.github.openfeign" % "feign-core" % "10.12" % "compile", +{{#jackson}} + "io.github.openfeign" % "feign-jackson" % "10.12" % "compile", +{{/jackson}} + "io.github.openfeign" % "feign-slf4j" % "10.12" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", - "io.github.openfeign" % "feign-okhttp" % "10.11" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}" % "2.9.10" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", + "io.github.openfeign" % "feign-okhttp" % "10.12" % "compile", +{{#jackson}} + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile", +{{/jackson}} "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % "test", "org.junit.jupiter" % "junit-jupiter-params" % "5.7.0" % "test", - "com.github.tomakehurst" % "wiremock-jre8" % "2.27.2" % "test", + "com.github.tomakehurst" % "wiremock-jre8" % "2.35.1" % "test", "org.hamcrest" % "hamcrest" % "2.2" % "test", "commons-io" % "commons-io" % "2.8.0" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/sdks/java-v2/templates/libraries/feign/model.mustache b/sdks/java-v2/templates/libraries/feign/model.mustache new file mode 100644 index 000000000..5fa9bca80 --- /dev/null +++ b/sdks/java-v2/templates/libraries/feign/model.mustache @@ -0,0 +1,78 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#useReflectionEqualsHashCode}} +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +{{/useReflectionEqualsHashCode}} +{{#models}} +{{#model}} +{{#additionalPropertiesType}} +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +{{/additionalPropertiesType}} +{{/model}} +{{/models}} +import java.util.Objects; +import java.util.Arrays; +{{#imports}} +import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.annotation.*; +{{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jackson}} +{{#withXml}} +import {{javaxPackage}}.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.adapters.*; +import io.github.threetenjaxb.core.*; +{{/withXml}} +{{#jsonb}} +import java.lang.reflect.Type; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{javaxPackage}}.json.bind.serializer.DeserializationContext; +import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer; +import {{javaxPackage}}.json.bind.serializer.JsonbSerializer; +import {{javaxPackage}}.json.bind.serializer.SerializationContext; +import {{javaxPackage}}.json.stream.JsonGenerator; +import {{javaxPackage}}.json.stream.JsonParser; +import {{javaxPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{javaxPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} +{{#parcelableModel}} +import android.os.Parcelable; +import android.os.Parcel; +{{/parcelableModel}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} +{{#performBeanValidation}} +import org.hibernate.validator.constraints.*; +{{/performBeanValidation}} +{{#supportUrlQuery}} +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; +{{/supportUrlQuery}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#vendorExtensions.x-is-one-of-interface}}{{>oneof_interface}}{{/vendorExtensions.x-is-one-of-interface}}{{^vendorExtensions.x-is-one-of-interface}}{{>pojo}}{{/vendorExtensions.x-is-one-of-interface}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/sdks/java-v2/templates/libraries/feign/model/ApiResponse.mustache b/sdks/java-v2/templates/libraries/feign/model/ApiResponse.mustache index bc460dc59..9c9b10746 100644 --- a/sdks/java-v2/templates/libraries/feign/model/ApiResponse.mustache +++ b/sdks/java-v2/templates/libraries/feign/model/ApiResponse.mustache @@ -1,19 +1,21 @@ +{{>licenseInfo}} + package {{modelPackage}}; import java.util.Map; -import java.util.List; +import java.util.Collection; public class ApiResponse{ final private int statusCode; - final private Map> headers; + final private Map> headers; final private T data; /** * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response */ - public ApiResponse(int statusCode, Map> headers) { + public ApiResponse(int statusCode, Map> headers) { this(statusCode, headers, null); } @@ -22,7 +24,7 @@ public class ApiResponse{ * @param headers The headers of HTTP response * @param data The object deserialized from response bod */ - public ApiResponse(int statusCode, Map> headers, T data) { + public ApiResponse(int statusCode, Map> headers, T data) { this.statusCode = statusCode; this.headers = headers; this.data = data; @@ -32,7 +34,7 @@ public class ApiResponse{ return statusCode; } - public Map> getHeaders() { + public Map> getHeaders() { return headers; } diff --git a/sdks/java-v2/templates/libraries/feign/model_test.mustache b/sdks/java-v2/templates/libraries/feign/model_test.mustache index 0d75e120b..2759ff525 100644 --- a/sdks/java-v2/templates/libraries/feign/model_test.mustache +++ b/sdks/java-v2/templates/libraries/feign/model_test.mustache @@ -6,13 +6,6 @@ package {{package}}; {{/imports}} import org.junit.jupiter.api.Test; -{{#fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} - /** * Model tests for {{classname}} */ diff --git a/sdks/java-v2/templates/libraries/feign/pojo.mustache b/sdks/java-v2/templates/libraries/feign/pojo.mustache new file mode 100644 index 000000000..fe97e3b1b --- /dev/null +++ b/sdks/java-v2/templates/libraries/feign/pojo.mustache @@ -0,0 +1,580 @@ +/** + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + */{{#isDeprecated}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +{{#isClassnameSanitized}} +{{^hasDiscriminatorWithNonEmptyMapping}} +@JsonTypeName("{{name}}") +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/isClassnameSanitized}} +{{/jackson}} +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +{{#serializableModel}} + private static final long serialVersionUID = 1L; + +{{/serializableModel}} + {{#vars}} + {{#isEnum}} + {{^isContainer}} +{{>modelInnerEnum}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>modelInnerEnum}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + {{#gson}} + public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; + {{/gson}} + {{#jackson}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; + {{/jackson}} + {{#withXml}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{^isXmlAttribute}} + {{#isDateTime}} + @XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class) + {{/isDateTime}} + {{/isXmlAttribute}} + {{/withXml}} + {{#gson}} + @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) + {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{/isContainer}} + {{^isContainer}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} + {{^isContainer}} + {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{/vars}} + public {{classname}}() { + {{#parent}} + {{#parcelableModel}} + super();{{/parcelableModel}} + {{/parent}} + {{#gson}} + {{#discriminator}} + {{#discriminator.isEnum}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator.isEnum}} + {{/discriminator}} + {{/gson}} + } + {{#vendorExtensions.x-has-readonly-properties}} + {{^withXml}} + + {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} + public {{classname}}( + {{#readOnlyVars}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; + {{/readOnlyVars}} + } + {{/withXml}} + {{/vendorExtensions.x-has-readonly-properties}} + {{#vars}} + + {{^isReadOnly}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = {{name}};{{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); + } + try { + this.{{name}}.get().add({{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; + } + this.{{name}}.add({{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); + } + try { + this.{{name}}.get().put(key, {{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; + } + {{/required}} + this.{{name}}.put(key, {{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isMap}} + + {{/isReadOnly}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + */ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#required}} +{{#isNullable}} + @{{javaxPackage}}.annotation.Nullable +{{/isNullable}} +{{^isNullable}} + @{{javaxPackage}}.annotation.Nonnull +{{/isNullable}} +{{/required}} +{{^required}} + @{{javaxPackage}}.annotation.Nullable +{{/required}} +{{#jsonb}} + @JsonbProperty("{{baseName}}") +{{/jsonb}} +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} +{{#vendorExtensions.x-is-jackson-optional-nullable}} + {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} + @JsonIgnore +{{/vendorExtensions.x-is-jackson-optional-nullable}} +{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} + public {{{datatypeWithEnum}}} {{getter}}() { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} + if ({{name}} == null) { + {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + } + {{/isReadOnly}} + return {{name}}.orElse(null); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + return {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + + {{#vendorExtensions.x-is-jackson-optional-nullable}} +{{> jackson_annotations}} + public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { + return {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} + this.{{name}} = {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{^isReadOnly}} +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isReadOnly}} + + {{/vars}} +{{>libraries/feign/additional_properties}} + @Override + public boolean equals(Object o) { + {{#useReflectionEqualsHashCode}} + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} && + {{/-last}}{{/vars}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public int hashCode() { + {{#useReflectionEqualsHashCode}} + return HashCodeBuilder.reflectionHashCode(this); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}} + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + {{/parent}} + {{#vars}} + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); + {{/vars}} + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#allVars}} + // add `{{baseName}}` to the URL query string + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{items.dataType}} _item : {{getter}}()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{items.dataType}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{items.dataType}} _item : {{getter}}()) { + if (_item != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isPrimitiveType}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + {{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + if ({{getter}}().get(_key) != null) { + joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isPrimitiveType}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if ({{getter}}() != null) { + joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + + {{/allVars}} + return joiner.toString(); + } +{{/supportUrlQuery}} +{{#parcelableModel}} + + public void writeToParcel(Parcel out, int flags) { +{{#model}} +{{#isArray}} + out.writeList(this); +{{/isArray}} +{{^isArray}} +{{#parent}} + super.writeToParcel(out, flags); +{{/parent}} +{{#vars}} + out.writeValue({{name}}); +{{/vars}} +{{/isArray}} +{{/model}} + } + + {{classname}}(Parcel in) { +{{#isArray}} + in.readTypedList(this, {{arrayModelType}}.CREATOR); +{{/isArray}} +{{^isArray}} +{{#parent}} + super(in); +{{/parent}} +{{#vars}} +{{#isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); +{{/isPrimitiveType}} +{{/vars}} +{{/isArray}} + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public {{classname}} createFromParcel(Parcel in) { +{{#model}} +{{#isArray}} + {{classname}} result = new {{classname}}(); + result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); + return result; +{{/isArray}} +{{^isArray}} + return new {{classname}}(in); +{{/isArray}} +{{/model}} + } + public {{classname}}[] newArray(int size) { + return new {{classname}}[size]; + } + }; +{{/parcelableModel}} + +} diff --git a/sdks/java-v2/templates/libraries/feign/pom.mustache b/sdks/java-v2/templates/libraries/feign/pom.mustache index f57614c58..9be4a094f 100644 --- a/sdks/java-v2/templates/libraries/feign/pom.mustache +++ b/sdks/java-v2/templates/libraries/feign/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 3.0.0-M4 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -158,7 +158,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none 1.8 @@ -213,11 +213,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -232,11 +241,20 @@ feign-core ${feign-version} + {{#jackson}} io.github.openfeign feign-jackson ${feign-version} + {{/jackson}} + {{#gson}} + + io.github.openfeign + feign-gson + ${feign-version} + + {{/gson}} io.github.openfeign feign-slf4j @@ -253,6 +271,7 @@ ${feign-version} + {{#jackson}} com.fasterxml.jackson.core @@ -269,6 +288,14 @@ jackson-databind ${jackson-databind-version} + {{/jackson}} + {{#gson}} + + com.google.code.gson + gson + ${gson-version} + + {{/gson}} {{#openApiNullable}} org.openapitools @@ -291,20 +318,13 @@ ${jackson-version} {{/joda}} - {{#java8}} + {{#jackson}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} + {{/jackson}} com.github.scribejava scribejava-core @@ -316,12 +336,21 @@ ${jakarta-annotation-version} provided + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} ch.qos.logback logback-classic - 1.2.3 + 1.3.13 test @@ -345,13 +374,7 @@ com.github.tomakehurst wiremock-jre8 - 2.27.2 - test - - - commons-io - commons-io - 2.8.0 + 2.35.1 test @@ -360,20 +383,35 @@ 1.8 ${java.version} ${java.version} - 1.5.24 - 10.11 + {{#swagger1AnnotationLibrary}} + 1.6.11 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 13.2.1 3.8.0 - 2.10.3 + {{#jackson}} + 2.17.1 + 2.17.1 + {{/jackson}} + {{#gson}} + 2.10.1 + {{/gson}} {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} - 2.10.3 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 - 5.7.0 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 5.10.0 1.0.0 - 8.0.0 + 8.3.3 diff --git a/sdks/java-v2/templates/libraries/google-api-client/ApiClient.mustache b/sdks/java-v2/templates/libraries/google-api-client/ApiClient.mustache index aa91362ba..03c44a8ed 100644 --- a/sdks/java-v2/templates/libraries/google-api-client/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/google-api-client/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import {{apiPackage}}.*; @@ -10,15 +12,7 @@ import org.openapitools.jackson.nullable.JsonNullableModule; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.google.api.client.googleapis.util.Utils; import com.google.api.client.http.AbstractHttpContent; import com.google.api.client.http.HttpRequestFactory; @@ -46,16 +40,7 @@ public class ApiClient { {{#joda}} objectMapper.registerModule(new JodaModule()); {{/joda}} - {{#java8}} objectMapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - objectMapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); objectMapper.registerModule(jnm); diff --git a/sdks/java-v2/templates/libraries/google-api-client/api.mustache b/sdks/java-v2/templates/libraries/google-api-client/api.mustache index 97b1dd688..6ca6a2811 100644 --- a/sdks/java-v2/templates/libraries/google-api-client/api.mustache +++ b/sdks/java-v2/templates/libraries/google-api-client/api.mustache @@ -14,7 +14,7 @@ import com.google.api.client.http.HttpMethods; import com.google.api.client.http.HttpResponse; import com.google.api.client.json.Json; -import javax.ws.rs.core.UriBuilder; +import {{javaxPackage}}.ws.rs.core.UriBuilder; import java.io.IOException; import java.util.Collection; import java.util.HashMap; @@ -121,7 +121,7 @@ public class {{classname}} { String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isMethodPutOrPatchOrPost}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isMethodPutOrPatchOrPost}}{{^isMethodPutOrPatchOrPost}}null{{/isMethodPutOrPatchOrPost}}; + HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); }{{#bodyParam}} @@ -199,7 +199,7 @@ public class {{classname}} { String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isMethodPutOrPatchOrPost}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isMethodPutOrPatchOrPost}}{{^isMethodPutOrPatchOrPost}}null{{/isMethodPutOrPatchOrPost}}; + HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); } diff --git a/sdks/java-v2/templates/libraries/google-api-client/api_test.mustache b/sdks/java-v2/templates/libraries/google-api-client/api_test.mustache index 1dc2f174f..bfb939f95 100644 --- a/sdks/java-v2/templates/libraries/google-api-client/api_test.mustache +++ b/sdks/java-v2/templates/libraries/google-api-client/api_test.mustache @@ -4,26 +4,26 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.io.IOException; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} /** * API tests for {{classname}} */ -@Ignore public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); - {{#operations}}{{#operation}} + {{#operations}} + {{#operation}} /** * {{summary}} * @@ -37,9 +37,12 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // uncomment below to test the API function + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } - {{/operation}}{{/operations}} + + {{/operation}} + {{/operations}} } diff --git a/sdks/java-v2/templates/libraries/google-api-client/build.gradle.mustache b/sdks/java-v2/templates/libraries/google-api-client/build.gradle.mustache index 6341f0271..c87983171 100644 --- a/sdks/java-v2/templates/libraries/google-api-client/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/google-api-client/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -110,19 +98,16 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.12.5" - jackson_databind_version = "2.10.5.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" google_api_client_version = "1.32.2" jersey_common_version = "2.25.1" jodatime_version = "2.9.9" - junit_version = "4.13.1" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} + junit_version = "4.13.2" } dependencies { @@ -137,16 +122,11 @@ dependencies { {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" - {{/threetenbp}} {{#withXml}} implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" {{/withXml}} diff --git a/sdks/java-v2/templates/libraries/google-api-client/build.sbt.mustache b/sdks/java-v2/templates/libraries/google-api-client/build.sbt.mustache index 721b638dd..78da21f2e 100644 --- a/sdks/java-v2/templates/libraries/google-api-client/build.sbt.mustache +++ b/sdks/java-v2/templates/libraries/google-api-client/build.sbt.mustache @@ -12,23 +12,18 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.22", "com.google.api-client" % "google-api-client" % "1.23.0", "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.12.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", {{#withXml}} "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.9.10" % "compile", {{/withXml}} {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", {{/joda}} - {{#java8}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - {{/threetenbp}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "junit" % "junit" % "4.13.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/sdks/java-v2/templates/libraries/google-api-client/pom.mustache b/sdks/java-v2/templates/libraries/google-api-client/pom.mustache index 81e0ee465..97c5123e9 100644 --- a/sdks/java-v2/templates/libraries/google-api-client/pom.mustache +++ b/sdks/java-v2/templates/libraries/google-api-client/pom.mustache @@ -63,17 +63,16 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods - pertest @@ -144,28 +143,17 @@ maven-compiler-plugin 3.6.1 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + 1.8 + 1.8 org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -217,11 +205,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -254,7 +251,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} {{#openApiNullable}} @@ -271,13 +268,11 @@ ${jackson-version} {{/withXml}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype @@ -290,13 +285,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} jakarta.annotation jakarta.annotation-api @@ -306,30 +294,37 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.5.22 - 1.32.2 - 2.25.1 - 2.12.1 - 2.10.5.1 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.2.0 + 2.40 + 2.17.1 + 2.17.1 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} 1.0.0 - 4.13.1 + 5.10.2 diff --git a/sdks/java-v2/templates/libraries/jersey2/AbstractOpenApiSchema.mustache b/sdks/java-v2/templates/libraries/jersey2/AbstractOpenApiSchema.mustache index 00253ccee..d92c85e26 100644 --- a/sdks/java-v2/templates/libraries/jersey2/AbstractOpenApiSchema.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/AbstractOpenApiSchema.mustache @@ -6,14 +6,14 @@ import {{invokerPackage}}.ApiException; import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.GenericType; import com.fasterxml.jackson.annotation.JsonValue; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} +{{>generatedAnnotation}} public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/sdks/java-v2/templates/libraries/jersey2/ApiClient.mustache b/sdks/java-v2/templates/libraries/jersey2/ApiClient.mustache index d5835c19b..09563afa7 100644 --- a/sdks/java-v2/templates/libraries/jersey2/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/ApiClient.mustache @@ -1,15 +1,17 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; +import {{javaxPackage}}.ws.rs.client.Client; +import {{javaxPackage}}.ws.rs.client.ClientBuilder; +import {{javaxPackage}}.ws.rs.client.Entity; +import {{javaxPackage}}.ws.rs.client.Invocation; +import {{javaxPackage}}.ws.rs.client.WebTarget; +import {{javaxPackage}}.ws.rs.core.Form; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.Response.Status; {{#hasOAuthMethods}} import com.github.scribejava.core.model.OAuth2AccessToken; @@ -38,6 +40,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -45,18 +48,16 @@ import java.util.Collections; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.Stream; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import java.net.URLEncoder; @@ -79,87 +80,98 @@ import {{invokerPackage}}.auth.ApiKeyAuth; import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} -import com.dropbox.sign.model.ErrorResponse; - /** *

ApiClient class.

*/ {{>generatedAnnotation}} public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { - protected Map defaultHeaderMap = new HashMap(); - protected Map defaultCookieMap = new HashMap(); + private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); protected String basePath = "{{{basePath}}}"; protected String userAgent; private static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList( -{{/-first}} new ServerConfiguration( - "{{{url}}}", - "{{{description}}}{{^description}}No description provided{{/description}}", - new HashMap(){{#variables}}{{#-first}} {{ -{{/-first}} put("{{{name}}}", new ServerVariable( - "{{{description}}}{{^description}}No description provided{{/description}}", - "{{{defaultValue}}}", - new HashSet( - {{#enumValues}} - {{#-first}} - Arrays.asList( - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ) - {{/-last}} - {{/enumValues}} - ) - )); - {{#-last}} - }}{{/-last}}{{/variables}} - ){{^-last}},{{/-last}} + protected List servers = new ArrayList<>({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} {{#-last}} ){{/-last}}{{/servers}}); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ + {{^hasOperationServers}} + protected Map> operationServers = new HashMap<>(); + {{/hasOperationServers}} + {{#hasOperationServers}} + protected Map> operationServers; + + { + Map> operationServers = new HashMap<>(); {{#apiInfo}} {{#apis}} {{#operations}} {{#operation}} {{#servers}} {{#-first}} - put("{{{classname}}}.{{{operationId}}}", new ArrayList(Arrays.asList( + operationServers.put("{{{classname}}}.{{{operationId}}}", new ArrayList<>(Arrays.asList( {{/-first}} - new ServerConfiguration( - "{{{url}}}", - "{{{description}}}{{^description}}No description provided{{/description}}", - new HashMap(){{#variables}}{{#-first}} {{ -{{/-first}} put("{{{name}}}", new ServerVariable( - "{{{description}}}{{^description}}No description provided{{/description}}", - "{{{defaultValue}}}", - new HashSet( - {{#enumValues}} - {{#-first}} - Arrays.asList( - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ) - {{/-last}} - {{/enumValues}} - ) - )); - {{#-last}} - }}{{/-last}}{{/variables}} - ){{^-last}},{{/-last}} + new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} {{#-last}} - )));{{/-last}} + ))); + {{/-last}} {{/servers}} {{/operation}} {{/operations}} {{/apis}} {{/apiInfo}} - }}; - protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + this.operationServers = operationServers; + } + + {{/hasOperationServers}} + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; protected ClientConfig clientConfig; protected int connectionTimeout = 0; @@ -196,7 +208,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); + authentications = new HashMap<>(); Authentication auth = null; {{#authMethods}} if (authMap != null) { @@ -234,7 +246,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (auth instanceof OAuth) { authentications.put("{{name}}", auth); } else { - authentications.put("{{name}}", new OAuth(basePath, "{{tokenUrl}}")); + authentications.put("{{name}}", new OAuth(basePath, "{{{tokenUrl}}}")); } {{/isOAuth}} {{/authMethods}} @@ -242,7 +254,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { authentications = Collections.unmodifiableMap(authentications); // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} + authenticationLookup = new HashMap<>();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} authenticationLookup.put("{{name}}", "{{.}}");{{/vendorExtensions.x-auth-id-alias}}{{/authMethods}} } @@ -258,7 +270,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Getter for the field httpClient.

* - * @return a {@link javax.ws.rs.client.Client} object. + * @return a {@link {{javaxPackage}}.ws.rs.client.Client} object. */ public Client getHttpClient() { return httpClient; @@ -267,8 +279,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Setter for the field httpClient.

* - * @param httpClient a {@link javax.ws.rs.client.Client} object. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -288,7 +300,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -311,7 +323,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -332,7 +344,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -353,7 +365,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -400,7 +412,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -416,7 +428,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -432,7 +444,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { @@ -448,7 +460,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to configure authentications which respects aliases of API keys. * * @param secrets Hash map from authentication name to its secret. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient configureApiKeys(Map secrets) { for (Map.Entry authEntry : authentications.entrySet()) { @@ -456,9 +468,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (auth instanceof ApiKeyAuth) { String name = authEntry.getKey(); // respect x-auth-id-alias property - name = authenticationLookup.containsKey(name) ? authenticationLookup.get(name) : name; - if (secrets.containsKey(name)) { - ((ApiKeyAuth) auth).setApiKey(secrets.get(name)); + name = authenticationLookup.getOrDefault(name, name); + String secret = secrets.get(name); + if (secret != null) { + ((ApiKeyAuth) auth).setApiKey(secret); } } } @@ -469,7 +482,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key prefix for the first API key authentication. * * @param apiKeyPrefix API key prefix - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKeyPrefix(String apiKeyPrefix) { for (Authentication auth : authentications.values()) { @@ -485,7 +498,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -502,7 +515,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -519,7 +532,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -531,12 +544,28 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + /** * Helper method to set the password flow for the first OAuth2 authentication. * * @param username the user name * @param password the user password - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -552,7 +581,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -568,7 +597,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -585,7 +614,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -607,7 +636,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The header's key * @param value The header's value - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -619,7 +648,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -639,7 +668,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -661,7 +690,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -685,7 +714,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -707,7 +736,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -730,7 +759,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -751,7 +780,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -797,9 +826,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return formatDate((Date) param); } {{#jsr310}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/jsr310}}else if (param instanceof Collection) { + } {{/jsr310}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -820,14 +849,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return List of pairs */ public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); + List params = new ArrayList<>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; @@ -879,14 +908,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json - * "* / *" is also default to JSON + * "*{@literal /}*" is also considered JSON by this method. * * @param mime MIME * @return True if the MIME type is JSON */ public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); } /** @@ -898,8 +926,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return The Accept header to use. If the given array is empty, * null will be returned (not to set the Accept header explicitly). */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { return null; } for (String accept : accepts) { @@ -919,8 +947,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return The Content-Type header to use. If the given array is empty, * JSON will be used. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { @@ -964,7 +992,17 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { File file = (File) param.getValue(); FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) .fileName(file.getName()).size(file.length()).build(); - multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); + + // Attempt to probe the content type for the file so that the form part is more correctly + // and precisely identified, but fall back to application/octet-stream if that fails. + MediaType type; + try { + type = MediaType.valueOf(Files.probeContentType(file.toPath())); + } catch (IOException | IllegalArgumentException e) { + type = MediaType.APPLICATION_OCTET_STREAM_TYPE; + } + + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type)); } else { FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); @@ -1058,11 +1096,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return file; } - String contentType = null; - List contentTypes = response.getHeaders().get("Content-Type"); - if (contentTypes != null && !contentTypes.isEmpty()) - contentType = String.valueOf(contentTypes.get(0)); - // read the entity stream multiple times response.bufferEntity(); @@ -1089,7 +1122,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Prepare the file for download from the response.

* - * @param response a {@link javax.ws.rs.core.Response} object. + * @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object. * @return a {@link java.io.File} object. * @throws java.io.IOException if any. */ @@ -1164,14 +1197,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { boolean isBodyNullable) throws ApiException { - // Not using `.target(targetURL).path(path)` below, - // to support (constant) query string in `path`, e.g. "/posts?draft=1" String targetURL; - if (serverIndex != null && operationServers.containsKey(operation)) { - Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex; - Map variables = operationServerVariables.containsKey(operation) ? - operationServerVariables.get(operation) : serverVariables; - List serverConfigurations = operationServers.get(operation); + List serverConfigurations; + if (serverIndex != null && (serverConfigurations = operationServers.get(operation)) != null) { + int index = operationServerIndex.getOrDefault(operation, serverIndex).intValue(); + Map variables = operationServerVariables.getOrDefault(operation, serverVariables); if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( @@ -1182,6 +1212,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { targetURL = this.basePath + path; } + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" WebTarget target = httpClient.target(targetURL); if (queryParams != null) { @@ -1192,11 +1224,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } - Invocation.Builder invocationBuilder; + Invocation.Builder invocationBuilder = target.request(); + if (accept != null) { - invocationBuilder = target.request().accept(accept); - } else { - invocationBuilder = target.request(); + invocationBuilder = invocationBuilder.accept(accept); } for (Entry entry : cookieParams.entrySet()) { @@ -1219,15 +1250,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { Map allHeaderParams = new HashMap<>(defaultHeaderMap); allHeaderParams.putAll(headerParams); - // update different parameters (e.g. headers) for authentication - updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + {{#hasHttpSignatureMethods}} + serializeToString(body, formParams, contentType, isBodyNullable), + {{/hasHttpSignatureMethods}} + {{^hasHttpSignatureMethods}} + null, + {{/hasHttpSignatureMethods}} + method, + target.getUri()); + } for (Entry entry : allHeaderParams.entrySet()) { String value = entry.getValue(); @@ -1241,9 +1279,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { try { response = sendRequest(method, invocationBuilder, entity); + final int statusCode = response.getStatusInfo().getStatusCode(); + {{#hasOAuthMethods}} // If OAuth is used and a status 401 is received, renew the access token and retry the request - if (response.getStatusInfo() == Status.UNAUTHORIZED) { + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { for (String authName : authNames) { Authentication authentication = authentications.get(authName); if (authentication instanceof OAuth) { @@ -1259,10 +1299,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } {{/hasOAuthMethods}} - int statusCode = response.getStatusInfo().getStatusCode(); Map> responseHeaders = buildResponseHeaders(response); - if (response.getStatusInfo() == Status.NO_CONTENT) { + if (statusCode == Status.NO_CONTENT.getStatusCode()) { return new ApiResponse(statusCode, responseHeaders); } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { if (returnType == null) { @@ -1273,23 +1312,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { String message = "error"; String respBody = null; - ErrorResponse errorResponse = null; if (response.hasEntity()) { try { - if (response.getStatusInfo().getFamily() == Status.Family.CLIENT_ERROR) { - errorResponse = response.readEntity(ErrorResponse.class); - respBody = errorResponse.toString(); - message = respBody; - } else { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; - } + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; } catch (RuntimeException e) { // e.printStackTrace(); } } throw new ApiException( - response.getStatus(), message, buildResponseHeaders(response), respBody, errorResponse); + response.getStatus(), message, buildResponseHeaders(response), respBody); } } finally { try { @@ -1335,8 +1367,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { clientConfig = getDefaultClientConfig(); ClientBuilder clientBuilder = ClientBuilder.newBuilder(); - customizeClientBuilder(clientBuilder); clientBuilder = clientBuilder.withConfig(clientConfig); + customizeClientBuilder(clientBuilder); return clientBuilder.build(); } @@ -1380,7 +1412,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * To completely disable certificate validation (at your own risk), you can * override this method and invoke disableCertificateValidation(clientBuilder). * - * @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object. + * @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object. */ protected void customizeClientBuilder(ClientBuilder clientBuilder) { // No-op extension point @@ -1392,7 +1424,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Please note that trusting all certificates is extremely risky. * This may be useful in a development environment with self-signed certificates. * - * @param clientBuilder a {@link javax.ws.rs.client.ClientBuilder} object. + * @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object. * @throws java.security.KeyManagementException if any. * @throws java.security.NoSuchAlgorithmException if any. */ @@ -1419,14 +1451,14 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { /** *

Build the response headers.

* - * @param response a {@link javax.ws.rs.core.Response} object. + * @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object. * @return a {@link java.util.Map} of response headers. */ protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); + Map> responseHeaders = new HashMap<>(); for (Entry> entry: response.getHeaders().entrySet()) { List values = entry.getValue(); - List headers = new ArrayList(); + List headers = new ArrayList<>(); for (Object o : values) { headers.add(String.valueOf(o)); } diff --git a/sdks/java-v2/templates/libraries/jersey2/JSON.mustache b/sdks/java-v2/templates/libraries/jersey2/JSON.mustache index f132a312b..97cee6394 100644 --- a/sdks/java-v2/templates/libraries/jersey2/JSON.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/JSON.mustache @@ -1,23 +1,17 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -27,40 +21,31 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.ext.ContextResolver; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; {{>generatedAnnotation}} public class JSON implements ContextResolver { private ObjectMapper mapper; public JSON() { - mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - JsonMapper.builder().configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} - mapper.registerModule(new JavaTimeModule()); - {{/java8}} - {{#joda}} - mapper.registerModule(new JodaModule()); - {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} - {{#openApiNullable}} - JsonNullableModule jnm = new JsonNullableModule(); - mapper.registerModule(jnm); - {{/openApiNullable}} + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + {{#joda}} + .addModule(new JodaModule()) + {{/joda}} + {{#openApiNullable}} + .addModule(new JsonNullableModule()) + {{/openApiNullable}} + .build(); } /** @@ -93,7 +78,7 @@ public class JSON implements ContextResolver { public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); + return cdm.getClassForElement(node, new HashSet<>()); } return null; } @@ -113,7 +98,7 @@ public class JSON implements ContextResolver { ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { modelClass = cls; discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); + discriminatorMappings = new HashMap<>(); if (mappings != null) { discriminatorMappings.putAll(mappings); } @@ -197,6 +182,7 @@ public class JSON implements ContextResolver { */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. return true; } if (visitedClasses.contains(modelClass)) { @@ -207,9 +193,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -221,12 +207,12 @@ public class JSON implements ContextResolver { /** * A map of discriminators for all model classes. */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap, Map>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -246,7 +232,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/sdks/java-v2/templates/libraries/jersey2/additional_properties.mustache b/sdks/java-v2/templates/libraries/jersey2/additional_properties.mustache index 61973dc24..2955e9392 100644 --- a/sdks/java-v2/templates/libraries/jersey2/additional_properties.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/additional_properties.mustache @@ -13,7 +13,7 @@ @JsonAnySetter public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + this.additionalProperties = new HashMap<>(); } this.additionalProperties.put(key, value); return this; diff --git a/sdks/java-v2/templates/libraries/jersey2/anyof_model.mustache b/sdks/java-v2/templates/libraries/jersey2/anyof_model.mustache index d5b381987..d480667f3 100644 --- a/sdks/java-v2/templates/libraries/jersey2/anyof_model.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/anyof_model.mustache @@ -1,5 +1,5 @@ -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.Response; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; @@ -24,7 +24,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -57,7 +57,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. @@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -134,7 +134,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); {{#mappedModels}} mappings.put("{{mappingName}}", {{modelName}}.class); {{/mappedModels}} @@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } @@ -166,7 +166,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/isNullable}} {{#anyOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } diff --git a/sdks/java-v2/templates/libraries/jersey2/api.mustache b/sdks/java-v2/templates/libraries/jersey2/api.mustache index dc965e199..8d3e62f27 100644 --- a/sdks/java-v2/templates/libraries/jersey2/api.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/api.mustache @@ -6,18 +6,22 @@ import {{invokerPackage}}.ApiResponse; import {{invokerPackage}}.Configuration; import {{invokerPackage}}.Pair; -import javax.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.GenericType; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} {{>generatedAnnotation}} {{#operations}} public class {{classname}} { @@ -86,8 +90,6 @@ public class {{classname}} { } {{/vendorExtensions.x-group-parameters}} - __OVERLOAD_DELIMITER { "class": "{{classname}}", "method": "{{operationId}}", "returnType": "{{#returnType}}{{.}}{{/returnType}}", "parameters": [ {{#allParams}}{ "type": "{{{dataType}}}", "name": "{{paramName}}", "required": {{#required}}true{{/required}}{{^required}}false{{/required}}, "value": {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}"{{/isString}}{{{.}}}{{#isString}}"{{/isString}}{{/defaultValue}} }{{^-last}},{{/-last}}{{/allParams}} ]} - {{^vendorExtensions.x-group-parameters}} /** * {{summary}} @@ -118,72 +120,90 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#allParams}}{{^required}}{{#defaultValue}} - if ({{paramName}} == null) { - {{paramName}} = {{#isString}}"{{/isString}}{{{defaultValue}}}{{#isString}}"{{/isString}}; - }{{/defaultValue}}{{/required}}{{/allParams}} - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set + {{#hasRequiredParams}} + // Check required parameters + {{#allParams}} + {{#required}} if ({{paramName}} == null) { throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); } - {{/required}}{{/allParams}} - // create path and map variables - String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + {{/required}} + {{/allParams}} - // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + {{/hasRequiredParams}} + {{#hasPathParams}} + // Path parameters + String localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + {{/hasPathParams}} {{#queryParams}} + {{#-first}} + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}}) + ); + {{/-first}} + {{^-first}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/-first}} + {{#-last}} + + {{/-last}} {{/queryParams}} + {{#headerParams}} + {{#-first}} + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#headerParams}}if ({{paramName}} != null) - localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/headerParams}} + {{#cookieParams}} + {{#-first}} + // Cookie parameters + Map localVarCookieParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#cookieParams}}if ({{paramName}} != null) - localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/cookieParams}} + {{#formParams}} + {{#-first}} + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarFormParams.put("{{baseName}}", {{paramName}});{{^required}} + }{{/required}} + {{#-last}} - {{#formParams}}if ({{paramName}} != null) - localVarFormParams.put("{{baseName}}", {{paramName}}); + {{/-last}} {{/formParams}} - - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - - localVarFormParams = {{#bodyParam}}{{paramName}}.createFormData(){{/bodyParam}}{{^bodyParam}}new {{javaUtilPrefix}}HashMap(){{/bodyParam}}; - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - + String localVarAccept = apiClient.selectHeaderAccept({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}); + String localVarContentType = apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); + {{#hasAuthMethods}} + String[] localVarAuthNames = {{=% %=}}new String[] {%#authMethods%"%name%"%^-last%, %/-last%%/authMethods%};%={{ }}=% + {{/hasAuthMethods}} {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; - {{/returnType}} - return apiClient.invokeAPI("{{classname}}.{{operationId}}", localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); + return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); } {{#vendorExtensions.x-group-parameters}} public class API{{operationId}}Request { {{#allParams}} - private {{#isRequired}}final {{/isRequired}}{{{dataType}}} {{paramName}}; + private {{{dataType}}} {{paramName}}; {{/allParams}} private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) { diff --git a/sdks/java-v2/templates/libraries/jersey2/apiException.mustache b/sdks/java-v2/templates/libraries/jersey2/apiException.mustache index 84b4567c9..d10322379 100644 --- a/sdks/java-v2/templates/libraries/jersey2/apiException.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/apiException.mustache @@ -2,7 +2,6 @@ package {{invokerPackage}}; -import com.dropbox.sign.model.ErrorResponse; import java.util.Map; import java.util.List; {{#caseInsensitiveResponseHeaders}} @@ -15,10 +14,11 @@ import java.util.TreeMap; */ {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - private ErrorResponse errorResponse; public ApiException() {} @@ -72,11 +72,6 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us this.responseBody = responseBody; } - public ApiException(int code, String message, Map> responseHeaders, String responseBody, ErrorResponse errorResponse) { - this(code, message, responseHeaders, responseBody); - this.errorResponse = errorResponse; - } - /** * Get the HTTP status code. * @@ -103,8 +98,4 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } - - public ErrorResponse getErrorResponse() { - return errorResponse; - } } diff --git a/sdks/java-v2/templates/libraries/jersey2/api_doc.mustache b/sdks/java-v2/templates/libraries/jersey2/api_doc.mustache index 3994b56bc..26c98508e 100644 --- a/sdks/java-v2/templates/libraries/jersey2/api_doc.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/api_doc.mustache @@ -4,9 +4,9 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} @@ -28,15 +28,74 @@ Method | HTTP request | Description ### Example ```java -REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Java_CODE +{{#vendorExtensions.x-java-import}} +import {{.}}; +{{/vendorExtensions.x-java-import}} +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.model.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{^vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} + .execute(); + {{/vendorExtensions.x-group-parameters}} + {{#returnType}} + System.out.println(result); + {{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} ``` ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type diff --git a/sdks/java-v2/templates/libraries/jersey2/api_test.mustache b/sdks/java-v2/templates/libraries/jersey2/api_test.mustache index c325e3d1e..7b8214bd4 100644 --- a/sdks/java-v2/templates/libraries/jersey2/api_test.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/api_test.mustache @@ -6,18 +6,21 @@ import {{invokerPackage}}.*; import {{invokerPackage}}.auth.*; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ @@ -28,12 +31,15 @@ public class {{classname}}Test { {{#operations}} {{#operation}} /** + {{#summary}} * {{summary}} * + {{/summary}} + {{#notes}} * {{notes}} * - * @throws ApiException - * if the Api call fails + {{/notes}} + * @throws ApiException if the Api call fails */ @Test public void {{operationId}}Test() throws ApiException { diff --git a/sdks/java-v2/templates/libraries/jersey2/auth/HttpBasicAuth.mustache b/sdks/java-v2/templates/libraries/jersey2/auth/HttpBasicAuth.mustache index 898bb97ee..13cecfa90 100644 --- a/sdks/java-v2/templates/libraries/jersey2/auth/HttpBasicAuth.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/auth/HttpBasicAuth.mustache @@ -5,22 +5,13 @@ package {{invokerPackage}}.auth; import {{invokerPackage}}.Pair; import {{invokerPackage}}.ApiException; -{{^java8}} -import com.migcomponents.migbase64.Base64; -{{/java8}} -{{#java8}} import java.util.Base64; import java.nio.charset.StandardCharsets; -{{/java8}} import java.net.URI; import java.util.Map; import java.util.List; -{{^java8}} -import java.io.UnsupportedEncodingException; -{{/java8}} - {{>generatedAnnotation}} public class HttpBasicAuth implements Authentication { private String username; @@ -48,15 +39,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); -{{^java8}} - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } -{{/java8}} -{{#java8}} headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); -{{/java8}} } } diff --git a/sdks/java-v2/templates/libraries/jersey2/auth/OAuth.mustache b/sdks/java-v2/templates/libraries/jersey2/auth/OAuth.mustache index 62b573a66..6617522ed 100644 --- a/sdks/java-v2/templates/libraries/jersey2/auth/OAuth.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/auth/OAuth.mustache @@ -10,7 +10,7 @@ import com.github.scribejava.core.exceptions.OAuthException; import com.github.scribejava.core.model.OAuth2AccessToken; import com.github.scribejava.core.oauth.OAuth20Service; -import javax.ws.rs.core.UriBuilder; +import {{javaxPackage}}.ws.rs.core.UriBuilder; import java.io.IOException; import java.net.MalformedURLException; import java.net.URI; @@ -26,7 +26,7 @@ public class OAuth implements Authentication { private String tokenUrl; private String absoluteTokenUrl; - private OAuthFlow flow = OAuthFlow.application; + private OAuthFlow flow = OAuthFlow.APPLICATION; private OAuth20Service service; private DefaultApi20 authApi; private String scope; @@ -99,22 +99,22 @@ public class OAuth implements Authentication { return service.refreshAccessToken(refreshToken); } } catch (OAuthException | InterruptedException | ExecutionException | IOException e) { - log.log(Level.FINE, "Refreshing the access token using the refresh token failed", e); + throw new ApiException("Refreshing the access token using the refresh token failed: " + e.toString()); } try { switch (flow) { - case password: + case PASSWORD: if (username != null && password != null) { accessToken = service.getAccessTokenPasswordGrant(username, password, scope); } break; - case accessCode: + case ACCESS_CODE: if (code != null) { accessToken = service.getAccessToken(code); code = null; } break; - case application: + case APPLICATION: accessToken = service.getAccessTokenClientCredentialsGrant(scope); break; default: @@ -158,15 +158,28 @@ public class OAuth implements Authentication { return this; } + public OAuth setCredentialsForPublicClient(String clientId, Boolean debug) { + if (Boolean.TRUE.equals(debug)) { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe().debug() + .build(authApi); + } else { + service = new ServiceBuilder(clientId) + .apiSecretIsEmptyStringUnsafe() + .build(authApi); + } + return this; + } + public OAuth usePasswordFlow(String username, String password) { - this.flow = OAuthFlow.password; + this.flow = OAuthFlow.PASSWORD; this.username = username; this.password = password; return this; } public OAuth useAuthorizationCodeFlow(String code) { - this.flow = OAuthFlow.accessCode; + this.flow = OAuthFlow.ACCESS_CODE; this.code = code; return this; } diff --git a/sdks/java-v2/templates/libraries/jersey2/auth/OAuthFlow.mustache b/sdks/java-v2/templates/libraries/jersey2/auth/OAuthFlow.mustache index 002e9572f..190781fb1 100644 --- a/sdks/java-v2/templates/libraries/jersey2/auth/OAuthFlow.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/auth/OAuthFlow.mustache @@ -2,6 +2,12 @@ package {{invokerPackage}}.auth; +/** + * OAuth flows that are supported by this client + */ public enum OAuthFlow { - accessCode, implicit, password, application + ACCESS_CODE, + IMPLICIT, + PASSWORD, + APPLICATION } diff --git a/sdks/java-v2/templates/libraries/jersey2/build.gradle.mustache b/sdks/java-v2/templates/libraries/jersey2/build.gradle.mustache index 76671e774..a9ab96231 100644 --- a/sdks/java-v2/templates/libraries/jersey2/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/build.gradle.mustache @@ -1,144 +1,125 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' + +group = '{{groupId}}' +version = '{{artifactVersion}}' + buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' } } -plugins { - id 'com.vanniktech.maven.publish' version '0.24.0' +repositories { + mavenCentral() } -apply plugin: 'java' -apply plugin: 'maven-publish' -apply plugin: 'com.diffplug.spotless' -apply plugin: 'signing' +if(hasProperty('target') && target == 'android') { -group = '{{groupId}}' -archivesBaseName = '{{artifactId}}' -version = '{{artifactVersion}}' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' -repositories { - mavenCentral() -} + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } -if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { - // disable the crazy super-strict doclint tool in Java 8 - //noinspection SpellCheckingInspection - options.addStringOption('Xdoclint:none', '-quiet') + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } } -} -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc -} + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource -} + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } -task fatJar(type: Jar) { - classifier = 'all' - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - from { - configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } + artifacts { + archives sourcesJar } - with jar -} -processResources { - expand(project.properties) -} +} else { -artifacts { - archives javadocJar, sourcesJar, fatJar -} + apply plugin: 'java' + apply plugin: 'maven-publish' + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 -publishing { - publications { - mavenJava(MavenPublication) { - pom { - name = 'Dropbox Sign' - packaging = 'jar' - // optionally artifactId can be defined here - artifactId = '{{artifactId}}' - description = 'Use the Dropbox SIgn Java SDK to connect your Java app to Dropbox Sign\'s service in microseconds!' - url = 'https://www.hellosign.com/' - - scm { - connection = '{{scmConnection}}' - developerConnection = '{{scmDeveloperConnection}}' - url = '{{scmUrl}}' - } + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' - licenses { - license { - name = '{{licenseName}}' - url = 'http://www.opensource.org/licenses/mit-license.php' - } - } - - developers { - developer { - name = '{{developerName}}' - email = '{{developerEmail}}' - url = 'https://www.hellosign.com' - } - } + from components.java } } } - repositories { - maven { - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username findProperty('ossrhUsername') - password findProperty('ossrhPassword') - } - } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath } } ext { - swagger_annotations_version = "1.6.3" - jackson_version = "2.13.0" - jackson_databind_version = "2.13.0" + swagger_annotations_version = "1.6.5" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" + {{#useBeanValidation}} + bean_validation_version = "3.0.2" + {{/useBeanValidation}} jersey_version = "2.35" - junit_version = "4.13.2" - {{#threetenbp}} - threetenbp_version = "2.9.10" - {{/threetenbp}} + junit_version = "5.8.2" {{#hasOAuthMethods}} scribejava_apis_version = "8.3.1" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} tomitribe_http_signatures_version = "1.7" {{/hasHttpSignatureMethods}} - mockito_version = "3.12.4" } dependencies { implementation "io.swagger:swagger-annotations:$swagger_annotations_version" - implementation 'commons-codec:commons-codec:1.15' implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "org.glassfish.jersey.core:jersey-client:$jersey_version" implementation "org.glassfish.jersey.inject:jersey-hk2:$jersey_version" @@ -154,24 +135,23 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#hasOAuthMethods}} implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" {{/hasHttpSignatureMethods}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" - {{/threetenbp}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" - testImplementation "org.mockito:mockito-core:$mockito_version" + {{#useBeanValidation}} + implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + {{/useBeanValidation}} + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + useJUnitPlatform() } javadoc { diff --git a/sdks/java-v2/templates/libraries/jersey2/build.sbt.mustache b/sdks/java-v2/templates/libraries/jersey2/build.sbt.mustache index d296ad4df..d055cf378 100644 --- a/sdks/java-v2/templates/libraries/jersey2/build.sbt.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/build.sbt.mustache @@ -9,28 +9,22 @@ lazy val root = (project in file(".")). Compile / packageDoc / publishArtifact := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - libraryDependencies += "commons-codec" % "commons-codec" % "1.15" "com.google.code.findbugs" % "jsr305" % "3.0.0", - "io.swagger" % "swagger-annotations" % "1.6.3", + "io.swagger" % "swagger-annotations" % "1.6.5", "org.glassfish.jersey.core" % "jersey-client" % "2.35", "org.glassfish.jersey.inject" % "jersey-hk2" % "2.35", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.35", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.35", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.35", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.0" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile", {{/joda}} - {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", - {{/threetenbp}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", {{/openApiNullable}} {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", @@ -38,11 +32,7 @@ lazy val root = (project in file(".")). {{#hasHttpSignatureMethods}} "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", {{/hasHttpSignatureMethods}} - {{^java8}} - "com.brsanthu" % "migbase64" % "2.2", - {{/java8}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.2" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/sdks/java-v2/templates/libraries/jersey2/model.mustache b/sdks/java-v2/templates/libraries/jersey2/model.mustache index c5abf57e6..1904ee40e 100644 --- a/sdks/java-v2/templates/libraries/jersey2/model.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/model.mustache @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; {{/model}} {{/models}} import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; {{#imports}} @@ -28,8 +27,6 @@ import java.io.Serializable; {{/serializableModel}} {{#jackson}} import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.ObjectMapper; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.*; {{/withXml}} @@ -38,15 +35,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} -import javax.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.*; {{/withXml}} {{#parcelableModel}} import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/sdks/java-v2/templates/libraries/jersey2/model_test.mustache b/sdks/java-v2/templates/libraries/jersey2/model_test.mustache new file mode 100644 index 000000000..acd659b66 --- /dev/null +++ b/sdks/java-v2/templates/libraries/jersey2/model_test.mustache @@ -0,0 +1,44 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for {{classname}} + */ +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/sdks/java-v2/templates/libraries/jersey2/oneof_model.mustache b/sdks/java-v2/templates/libraries/jersey2/oneof_model.mustache index 18bcbc5e1..09906d7b0 100644 --- a/sdks/java-v2/templates/libraries/jersey2/oneof_model.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/oneof_model.mustache @@ -1,5 +1,5 @@ -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.Response; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; @@ -26,7 +26,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -60,7 +60,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#useOneOfDiscriminatorLookup}} {{#discriminator}} {{classname}} new{{classname}} = new {{classname}}(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); switch (discriminatorValue) { {{#mappedModels}} @@ -78,37 +78,74 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + {{#composedSchemas}} {{#oneOf}} - // deserialize {{{.}}} + // deserialize {{{dataType}}}{{#isNullable}} (nullable){{/isNullable}} try { + {{^isArray}} boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if ({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class) || {{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class) || {{{.}}}.class.equals(Boolean.class) || {{{.}}}.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= (({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= (({{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= ({{{.}}}.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= ({{{.}}}.class.equals(String.class) && token == JsonToken.VALUE_STRING); - {{#isNullable}} - attemptParsing |= (token == JsonToken.VALUE_NULL); - {{/isNullable}} - } + {{#isPrimitiveType}} + attemptParsing = typeCoercion; //respect type coercion setting + if (!attemptParsing) { + {{#isString}} + attemptParsing |= (token == JsonToken.VALUE_STRING); + {{/isString}} + {{#isInteger}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isInteger}} + {{#isLong}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isLong}} + {{#isShort}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isShort}} + {{#isFloat}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isFloat}} + {{#isDouble}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDouble}} + {{#isNumber}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isNumber}} + {{#isDecimal}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDecimal}} + {{#isBoolean}} + attemptParsing |= (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + {{/isBoolean}} + {{#isNullable}} + attemptParsing |= (token == JsonToken.VALUE_NULL); + {{/isNullable}} } + {{/isPrimitiveType}} if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs({{{dataType}}}.class); // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON // validation, which means the 'match' count may be higher than it should be. match++; - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); } + {{/isArray}} + {{#isArray}} + if (token == JsonToken.START_ARRAY) { + final TypeReference<{{{dataType}}}> ref = new TypeReference<{{{dataType}}}>(){}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(ref); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); + } + {{/isArray}} } catch (Exception e) { // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); } {{/oneOf}} + {{/composedSchemas}} if (match == 1) { {{classname}} ret = new {{classname}}(); ret.setActualInstance(deserialized); @@ -132,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -152,13 +189,17 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); } {{/additionalPropertiesType}} + {{#composedSchemas}} {{#oneOf}} - public {{classname}}({{{.}}} o) { + {{^vendorExtensions.x-duplicated-data-type}} + public {{classname}}({{{baseType}}} o) { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); setActualInstance(o); } + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} + {{/composedSchemas}} static { {{#oneOf}} schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { @@ -167,7 +208,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas)); {{#discriminator}} // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); + Map> mappings = new HashMap<>(); {{#mappedModels}} mappings.put("{{mappingName}}", {{modelName}}.class); {{/mappedModels}} @@ -177,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } @@ -198,13 +239,17 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/isNullable}} + {{#composedSchemas}} {{#oneOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) { + {{^vendorExtensions.x-duplicated-data-type}} + if (JSON.isInstanceOf({{{baseType}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} + {{/composedSchemas}} throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); } @@ -219,17 +264,26 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return super.getActualInstance(); } + {{#composedSchemas}} {{#oneOf}} /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, * the ClassCastException will be thrown. * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); + {{^isArray}} + public {{{dataType}}} get{{{dataType}}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); } + {{/isArray}} + {{#isArray}} + public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/isArray}} {{/oneOf}} + {{/composedSchemas}} } diff --git a/sdks/java-v2/templates/libraries/jersey2/pojo.mustache b/sdks/java-v2/templates/libraries/jersey2/pojo.mustache index 4dea6caae..06be4ddf2 100644 --- a/sdks/java-v2/templates/libraries/jersey2/pojo.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/pojo.mustache @@ -1,19 +1,32 @@ -import com.dropbox.sign.ApiException; /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} - {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) -@JsonIgnoreProperties(ignoreUnknown=true) +{{#isClassnameSanitized}} +@JsonTypeName("{{name}}") +{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -39,44 +52,36 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); {{/isContainer}} {{^isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; - {{/isContainer}} - {{^isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; - {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} @@ -93,24 +98,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} }{{/jackson}}{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public {{classname}} init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, {{classname}}.class); - } - - static public {{classname}} init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - {{classname}}.class - ); - } {{#vars}} {{^isReadOnly}} @@ -120,6 +110,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens )); {{/vendorExtensions.x-enum-as-string}} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) { @@ -135,18 +128,12 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} return this; } - {{#vendorExtensions.x-int-or-string}} - public {{classname}} {{name}}(Integer {{name}}) { - this.{{name}} = String.valueOf({{name}}); - return this; - } - {{/vendorExtensions.x-int-or-string}} {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -156,11 +143,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -168,10 +153,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -181,11 +166,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -193,7 +176,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -210,22 +193,30 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} {{#required}} {{#isNullable}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/isNullable}} {{^isNullable}} - @javax.annotation.Nonnull + @{{javaxPackage}}.annotation.Nonnull {{/isNullable}} {{/required}} {{^required}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/required}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -262,6 +253,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^isReadOnly}} + {{#deprecated}} + @Deprecated + {{/deprecated}} {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} {{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} @@ -277,12 +271,6 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens this.{{name}} = {{name}}; {{/vendorExtensions.x-is-jackson-optional-nullable}} } - {{#vendorExtensions.x-int-or-string}} - - public void {{setter}}(Integer {{name}}) { - this.{{name}} = String.valueOf({{name}}); - } - {{/vendorExtensions.x-int-or-string}} {{/isReadOnly}} {{/vars}} @@ -340,7 +328,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} {{#additionalPropertiesType}} sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -349,61 +337,6 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return sb.toString(); } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - {{#parent}} - map.putAll(super.createFormData()); - {{/parent}} - try { - {{#vars}} - if ({{name}} != null) { - if (isFileTypeOrListOfFiles({{name}})) { - fileTypeFound = true; - } - - if ({{name}}.getClass().equals(java.io.File.class) || - {{name}}.getClass().equals(Integer.class) || - {{name}}.getClass().equals(String.class) || - {{name}}.getClass().isEnum()) { - map.put("{{baseName}}", {{name}}); - } else if (isListOfFile({{name}})) { - for(int i = 0; i< getListSize({{name}}); i++) { - map.put("{{baseName}}[" + i + "]", getFromList({{name}}, i)); - } - } - else { - map.put("{{baseName}}", JSON.getDefault().getMapper().writeValueAsString({{name}})); - } - } - {{/vars}} - } 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). @@ -456,7 +389,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return 0; } - public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<>() { public {{classname}} createFromParcel(Parcel in) { {{#model}} {{#isArray}} @@ -475,14 +408,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens }; {{/parcelableModel}} {{#discriminator}} -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - {{#mappedModels}} - mappings.put("{{mappingName}}", {{modelName}}.class); - {{/mappedModels}} - mappings.put("{{name}}", {{classname}}.class); - JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); -} + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + {{#mappedModels}} + mappings.put("{{mappingName}}", {{modelName}}.class); + {{/mappedModels}} + mappings.put("{{name}}", {{classname}}.class); + JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); + } {{/discriminator}} } diff --git a/sdks/java-v2/templates/libraries/jersey2/pom.mustache b/sdks/java-v2/templates/libraries/jersey2/pom.mustache index 15bae375e..214d3ce2b 100644 --- a/sdks/java-v2/templates/libraries/jersey2/pom.mustache +++ b/sdks/java-v2/templates/libraries/jersey2/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 3.0.0-M5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -91,27 +91,11 @@ - - maven-assembly-plugin - - - package - - single - - - - - - jar-with-dependencies - - - org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.2.2 @@ -125,7 +109,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add_sources @@ -156,7 +140,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.10.1 1.8 1.8 @@ -172,7 +156,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.3.2 attach-javadocs @@ -257,7 +241,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 sign-artifacts @@ -274,17 +258,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} - + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} - commons-codec - commons-codec - 1.15 + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + {{/swagger2AnnotationLibrary}} @@ -358,13 +345,6 @@ jackson-datatype-jsr310 ${jackson-version} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#hasHttpSignatureMethods}} org.tomitribe @@ -401,40 +381,40 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test - - org.mockito - mockito-core - ${mockito.version} - test - UTF-8 - 1.6.3 - 2.35 - 2.13.0 - 2.13.0 - 0.2.2 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.37 + 2.17.1 + 2.17.1 + 0.2.6 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} - 4.13.2 + 5.10.0 {{#hasHttpSignatureMethods}} - 1.7 + 1.8 {{/hasHttpSignatureMethods}} {{#hasOAuthMethods}} - 8.3.1 + 8.3.3 {{/hasOAuthMethods}} - 2.17.3 - 3.12.4 + 2.21.0 diff --git a/sdks/java-v2/templates/libraries/jersey3/AbstractOpenApiSchema.mustache b/sdks/java-v2/templates/libraries/jersey3/AbstractOpenApiSchema.mustache index 417745bc5..d92c85e26 100644 --- a/sdks/java-v2/templates/libraries/jersey3/AbstractOpenApiSchema.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/AbstractOpenApiSchema.mustache @@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/sdks/java-v2/templates/libraries/jersey3/ApiClient.mustache b/sdks/java-v2/templates/libraries/jersey3/ApiClient.mustache index f645d9852..344a2ec55 100644 --- a/sdks/java-v2/templates/libraries/jersey3/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import {{javaxPackage}}.ws.rs.client.Client; @@ -55,12 +57,7 @@ import java.util.Date; import java.util.stream.Collectors; import java.util.stream.Stream; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import java.net.URLEncoder; @@ -82,8 +79,9 @@ import {{invokerPackage}}.auth.ApiKeyAuth; {{#hasOAuthMethods}} import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} - +{{#useCustomTemplateCode}} import com.dropbox.sign.model.ErrorResponse; +{{/useCustomTemplateCode}} /** *

ApiClient class.

@@ -126,13 +124,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { protected Integer serverIndex = 0; protected Map serverVariables = null; {{^hasOperationServers}} - protected Map> operationServers = new LinkedHashMap<>(); + protected Map> operationServers = new HashMap<>(); {{/hasOperationServers}} {{#hasOperationServers}} protected Map> operationServers; { - Map> operationServers = new LinkedHashMap<>(); + Map> operationServers = new HashMap<>(); {{#apiInfo}} {{#apis}} {{#operations}} @@ -285,7 +283,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field httpClient.

* * @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; @@ -305,7 +303,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Sets the base URL to the location where the OpenAPI document is being served. * * @param basePath The base URL to the target host. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; @@ -328,7 +326,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field servers.

* * @param servers a {@link java.util.List} of servers. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServers(List servers) { this.servers = servers; @@ -349,7 +347,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverIndex.

* * @param serverIndex the server index - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; @@ -370,7 +368,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { *

Setter for the field serverVariables.

* * @param serverVariables a {@link java.util.Map} of server variables. - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setServerVariables(Map serverVariables) { this.serverVariables = serverVariables; @@ -417,7 +415,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set username for the first HTTP basic authentication. * * @param username Username - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { @@ -433,7 +431,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set password for the first HTTP basic authentication. * * @param password Password - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { @@ -449,10 +447,17 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set API key value for the first API key authentication. * * @param apiKey API key - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setApiKey(String apiKey) { for (Authentication auth : authentications.values()) { +{{^useCustomTemplateCode}} + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return this; + } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setUsername(apiKey); return this; @@ -460,6 +465,45 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { ((ApiKeyAuth) auth).setApiKey(apiKey); return this; } +{{/useCustomTemplateCode}} + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + * @return a {@link ApiClient} object. + */ + public ApiClient configureApiKeys(Map secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.getOrDefault(name, name); + String secret = secrets.get(name); + if (secret != null) { + ((ApiKeyAuth) auth).setApiKey(secret); + } + } + } + return this; + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + * @return a {@link ApiClient} object. + */ + public ApiClient setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return this; + } } throw new RuntimeException("No API key authentication configured!"); } @@ -468,7 +512,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set bearer token for the first Bearer authentication. * * @param bearerToken Bearer token - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { @@ -485,7 +529,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set access token for the first OAuth2 authentication. * * @param accessToken Access token - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { @@ -502,7 +546,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param clientId the client ID * @param clientSecret the client secret - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { @@ -518,7 +562,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the credentials of a public client for the first OAuth2 authentication. * * @param clientId the client ID - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthCredentialsForPublicClient(String clientId) { for (Authentication auth : authentications.values()) { @@ -535,7 +579,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param username the user name * @param password the user password - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthPasswordFlow(String username, String password) { for (Authentication auth : authentications.values()) { @@ -551,7 +595,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the authorization code flow for the first OAuth2 authentication. * * @param code the authorization code - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { @@ -567,7 +611,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Helper method to set the scopes for the first OAuth2 authentication. * * @param scope the oauth scope - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setOauthScope(String scope) { for (Authentication auth : authentications.values()) { @@ -584,7 +628,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the User-Agent header's value (by adding to the default header map). * * @param userAgent Http user agent - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setUserAgent(String userAgent) { this.userAgent = userAgent; @@ -606,7 +650,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The header's key * @param value The header's value - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); @@ -618,7 +662,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * * @param key The cookie's key * @param value The cookie's value - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient addDefaultCookie(String key, String value) { defaultCookieMap.put(key, value); @@ -638,7 +682,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the client config. * * @param clientConfig Set the client config - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; @@ -660,7 +704,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Enable/disable debugging for this API client. * * @param debugging To enable (true) or disable (false) debugging - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; @@ -684,7 +728,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set temp folder path * * @param tempFolderPath Temp folder path - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setTempFolderPath(String tempFolderPath) { this.tempFolderPath = tempFolderPath; @@ -706,7 +750,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param connectionTimeout Connection timeout in milliseconds - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; @@ -729,7 +773,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * {@link Integer#MAX_VALUE}. * * @param readTimeout Read timeout in milliseconds - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setReadTimeout(int readTimeout) { this.readTimeout = readTimeout; @@ -750,7 +794,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * Set the date format used to parse/format date parameters. * * @param dateFormat Date format - * @return a {@link {{invokerPackage}}.ApiClient} object. + * @return a {@link ApiClient} object. */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; @@ -796,9 +840,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return formatDate((Date) param); } {{#jsr310}}else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); - } {{/jsr310}}else if (param instanceof Collection) { + } {{/jsr310}}else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { + for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } @@ -824,9 +868,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; @@ -1282,7 +1326,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } else { String message = "error"; String respBody = null; +{{#useCustomTemplateCode}} ErrorResponse errorResponse = null; +{{/useCustomTemplateCode}} +{{^useCustomTemplateCode}} + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), message, buildResponseHeaders(response), respBody); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if (response.hasEntity()) { try { if (response.getStatusInfo().getFamily() == Status.Family.CLIENT_ERROR) { @@ -1299,6 +1358,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } throw new ApiException( response.getStatus(), message, buildResponseHeaders(response), respBody, errorResponse); +{{/useCustomTemplateCode}} } } finally { try { diff --git a/sdks/java-v2/templates/libraries/jersey3/JSON.mustache b/sdks/java-v2/templates/libraries/jersey3/JSON.mustache index 162a9b9fe..e1f17c972 100644 --- a/sdks/java-v2/templates/libraries/jersey3/JSON.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/JSON.mustache @@ -1,8 +1,7 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; @@ -13,9 +12,6 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -33,16 +29,15 @@ public class JSON implements ContextResolver { private ObjectMapper mapper; public JSON() { - {{#threetenbp}} - ThreeTenModule threeTenModule = new ThreeTenModule(); - threeTenModule.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - threeTenModule.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - threeTenModule.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - {{/threetenbp}} mapper = JsonMapper.builder() .serializationInclusion(JsonInclude.Include.NON_NULL) .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) +{{^useCustomTemplateCode}} .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) +{{/useCustomTemplateCode}} .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) @@ -52,9 +47,6 @@ public class JSON implements ContextResolver { {{#joda}} .addModule(new JodaModule()) {{/joda}} - {{#threetenbp}} - .addModule(threeTenModule) - {{/threetenbp}} {{#openApiNullable}} .addModule(new JsonNullableModule()) {{/openApiNullable}} @@ -195,7 +187,9 @@ public class JSON implements ContextResolver { */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { +{{^useCustomTemplateCode}} // This handles the 'allOf' use case with single parent inheritance. +{{/useCustomTemplateCode}} return true; } if (visitedClasses.contains(modelClass)) { @@ -206,9 +200,9 @@ public class JSON implements ContextResolver { visitedClasses.add(modelClass); // Traverse the oneOf/anyOf composed schemas. - Map descendants = modelDescendants.get(modelClass); + Map> descendants = modelDescendants.get(modelClass); if (descendants != null) { - for (GenericType childType : descendants.values()) { + for (GenericType childType : descendants.values()) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { return true; } @@ -225,7 +219,7 @@ public class JSON implements ContextResolver { /** * A map of oneOf/anyOf descendants for each model class. */ - private static Map, Map> modelDescendants = new HashMap<>(); + private static Map, Map>> modelDescendants = new HashMap<>(); /** * Register a model class discriminator. @@ -245,7 +239,7 @@ public class JSON implements ContextResolver { * @param modelClass the model class * @param descendants a map of oneOf/anyOf descendants. */ - public static void registerDescendants(Class modelClass, Map descendants) { + public static void registerDescendants(Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } diff --git a/sdks/java-v2/templates/libraries/jersey3/anyof_model.mustache b/sdks/java-v2/templates/libraries/jersey3/anyof_model.mustache index 8239a303f..d480667f3 100644 --- a/sdks/java-v2/templates/libraries/jersey3/anyof_model.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/anyof_model.mustache @@ -24,7 +24,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -57,7 +57,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. @@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } diff --git a/sdks/java-v2/templates/libraries/jersey3/api.mustache b/sdks/java-v2/templates/libraries/jersey3/api.mustache index 326013696..1174ab128 100644 --- a/sdks/java-v2/templates/libraries/jersey3/api.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/api.mustache @@ -11,6 +11,11 @@ import {{javaxPackage}}.ws.rs.core.GenericType; {{#imports}}import {{import}}; {{/imports}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -85,8 +90,10 @@ public class {{classname}} { } {{/vendorExtensions.x-group-parameters}} +{{#useCustomTemplateCode}} __OVERLOAD_DELIMITER { "class": "{{classname}}", "method": "{{operationId}}", "returnType": "{{#returnType}}{{.}}{{/returnType}}", "parameters": [ {{#allParams}}{ "type": "{{{dataType}}}", "name": "{{paramName}}", "required": {{#required}}true{{/required}}{{^required}}false{{/required}}, "value": {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}"{{/isString}}{{{.}}}{{#isString}}"{{/isString}}{{/defaultValue}} }{{^-last}},{{/-last}}{{/allParams}} ]} +{{/useCustomTemplateCode}} {{^vendorExtensions.x-group-parameters}} /** * {{summary}} @@ -117,66 +124,119 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { +{{#useCustomTemplateCode}} {{#allParams}}{{^required}}{{#defaultValue}} if ({{paramName}} == null) { {{paramName}} = {{#isString}}"{{/isString}}{{{defaultValue}}}{{#isString}}"{{/isString}}; }{{/defaultValue}}{{/required}}{{/allParams}} - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set +{{/useCustomTemplateCode}} + {{#hasRequiredParams}} + // Check required parameters + {{#allParams}} + {{#required}} if ({{paramName}} == null) { throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); } - {{/required}}{{/allParams}} - // create path and map variables - String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + {{/required}} + {{/allParams}} - // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + {{/hasRequiredParams}} + {{#hasPathParams}} + // Path parameters + String localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll({{=% %=}}"\\{%baseName%}"%={{ }}=%, apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + {{/hasPathParams}} {{#queryParams}} + {{#-first}} + // Query parameters + List localVarQueryParams = new ArrayList<>( + apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}}) + ); + {{/-first}} + {{^-first}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/-first}} + {{#-last}} + + {{/-last}} {{/queryParams}} + {{#headerParams}} + {{#-first}} + // Header parameters + Map localVarHeaderParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#headerParams}}if ({{paramName}} != null) - localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/headerParams}} + {{#cookieParams}} + {{#-first}} + // Cookie parameters + Map localVarCookieParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^required}} + }{{/required}} + {{#-last}} - {{#cookieParams}}if ({{paramName}} != null) - localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/-last}} {{/cookieParams}} +{{^useCustomTemplateCode}} + {{#formParams}} + {{#-first}} + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + {{/-first}} + {{^required}}if ({{paramName}} != null) { + {{/required}}localVarFormParams.put("{{baseName}}", {{paramName}});{{^required}} + }{{/required}} + {{#-last}} - {{#formParams}}if ({{paramName}} != null) - localVarFormParams.put("{{baseName}}", {{paramName}}); + {{/-last}} {{/formParams}} - - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - +{{/useCustomTemplateCode}} + String localVarAccept = apiClient.selectHeaderAccept({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}); +{{^useCustomTemplateCode}} + String localVarContentType = apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + Map localVarFormParams = new LinkedHashMap<>(); localVarFormParams = {{#bodyParam}}{{paramName}}.createFormData(){{/bodyParam}}{{^bodyParam}}new {{javaUtilPrefix}}HashMap(){{/bodyParam}}; boolean isFileTypeFound = !localVarFormParams.isEmpty(); - - final String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - + String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType({{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}); +{{/useCustomTemplateCode}} + {{#hasAuthMethods}} + String[] localVarAuthNames = {{=% %=}}new String[] {%#authMethods%"%name%"%^-last%, %/-last%%/authMethods%};%={{ }}=% + {{/hasAuthMethods}} {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; - {{/returnType}} - return apiClient.invokeAPI("{{classname}}.{{operationId}}", localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); +{{^useCustomTemplateCode}} + return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + return apiClient.invokeAPI( + "{{classname}}.{{operationId}}", + {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{path}}"{{/hasPathParams}}, + "{{httpMethod}}", + {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, + {{#bodyParam}}isFileTypeFound ? null : {{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, + {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, + {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, + localVarFormParams, + localVarAccept, + localVarContentType, + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, + {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, + {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}} + ); +{{/useCustomTemplateCode}} } {{#vendorExtensions.x-group-parameters}} diff --git a/sdks/java-v2/templates/libraries/jersey3/apiException.mustache b/sdks/java-v2/templates/libraries/jersey3/apiException.mustache index 84b4567c9..70c2af504 100644 --- a/sdks/java-v2/templates/libraries/jersey3/apiException.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/apiException.mustache @@ -2,23 +2,29 @@ package {{invokerPackage}}; -import com.dropbox.sign.model.ErrorResponse; import java.util.Map; import java.util.List; {{#caseInsensitiveResponseHeaders}} import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} +{{#useCustomTemplateCode}} +import com.dropbox.sign.model.ErrorResponse; +{{/useCustomTemplateCode}} /** * API Exception */ {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; +{{#useCustomTemplateCode}} private ErrorResponse errorResponse; +{{/useCustomTemplateCode}} public ApiException() {} @@ -72,11 +78,13 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us this.responseBody = responseBody; } +{{#useCustomTemplateCode}} public ApiException(int code, String message, Map> responseHeaders, String responseBody, ErrorResponse errorResponse) { this(code, message, responseHeaders, responseBody); this.errorResponse = errorResponse; } +{{/useCustomTemplateCode}} /** * Get the HTTP status code. * @@ -103,8 +111,10 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } +{{#useCustomTemplateCode}} public ErrorResponse getErrorResponse() { return errorResponse; } +{{/useCustomTemplateCode}} } diff --git a/sdks/java-v2/templates/libraries/jersey3/api_doc.mustache b/sdks/java-v2/templates/libraries/jersey3/api_doc.mustache index 3994b56bc..457096710 100644 --- a/sdks/java-v2/templates/libraries/jersey3/api_doc.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/api_doc.mustache @@ -4,10 +4,16 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{^useCustomTemplateCode}} +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | +{{/operation}}{{/operations}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} +{{/useCustomTemplateCode}} {{#operations}} {{#operation}} @@ -28,16 +34,86 @@ Method | HTTP request | Description ### Example ```java +{{^useCustomTemplateCode}} +{{#vendorExtensions.x-java-import}} +import {{.}}; +{{/vendorExtensions.x-java-import}} +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.model.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{^vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#vendorExtensions.x-group-parameters}} + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} + .execute(); + {{/vendorExtensions.x-group-parameters}} + {{#returnType}} + System.out.println(result); + {{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Java_CODE +{{/useCustomTemplateCode}} ``` ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{^useCustomTemplateCode}} +{{#allParams}}| **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#allParams}} **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} +{{/useCustomTemplateCode}} ### Return type diff --git a/sdks/java-v2/templates/libraries/jersey3/api_test.mustache b/sdks/java-v2/templates/libraries/jersey3/api_test.mustache index ea9e7d177..7b8214bd4 100644 --- a/sdks/java-v2/templates/libraries/jersey3/api_test.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/api_test.mustache @@ -7,20 +7,20 @@ import {{invokerPackage}}.auth.*; {{#imports}}import {{import}}; {{/imports}} -{{! TODO use latest JUnit }} -{{!import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test;}} - -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/sdks/java-v2/templates/libraries/jersey3/build.gradle.mustache b/sdks/java-v2/templates/libraries/jersey3/build.gradle.mustache index 9a856a786..5be97a1cc 100644 --- a/sdks/java-v2/templates/libraries/jersey3/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/build.gradle.mustache @@ -1,3 +1,12 @@ +{{^useCustomTemplateCode}} +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' + +group = '{{groupId}}' +version = '{{artifactVersion}}' +{{/useCustomTemplateCode}} + buildscript { repositories { mavenCentral() @@ -9,6 +18,7 @@ buildscript { } } +{{#useCustomTemplateCode}} plugins { id 'com.vanniktech.maven.publish' version '0.24.0' } @@ -24,10 +34,90 @@ version = '{{artifactVersion}}' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 +{{/useCustomTemplateCode}} repositories { mavenCentral() } +{{^useCustomTemplateCode}} +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' + + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } @@ -113,29 +203,30 @@ publishing { } } } +{{/useCustomTemplateCode}} ext { swagger_annotations_version = "1.6.5" - jackson_version = "2.13.4" - jackson_databind_version = "2.13.4.2" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "2.1.0" - {{#threetenbp}} - jackson_threetenbp_version = "2.9.10" - {{/threetenbp}} + {{#useBeanValidation}} + bean_validation_version = "3.0.2" + {{/useBeanValidation}} jersey_version = "3.0.4" - {{! TODO use latest version of junit }} - {{!junit_version = "5.8.2"}} - junit_version = "4.13.1" + junit_version = "5.8.2" {{#hasOAuthMethods}} scribejava_apis_version = "8.3.1" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} tomitribe_http_signatures_version = "1.7" {{/hasHttpSignatureMethods}} +{{#useCustomTemplateCode}} mockito_version = "3.12.4" +{{/useCustomTemplateCode}} } dependencies { @@ -155,32 +246,28 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#hasOAuthMethods}} implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" {{/hasOAuthMethods}} {{#hasHttpSignatureMethods}} implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" {{/hasHttpSignatureMethods}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - {{! TODO use latest version of junit }} - {{!testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"}} - testImplementation "junit:junit:$junit_version" + {{#useBeanValidation}} + implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + {{/useBeanValidation}} + + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +{{#useCustomTemplateCode}} testImplementation "org.mockito:mockito-core:$mockito_version" +{{/useCustomTemplateCode}} } -{{! TODO use latest version of junit (uncomment the below) }} -{{! test { useJUnitPlatform() } -}} javadoc { options.tags = [ "http.response.details:a:Http Response Details" ] diff --git a/sdks/java-v2/templates/libraries/jersey3/build.sbt.mustache b/sdks/java-v2/templates/libraries/jersey3/build.sbt.mustache index ed294c048..e4c37f99f 100644 --- a/sdks/java-v2/templates/libraries/jersey3/build.sbt.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/build.sbt.mustache @@ -9,6 +9,9 @@ lazy val root = (project in file(".")). Compile / packageDoc / publishArtifact := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( +{{#useCustomTemplateCode}} + libraryDependencies += "commons-codec" % "commons-codec" % "1.15" +{{/useCustomTemplateCode}} "com.google.code.findbugs" % "jsr305" % "3.0.0", "io.swagger" % "swagger-annotations" % "1.6.5", "org.glassfish.jersey.core" % "jersey-client" % "3.0.4", @@ -16,16 +19,13 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4", "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4", - "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.17.1" % "compile", {{/joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.2" % "compile", - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", - {{/threetenbp}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", {{#openApiNullable}} "org.openapitools" % "jackson-databind-nullable" % "0.2.6" % "compile", {{/openApiNullable}} @@ -36,8 +36,6 @@ lazy val root = (project in file(".")). "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", {{/hasHttpSignatureMethods}} "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", - {{! TODO use the latest JUnit }} - {{! "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" }} - "junit" % "junit" % "4.13.2" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/sdks/java-v2/templates/libraries/jersey3/generatedAnnotation.mustache b/sdks/java-v2/templates/libraries/jersey3/generatedAnnotation.mustache index f408f3199..e05689d5f 100644 --- a/sdks/java-v2/templates/libraries/jersey3/generatedAnnotation.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/generatedAnnotation.mustache @@ -1 +1 @@ -@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/jersey3/model.mustache b/sdks/java-v2/templates/libraries/jersey3/model.mustache index 707d0ad93..509857733 100644 --- a/sdks/java-v2/templates/libraries/jersey3/model.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/model.mustache @@ -22,15 +22,11 @@ import java.util.HashMap; {{#imports}} import {{import}}; {{/imports}} -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; {{#serializableModel}} import java.io.Serializable; {{/serializableModel}} {{#jackson}} import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.ObjectMapper; {{#withXml}} import com.fasterxml.jackson.dataformat.xml.annotation.*; {{/withXml}} @@ -46,13 +42,17 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; {{/performBeanValidation}} import {{invokerPackage}}.JSON; +{{#useCustomTemplateCode}} +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.ObjectMapper; +{{/useCustomTemplateCode}} {{#models}} {{#model}} diff --git a/sdks/java-v2/templates/libraries/jersey3/model_test.mustache b/sdks/java-v2/templates/libraries/jersey3/model_test.mustache index cd926fbfe..acd659b66 100644 --- a/sdks/java-v2/templates/libraries/jersey3/model_test.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/model_test.mustache @@ -5,14 +5,9 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -{{! TODO use latest JUnit }} -{{!import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test;}} - -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for {{classname}} diff --git a/sdks/java-v2/templates/libraries/jersey3/oneof_model.mustache b/sdks/java-v2/templates/libraries/jersey3/oneof_model.mustache index de29a873b..09906d7b0 100644 --- a/sdks/java-v2/templates/libraries/jersey3/oneof_model.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/oneof_model.mustache @@ -26,7 +26,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -60,7 +60,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#useOneOfDiscriminatorLookup}} {{#discriminator}} {{classname}} new{{classname}} = new {{classname}}(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); switch (discriminatorValue) { {{#mappedModels}} @@ -78,37 +78,74 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + {{#composedSchemas}} {{#oneOf}} - // deserialize {{{.}}} + // deserialize {{{dataType}}}{{#isNullable}} (nullable){{/isNullable}} try { + {{^isArray}} boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if ({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class) || {{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class) || {{{.}}}.class.equals(Boolean.class) || {{{.}}}.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= (({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= (({{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= ({{{.}}}.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= ({{{.}}}.class.equals(String.class) && token == JsonToken.VALUE_STRING); - {{#isNullable}} - attemptParsing |= (token == JsonToken.VALUE_NULL); - {{/isNullable}} - } + {{#isPrimitiveType}} + attemptParsing = typeCoercion; //respect type coercion setting + if (!attemptParsing) { + {{#isString}} + attemptParsing |= (token == JsonToken.VALUE_STRING); + {{/isString}} + {{#isInteger}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isInteger}} + {{#isLong}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isLong}} + {{#isShort}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_INT); + {{/isShort}} + {{#isFloat}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isFloat}} + {{#isDouble}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDouble}} + {{#isNumber}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isNumber}} + {{#isDecimal}} + attemptParsing |= (token == JsonToken.VALUE_NUMBER_FLOAT); + {{/isDecimal}} + {{#isBoolean}} + attemptParsing |= (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + {{/isBoolean}} + {{#isNullable}} + attemptParsing |= (token == JsonToken.VALUE_NULL); + {{/isNullable}} } + {{/isPrimitiveType}} if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); + deserialized = tree.traverse(jp.getCodec()).readValueAs({{{dataType}}}.class); // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON // validation, which means the 'match' count may be higher than it should be. match++; - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); } + {{/isArray}} + {{#isArray}} + if (token == JsonToken.START_ARRAY) { + final TypeReference<{{{dataType}}}> ref = new TypeReference<{{{dataType}}}>(){}; + deserialized = tree.traverse(jp.getCodec()).readValueAs(ref); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); + } + {{/isArray}} } catch (Exception e) { // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); } {{/oneOf}} + {{/composedSchemas}} if (match == 1) { {{classname}} ret = new {{classname}}(); ret.setActualInstance(deserialized); @@ -132,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap<>(); + public static final Map> schemas = new HashMap<>(); public {{classname}}() { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); @@ -152,13 +189,17 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); } {{/additionalPropertiesType}} + {{#composedSchemas}} {{#oneOf}} - public {{classname}}({{{.}}} o) { + {{^vendorExtensions.x-duplicated-data-type}} + public {{classname}}({{{baseType}}} o) { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); setActualInstance(o); } + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} + {{/composedSchemas}} static { {{#oneOf}} schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { @@ -177,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public Map getSchemas() { + public Map> getSchemas() { return {{classname}}.schemas; } @@ -198,13 +239,17 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/isNullable}} + {{#composedSchemas}} {{#oneOf}} - if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet<>())) { + {{^vendorExtensions.x-duplicated-data-type}} + if (JSON.isInstanceOf({{{baseType}}}.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; } + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} + {{/composedSchemas}} throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); } @@ -219,17 +264,26 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return super.getActualInstance(); } + {{#composedSchemas}} {{#oneOf}} /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, * the ClassCastException will be thrown. * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); + {{^isArray}} + public {{{dataType}}} get{{{dataType}}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); } + {{/isArray}} + {{#isArray}} + public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/isArray}} {{/oneOf}} + {{/composedSchemas}} } diff --git a/sdks/java-v2/templates/libraries/jersey3/pojo.mustache b/sdks/java-v2/templates/libraries/jersey3/pojo.mustache index af7752f3d..0ba5ad05a 100644 --- a/sdks/java-v2/templates/libraries/jersey3/pojo.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/pojo.mustache @@ -1,4 +1,6 @@ +{{#useCustomTemplateCode}} import com.dropbox.sign.ApiException; +{{/useCustomTemplateCode}} /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} @@ -20,7 +22,6 @@ import com.dropbox.sign.ApiException; {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) -@JsonIgnoreProperties(ignoreUnknown=true) {{#isClassnameSanitized}} @JsonTypeName("{{name}}") {{/isClassnameSanitized}} @@ -29,6 +30,13 @@ import com.dropbox.sign.ApiException; {{#vendorExtensions.x-class-extra-annotation}} {{{vendorExtensions.x-class-extra-annotation}}} {{/vendorExtensions.x-class-extra-annotation}} +{{#useCustomTemplateCode}} +{{^parent}} +{{^discriminator}} +@JsonIgnoreProperties(ignoreUnknown=true) +{{/discriminator}} +{{/parent}} +{{/useCustomTemplateCode}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -54,25 +62,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) @@ -82,14 +75,33 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); {{/isContainer}} {{^isContainer}} + {{#deprecated}} + @Deprecated + {{/deprecated}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{#deprecated}} + @Deprecated + {{/deprecated}} +{{^useCustomTemplateCode}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + {{#isContainer}} + private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; + {{/isContainer}} + {{^isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} +{{/useCustomTemplateCode}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} @@ -106,9 +118,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} }{{/jackson}}{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} +{{#useCustomTemplateCode}} /** * Attempt to instantiate and hydrate a new instance of this class @@ -124,6 +137,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{classname}}.class ); } +{{/useCustomTemplateCode}} {{#vars}} {{^isReadOnly}} @@ -133,6 +147,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens )); {{/vendorExtensions.x-enum-as-string}} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) { @@ -148,15 +165,17 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} return this; } +{{#useCustomTemplateCode}} {{#vendorExtensions.x-int-or-string}} public {{classname}} {{name}}(Integer {{name}}) { this.{{name}} = String.valueOf({{name}}); return this; } {{/vendorExtensions.x-int-or-string}} +{{/useCustomTemplateCode}} {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); @@ -179,7 +198,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); @@ -202,7 +221,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -219,7 +238,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} @@ -279,6 +298,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^isReadOnly}} + {{#deprecated}} + @Deprecated + {{/deprecated}} {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} {{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-enum-as-string}} @@ -294,12 +316,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens this.{{name}} = {{name}}; {{/vendorExtensions.x-is-jackson-optional-nullable}} } +{{#useCustomTemplateCode}} {{#vendorExtensions.x-int-or-string}} public void {{setter}}(Integer {{name}}) { this.{{name}} = String.valueOf({{name}}); } {{/vendorExtensions.x-int-or-string}} +{{/useCustomTemplateCode}} {{/isReadOnly}} {{/vars}} @@ -357,7 +381,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} {{#additionalPropertiesType}} sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -366,6 +390,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return sb.toString(); } +{{#useCustomTemplateCode}} public Map createFormData() throws ApiException { Map map = new HashMap<>(); boolean fileTypeFound = false; @@ -421,6 +446,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } +{{/useCustomTemplateCode}} /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). diff --git a/sdks/java-v2/templates/libraries/jersey3/pom.mustache b/sdks/java-v2/templates/libraries/jersey3/pom.mustache index fa0079b0f..e2bb17240 100644 --- a/sdks/java-v2/templates/libraries/jersey3/pom.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 3.0.0-M5 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -91,6 +91,7 @@
+{{#useCustomTemplateCode}} maven-assembly-plugin @@ -107,6 +108,7 @@
+{{/useCustomTemplateCode}} org.apache.maven.plugins @@ -288,6 +290,13 @@ ${swagger-annotations-version} {{/swagger2AnnotationLibrary}} +{{#useCustomTemplateCode}} + + commons-codec + commons-codec + 1.15 + +{{/useCustomTemplateCode}} @@ -361,13 +370,6 @@ jackson-datatype-jsr310 ${jackson-version} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} {{#hasHttpSignatureMethods}} org.tomitribe @@ -403,25 +405,20 @@ ${jersey-version} - {{! TODO use latest version of junit }} - {{! + org.junit.jupiter junit-jupiter-api ${junit-version} test - }} - - junit - junit - ${junit-version} - test +{{#useCustomTemplateCode}} org.mockito mockito-core ${mockito.version} test +{{/useCustomTemplateCode}} UTF-8 @@ -429,29 +426,26 @@ 1.6.6 {{/swagger1AnnotationLibrary}} {{#swagger2AnnotationLibrary}} - 2.2.9 + 2.2.15 {{/swagger2AnnotationLibrary}} - 3.0.4 - 2.13.4 - 2.13.4.2 + 3.1.1 + 2.17.1 + 2.17.1 0.2.6 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} - 2.1.0 + 2.1.1 {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} - {{! TODO use latest version of junit }} - {{!5.8.2}} - 4.13.1 + 5.10.0 {{#hasHttpSignatureMethods}} - 1.7 + 1.8 {{/hasHttpSignatureMethods}} {{#hasOAuthMethods}} - 8.3.1 + 8.3.3 {{/hasOAuthMethods}} 2.21.0 +{{#useCustomTemplateCode}} 3.12.4 +{{/useCustomTemplateCode}} diff --git a/sdks/java-v2/templates/libraries/microprofile/README.mustache b/sdks/java-v2/templates/libraries/microprofile/README.mustache index 58d2d5f5c..377dfc2c9 100644 --- a/sdks/java-v2/templates/libraries/microprofile/README.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/README.mustache @@ -1,10 +1,19 @@ -# {{appName}} - MicroProfile Rest Client +# {{appName}} - MicroProfile Rest Client & MicroProfile Server {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} +{{^microprofileServer}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. +{{/microprofileServer}} + +{{#microprofileServer}} +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +The generated server contains an interface which acts as the server, you can inject it into the controller class. +This module is intended to provide additional server features, like accessing an operations response object, when multiple responses where specified. +{{/microprofileServer}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/microprofile/api.mustache b/sdks/java-v2/templates/libraries/microprofile/api.mustache index 119494e54..6e25c1f10 100644 --- a/sdks/java-v2/templates/libraries/microprofile/api.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/api.mustache @@ -9,12 +9,20 @@ import java.io.OutputStream; import java.util.List; import java.util.Map; import java.util.Set; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.MediaType; +import {{rootJavaEEPackage}}.ws.rs.*; +import {{rootJavaEEPackage}}.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.core.MediaType; {{^disableMultipart}} import org.apache.cxf.jaxrs.ext.multipart.*; {{/disableMultipart}} +{{#microprofileMutiny}} +import io.smallrye.mutiny.Uni; +{{/microprofileMutiny}} + +{{#useBeanValidation}} +import {{rootJavaEEPackage}}.validation.constraints.*; +import {{rootJavaEEPackage}}.validation.Valid; +{{/useBeanValidation}} import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; @@ -30,7 +38,9 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; */ {{/appName}} -@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}} +{{^microprofileServer}} +@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}}{{#configKeyFromClassName}}{{#operations}}(configKey="{{configKey}}"){{/operations}}{{/configKeyFromClassName}} +{{/microprofileServer}} @RegisterProvider(ApiExceptionMapper.class) @Path("{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}{{commonPath}}") public interface {{classname}} { @@ -61,7 +71,50 @@ public interface {{classname}} { {{#hasProduces}} @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }) {{/hasProduces}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; +{{^useSingleRequestParameter}} + {{^vendorExtensions.x-java-is-response-void}}{{#microprofileServer}}{{> server_operation}}{{/microprofileServer}}{{^microprofileServer}}{{> client_operation}}{{/microprofileServer}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; +{{/useSingleRequestParameter}} +{{#useSingleRequestParameter}} + {{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#hasNonBodyParams}}@BeanParam {{operationIdCamelCase}}Request request{{/hasNonBodyParams}}{{#bodyParams}}{{#hasNonBodyParams}}, {{/hasNonBodyParams}}{{>bodyParams}}{{/bodyParams}}) throws ApiException, ProcessingException; + {{#hasNonBodyParams}} + public class {{operationIdCamelCase}}Request { + + {{#queryParams}} + private {{>queryParams}}; + {{/queryParams}} + {{#headerParams}} + private {{>headerParams}}; + {{/headerParams}} + {{#pathParams}} + private {{>pathParams}}; + {{/pathParams}} + {{#formParams}} + private {{>formParams}}; + {{/formParams}} + + private {{operationIdCamelCase}}Request() { + } + + public static {{operationIdCamelCase}}Request newInstance() { + return new {{operationIdCamelCase}}Request(); + } + + {{#allParams}} + {{^isBodyParam}} + /** + * Set {{paramName}}{{>formParamsNameSuffix}} + * @param {{paramName}}{{>formParamsNameSuffix}} {{description}} ({{^required}}optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}{{/required}}{{#required}}required{{/required}}) + * @return {{operationIdCamelCase}}Request + */ + public {{operationIdCamelCase}}Request {{paramName}}{{>formParamsNameSuffix}}({{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>formParamsImpl}}) { + this.{{paramName}}{{>formParamsNameSuffix}} = {{paramName}}{{>formParamsNameSuffix}}; + return this; + } + {{/isBodyParam}} + {{/allParams}} + } + {{/hasNonBodyParams}} +{{/useSingleRequestParameter}} {{/operation}} } {{/operations}} diff --git a/sdks/java-v2/templates/libraries/microprofile/api_exception.mustache b/sdks/java-v2/templates/libraries/microprofile/api_exception.mustache index fc5c5e500..63a218675 100644 --- a/sdks/java-v2/templates/libraries/microprofile/api_exception.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/api_exception.mustache @@ -1,9 +1,9 @@ {{>licenseInfo}} package {{apiPackage}}; -import javax.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.core.Response; -public class ApiException extends Exception { +public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ private static final long serialVersionUID = 1L; private Response response; diff --git a/sdks/java-v2/templates/libraries/microprofile/api_exception_mapper.mustache b/sdks/java-v2/templates/libraries/microprofile/api_exception_mapper.mustache index 9c5988414..12988f5ed 100644 --- a/sdks/java-v2/templates/libraries/microprofile/api_exception_mapper.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/api_exception_mapper.mustache @@ -1,9 +1,9 @@ {{>licenseInfo}} package {{apiPackage}}; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.Provider; +import {{rootJavaEEPackage}}.ws.rs.core.MultivaluedMap; +import {{rootJavaEEPackage}}.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.ext.Provider; import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; @Provider diff --git a/sdks/java-v2/templates/libraries/microprofile/api_test.mustache b/sdks/java-v2/templates/libraries/microprofile/api_test.mustache index a53acad5c..d9af87719 100644 --- a/sdks/java-v2/templates/libraries/microprofile/api_test.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/api_test.mustache @@ -4,23 +4,23 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; +{{#generateSpringBootApplication}} +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.test.context.junit.jupiter.SpringExtension; +{{/generateSpringBootApplication}} import org.eclipse.microprofile.rest.client.RestClientBuilder; import java.net.URL; import java.net.MalformedURLException; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -{{/fullJavaUtil}} - - /** {{#appName}} @@ -30,7 +30,7 @@ import java.util.Set; * API tests for {{classname}} */ {{#generateSpringBootApplication}} -@RunWith(SpringJUnit4ClassRunner.class) +@ExtendWith(SpringExtension.class) @SpringApplicationConfiguration(classes = SpringBootApplication.class) @WebAppConfiguration @IntegrationTest("server.port=0") @@ -40,12 +40,17 @@ public class {{classname}}Test { private {{classname}} client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { + {{#microprofile3}} + // TODO initialize the client + {{/microprofile3}} + {{^microprofile3}} client = RestClientBuilder.newBuilder() .baseUrl(new URL(baseUrl)) .register(ApiException.class) .build({{classname}}.class); + {{/microprofile3}} } {{#operations}}{{#operation}} @@ -67,8 +72,8 @@ public class {{classname}}Test { {{#allParams}} {{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}} {{/allParams}} - //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - //{{#returnType}}assertNotNull(response);{{/returnType}} + //{{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}Assertions.assertNotNull(response);{{/returnType}} } diff --git a/sdks/java-v2/templates/libraries/microprofile/beanValidation.mustache b/sdks/java-v2/templates/libraries/microprofile/beanValidation.mustache index c8c6946fe..f8724b244 100644 --- a/sdks/java-v2/templates/libraries/microprofile/beanValidation.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/beanValidation.mustache @@ -1,4 +1,6 @@ {{#required}} +{{^isReadOnly}} @NotNull +{{/isReadOnly}} {{/required}} {{>beanValidationCore}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/microprofile/client_operation.mustache b/sdks/java-v2/templates/libraries/microprofile/client_operation.mustache new file mode 100644 index 000000000..403918ddc --- /dev/null +++ b/sdks/java-v2/templates/libraries/microprofile/client_operation.mustache @@ -0,0 +1 @@ +{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/microprofile/enumClass.mustache b/sdks/java-v2/templates/libraries/microprofile/enumClass.mustache index 38127a637..cb8539bd1 100644 --- a/sdks/java-v2/templates/libraries/microprofile/enumClass.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/enumClass.mustache @@ -3,8 +3,10 @@ @XmlEnum({{dataType}}.class) {{/withXml}} {{^withXml}} + {{#jsonb}} @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) + {{/jsonb}} {{/withXml}} {{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} { @@ -13,7 +15,7 @@ {{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/withXml}} {{^withXml}} - {{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} + {{#enumVars}}{{name}}({{^isUri}}{{dataType}}.valueOf({{/isUri}}{{{value}}}{{^isUri}}){{/isUri}}){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/withXml}} {{/allowableValues}} @@ -24,6 +26,9 @@ value = v; } + {{#jackson}} + @JsonValue + {{/jackson}} public {{dataType}} value() { return value; } @@ -44,6 +49,7 @@ } {{/withXml}} {{^withXml}} + {{#jsonb}} public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { @@ -59,8 +65,20 @@ public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { @Override public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { - generator.write(obj.value); + generator.write(obj.value{{#isUri}}.toASCIIString(){{/isUri}}); } } + {{/jsonb}} + {{#jackson}} + @JsonCreator + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.equals(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + } + {{/jackson}} {{/withXml}} } diff --git a/sdks/java-v2/templates/libraries/microprofile/enumOuterClass.mustache b/sdks/java-v2/templates/libraries/microprofile/enumOuterClass.mustache index 894ce951f..2539064d1 100644 --- a/sdks/java-v2/templates/libraries/microprofile/enumOuterClass.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/enumOuterClass.mustache @@ -2,10 +2,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} +{{#isUri}} +import java.net.URI; +{{/isUri}} /** * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ +{{#jsonb}} +@JsonbTypeSerializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Serializer.class) +@JsonbTypeDeserializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @@ -33,6 +40,22 @@ import com.fasterxml.jackson.annotation.JsonValue; return String.valueOf(value); } +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + return fromValue(parser.getString()); + } + } + + public static final class Serializer implements JsonbSerializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void serialize({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value{{#isUri}}.toASCIIString(){{/isUri}}); + } + } + +{{/jsonb}} {{#jackson}} @JsonCreator {{/jackson}} @@ -44,5 +67,4 @@ import com.fasterxml.jackson.annotation.JsonValue; } {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}} } - } diff --git a/sdks/java-v2/templates/libraries/microprofile/formParamsNameSuffix.mustache b/sdks/java-v2/templates/libraries/microprofile/formParamsNameSuffix.mustache new file mode 100644 index 000000000..a44f6d710 --- /dev/null +++ b/sdks/java-v2/templates/libraries/microprofile/formParamsNameSuffix.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{#isFile}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/microprofile/generatedAnnotation.mustache b/sdks/java-v2/templates/libraries/microprofile/generatedAnnotation.mustache index 875d7b97a..cf058a0fa 100644 --- a/sdks/java-v2/templates/libraries/microprofile/generatedAnnotation.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{rootJavaEEPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/microprofile/kumuluzee.pom.mustache b/sdks/java-v2/templates/libraries/microprofile/kumuluzee.pom.mustache index ac235b7ed..195aa9d44 100644 --- a/sdks/java-v2/templates/libraries/microprofile/kumuluzee.pom.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/kumuluzee.pom.mustache @@ -18,7 +18,7 @@ 1.2.3 1.4.1 3.2.6 - 4.13 + 5.10.2 2.28 @@ -70,8 +70,8 @@ ${cxf-rt-rs-extension-providers.version} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test diff --git a/sdks/java-v2/templates/libraries/microprofile/model.mustache b/sdks/java-v2/templates/libraries/microprofile/model.mustache index 5272ff094..e10e68d83 100644 --- a/sdks/java-v2/templates/libraries/microprofile/model.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/model.mustache @@ -6,9 +6,38 @@ package {{package}}; {{#serializableModel}} import java.io.Serializable; {{/serializableModel}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.annotation.*; +{{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jackson}} +{{#withXml}} +import {{rootJavaEEPackage}}.xml.bind.annotation.*; +import {{rootJavaEEPackage}}.xml.bind.annotation.adapters.*; +{{/withXml}} +{{#jsonb}} +import java.lang.reflect.Type; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.DeserializationContext; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbDeserializer; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.SerializationContext; +import {{rootJavaEEPackage}}.json.stream.JsonGenerator; +import {{rootJavaEEPackage}}.json.stream.JsonParser; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import {{rootJavaEEPackage}}.validation.constraints.*; +import {{rootJavaEEPackage}}.validation.Valid; {{/useBeanValidation}} {{#models}} @@ -20,4 +49,4 @@ import javax.validation.Valid; {{>pojo}} {{/isEnum}} {{/model}} -{{/models}} +{{/models}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/microprofile/pojo.mustache b/sdks/java-v2/templates/libraries/microprofile/pojo.mustache index f2f269ab7..afad09aa3 100644 --- a/sdks/java-v2/templates/libraries/microprofile/pojo.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/pojo.mustache @@ -1,57 +1,55 @@ {{#withXml}} -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -{{/withXml}} -{{^withXml}} -import java.lang.reflect.Type; -import javax.json.bind.annotation.JsonbTypeDeserializer; -import javax.json.bind.annotation.JsonbTypeSerializer; -import javax.json.bind.serializer.DeserializationContext; -import javax.json.bind.serializer.JsonbDeserializer; -import javax.json.bind.serializer.JsonbSerializer; -import javax.json.bind.serializer.SerializationContext; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.bind.annotation.JsonbProperty; -{{#vendorExtensions.x-has-readonly-properties}} -import javax.json.bind.annotation.JsonbCreator; -{{/vendorExtensions.x-has-readonly-properties}} -{{/withXml}} - -{{#withXml}} -@XmlAccessorType(XmlAccessType.FIELD) -{{#hasVars}} @XmlType(name = "{{classname}}", propOrder = - { {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}} -}){{/hasVars}} +{{#hasVars}}@XmlType(name = "{{classname}}", propOrder = + { {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}} } +){{/hasVars}} {{^hasVars}}@XmlType(name = "{{classname}}"){{/hasVars}} -{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}} +{{> xmlAnnotation }} {{/withXml}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +{{#isClassnameSanitized}} +{{^hasDiscriminatorWithNonEmptyMapping}} +@JsonTypeName("{{name}}") +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/isClassnameSanitized}} +{{/jackson}} {{#description}} /** * {{{.}}} - **/ + */ {{/description}} {{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensions.x-implements}}{{#-first}} implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} +{{#jackson}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; +{{/jackson}} {{#withXml}} - @XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}}) + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#description}} /** - * {{{.}}} - **/ + * {{{.}}} + */ {{/description}} {{^withXml}} - @JsonbProperty("{{baseName}}") + {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}} {{/withXml}} +{{#vendorExtensions.x-field-extra-annotation}} +{{{vendorExtensions.x-field-extra-annotation}}} +{{/vendorExtensions.x-field-extra-annotation}} {{#isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}}; {{/isContainer}} @@ -63,10 +61,10 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM public {{classname}}() { } - @JsonbCreator + {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} public {{classname}}( {{#readOnlyVars}} - @JsonbProperty("{{baseName}}") {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nillable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(value = JSON_PROPERTY_{{nameInSnakeCase}}{{#required}}, required = true{{/required}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} {{/readOnlyVars}} ) { {{#readOnlyVars}} @@ -75,7 +73,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM } {{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -92,14 +90,14 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM {{#deprecated}} * @deprecated {{/deprecated}} - **/ + **/ {{#deprecated}} @Deprecated {{/deprecated}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} {{#withXml}}{{#isEnum}}{{^isArray}}{{^isMap}}public {{dataType}} {{getter}}() { +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}}{{#jackson}}{{> jackson_annotations}}{{/jackson}} {{#withXml}}{{#isEnum}}{{^isArray}}{{^isMap}} public {{dataType}} {{getter}}() { if ({{name}} == null) { return null; } @@ -116,10 +114,10 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM {{^isReadOnly}} /** - * Set {{name}} - **/ - {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} - {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + * Set {{name}} + */ +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{> jackson_annotations}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; } @@ -129,14 +127,20 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; + } this.{{name}}.add({{name}}Item); return this; } {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; + } this.{{name}}.put(key, {{name}}Item); return this; } @@ -146,14 +150,14 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableM {{/vars}} /** - * Create a string representation of this pojo. - **/ + * Create a string representation of this pojo. + */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class {{classname}} {\n"); {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} - {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{#vars}}sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}}sb.append("}"); return sb.toString(); } diff --git a/sdks/java-v2/templates/libraries/microprofile/pom.mustache b/sdks/java-v2/templates/libraries/microprofile/pom.mustache index 3d5f94190..f814d4c0d 100644 --- a/sdks/java-v2/templates/libraries/microprofile/pom.mustache +++ b/sdks/java-v2/templates/libraries/microprofile/pom.mustache @@ -14,7 +14,7 @@ org.jboss.jandex jandex-maven-plugin - 1.1.0 + ${jandex.maven.plugin.version} make-index @@ -26,7 +26,7 @@ maven-failsafe-plugin - 2.6 + ${maven.failsafe.plugin.version} @@ -39,7 +39,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.9.1 + ${build.helper.maven.plugin.version} add-source @@ -58,10 +58,10 @@ - - junit - junit - ${junit-version} + + org.junit.jupiter + junit-jupiter-api + ${junit.version} test {{#useBeanValidation}} @@ -69,7 +69,7 @@ jakarta.validation jakarta.validation-api - ${beanvalidation-version} + ${beanvalidation.version} provided {{/useBeanValidation}} @@ -77,95 +77,125 @@ org.eclipse.microprofile.rest.client microprofile-rest-client-api - 1.4.1 + ${microprofile.rest.client.api.version} jakarta.ws.rs jakarta.ws.rs-api - ${jakarta.ws.rs-version} + ${jakarta.ws.rs.version} provided io.smallrye smallrye-rest-client - 1.2.1 + ${smallrye.rest.client.version} test io.smallrye smallrye-config - 1.3.5 + ${smallrye.config.version} test {{^disableMultipart}} org.apache.cxf cxf-rt-rs-extension-providers - 3.2.6 + ${cxf.rt.rs.extension.providers.version} {{/disableMultipart}} + {{#jsonb}} jakarta.json.bind jakarta.json.bind-api - ${jakarta.json.bind-version} + ${jakarta.json.bind.version} jakarta.json jakarta.json-api - ${jakarta.json-version} + ${jakarta.json.version} jakarta.xml.bind jakarta.xml.bind-api - ${jakarta.xml.bind-version} + ${jakarta.xml.bind.version} com.sun.xml.bind jaxb-core - 2.2.11 + ${jaxb.core.version} com.sun.xml.bind jaxb-impl - 2.2.11 + ${jaxb.impl.version} + + {{/jsonb}} + {{#jackson}} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + {{#withXml}} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson.version} + + {{/withXml}} + {{/jackson}} jakarta.activation jakarta.activation-api - ${jakarta.activation-version} + ${jakarta.activation.version} - -{{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - ${jackson-jaxrs-version} + ${jackson.jaxrs.version} -{{/java8}} -{{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - -{{/java8}} {{#useBeanValidationFeature}} org.hibernate hibernate-validator - 5.2.2.Final + ${hibernate.validator.version} {{/useBeanValidationFeature}} jakarta.annotation jakarta.annotation-api - ${jakarta-annotation-version} + ${jakarta.annotation.version} provided +{{#microprofileMutiny}} + + io.smallrye.reactive + mutiny + ${mutiny.version} + +{{/microprofileMutiny}} @@ -180,21 +210,37 @@ 1.8 ${java.version} ${java.version} - 1.5.18 - 9.2.9.v20150224 - 4.13.1 - 1.2.0 + 1.5.18 + 9.2.9.v20150224 + 5.10.2 + 1.4.14 {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} - 3.2.7 - 2.9.7 - 1.2.2 - 1.3.5 - 1.0.2 - 1.1.6 - 2.1.6 - 2.3.3 + 3.2.7 + 2.17.1 +{{#jackson}} + 2.17.1 +{{/jackson}} + 1.2.2 + 1.3.5 + 1.0.2 + 1.1.6 + 2.1.6 + 2.3.3 + {{microprofileRestClientVersion}} + 1.2.1 + 1.3.5 + 3.2.6 + 2.2.11 + 2.2.11 + 5.2.2.Final + 1.1.0 + 2.6 + 1.9.1 UTF-8 +{{#microprofileMutiny}} + 1.2.0 +{{/microprofileMutiny}} diff --git a/sdks/java-v2/templates/libraries/microprofile/pom_3.0.mustache b/sdks/java-v2/templates/libraries/microprofile/pom_3.0.mustache new file mode 100644 index 000000000..7accc4cb2 --- /dev/null +++ b/sdks/java-v2/templates/libraries/microprofile/pom_3.0.mustache @@ -0,0 +1,236 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{#appDescription}} + {{.}} + {{/appDescription}} + {{artifactVersion}} + + src/main/java + + + org.jboss.jandex + jandex-maven-plugin + ${jandex.maven.plugin.version} + + + make-index + + jandex + + + + + + maven-failsafe-plugin + ${maven.failsafe.plugin.version} + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${build.helper.maven.plugin.version} + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + +{{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation.version} + provided + +{{/useBeanValidation}} + + + org.eclipse.microprofile.rest.client + microprofile-rest-client-api + ${microprofile.rest.client.api.version} + + + + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs.version} + provided + + + + org.glassfish.jersey.ext.microprofile + jersey-mp-rest-client + ${jersey.mp.rest.client.version} + test + + + org.apache.geronimo.config + geronimo-config-impl + ${geronimo.config.impl.version} + test + + + {{^disableMultipart}} + + org.apache.cxf + cxf-rt-rs-extension-providers + ${cxf.rt.rs.extension.providers.version} + + {{/disableMultipart}} + {{#jsonb}} + + jakarta.json.bind + jakarta.json.bind-api + ${jakarta.json.bind.version} + + + jakarta.json + jakarta.json-api + ${jakarta.json.version} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.sun.xml.bind + jaxb-core + ${jaxb.core.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb.impl.version} + + {{/jsonb}} + {{#jackson}} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + {{#withXml}} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson.version} + + {{/withXml}} + {{/jackson}} + + jakarta.activation + jakarta.activation-api + ${jakarta.activation.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.jaxrs.version} + +{{#useBeanValidationFeature}} + + org.hibernate + hibernate-validator + ${hibernate.validator.version} + +{{/useBeanValidationFeature}} + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation.version} + provided + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 11 + ${java.version} + ${java.version} + 1.5.18 + 9.2.9.v20150224 + 5.10.2 + 1.4.14 +{{#useBeanValidation}} + 3.0.1 +{{/useBeanValidation}} + 3.2.7 + 2.17.1 +{{#jackson}} + 2.17.1 +{{/jackson}} + 2.1.0 + 2.0.0 + 2.0.0 + 2.0.1 + 3.0.0 + 3.0.1 + {{microprofileRestClientVersion}} + 3.0.4 + 1.2.3 + 3.5.1 + 3.0.2 + 3.0.2 + 7.0.4.Final + 1.1.0 + 2.6 + 1.9.1 + UTF-8 + + diff --git a/sdks/java-v2/templates/libraries/microprofile/returnTypes.mustache b/sdks/java-v2/templates/libraries/microprofile/returnTypes.mustache deleted file mode 100644 index 32f96a904..000000000 --- a/sdks/java-v2/templates/libraries/microprofile/returnTypes.mustache +++ /dev/null @@ -1,4 +0,0 @@ -{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: -}}{{^useGenericResponse}}{{! -}}{{{returnType}}}{{! -}}{{/useGenericResponse}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/microprofile/server_operation.mustache b/sdks/java-v2/templates/libraries/microprofile/server_operation.mustache new file mode 100644 index 000000000..d6fa9054d --- /dev/null +++ b/sdks/java-v2/templates/libraries/microprofile/server_operation.mustache @@ -0,0 +1 @@ +{{#vendorExtensions.x-multiple-2xx-response-operation}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}Response{{/microprofileMutiny}}{{/vendorExtensions.x-multiple-2xx-response-operation}}{{^vendorExtensions.x-multiple-2xx-response-operation}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-multiple-2xx-response-operation}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/native/AbstractOpenApiSchema.mustache b/sdks/java-v2/templates/libraries/native/AbstractOpenApiSchema.mustache index 19bf0a634..f196a13ec 100644 --- a/sdks/java-v2/templates/libraries/native/AbstractOpenApiSchema.mustache +++ b/sdks/java-v2/templates/libraries/native/AbstractOpenApiSchema.mustache @@ -2,7 +2,6 @@ package {{modelPackage}}; -import {{invokerPackage}}.ApiException; import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; @@ -12,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} +{{>generatedAnnotation}} public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/sdks/java-v2/templates/libraries/native/ApiClient.mustache b/sdks/java-v2/templates/libraries/native/ApiClient.mustache index 03fe2a468..a641525af 100644 --- a/sdks/java-v2/templates/libraries/native/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/native/ApiClient.mustache @@ -14,13 +14,12 @@ import java.io.InputStream; import java.net.URI; import java.net.URLEncoder; import java.net.http.HttpClient; +import java.net.http.HttpConnectTimeoutException; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; -{{#java8}} import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Collection; import java.util.Collections; import java.util.List; @@ -56,16 +55,15 @@ public class ApiClient { private Consumer> responseInterceptor; private Consumer> asyncResponseInterceptor; private Duration readTimeout; + private Duration connectTimeout; - private static String valueToString(Object value) { + public static String valueToString(Object value) { if (value == null) { return ""; } - {{#java8}} if (value instanceof OffsetDateTime) { return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); } - {{/java8}} return value.toString(); } @@ -154,7 +152,7 @@ public class ApiClient { } /** - * Ctor. + * Create an instance of ApiClient. */ public ApiClient() { this.builder = createDefaultHttpClientBuilder(); @@ -162,12 +160,17 @@ public class ApiClient { updateBaseUri(getDefaultBaseUri()); interceptor = null; readTimeout = null; + connectTimeout = null; responseInterceptor = null; asyncResponseInterceptor = null; } /** - * Ctor. + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI */ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { this.builder = builder; @@ -175,6 +178,7 @@ public class ApiClient { updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); interceptor = null; readTimeout = null; + connectTimeout = null; responseInterceptor = null; asyncResponseInterceptor = null; } @@ -411,4 +415,35 @@ public class ApiClient { public Duration getReadTimeout() { return readTimeout; } + /** + * Sets the connect timeout (in milliseconds) for the http client. + * + *

In the case where a new connection needs to be established, if + * the connection cannot be established within the given {@code + * duration}, then {@link HttpClient#send(HttpRequest,BodyHandler) + * HttpClient::send} throws an {@link HttpConnectTimeoutException}, or + * {@link HttpClient#sendAsync(HttpRequest,BodyHandler) + * HttpClient::sendAsync} completes exceptionally with an + * {@code HttpConnectTimeoutException}. If a new connection does not + * need to be established, for example if a connection can be reused + * from a previous request, then this timeout duration has no effect. + * + * @param connectTimeout connection timeout in milliseconds + * + * @return This object. + */ + public ApiClient setConnectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + this.builder.connectTimeout(connectTimeout); + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public Duration getConnectTimeout() { + return connectTimeout; + } } diff --git a/sdks/java-v2/templates/libraries/native/ApiResponse.mustache b/sdks/java-v2/templates/libraries/native/ApiResponse.mustache index 1e277319a..e2f8f6cd4 100644 --- a/sdks/java-v2/templates/libraries/native/ApiResponse.mustache +++ b/sdks/java-v2/templates/libraries/native/ApiResponse.mustache @@ -14,6 +14,7 @@ import java.util.TreeMap; * * @param The type of data that is deserialized from response body */ +{{>generatedAnnotation}} public class ApiResponse { final private int statusCode; final private Map> headers; diff --git a/sdks/java-v2/templates/libraries/native/JSON.mustache b/sdks/java-v2/templates/libraries/native/JSON.mustache index 961f23b48..813bb7940 100644 --- a/sdks/java-v2/templates/libraries/native/JSON.mustache +++ b/sdks/java-v2/templates/libraries/native/JSON.mustache @@ -1,22 +1,17 @@ +{{>licenseInfo}} + package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -32,28 +27,20 @@ public class JSON { private ObjectMapper mapper; public JSON() { - mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} - mapper.registerModule(new JavaTimeModule()); - {{/java8}} + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS) + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + .build(); {{#joda}} mapper.registerModule(new JodaModule()); {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); @@ -62,6 +49,7 @@ public class JSON { /** * Set the date format for JSON (de)serialization with Date properties. + * * @param dateFormat Date format */ public void setDateFormat(DateFormat dateFormat) { @@ -81,6 +69,8 @@ public class JSON { * * @param node The input data. * @param modelClass The class that contains the discriminator mappings. + * + * @return the target model class. */ public static Class getClassForElement(JsonNode node, Class modelClass) { ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); @@ -93,6 +83,7 @@ public class JSON { /** * Helper class to register the discriminator mappings. */ + {{>generatedAnnotation}} private static class ClassDiscriminatorMapping { // The model class name. Class modelClass; @@ -140,6 +131,8 @@ public class JSON { * * @param node The input data. * @param visitedClasses The set of classes that have already been visited. + * + * @return the target model class. */ Class getClassForElement(JsonNode node, Set> visitedClasses) { if (visitedClasses.contains(modelClass)) { @@ -186,6 +179,9 @@ public class JSON { * * @param modelClass A OpenAPI model class. * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. */ public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { diff --git a/sdks/java-v2/templates/libraries/native/README.mustache b/sdks/java-v2/templates/libraries/native/README.mustache index ef15f379a..fd7d4905a 100644 --- a/sdks/java-v2/templates/libraries/native/README.mustache +++ b/sdks/java-v2/templates/libraries/native/README.mustache @@ -8,6 +8,8 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} + {{{appDescriptionWithNewLines}}} {{#infoUrl}} @@ -139,11 +141,14 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}} @@ -151,10 +156,18 @@ Class | Method | HTTP request | Description - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasic}} +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}} - **Type**: OAuth diff --git a/sdks/java-v2/templates/libraries/native/additional_properties.mustache b/sdks/java-v2/templates/libraries/native/additional_properties.mustache index 61973dc24..8e7182792 100644 --- a/sdks/java-v2/templates/libraries/native/additional_properties.mustache +++ b/sdks/java-v2/templates/libraries/native/additional_properties.mustache @@ -9,6 +9,9 @@ /** * Set the additional (undeclared) property with the specified name and value. * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference */ @JsonAnySetter public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { @@ -20,7 +23,8 @@ } /** - * Return the additional (undeclared) property. + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties */ @JsonAnyGetter public Map getAdditionalProperties() { @@ -29,6 +33,8 @@ /** * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name */ public {{{.}}} getAdditionalProperty(String key) { if (this.additionalProperties == null) { diff --git a/sdks/java-v2/templates/libraries/native/anyof_model.mustache b/sdks/java-v2/templates/libraries/native/anyof_model.mustache index c87c932fe..dfb6464d5 100644 --- a/sdks/java-v2/templates/libraries/native/anyof_model.mustache +++ b/sdks/java-v2/templates/libraries/native/anyof_model.mustache @@ -21,7 +21,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -54,7 +54,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Object deserialized = null; {{#discriminator}} - Class cls = JSON.getClassForElement(tree, {{classname}}.class); + Class cls = JSON.getClassForElement(tree, new {{classname}}().getClass()); if (cls != null) { // When the OAS schema includes a discriminator, use the discriminator value to // discriminate the anyOf schemas. @@ -195,4 +195,168 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} + +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (getActualInstance() instanceof {{{dataType}}}) { + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getActualInstance().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if ((({{{dataType}}})getActualInstance()).get(i) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if (getActualInstance().get(i) != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getActualInstance().get(_key), URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + if ((({{{dataType}}})getActualInstance()).get(_key) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isPrimitiveType}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if (getActualInstance() != null) { + joiner.add((({{{dataType}}})getActualInstance()).toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + return joiner.toString(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + return null; + } +{{/supportUrlQuery}} + } diff --git a/sdks/java-v2/templates/libraries/native/api.mustache b/sdks/java-v2/templates/libraries/native/api.mustache index 86fb8dd89..a80dcbac8 100644 --- a/sdks/java-v2/templates/libraries/native/api.mustache +++ b/sdks/java-v2/templates/libraries/native/api.mustache @@ -13,22 +13,40 @@ import {{import}}; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import java.io.IOException; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} +{{#hasFormParamsInSpec}} +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; + +{{/hasFormParamsInSpec}} import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; -import java.util.function.Consumer; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.StringJoiner; import java.util.List; import java.util.Map; import java.util.Set; -{{/fullJavaUtil}} +import java.util.function.Consumer; {{#asyncNative}} import java.util.concurrent.CompletableFuture; @@ -91,6 +109,11 @@ public class {{classname}} { {{#returnType}} * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}{{returnType}}{{#asyncNative}}>{{/asyncNative}} {{/returnType}} + {{^returnType}} + {{#asyncNative}} + * @return CompletableFuture<Void> + {{/asyncNative}} + {{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -140,11 +163,16 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} {{#returnType}} * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}{{returnType}}{{#asyncNative}}>{{/asyncNative}} {{/returnType}} + {{^returnType}} + {{#asyncNative}} + * @return CompletableFuture<Void> + {{/asyncNative}} + {{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -175,8 +203,9 @@ public class {{classname}} { } {{#returnType}} try { + String responseBody = localVarResponse.body(); return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) + responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<{{{returnType}}}>() {}) ); } catch (IOException e) { return CompletableFuture.failedFuture(new ApiException(e)); @@ -197,7 +226,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} * @throws ApiException if fails to make API call @@ -226,12 +255,33 @@ public class {{classname}} { if (localVarResponse.statusCode()/ 100 != 2) { throw getApiException("{{operationId}}", localVarResponse); } + {{#vendorExtensions.x-java-text-plain-string}} + // for plain text response + if (localVarResponse.headers().map().containsKey("Content-Type") && + "text/plain".equalsIgnoreCase(localVarResponse.headers().map().get("Content-Type").get(0).split(";")[0].trim())) { + java.util.Scanner s = new java.util.Scanner(localVarResponse.body()).useDelimiter("\\A"); + String responseBodyText = s.hasNext() ? s.next() : ""; + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseBodyText + ); + } else { + throw new RuntimeException("Error! The response Content-Type is supposed to be `text/plain` but it's not: " + localVarResponse); + } + {{/vendorExtensions.x-java-text-plain-string}} + {{^vendorExtensions.x-java-text-plain-string}} return new ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>( localVarResponse.statusCode(), localVarResponse.headers().map(), - {{#returnType}}memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) // closes the InputStream{{/returnType}} - {{^returnType}}null{{/returnType}} + {{#returnType}} + localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) // closes the InputStream + {{/returnType}} + {{^returnType}} + null + {{/returnType}} ); + {{/vendorExtensions.x-java-text-plain-string}} } finally { {{^returnType}} // Drain the InputStream @@ -263,11 +313,12 @@ public class {{classname}} { } {{#returnType}} try { + String responseBody = localVarResponse.body(); return CompletableFuture.completedFuture( new ApiResponse<{{{returnType}}}>( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {})) + responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<{{{returnType}}}>() {})) ); } catch (IOException e) { return CompletableFuture.failedFuture(new ApiException(e)); @@ -304,28 +355,64 @@ public class {{classname}} { .replace({{=<% %>=}}"{<%baseName%>}"<%={{ }}=%>, ApiClient.urlEncode({{{paramName}}}.toString())){{/pathParams}}; {{#hasQueryParams}} - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList<>(); + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; {{#queryParams}} + localVarQueryParameterBaseName = "{{{baseName}}}"; {{#collectionFormat}} localVarQueryParams.addAll(ApiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/collectionFormat}} {{^collectionFormat}} {{#isDeepObject}} if ({{paramName}} != null) { - {{#items.vars}} - localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}())); - {{/items.vars}} + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + localVarQueryStringJoiner.add({{paramName}}.get(i).toUrlQueryString(String.format("{{baseName}}[%d]", i))); + } + {{/isArray}} + {{^isArray}} + String queryString = {{paramName}}.toUrlQueryString("{{baseName}}"); + if (!queryString.isBlank()) { + localVarQueryStringJoiner.add(queryString); + } + {{/isArray}} } {{/isDeepObject}} {{^isDeepObject}} + {{#isExplode}} + {{#hasVars}} + {{#vars}} + {{#isArray}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{^isArray}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}())); + {{/isArray}} + {{/vars}} + {{/hasVars}} + {{^hasVars}} + {{#isModel}} + localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString()); + {{/isModel}} + {{^isModel}} localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}})); + {{/isModel}} + {{/hasVars}} + {{/isExplode}} + {{^isExplode}} + localVarQueryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}})); + {{/isExplode}} {{/isDeepObject}} {{/collectionFormat}} {{/queryParams}} - if (!localVarQueryParams.isEmpty()) { - {{javaUtilPrefix}}StringJoiner queryJoiner = new StringJoiner("&"); + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); } else { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); @@ -341,20 +428,113 @@ public class {{classname}} { } {{/headerParams}} {{#bodyParam}} - localVarRequestBuilder.header("Content-Type", "{{#hasConsumes}}{{#consumes}}{{#-first}}{{mediaType}}{{/-first}}{{/consumes}}{{/hasConsumes}}{{#hasConsumes}}{{^consumes}}application/json{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}application/json{{/hasConsumes}}"); + localVarRequestBuilder.header("Content-Type", "{{#hasConsumes}}{{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}{{/hasConsumes}}{{#hasConsumes}}{{^consumes}}application/json{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}application/json{{/hasConsumes}}"); {{/bodyParam}} - localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{mediaType}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}"); + localVarRequestBuilder.header("Accept", "{{#hasProduces}}{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{/hasProduces}}{{#hasProduces}}{{^produces}}application/json{{/produces}}{{/hasProduces}}{{^hasProduces}}application/json{{/hasProduces}}"); {{#bodyParam}} + {{#isString}} + localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.ofString({{paramName}})); + {{/isString}} + {{^isString}} try { byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes({{paramName}}); localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); } catch (IOException e) { throw new ApiException(e); } + {{/isString}} {{/bodyParam}} {{^bodyParam}} + {{#hasFormParams}} + {{#isMultipart}} + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + {{#formParams}} + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + {{#isFile}} + multiPartBuilder.addBinaryBody("{{{baseName}}}", {{paramName}}.get(i)); + hasFiles = true; + {{/isFile}} + {{^isFile}} + multiPartBuilder.addTextBody("{{{baseName}}}", {{paramName}}.get(i).toString()); + {{/isFile}} + } + {{/isArray}} + {{^isArray}} + {{#isFile}} + multiPartBuilder.addBinaryBody("{{{baseName}}}", {{paramName}}); + hasFiles = true; + {{/isFile}} + {{^isFile}} + multiPartBuilder.addTextBody("{{{baseName}}}", {{paramName}}.toString()); + {{/isFile}} + {{/isArray}} + {{/formParams}} + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("{{httpMethod}}", formDataPublisher); + {{/isMultipart}} + {{^isMultipart}} + List formValues = new ArrayList<>(); + {{#formParams}} + {{#isArray}} + for (int i=0; i < {{paramName}}.size(); i++) { + if ({{paramName}}.get(i) != null) { + formValues.add(new BasicNameValuePair("{{{baseName}}}", {{paramName}}.get(i).toString())); + } + } + {{/isArray}} + {{^isArray}} + if ({{paramName}} != null) { + formValues.add(new BasicNameValuePair("{{{baseName}}}", {{paramName}}.toString())); + } + {{/isArray}} + {{/formParams}} + HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("{{httpMethod}}", HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray()))); + {{/isMultipart}} + {{/hasFormParams}} + {{^hasFormParams}} localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.noBody()); + {{/hasFormParams}} {{/bodyParam}} if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); @@ -364,6 +544,7 @@ public class {{classname}} { } return localVarRequestBuilder; } + {{#vendorExtensions.x-group-parameters}} {{#hasParams}} @@ -372,7 +553,7 @@ public class {{classname}} { private {{{dataType}}} {{paramName}}; // {{description}} (required) {{/requiredParams}} {{#optionalParams}} - private {{{dataType}}} {{paramName}}; // {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}} + private {{{dataType}}} {{paramName}}; // {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}) {{/optionalParams}} private API{{operationId}}Request(Builder builder) { diff --git a/sdks/java-v2/templates/libraries/native/apiException.mustache b/sdks/java-v2/templates/libraries/native/apiException.mustache index 3d0eee4bf..9596b73b6 100644 --- a/sdks/java-v2/templates/libraries/native/apiException.mustache +++ b/sdks/java-v2/templates/libraries/native/apiException.mustache @@ -6,6 +6,8 @@ import java.net.http.HttpHeaders; {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private HttpHeaders responseHeaders = null; private String responseBody = null; diff --git a/sdks/java-v2/templates/libraries/native/api_doc.mustache b/sdks/java-v2/templates/libraries/native/api_doc.mustache index 3af38b331..2b125e1f9 100644 --- a/sdks/java-v2/templates/libraries/native/api_doc.mustache +++ b/sdks/java-v2/templates/libraries/native/api_doc.mustache @@ -4,10 +4,10 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -[**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | +| [**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} @@ -98,9 +98,9 @@ public class Example { ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} @@ -230,9 +230,9 @@ public class Example { ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} @@ -266,13 +266,13 @@ Name | Type | Description | Notes {{/responses.0}} {{#vendorExtensions.x-group-parameters}}{{#hasParams}} - + ## API{{operationId}}Request ### Properties {{#allParams}}{{#-last}} | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} {{/hasParams}}{{/vendorExtensions.x-group-parameters}} diff --git a/sdks/java-v2/templates/libraries/native/api_test.mustache b/sdks/java-v2/templates/libraries/native/api_test.mustache index ffcf05ec3..497bd5308 100644 --- a/sdks/java-v2/templates/libraries/native/api_test.mustache +++ b/sdks/java-v2/templates/libraries/native/api_test.mustache @@ -5,25 +5,28 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -{{/fullJavaUtil}} {{#asyncNative}} import java.util.concurrent.CompletableFuture; {{/asyncNative}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); diff --git a/sdks/java-v2/templates/libraries/native/build.gradle.mustache b/sdks/java-v2/templates/libraries/native/build.gradle.mustache index 03d303d0d..24ea4fef0 100644 --- a/sdks/java-v2/templates/libraries/native/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/native/build.gradle.mustache @@ -1,5 +1,6 @@ apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' group = '{{groupId}}' version = '{{artifactVersion}}' @@ -8,6 +9,9 @@ buildscript { repositories { mavenCentral() } + dependencies { + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } } repositories { @@ -62,17 +66,27 @@ artifacts { ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.4" + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + jackson_version = "2.17.1" jakarta_annotation_version = "1.3.5" - junit_version = "4.13.1" - {{#threetenbp}} - threetenbp_version = "2.9.10" - {{/threetenbp}} + junit_version = "5.10.2" + {{#hasFormParamsInSpec}} + httpmime_version = "4.5.13" + {{/hasFormParamsInSpec}} } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" @@ -80,8 +94,31 @@ dependencies { implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" - {{/threetenbp}} - testImplementation "junit:junit:$junit_version" + {{#hasFormParamsInSpec}} + implementation "org.apache.httpcomponents:httpmime:$httpmime_version" + {{/hasFormParamsInSpec}} + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } } diff --git a/sdks/java-v2/templates/libraries/native/generatedAnnotation.mustache b/sdks/java-v2/templates/libraries/native/generatedAnnotation.mustache index baf5ff08b..e05689d5f 100644 --- a/sdks/java-v2/templates/libraries/native/generatedAnnotation.mustache +++ b/sdks/java-v2/templates/libraries/native/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.processing.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@{{javaxPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}, comments = "Generator version: {{generatorVersion}}") \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/native/model.mustache b/sdks/java-v2/templates/libraries/native/model.mustache index 6f2436c38..cd2a85a22 100644 --- a/sdks/java-v2/templates/libraries/native/model.mustache +++ b/sdks/java-v2/templates/libraries/native/model.mustache @@ -16,8 +16,12 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; {{/additionalPropertiesType}} {{/model}} {{/models}} +{{#supportUrlQuery}} +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +{{/supportUrlQuery}} import java.util.Objects; -import java.util.Arrays; import java.util.Map; import java.util.HashMap; {{#imports}} @@ -36,15 +40,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} -import javax.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.*; {{/withXml}} {{#parcelableModel}} import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/sdks/java-v2/templates/libraries/native/modelEnum.mustache b/sdks/java-v2/templates/libraries/native/modelEnum.mustache new file mode 100644 index 000000000..5f22f7559 --- /dev/null +++ b/sdks/java-v2/templates/libraries/native/modelEnum.mustache @@ -0,0 +1,120 @@ +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +{{/jackson}} +{{#gson}} +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +{{/gson}} +{{#isUri}} +import java.net.URI; +{{/isUri}} + +/** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +{{#gson}} +@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class) +{{/gson}} +{{#jsonb}} +@JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) +@JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + +{{#jackson}} + @JsonValue +{{/jackson}} + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +{{#jackson}} + @JsonCreator +{{/jackson}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +{{/supportUrlQuery}} + +{{#gson}} + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } +{{/gson}} +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { + @Override + public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}} + } + } + + public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { + @Override + public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } +{{/jsonb}} +} diff --git a/sdks/java-v2/templates/libraries/native/oneof_model.mustache b/sdks/java-v2/templates/libraries/native/oneof_model.mustache index 993961a6e..8aa2ef073 100644 --- a/sdks/java-v2/templates/libraries/native/oneof_model.mustache +++ b/sdks/java-v2/templates/libraries/native/oneof_model.mustache @@ -23,7 +23,7 @@ import {{invokerPackage}}.JSON; {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} @JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class) @JsonSerialize(using = {{classname}}.{{classname}}Serializer.class) -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { private static final Logger log = Logger.getLogger({{classname}}.class.getName()); public static class {{classname}}Serializer extends StdSerializer<{{classname}}> { @@ -60,12 +60,12 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}"); switch (discriminatorValue) { - {{#mappedModels}} + {{#mappedModels}} case "{{{mappingName}}}": deserialized = tree.traverse(jp.getCodec()).readValueAs({{{modelName}}}.class); new{{classname}}.setActualInstance(deserialized); return new{{classname}}; - {{/mappedModels}} + {{/mappedModels}} default: log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); } @@ -228,4 +228,168 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/oneOf}} + +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (getActualInstance() instanceof {{{dataType}}}) { + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getActualInstance().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if ((({{{dataType}}})getActualInstance()).get(i) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if (getActualInstance() != null) { + int i = 0; + for ({{{items.dataType}}} _item : ({{{dataType}}})getActualInstance()) { + if (_item != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if (getActualInstance() != null) { + for (int i = 0; i < (({{{dataType}}})getActualInstance()).size(); i++) { + if (getActualInstance().get(i) != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{#items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getActualInstance().get(_key), URLEncoder.encode(String.valueOf((({{{dataType}}})getActualInstance()).get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + if (getActualInstance() != null) { + for (String _key : (({{{dataType}}})getActualInstance()).keySet()) { + if ((({{{dataType}}})getActualInstance()).get(_key) != null) { + joiner.add((({{{items.dataType}}})getActualInstance()).get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isPrimitiveType}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if (getActualInstance() != null) { + joiner.add((({{{dataType}}})getActualInstance()).toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if (getActualInstance() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + return joiner.toString(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + return null; + } +{{/supportUrlQuery}} + } diff --git a/sdks/java-v2/templates/libraries/native/pojo.mustache b/sdks/java-v2/templates/libraries/native/pojo.mustache index 5f0c03679..1250a71ec 100644 --- a/sdks/java-v2/templates/libraries/native/pojo.mustache +++ b/sdks/java-v2/templates/libraries/native/pojo.mustache @@ -1,12 +1,24 @@ {{#discriminator}} import {{invokerPackage}}.JSON; {{/discriminator}} +{{#supportUrlQuery}} +import {{invokerPackage}}.ApiClient; +{{/supportUrlQuery}} /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -15,6 +27,9 @@ import {{invokerPackage}}.JSON; }) {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -40,29 +55,17 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); @@ -72,12 +75,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; - {{/isContainer}} - {{^isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; - {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} @@ -94,7 +92,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} {{#vars}} @@ -123,10 +121,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -136,11 +134,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -148,10 +144,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -161,11 +157,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -173,7 +167,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -190,22 +184,30 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} {{#required}} {{#isNullable}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/isNullable}} {{^isNullable}} - @javax.annotation.Nonnull + @{{javaxPackage}}.annotation.Nonnull {{/isNullable}} {{/required}} {{^required}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/required}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -213,8 +215,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} @JsonIgnore {{/vendorExtensions.x-is-jackson-optional-nullable}} -{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} - public {{{datatypeWithEnum}}} {{getter}}() { +{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} public {{{datatypeWithEnum}}} {{getter}}() { {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} if ({{name}} == null) { @@ -261,6 +262,23 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vars}} {{>libraries/native/additional_properties}} + {{#parent}} + {{#allVars}} + {{#isOverridden}} + @Override + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}(JsonNullable.<{{{datatypeWithEnum}}}>of({{name}})); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + + {{/isOverridden}} + {{/allVars}} + {{/parent}} /** * Return true if this {{name}} object is equal to o. */ @@ -314,7 +332,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} {{#additionalPropertiesType}} sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); @@ -333,7 +351,165 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } return o.toString().replace("\n", "\n "); } +{{#supportUrlQuery}} + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#allVars}} + // add `{{baseName}}` to the URL query string + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString(_item), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(ApiClient.valueToString({{getter}}().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{^items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + {{getter}}().get(_key), URLEncoder.encode(ApiClient.valueToString({{getter}}().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + {{/items.isModel}} + {{#items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + if ({{getter}}().get(_key) != null) { + joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isModel}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if ({{getter}}() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if ({{getter}}() != null) { + joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if ({{getter}}() != null) { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString({{{getter}}}()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + + {{/allVars}} + return joiner.toString(); + } +{{/supportUrlQuery}} {{#parcelableModel}} public void writeToParcel(Parcel out, int flags) { @@ -404,4 +580,8 @@ static { JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); } {{/discriminator}} +{{#generateBuilders}} + + {{>javaBuilder}} +{{/generateBuilders}} } diff --git a/sdks/java-v2/templates/libraries/native/pom.mustache b/sdks/java-v2/templates/libraries/native/pom.mustache index c0c151cda..8ed827791 100644 --- a/sdks/java-v2/templates/libraries/native/pom.mustache +++ b/sdks/java-v2/templates/libraries/native/pom.mustache @@ -42,7 +42,7 @@ maven-enforcer-plugin - 3.0.0-M1 + 3.1.0 enforce-maven @@ -64,7 +64,7 @@ maven-surefire-plugin - 3.0.0-M3 + 3.2.5 conf/log4j.properties @@ -76,7 +76,7 @@ maven-dependency-plugin - 3.1.1 + 3.3.0 package @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.1.2 + 3.3.0 @@ -107,12 +107,12 @@ maven-compiler-plugin - 3.8.1 + 3.10.1 org.apache.maven.plugins maven-javadoc-plugin - 3.1.0 + 3.4.1 attach-javadocs @@ -124,7 +124,7 @@ maven-source-plugin - 3.1.0 + 3.2.1 attach-sources @@ -134,6 +134,46 @@ + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + @@ -144,7 +184,7 @@ maven-gpg-plugin - 1.6 + 3.0.1 sign-artifacts @@ -161,11 +201,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -193,13 +242,6 @@ jackson-databind-nullable ${jackson-databind-nullable-version} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - - {{/threetenbp}} @@ -213,11 +255,27 @@ ${jakarta-annotation-version} provided + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + {{#hasFormParamsInSpec}} + + org.apache.httpcomponents + httpmime + ${httpmime-version} + + {{/hasFormParamsInSpec}} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -225,15 +283,29 @@ UTF-8 - 1.5.22 + {{#swagger1AnnotationLibrary}} + 1.6.9 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} 11 11 - 2.10.4 - 0.2.2 + 2.17.1 + 0.2.6 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} - 4.13.1 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + {{#hasFormParamsInSpec}} + 4.5.14 + {{/hasFormParamsInSpec}} + 5.10.2 + 2.27.2 diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache deleted file mode 100644 index 3ba02e44c..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache +++ /dev/null @@ -1,138 +0,0 @@ -{{>licenseInfo}} - -package {{modelPackage}}; - -import {{invokerPackage}}.ApiException; -import java.util.Objects; -import java.lang.reflect.Type; -import java.util.Map; -import javax.ws.rs.core.GenericType; - -//import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec - */ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} -public abstract class AbstractOpenApiSchema { - - // store the actual instance of the schema/object - private Object instance; - - // is nullable - private Boolean isNullable; - - // schema type (e.g. oneOf, anyOf) - private final String schemaType; - - public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { - this.schemaType = schemaType; - this.isNullable = isNullable; - } - - /** - * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object - * - * @return an instance of the actual schema/object - */ - public abstract Map getSchemas(); - - /** - * Get the actual instance - * - * @return an instance of the actual schema/object - */ - //@JsonValue - public Object getActualInstance() {return instance;} - - /** - * Set the actual instance - * - * @param instance the actual instance of the schema/object - */ - public void setActualInstance(Object instance) {this.instance = instance;} - - /** - * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well - * - * @return an instance of the actual schema/object - */ - public Object getActualInstanceRecursively() { - return getActualInstanceRecursively(this); - } - - private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { - if (object.getActualInstance() == null) { - return null; - } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { - return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); - } else { - return object.getActualInstance(); - } - } - - /** - * Get the schema type (e.g. anyOf, oneOf) - * - * @return the schema type - */ - public String getSchemaType() { - return schemaType; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ").append(getClass()).append(" {\n"); - sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); - sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); - sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * 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 "); - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; - return Objects.equals(this.instance, a.instance) && - Objects.equals(this.isNullable, a.isNullable) && - Objects.equals(this.schemaType, a.schemaType); - } - - @Override - public int hashCode() { - return Objects.hash(instance, isNullable, schemaType); - } - - /** - * Is nullable - * - * @return true if it's nullable - */ - public Boolean isNullable() { - if (Boolean.TRUE.equals(isNullable)) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } - -{{>libraries/jersey2/additional_properties}} - -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ApiCallback.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ApiCallback.mustache deleted file mode 100644 index 53b6a7b8e..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ApiCallback.mustache +++ /dev/null @@ -1,51 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.io.IOException; - -import java.util.Map; -import java.util.List; - -/** - * Callback for asynchronous API call. - * - * @param The return type - */ -public interface ApiCallback { - /** - * This is called when the API call fails. - * - * @param e The exception causing the failure - * @param statusCode Status code of the response if available, otherwise it would be 0 - * @param responseHeaders Headers of the response if available, otherwise it would be null - */ - void onFailure(ApiException e, int statusCode, Map> responseHeaders); - - /** - * This is called when the API call succeeded. - * - * @param result The result deserialized from response - * @param statusCode Status code of the response - * @param responseHeaders Headers of the response - */ - void onSuccess(T result, int statusCode, Map> responseHeaders); - - /** - * This is called when the API upload processing. - * - * @param bytesWritten bytes Written - * @param contentLength content length of request body - * @param done write end - */ - void onUploadProgress(long bytesWritten, long contentLength, boolean done); - - /** - * This is called when the API download processing. - * - * @param bytesRead bytes Read - * @param contentLength content length of the response - * @param done Read end - */ - void onDownloadProgress(long bytesRead, long contentLength, boolean done); -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ApiClient.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ApiClient.mustache deleted file mode 100644 index de8ac2527..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ApiClient.mustache +++ /dev/null @@ -1,1738 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -{{#dynamicOperations}} -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.parameters.Parameter; -import io.swagger.v3.oas.models.parameters.Parameter.StyleEnum; -import io.swagger.v3.parser.OpenAPIV3Parser; -{{/dynamicOperations}} -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; -{{#joda}} -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormatter; -{{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} -{{#hasOAuthMethods}} -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.common.message.types.GrantType; -{{/hasOAuthMethods}} - -import javax.net.ssl.*; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Type; -import java.net.URI; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.GeneralSecurityException; -import java.security.KeyStore; -import java.security.SecureRandom; -import java.security.cert.Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.text.DateFormat; -{{#java8}} -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -{{/java8}} -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import {{invokerPackage}}.auth.Authentication; -import {{invokerPackage}}.auth.HttpBasicAuth; -import {{invokerPackage}}.auth.HttpBearerAuth; -import {{invokerPackage}}.auth.ApiKeyAuth; -{{#hasOAuthMethods}} -import {{invokerPackage}}.auth.OAuth; -import {{invokerPackage}}.auth.RetryingOAuth; -import {{invokerPackage}}.auth.OAuthFlow; -{{/hasOAuthMethods}} - -/** - *

ApiClient class.

- */ -public class ApiClient { - - private String basePath = "{{{basePath}}}"; - private boolean debugging = false; - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String tempFolderPath = null; - - private Map authentications; - - private DateFormat dateFormat; - private DateFormat datetimeFormat; - private boolean lenientDatetimeFormat; - private int dateLength; - - private InputStream sslCaCert; - private boolean verifyingSsl; - private KeyManager[] keyManagers; - - private OkHttpClient httpClient; - private JSON json; - - private HttpLoggingInterceptor loggingInterceptor; - - {{#dynamicOperations}} - private Map operationLookupMap = new HashMap<>(); - - {{/dynamicOperations}} - /** - * Basic constructor for ApiClient - */ - public ApiClient() { - init(); - initHttpClient(); - - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Basic constructor with custom OkHttpClient - * - * @param client a {@link okhttp3.OkHttpClient} object - */ - public ApiClient(OkHttpClient client) { - init(); - - httpClient = client; - - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - {{#hasOAuthMethods}} - {{#oauthMethods}} - {{#-first}} - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID - * - * @param clientId client ID - */ - public ApiClient(String clientId) { - this(clientId, null, null); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters - * - * @param clientId client ID - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String clientId, Map parameters) { - this(clientId, null, parameters); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters - * - * @param clientId client ID - * @param clientSecret client secret - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String clientId, String clientSecret, Map parameters) { - this(null, clientId, clientSecret, parameters); - } - - /** - * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters - * - * @param basePath base path - * @param clientId client ID - * @param clientSecret client secret - * @param parameters a {@link java.util.Map} of parameters - */ - public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { - init(); - if (basePath != null) { - this.basePath = basePath; - } - -{{#hasOAuthMethods}} - String tokenUrl = "{{tokenUrl}}"; - if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { - URI uri = URI.create(getBasePath()); - tokenUrl = uri.getScheme() + ":" + - (uri.getAuthority() != null ? "//" + uri.getAuthority() : "") + - tokenUrl; - if (!URI.create(tokenUrl).isAbsolute()) { - throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); - } - } - RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{flow}}, clientSecret, parameters); - authentications.put( - "{{name}}", - retryingOAuth - ); - initHttpClient(Collections.singletonList(retryingOAuth)); -{{/hasOAuthMethods}} - // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}} - - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - {{/-first}} - {{/oauthMethods}} - {{/hasOAuthMethods}} - private void initHttpClient() { - initHttpClient(Collections.emptyList()); - } - - private void initHttpClient(List interceptors) { - OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor: interceptors) { - builder.addInterceptor(interceptor); - } - {{#useGzipFeature}} - // Enable gzip request compression - builder.addInterceptor(new GzipRequestInterceptor()); - {{/useGzipFeature}} - - httpClient = builder.build(); - } - - private void init() { - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); - - authentications = new HashMap(); - {{#dynamicOperations}} - - OpenAPI openAPI = new OpenAPIV3Parser().read("openapi/openapi.yaml"); - createOperationLookupMap(openAPI); - {{/dynamicOperations}} - } - - /** - * Get base path - * - * @return Base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g {{{basePath}}} - * @return An instance of OkHttpClient - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Set HTTP client, which must never be null. - * - * @param newHttpClient An instance of OkHttpClient - * @return Api Client - * @throws java.lang.NullPointerException when newHttpClient is null - */ - public ApiClient setHttpClient(OkHttpClient newHttpClient) { - this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); - return this; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - /** - * Configure whether to verify certificate and hostname when making https requests. - * Default to true. - * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - /** - *

Getter for the field keyManagers.

- * - * @return an array of {@link javax.net.ssl.KeyManager} objects - */ - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - /** - *

Getter for the field dateFormat.

- * - * @return a {@link java.text.DateFormat} object - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - *

Setter for the field dateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); - return this; - } - - /** - *

Set SqlDateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); - return this; - } - - {{#joda}} - public ApiClient setDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setDateTimeFormat(dateFormat); - return this; - } - - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; - } - - {{/joda}} - {{#jsr310}} - /** - *

Set OffsetDateTimeFormat.

- * - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); - return this; - } - - /** - *

Set LocalDateFormat.

- * - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); - return this; - } - - {{/jsr310}} - /** - *

Set LenientOnJson.

- * - * @param lenientOnJson a boolean - * @return a {@link org.openapitools.client.ApiClient} object - */ - public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication objects - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - {{#hasHttpBearerMethods}} - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); - } - {{/hasHttpBearerMethods}} - - /** - * Helper method to set username for the first HTTP basic authentication. - * - * @param username Username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * - * @param apiKey API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - {{#hasOAuthMethods}} - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - {{/hasOAuthMethods}} - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return ApiClient - */ - public ApiClient addDefaultCookie(String key, String value) { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. - * - * @see createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - /** - * Sets the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - {{#hasOAuthMethods}} - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * - * @return Token request builder - */ - public TokenRequestBuilder getTokenEndPoint() { - for (Authentication apiAuth : authentications.values()) { - if (apiAuth instanceof RetryingOAuth) { - RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; - return retryingOAuth.getTokenRequestBuilder(); - } - } - return null; - } - {{/hasOAuthMethods}} - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date {{#joda}}|| param instanceof DateTime || param instanceof LocalDate{{/joda}}{{#jsr310}}|| param instanceof OffsetDateTime || param instanceof LocalDate{{/jsr310}}) { - //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - * Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - {{^dynamicOperations}} - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - * Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - {{/dynamicOperations}} - {{#dynamicOperations}} - public List parameterToPairs(Parameter param, Collection value) { - List params = new ArrayList(); - - // preconditions - if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) { - return params; - } - - // create the params based on the collection format - if (StyleEnum.FORM.equals(param.getStyle()) && Boolean.TRUE.equals(param.getExplode())) { - for (Object item : value) { - params.add(new Pair(param.getName(), escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if (StyleEnum.SPACEDELIMITED.equals(param.getStyle())) { - delimiter = escapeString(" "); - } else if (StyleEnum.PIPEDELIMITED.equals(param.getStyle())) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(param.getName(), sb.substring(delimiter.length()))); - - return params; - } - {{/dynamicOperations}} - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString(String collectionFormat, Collection value) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - return sb.substring(delimiter.length()); - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(String filename) { - return filename.replaceAll(".*[/\\\\]", ""); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * returns null. If it matches "any", JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return null; - } - - if (contentTypes[0].equals("*/*")) { - return "application/json"; - } - - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body - * or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - String respBody; - try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; - } catch (IOException e) { - throw new ApiException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new ApiException( - "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody); - } - } - - /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws org.openapitools.client.ApiException If fail to serialize the given object - */ - public RequestBody serialize(Object obj, String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = json.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @return Prepared file for the download - * @throws java.io.IOException If fail to prepare file for download - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and - * data, which is a Java object deserialized from response body and would be null - * when returnType is null. - * @throws org.openapitools.client.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse(response.code(), response.headers().toMultimap(), data); - } catch (IOException e) { - throw new ApiException(e); - } - } - - {{#supportStreaming}} - /** - *

Execute stream.

- * - * @param call a {@link okhttp3.Call} object - * @param returnType a {@link java.lang.reflect.Type} object - * @return a {@link java.io.InputStream} object - * @throws org.openapitools.client.ApiException if any. - */ - public InputStream executeStream(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - if (!response.isSuccessful()) { - throw new ApiException(response.code(), response.message()); - } - if (response.body() == null) { - return null; - } - return response.body().byteStream(); - } catch (IOException e) { - throw new ApiException(e); - } - } - - {{/supportStreaming}} - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - @SuppressWarnings("unchecked") - public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (Exception e) { - callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); - return; - } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); - } - }); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or - * fail to deserialize the response body - */ - public T handleResponse(Response response, Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (Exception e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - /** - * Build HTTP call with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws org.openapitools.client.ApiException If fail to serialize the request body object - */ - public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - - final String url = buildUrl(path, queryParams, collectionQueryParams); - - // prepare HTTP request body - RequestBody reqBody; - String contentType = headerParams.get("Content-Type"); - - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentType)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentType)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); - } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Set cookie parameters to the request builder, including default cookies. - * - * @param cookieParams Cookie parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { - for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - for (Entry param : defaultCookieMap.entrySet()) { - if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - } - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws org.openapitools.client.ApiException If fails to update the parameters - */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, - Map cookieParams, String payload, String method, URI uri) throws ApiException { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) { - throw new RuntimeException("Authentication undefined: " + authName); - } - auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(Map formParams) { - okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); - } else { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); - mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); - } - } - return mpBuilder.build(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(File file) { - String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for - * async requests. - */ - private Interceptor getProgressInterceptor() { - return new Interceptor() { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - } - }; - } - - /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. - */ - private void applySslSettings() { - try { - TrustManager[] trustManagers; - HostnameVerifier hostnameVerifier; - if (!verifyingSsl) { - trustManagers = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; - } - } - }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - } else { - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - if (sslCaCert == null) { - trustManagerFactory.init((KeyStore) null); - } else { - char[] password = null; // Any password will work. - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); - } - KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - trustManagerFactory.init(caKeyStore); - } - trustManagers = trustManagerFactory.getTrustManagers(); - hostnameVerifier = OkHostnameVerifier.INSTANCE; - } - - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = httpClient.newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) - .hostnameVerifier(hostnameVerifier) - .build(); - } catch (GeneralSecurityException e) { - throw new RuntimeException(e); - } - } - - private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { - try { - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (IOException e) { - throw new AssertionError(e); - } - } - {{#dynamicOperations}} - - public ApiClient createOperationLookupMap(OpenAPI openAPI) { - operationLookupMap = new HashMap<>(); - for (Map.Entry pathItemEntry : openAPI.getPaths().entrySet()) { - String path = pathItemEntry.getKey(); - PathItem pathItem = pathItemEntry.getValue(); - addOperationLookupEntry(path, "GET", pathItem.getGet()); - addOperationLookupEntry(path, "PUT", pathItem.getPut()); - addOperationLookupEntry(path, "POST", pathItem.getPost()); - addOperationLookupEntry(path, "DELETE", pathItem.getDelete()); - addOperationLookupEntry(path, "OPTIONS", pathItem.getOptions()); - addOperationLookupEntry(path, "HEAD", pathItem.getHead()); - addOperationLookupEntry(path, "PATCH", pathItem.getPatch()); - addOperationLookupEntry(path, "TRACE", pathItem.getTrace()); - } - return this; - } - - private void addOperationLookupEntry(String path, String method, Operation operation) { - if ( operation != null && operation.getOperationId() != null) { - operationLookupMap.put( - operation.getOperationId(), - new ApiOperation(path, method, operation)); - } - } - - public Map getOperationLookupMap() { - return operationLookupMap; - } - - public String fillParametersFromOperation( - Operation operation, - Map paramMap, - String path, - List queryParams, - List collectionQueryParams, - Map headerParams, - Map cookieParams - ) { - for (Map.Entry entry : paramMap.entrySet()) { - Object value = entry.getValue(); - for (Parameter param : operation.getParameters()) { - if (entry.getKey().equals(param.getName())) { - switch (param.getIn()) { - case "path": - path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString())); - break; - case "query": - if (value instanceof Collection) { - collectionQueryParams.addAll(parameterToPairs(param, (Collection) value)); - } else { - queryParams.addAll(parameterToPair(param.getName(), value)); - } - break; - case "header": - headerParams.put(param.getName(), parameterToString(value)); - break; - case "cookie": - cookieParams.put(param.getName(), parameterToString(value)); - break; - default: - throw new IllegalStateException("Unexpected param in: " + param.getIn()); - } - - } - } - } - return path; - } - {{/dynamicOperations}} - - /** - * Convert the HTTP request body to a string. - * - * @param request The HTTP request object - * @return The string representation of the HTTP request body - * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string - */ - private String requestBodyToString(RequestBody requestBody) throws ApiException { - if (requestBody != null) { - try { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - throw new ApiException(e); - } - } - - // empty http request body - return ""; - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ApiResponse.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ApiResponse.mustache deleted file mode 100644 index cecbaac1d..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ApiResponse.mustache +++ /dev/null @@ -1,75 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.util.List; -import java.util.Map; -{{#caseInsensitiveResponseHeaders}} -import java.util.Map.Entry; -import java.util.TreeMap; -{{/caseInsensitiveResponseHeaders}} - -/** - * API response returned by API call. - */ -public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; - - /** - *

Constructor for ApiResponse.

- * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - *

Constructor for ApiResponse.

- * - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - {{#caseInsensitiveResponseHeaders}} - Map> responseHeaders = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : headers.entrySet()){ - responseHeaders.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.headers = {{#caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}; - this.data = data; - } - - /** - *

Get the status code.

- * - * @return the status code - */ - public int getStatusCode() { - return statusCode; - } - - /** - *

Get the headers.

- * - * @return a {@link java.util.Map} of headers - */ - public Map> getHeaders() { - return headers; - } - - /** - *

Get the data.

- * - * @return the data - */ - public T getData() { - return data; - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache deleted file mode 100644 index b633aa8f5..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache +++ /dev/null @@ -1,74 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.*; -import okio.Buffer; -import okio.BufferedSink; -import okio.GzipSink; -import okio.Okio; - -import java.io.IOException; - -/** - * Encodes request bodies using gzip. - * - * Taken from https://github.com/square/okhttp/issues/350 - */ -class GzipRequestInterceptor implements Interceptor { - @Override - public Response intercept(Chain chain) throws IOException { - Request originalRequest = chain.request(); - if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { - return chain.proceed(originalRequest); - } - - Request compressedRequest = originalRequest.newBuilder() - .header("Content-Encoding", "gzip") - .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) - .build(); - return chain.proceed(compressedRequest); - } - - private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return new RequestBody() { - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() { - return buffer.size(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - sink.write(buffer.snapshot()); - } - }; - } - - private RequestBody gzip(final RequestBody body) { - return new RequestBody() { - @Override - public MediaType contentType() { - return body.contentType(); - } - - @Override - public long contentLength() { - return -1; // We don't know the compressed length in advance! - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); - body.writeTo(gzipSink); - gzipSink.close(); - } - }; - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/JSON.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/JSON.mustache deleted file mode 100644 index 32bef199e..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/JSON.mustache +++ /dev/null @@ -1,541 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonElement; -import io.gsonfire.GsonFireBuilder; -import io.gsonfire.TypeSelector; -{{#joda}} -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.DateTimeFormatterBuilder; -import org.joda.time.format.ISODateTimeFormat; -{{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} - -import okio.ByteString; - -import java.io.IOException; -import java.io.StringReader; -import java.lang.reflect.Type; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -{{#java8}} -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -{{/java8}} -import java.util.Date; -import java.util.Locale; -import java.util.Map; -import java.util.HashMap; - -/* - * A JSON utility class - * - * NOTE: in the future, this class may be converted to static, which may break - * backward-compatibility - */ -public class JSON { - private static Gson gson; - private static boolean isLenientOnJson = false; - private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - {{#joda}} - private static DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); - private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - {{/joda}} - {{#jsr310}} - private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - {{/jsr310}} - private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); - - @SuppressWarnings("unchecked") - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder() - {{#models}} - {{#model}} - {{#discriminator}} - .registerTypeSelector({{modelPackage}}.{{classname}}.class, new TypeSelector<{{modelPackage}}.{{classname}}>() { - @Override - public Class getClassForElement(JsonElement readElement) { - Map classByDiscriminatorValue = new HashMap(); - {{#mappedModels}} - classByDiscriminatorValue.put("{{mappingName}}"{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}, {{modelPackage}}.{{modelName}}.class); - {{/mappedModels}} - classByDiscriminatorValue.put("{{name}}"{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}, {{modelPackage}}.{{classname}}.class); - return getClassByDiscriminator(classByDiscriminatorValue, - getDiscriminatorValue(readElement, "{{{propertyBaseName}}}")); - } - }) - {{/discriminator}} - {{/model}} - {{/models}} - ; - GsonBuilder builder = fireBuilder.createGsonBuilder(); - {{#disableHtmlEscaping}} - builder.disableHtmlEscaping(); - {{/disableHtmlEscaping}} - return builder; - } - - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if (null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - /** - * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. - * - * @param classByDiscriminatorValue The map of discriminator values to Java classes. - * @param discriminatorValue The value of the OpenAPI discriminator in the input data. - * @return The Java class that implements the OpenAPI schema - */ - private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}); - if (null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } - - { - gson = createGson() - .registerTypeAdapter(Date.class, dateTypeAdapter) - .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) - {{#joda}} - .registerTypeAdapter(DateTime.class, dateTimeTypeAdapter) - .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) - {{/joda}} - {{#jsr310}} - .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) - .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) - {{/jsr310}} - .registerTypeAdapter(byte[].class, byteArrayAdapter) - {{#models}} - {{#model}} - {{^isEnum}} - {{^hasChildren}} - .registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) - {{/hasChildren}} - {{/isEnum}} - {{/model}} - {{/models}} - .create(); - } - - /** - * Get Gson. - * - * @return Gson - */ - public static Gson getGson() { - return gson; - } - - /** - * Set Gson. - * - * @param gson Gson - */ - public static void setGson(Gson gson) { - JSON.gson = gson; - } - - public static void setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - } - - /** - * Serialize the given Java object into JSON string. - * - * @param obj Object - * @return String representation of the JSON - */ - public static String serialize(Object obj) { - return gson.toJson(obj); - } - - /** - * Deserialize the given JSON string to Java object. - * - * @param Type - * @param body The JSON string - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - @SuppressWarnings("unchecked") - public static T deserialize(String body, Type returnType) { - try { - if (isLenientOnJson) { - JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(body, returnType); - } - } catch (JsonParseException e) { - // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; - if (returnType.equals(String.class)) { - return (T) body; - } else { - throw (e); - } - } - } - - /** - * Gson TypeAdapter for Byte Array type - */ - public static class ByteArrayAdapter extends TypeAdapter { - - @Override - public void write(JsonWriter out, byte[] value) throws IOException { - if (value == null) { - out.nullValue(); - } else { - out.value(ByteString.of(value).base64()); - } - } - - @Override - public byte[] read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String bytesAsBase64 = in.nextString(); - ByteString byteString = ByteString.decodeBase64(bytesAsBase64); - return byteString.toByteArray(); - } - } - } - - {{#joda}} - /** - * Gson TypeAdapter for Joda DateTime type - */ - public static class DateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public DateTimeTypeAdapter() { - this(new DateTimeFormatterBuilder() - .append(ISODateTimeFormat.dateTime().getPrinter(), ISODateTimeFormat.dateOptionalTimeParser().getParser()) - .toFormatter()); - } - - public DateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, DateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.print(date)); - } - } - - @Override - public DateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return formatter.parseDateTime(date); - } - } - } - - /** - * Gson TypeAdapter for Joda LocalDate type - */ - public static class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(ISODateTimeFormat.date()); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.print(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return formatter.parseLocalDate(date); - } - } - } - - public static void setDateTimeFormat(DateTimeFormatter dateFormat) { - dateTimeTypeAdapter.setFormat(dateFormat); - } - - public static void setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - } - - {{/joda}} - {{#jsr310}} - /** - * Gson TypeAdapter for JSR310 OffsetDateTime type - */ - public static class OffsetDateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length()-5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } - } - } - - /** - * Gson TypeAdapter for JSR310 LocalDate type - */ - public static class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } - } - } - - public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - } - - public static void setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - } - - {{/jsr310}} - /** - * Gson TypeAdapter for java.sql.Date type - * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used - * (more efficient than SimpleDateFormat). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() {} - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - - /** - * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, ISO8601Utils will be used. - */ - public static class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() {} - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } - } - - public static void setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - } - - public static void setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache deleted file mode 100644 index 71e1e2b4c..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache +++ /dev/null @@ -1,62 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.MediaType; -import okhttp3.RequestBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSink; -import okio.ForwardingSink; -import okio.Okio; -import okio.Sink; - -public class ProgressRequestBody extends RequestBody { - - private final RequestBody requestBody; - - private final ApiCallback callback; - - public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { - this.requestBody = requestBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return requestBody.contentType(); - } - - @Override - public long contentLength() throws IOException { - return requestBody.contentLength(); - } - - @Override - public void writeTo(BufferedSink sink) throws IOException { - BufferedSink bufferedSink = Okio.buffer(sink(sink)); - requestBody.writeTo(bufferedSink); - bufferedSink.flush(); - } - - private Sink sink(Sink sink) { - return new ForwardingSink(sink) { - - long bytesWritten = 0L; - long contentLength = 0L; - - @Override - public void write(Buffer source, long byteCount) throws IOException { - super.write(source, byteCount); - if (contentLength == 0) { - contentLength = contentLength(); - } - - bytesWritten += byteCount; - callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); - } - }; - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache deleted file mode 100644 index 45115940b..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache +++ /dev/null @@ -1,59 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import okhttp3.MediaType; -import okhttp3.ResponseBody; - -import java.io.IOException; - -import okio.Buffer; -import okio.BufferedSource; -import okio.ForwardingSource; -import okio.Okio; -import okio.Source; - -public class ProgressResponseBody extends ResponseBody { - - private final ResponseBody responseBody; - private final ApiCallback callback; - private BufferedSource bufferedSource; - - public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { - this.responseBody = responseBody; - this.callback = callback; - } - - @Override - public MediaType contentType() { - return responseBody.contentType(); - } - - @Override - public long contentLength() { - return responseBody.contentLength(); - } - - @Override - public BufferedSource source() { - if (bufferedSource == null) { - bufferedSource = Okio.buffer(source(responseBody.source())); - } - return bufferedSource; - } - - private Source source(Source source) { - return new ForwardingSource(source) { - long totalBytesRead = 0L; - - @Override - public long read(Buffer sink, long byteCount) throws IOException { - long bytesRead = super.read(sink, byteCount); - // read() returns the number of bytes read, or -1 if this source is exhausted. - totalBytesRead += bytesRead != -1 ? bytesRead : 0; - callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); - return bytesRead; - } - }; - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/README.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/README.mustache deleted file mode 100644 index a1a142bd4..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/README.mustache +++ /dev/null @@ -1,183 +0,0 @@ -# {{artifactId}} - -{{appName}} -- API version: {{appVersion}} -{{^hideGenerationTimestamp}} - - Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} - -{{{appDescriptionWithNewLines}}} - -{{#infoUrl}} - For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* - - -## Requirements - -Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ -2. Maven (3.8.3+)/Gradle (7.2+) - -## Installation - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn clean install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn clean deploy -``` - -Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - {{{groupId}}} - {{{artifactId}}} - {{{artifactVersion}}} - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy - repositories { - mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central. - mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo. - } - - dependencies { - implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" - } -``` - -### Others - -At first generate the JAR by executing: - -```shell -mvn clean package -``` - -Then manually install the following JARs: - -* `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` -* `target/lib/*.jar` - -## Getting Started - -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -// Import classes: -import {{{invokerPackage}}}.ApiClient; -import {{{invokerPackage}}}.ApiException; -import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} -import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} -import {{{invokerPackage}}}.models.*; -import {{{package}}}.{{{classname}}}; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("{{{basePath}}}"); - {{#hasAuthMethods}} - {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setUsername("YOUR USERNAME"); - {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} - // Configure HTTP bearer authorization: {{{name}}} - HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - // Configure API key authorization: {{{name}}} - ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} - {{/authMethods}} - {{/hasAuthMethods}} - - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{#allParams}} - {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} - {{/allParams}} - try { - {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{{paramName}}}({{{paramName}}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} - System.out.println(result);{{/returnType}} - } catch (ApiException e) { - System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} -``` - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation for Models - -{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) -{{/model}}{{/models}} - -## Documentation for Authorization - -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - {{scope}}: {{description}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/anyof_model.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/anyof_model.mustache deleted file mode 100644 index fae56fd29..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ /dev/null @@ -1,236 +0,0 @@ -import javax.ws.rs.core.GenericType; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; - -import {{invokerPackage}}.JSON; - -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { - private static final Logger log = Logger.getLogger({{classname}}.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes '{{classname}}' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - {{#anyOf}} - final TypeAdapter<{{.}}> adapter{{.}} = gson.getDelegateAdapter(this, TypeToken.get({{.}}.class)); - {{/anyOf}} - - return (TypeAdapter) new TypeAdapter<{{classname}}>() { - @Override - public void write(JsonWriter out, {{classname}} value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - {{#anyOf}} - // check if the actual instance is of the type `{{.}}` - if (value.getActualInstance() instanceof {{.}}) { - JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - {{/anyOf}} - throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); - } - - @Override - public {{classname}} read(JsonReader in) throws IOException { - Object deserialized = null; - JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - - {{#useOneOfDiscriminatorLookup}} - {{#discriminator}} - // use discriminator value for faster anyOf lookup - {{classname}} new{{classname}} = new {{classname}}(); - String discriminatorValue = elementAdapter.read(in).getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); - switch (discriminatorValue) { - {{#mappedModels}} - case "{{{mappingName}}}": - deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); - new{{classname}}.setActualInstance(deserialized); - return new{{classname}}; - {{/mappedModels}} - default: - log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); - } - - {{/discriminator}} - {{/useOneOfDiscriminatorLookup}} - {{#anyOf}} - // deserialize {{{.}}} - try { - // validate the JSON object to see if any excpetion is thrown - {{.}}.validateJsonObject(jsonObject); - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); - {{classname}} ret = new {{classname}}(); - ret.setActualInstance(adapter{{.}}.fromJsonTree(jsonObject)); - return ret; - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); - } - - {{/anyOf}} - - throw new IOException(String.format("Failed deserialization for {{classname}}: no class matched. JSON: %s", jsonObject.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in anyOf - public static final Map schemas = new HashMap(); - - public {{classname}}() { - super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - } - - {{#anyOf}} - public {{classname}}({{{.}}} o) { - super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - setActualInstance(o); - } - - {{/anyOf}} - static { - {{#anyOf}} - schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { - }); - {{/anyOf}} - } - - @Override - public Map getSchemas() { - return {{classname}}.schemas; - } - - /** - * Set the instance that matches the anyOf child schema, check - * the instance parameter is valid against the anyOf child schemas: - * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} - * - * It could be an instance of the 'anyOf' schemas. - * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). - */ - @Override - public void setActualInstance(Object instance) { - {{#isNullable}} - if (instance == null) { - super.setActualInstance(instance); - return; - } - - {{/isNullable}} - {{#anyOf}} - if (instance instanceof {{{.}}}) { - super.setActualInstance(instance); - return; - } - - {{/anyOf}} - throw new RuntimeException("Invalid instance type. Must be {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); - } - - /** - * Get the actual instance, which can be the following: - * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} - * - * @return The actual instance ({{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - {{#anyOf}} - /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` - */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); - } - - {{/anyOf}} - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to {{classname}} - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - // validate anyOf schemas one by one - int validCount = 0; - {{#anyOf}} - // validate the json string with {{{.}}} - try { - {{{.}}}.validateJsonObject(jsonObj); - return; // return earlier as at least one schema is valid with respect to the Json object - //validCount++; - } catch (Exception e) { - // continue to the next one - } - {{/anyOf}} - if (validCount == 0) { - throw new IOException(String.format("The JSON string is invalid for {{classname}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObj.toString())); - } - } - - /** - * Create an instance of {{classname}} given an JSON string - * - * @param jsonString JSON string - * @return An instance of {{classname}} - * @throws IOException if the JSON string is invalid with respect to {{classname}} - */ - public static {{{classname}}} fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); - } - - /** - * Convert an instance of {{classname}} to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/api.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/api.mustache deleted file mode 100644 index 943e6948d..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/api.mustache +++ /dev/null @@ -1,520 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -import {{invokerPackage}}.ApiCallback; -import {{invokerPackage}}.ApiClient; -import {{invokerPackage}}.ApiException; -{{#dynamicOperations}} -import {{invokerPackage}}.ApiOperation; -{{/dynamicOperations}} -import {{invokerPackage}}.ApiResponse; -import {{invokerPackage}}.Configuration; -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ProgressRequestBody; -import {{invokerPackage}}.ProgressResponseBody; -{{#performBeanValidation}} -import {{invokerPackage}}.BeanValidationException; -{{/performBeanValidation}} - -import com.google.gson.reflect.TypeToken; -{{#dynamicOperations}} -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.parameters.Parameter; -{{/dynamicOperations}} - -import java.io.IOException; - -{{#useBeanValidation}} -import javax.validation.constraints.*; -{{/useBeanValidation}} -{{#performBeanValidation}} -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.ValidatorFactory; -import javax.validation.executable.ExecutableValidator; -import java.util.Set; -import java.lang.reflect.Method; -import java.lang.reflect.Type; -{{/performBeanValidation}} - -{{#imports}}import {{import}}; -{{/imports}} - -import java.lang.reflect.Type; -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{#supportStreaming}} -import java.io.InputStream; -{{/supportStreaming}} -{{/fullJavaUtil}} -import javax.ws.rs.core.GenericType; - -{{#operations}} -public class {{classname}} { - private ApiClient localVarApiClient; - - public {{classname}}() { - this(Configuration.getDefaultApiClient()); - } - - public {{classname}}(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - {{#operation}} - {{^vendorExtensions.x-group-parameters}}/** - * Build call for {{operationId}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - - // create path and map variables - {{^dynamicOperations}} - String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; - {{/dynamicOperations}} - {{#dynamicOperations}} - ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}"); - if (apiOperation == null) { - throw new ApiException("Operation not found in OAS"); - } - Operation operation = apiOperation.getOperation(); - String localVarPath = apiOperation.getPath(); - Map paramMap = new HashMap<>(); - {{#allParams}} - {{^isFormParam}} - {{^isBodyParam}} - paramMap.put("{{baseName}}", {{paramName}}); - {{/isBodyParam}} - {{/isFormParam}} - {{/allParams}} - {{/dynamicOperations}} - - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); - - {{#formParams}} - if ({{paramName}} != null) { - localVarFormParams.put("{{baseName}}", {{paramName}}); - } - - {{/formParams}} - {{^dynamicOperations}} - {{#queryParams}} - if ({{paramName}} != null) { - {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); - } - - {{/queryParams}} - {{#headerParams}} - if ({{paramName}} != null) { - localVarHeaderParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); - } - - {{/headerParams}} - {{#cookieParams}} - if ({{paramName}} != null) { - localVarCookieParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); - } - - {{/cookieParams}} - {{/dynamicOperations}} - {{#dynamicOperations}} - localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); - - {{/dynamicOperations}} - final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - return localVarApiClient.buildCall(localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - @SuppressWarnings("rawtypes") - private okhttp3.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { - {{^performBeanValidation}} - {{#allParams}}{{#required}} - // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) { - throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)"); - } - {{/required}}{{/allParams}} - - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - - {{/performBeanValidation}} - {{#performBeanValidation}} - try { - ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); - ExecutableValidator executableValidator = factory.getValidator().forExecutables(); - - Object[] parameterValues = { {{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}} }; - Method method = this.getClass().getMethod("{{operationId}}WithHttpInfo"{{#allParams}}, {{#isArray}}java.util.List{{/isArray}}{{#isMap}}java.util.Map{{/isMap}}{{^isArray}}{{^isMap}}{{{dataType}}}{{/isMap}}{{/isArray}}.class{{/allParams}}); - Set> violations = executableValidator.validateParameters(this, method, - parameterValues); - - if (violations.size() == 0) { - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - - } else { - throw new BeanValidationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - - {{/performBeanValidation}} - } - - {{^vendorExtensions.x-group-parameters}} - /** - * {{summary}} - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}{{#returnType}} - * @return {{.}}{{/returnType}} - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#vendorExtensions.x-streaming}} - public {{#returnType}}InputStream {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}InputStream localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp;{{/returnType}} - } - {{/vendorExtensions.x-streaming}} - {{^vendorExtensions.x-streaming}} - public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp.getData();{{/returnType}} - } - {{/vendorExtensions.x-streaming}} - {{/vendorExtensions.x-group-parameters}} - - {{^vendorExtensions.x-group-parameters}}/** - * {{summary}} - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}} - try { - Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); - e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); - throw e; - } - {{/returnType}} - } - {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{^returnType}} - return localVarApiClient.execute(localVarCall); - {{/returnType}} - {{#returnType}} - try { - Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } catch (ApiException e) { - e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); - e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); - throw e; - } - {{/returnType}} - } - {{/vendorExtensions.x-streaming}} - - {{^vendorExtensions.x-group-parameters}}/** - * {{summary}} (asynchronously) - * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { - - okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}_callback); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);{{/returnType}}{{^returnType}}localVarApiClient.executeAsync(localVarCall, _callback);{{/returnType}} - return localVarCall; - } - {{#vendorExtensions.x-group-parameters}} - - public class API{{operationId}}Request { - {{#requiredParams}} - private final {{{dataType}}} {{paramName}}; - {{/requiredParams}} - {{#optionalParams}} - private {{{dataType}}} {{paramName}}; - {{/optionalParams}} - - private API{{operationId}}Request({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) { - {{#requiredParams}} - this.{{paramName}} = {{paramName}}; - {{/requiredParams}} - } - - {{#optionalParams}} - /** - * Set {{paramName}} - * @param {{paramName}} {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}) - * @return API{{operationId}}Request - */ - public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) { - this.{{paramName}} = {{paramName}}; - return this; - } - - {{/optionalParams}} - /** - * Build call for {{operationId}} - * @param _callback ApiCallback API callback - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - } - - /** - * Execute {{operationId}} request{{#returnType}} - * @return {{.}}{{/returnType}} - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { - {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - return localVarResp.getData();{{/returnType}} - } - - /** - * Execute {{operationId}} request with HTTP info returned - * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { - return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - } - - /** - * Execute {{operationId}} request (asynchronously) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public okhttp3.Call executeAsync(final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { - return {{operationId}}Async({{#allParams}}{{paramName}}, {{/allParams}}_callback); - } - } - - /** - * {{summary}} - * {{notes}}{{#requiredParams}} - * @param {{paramName}} {{description}} (required){{/requiredParams}} - * @return API{{operationId}}Request - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public API{{operationId}}Request {{operationId}}({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) { - return new API{{operationId}}Request({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}); - } - {{/vendorExtensions.x-group-parameters}} - {{/operation}} -} -{{/operations}} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/apiException.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/apiException.mustache deleted file mode 100644 index 59da3c51c..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/apiException.mustache +++ /dev/null @@ -1,199 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}; - -import java.util.Map; -import java.util.List; -{{#caseInsensitiveResponseHeaders}} -import java.util.Map.Entry; -import java.util.TreeMap; -{{/caseInsensitiveResponseHeaders}} - -import javax.ws.rs.core.GenericType; - -/** - *

ApiException class.

- */ -@SuppressWarnings("serial") -{{>generatedAnnotation}} -public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - private {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject = null; - private GenericType errorObjectType = null; - - /** - *

Constructor for ApiException.

- */ - public ApiException() {} - - /** - *

Constructor for ApiException.

- * - * @param throwable a {@link java.lang.Throwable} object - */ - public ApiException(Throwable throwable) { - super(throwable); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - */ - public ApiException(String message) { - super(message); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - {{#caseInsensitiveResponseHeaders}} - Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : responseHeaders.entrySet()){ - headers.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; - this.responseBody = responseBody; - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

Constructor for ApiException.

- * - * @param message the error message - * @param throwable a {@link java.lang.Throwable} object - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - */ - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param message a {@link java.lang.String} object - */ - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - /** - *

Constructor for ApiException.

- * - * @param code HTTP status code - * @param message the error message - * @param responseHeaders a {@link java.util.Map} of HTTP response headers - * @param responseBody the response body - */ - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - {{#caseInsensitiveResponseHeaders}} - Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); - for(Entry> entry : responseHeaders.entrySet()){ - headers.put(entry.getKey().toLowerCase(), entry.getValue()); - } - {{/caseInsensitiveResponseHeaders}} - this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } - - /** - * Get the error object type. - * - * @return Error object type - */ - public GenericType getErrorObjectType() { - return errorObjectType; - } - - /** - * Set the error object type. - * - * @param errorObjectType object type - */ - public void setErrorObjectType(GenericType errorObjectType) { - this.errorObjectType = errorObjectType; - } - - /** - * Get the error object. - * - * @return Error object - */ - public {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} getErrorObject() { - return errorObject; - } - - /** - * Get the error object. - * - * @param errorObject Error object - */ - public void setErrorObject({{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject) { - this.errorObject = errorObject; - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/api_doc.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/api_doc.mustache deleted file mode 100644 index 616ad65a5..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/api_doc.mustache +++ /dev/null @@ -1,118 +0,0 @@ -# {{classname}}{{#description}} -{{.}}{{/description}} - -All URIs are relative to *{{basePath}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} - -# **{{operationId}}**{{^vendorExtensions.x-group-parameters}} -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} - -{{summary}}{{#notes}} - -{{.}}{{/notes}} - -### Example -```java -// Import classes: -import {{{invokerPackage}}}.ApiClient; -import {{{invokerPackage}}}.ApiException; -import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} -import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} -import {{{invokerPackage}}}.models.*; -import {{{package}}}.{{{classname}}}; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("{{{basePath}}}"); - {{#hasAuthMethods}} - {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // Configure HTTP basic authorization: {{{name}}} - HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setUsername("YOUR USERNAME"); - {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} - // Configure HTTP bearer authorization: {{{name}}} - HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - // Configure API key authorization: {{{name}}} - ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} - // Configure OAuth2 access token for authorization: {{{name}}} - OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} - {{/authMethods}} - {{/hasAuthMethods}} - - {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); - {{#allParams}} - {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} - {{/allParams}} - try { - {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{{paramName}}}({{{paramName}}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} - System.out.println(result);{{/returnType}} - } catch (ApiException e) { - {{=< >=}} - <#errorObjectSubtype> - <^-first>} else if (e.getErrorObject() instanceof <&.>) { - // do something here - <#-last> - } else { - // something else happened - System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - - - <={{ }}=> - - } - } -} -``` - -### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} -{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} - -{{#responses.0}} -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -{{#responses}} -**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | -{{/responses}} -{{/responses.0}} - -{{/operation}} -{{/operations}} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/api_test.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/api_test.mustache deleted file mode 100644 index 98a30a60c..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/api_test.mustache +++ /dev/null @@ -1,56 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -import {{invokerPackage}}.ApiException; -{{#imports}}import {{import}}; -{{/imports}} -import org.junit.Test; -import org.junit.Ignore; - -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{#supportStreaming}} -import java.io.InputStream; -{{/supportStreaming}} -{{/fullJavaUtil}} - -/** - * API tests for {{classname}} - */ -@Ignore -public class {{classname}}Test { - - private final {{classname}} api = new {{classname}}(); - - {{#operations}}{{#operation}} - /** - * {{summary}} - * - * {{notes}} - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void {{operationId}}Test() throws ApiException { - {{#allParams}} - {{{dataType}}} {{paramName}} = null; - {{/allParams}} - {{#vendorExtensions.x-streaming}} - InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{paramName}}({{paramName}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}} - {{/vendorExtensions.x-streaming}} - {{^vendorExtensions.x-streaming}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} - .{{paramName}}({{paramName}}){{/optionalParams}} - .execute();{{/vendorExtensions.x-group-parameters}} - {{/vendorExtensions.x-streaming}} - // TODO: test validations - } - {{/operation}}{{/operations}} -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache deleted file mode 100644 index a0dda669a..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache +++ /dev/null @@ -1,69 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } else if ("cookie".equals(location)) { - cookieParams.put(paramName, value); - } - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/Authentication.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/Authentication.mustache deleted file mode 100644 index c4ad338c7..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/Authentication.mustache +++ /dev/null @@ -1,25 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws ApiException if failed to update the parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache deleted file mode 100644 index 417a89e34..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache +++ /dev/null @@ -1,46 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import okhttp3.Credentials; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -import java.io.UnsupportedEncodingException; - -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (username == null && password == null) { - return; - } - headerParams.put("Authorization", Credentials.basic( - username == null ? "" : username, - password == null ? "" : password)); - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache deleted file mode 100644 index c8a9fce29..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache +++ /dev/null @@ -1,52 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class HttpBearerAuth implements Authentication { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return bearerToken; - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (bearerToken == null) { - return; - } - - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/OAuth.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/OAuth.mustache deleted file mode 100644 index 34d359857..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/OAuth.mustache +++ /dev/null @@ -1,31 +0,0 @@ -{{>licenseInfo}} - -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.Pair; -import {{invokerPackage}}.ApiException; - -import java.net.URI; -import java.util.Map; -import java.util.List; - -{{>generatedAnnotation}} -public class OAuth implements Authentication { - private String accessToken; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - if (accessToken != null) { - headerParams.put("Authorization", "Bearer " + accessToken); - } - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache deleted file mode 100644 index cb0e82505..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache +++ /dev/null @@ -1,70 +0,0 @@ -{{#hasOAuthMethods}} -package {{invokerPackage}}.auth; - -import okhttp3.OkHttpClient; -import okhttp3.MediaType; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -public class OAuthOkHttpClient implements HttpClient { - private OkHttpClient client; - - public OAuthOkHttpClient() { - this.client = new OkHttpClient(); - } - - public OAuthOkHttpClient(OkHttpClient client) { - this.client = client; - } - - @Override - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - MediaType mediaType = MediaType.parse("application/json"); - Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); - - if(headers != null) { - for (Entry entry : headers.entrySet()) { - if (entry.getKey().equalsIgnoreCase("Content-Type")) { - mediaType = MediaType.parse(entry.getValue()); - } else { - requestBuilder.addHeader(entry.getKey(), entry.getValue()); - } - } - } - - RequestBody body = request.getBody() != null ? RequestBody.create(request.getBody(), mediaType) : null; - requestBuilder.method(requestMethod, body); - - try { - Response response = client.newCall(requestBuilder.build()).execute(); - return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), - response.body().contentType().toString(), - response.code(), - responseClass); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - } - - @Override - public void shutdown() { - // Nothing to do here - } -} -{{/hasOAuthMethods}} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache deleted file mode 100644 index 43d58ce88..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache +++ /dev/null @@ -1,213 +0,0 @@ -{{#hasOAuthMethods}} -package {{invokerPackage}}.auth; - -import {{invokerPackage}}.ApiException; -import {{invokerPackage}}.Pair; - -import okhttp3.Interceptor; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; - -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URI; -import java.util.Map; -import java.util.List; - -public class RetryingOAuth extends OAuth implements Interceptor { - private OAuthClient oAuthClient; - - private TokenRequestBuilder tokenRequestBuilder; - - /** - * @param client An OkHttp client - * @param tokenRequestBuilder A token request builder - */ - public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { - this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); - this.tokenRequestBuilder = tokenRequestBuilder; - } - - /** - * @param tokenRequestBuilder A token request builder - */ - public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { - this(new OkHttpClient(), tokenRequestBuilder); - } - - /** - * @param tokenUrl The token URL to be used for this OAuth2 flow. - * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - * The value must be an absolute URL. - * @param clientId The OAuth2 client ID for the "clientCredentials" flow. - * @param flow OAuth flow. - * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - * @param parameters A map of string. - */ - public RetryingOAuth( - String tokenUrl, - String clientId, - OAuthFlow flow, - String clientSecret, - Map parameters - ) { - this(OAuthClientRequest.tokenLocation(tokenUrl) - .setClientId(clientId) - .setClientSecret(clientSecret)); - setFlow(flow); - if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); - } - } - } - - /** - * Set the OAuth flow - * - * @param flow The OAuth flow. - */ - public void setFlow(OAuthFlow flow) { - switch(flow) { - case accessCode: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case implicit: - tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); - break; - case password: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case application: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - } - - @Override - public Response intercept(Chain chain) throws IOException { - return retryingIntercept(chain, true); - } - - private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { - Request request = chain.request(); - - // If the request already has an authorization (e.g. Basic auth), proceed with the request as is - if (request.header("Authorization") != null) { - return chain.proceed(request); - } - - // Get the token if it has not yet been acquired - if (getAccessToken() == null) { - updateAccessToken(null); - } - - OAuthClientRequest oAuthRequest; - if (getAccessToken() != null) { - // Build the request - Request.Builder requestBuilder = request.newBuilder(); - - String requestAccessToken = getAccessToken(); - try { - oAuthRequest = - new OAuthBearerClientRequest(request.url().toString()). - setAccessToken(requestAccessToken). - buildHeaderMessage(); - } catch (OAuthSystemException e) { - throw new IOException(e); - } - - Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); - } - requestBuilder.url(oAuthRequest.getLocationUri()); - - // Execute the request - Response response = chain.proceed(requestBuilder.build()); - - // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row - if ( - response != null && - ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || - response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && - updateTokenAndRetryOnAuthorizationFailure - ) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body().close(); - return retryingIntercept(chain, false); - } - } catch (Exception e) { - response.body().close(); - throw e; - } - } - return response; - } - else { - return chain.proceed(chain.request()); - } - } - - /** - * Returns true if the access token has been updated - * - * @param requestAccessToken the request access token - * @return True if the update is successful - * @throws java.io.IOException If fail to update the access token - */ - public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { - try { - OAuthJSONAccessTokenResponse accessTokenResponse = - oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken()); - } - } catch (OAuthSystemException | OAuthProblemException e) { - throw new IOException(e); - } - } - return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); - } - - /** - * Gets the token request builder - * - * @return A token request builder - * @throws java.io.IOException If fail to update the access token - */ - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } - - /** - * Sets the token request builder - * - * @param tokenRequestBuilder Token request builder - */ - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - // Applying authorization to parameters is performed in the retryingIntercept method - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - // No implementation necessary - } -} -{{/hasOAuthMethods}} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/build.gradle.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/build.gradle.mustache deleted file mode 100644 index c97cb873e..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/build.gradle.mustache +++ /dev/null @@ -1,169 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' -{{#sourceFolder}} -apply plugin: 'java' -{{/sourceFolder}} -apply plugin: 'com.diffplug.spotless' - -group = '{{groupId}}' -version = '{{artifactVersion}}' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' - } -} - -repositories { - mavenCentral() -} -{{#sourceFolder}} -sourceSets { - main.java.srcDirs = ['{{sourceFolder}}'] -} - -{{/sourceFolder}} -if(hasProperty('target') && target == 'android') { - - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' - - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } - - dependencies { - provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - } - } - - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven-publish' - - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - - publishing { - publications { - maven(MavenPublication) { - artifactId = '{{artifactId}}' - from components.java - } - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - jakarta_annotation_version = "1.3.5" -} - -dependencies { - implementation 'io.swagger:swagger-annotations:1.5.24' - implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'io.gsonfire:gson-fire:1.8.4' - {{#openApiNullable}} - implementation 'org.openapitools:jackson-databind-nullable:0.2.1' - {{/openApiNullable}} - {{#hasOAuthMethods}} - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' - {{/hasOAuthMethods}} - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - {{#joda}} - implementation 'joda-time:joda-time:2.9.9' - {{/joda}} - {{#threetenbp}} - implementation 'org.threeten:threetenbp:1.4.3' - {{/threetenbp}} - {{#dynamicOperations}} - implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.23' - {{/dynamicOperations}} - implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:3.11.2' -} - -javadoc { - options.tags = [ "http.response.details:a:Http Response Details" ] -} - -// Use spotless plugin to automatically format code, remove unused import, etc -// To apply changes directly to the file, run `gradlew spotlessApply` -// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle -spotless { - // comment out below to run spotless as part of the `check` task - enforceCheck false - - format 'misc', { - // define the files (e.g. '*.gradle', '*.md') to apply `misc` to - target '.gitignore' - - // define the steps to apply to those files - trimTrailingWhitespace() - indentWithSpaces() // Takes an integer argument if you don't like 4 - endWithNewline() - } - java { - // don't need to set target, it is inferred from java - - // apply a specific flavor of google-java-format - googleJavaFormat('1.8').aosp().reflowLongStrings() - - removeUnusedImports() - importOrder() - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/build.sbt.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/build.sbt.mustache deleted file mode 100644 index 5e0c74c55..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/build.sbt.mustache +++ /dev/null @@ -1,39 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "{{groupId}}", - name := "{{artifactId}}", - version := "{{artifactVersion}}", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24", - "com.squareup.okhttp3" % "okhttp" % "4.9.1", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", - "com.google.code.gson" % "gson" % "2.8.6", - "org.apache.commons" % "commons-lang3" % "3.10", - {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", - {{/openApiNullable}} - {{#hasOAuthMethods}} - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", - {{/hasOAuthMethods}} - {{#joda}} - "joda-time" % "joda-time" % "2.9.9" % "compile", - {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - {{/threetenbp}} - {{#dynamicOperations}} - "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" - {{/dynamicOperations}} - "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" - ) - ) diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/model.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/model.mustache deleted file mode 100644 index b6b0381a5..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/model.mustache +++ /dev/null @@ -1,61 +0,0 @@ -{{>licenseInfo}} - -package {{package}}; - -{{#useReflectionEqualsHashCode}} -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -{{/useReflectionEqualsHashCode}} -import java.util.Objects; -import java.util.Arrays; -{{#imports}} -import {{import}}; -{{/imports}} -{{#serializableModel}} -import java.io.Serializable; -{{/serializableModel}} -{{#jackson}} -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; -{{#withXml}} -import com.fasterxml.jackson.dataformat.xml.annotation.*; -{{/withXml}} -{{#vendorExtensions.x-has-readonly-properties}} -import com.fasterxml.jackson.annotation.JsonCreator; -{{/vendorExtensions.x-has-readonly-properties}} -{{/jackson}} -{{#withXml}} -import javax.xml.bind.annotation.*; -{{/withXml}} -{{#jsonb}} -import java.lang.reflect.Type; -import javax.json.bind.annotation.JsonbTypeDeserializer; -import javax.json.bind.annotation.JsonbTypeSerializer; -import javax.json.bind.serializer.DeserializationContext; -import javax.json.bind.serializer.JsonbDeserializer; -import javax.json.bind.serializer.JsonbSerializer; -import javax.json.bind.serializer.SerializationContext; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.bind.annotation.JsonbProperty; -{{#vendorExtensions.x-has-readonly-properties}} -import javax.json.bind.annotation.JsonbCreator; -{{/vendorExtensions.x-has-readonly-properties}} -{{/jsonb}} -{{#parcelableModel}} -import android.os.Parcelable; -import android.os.Parcel; -{{/parcelableModel}} -{{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; -{{/useBeanValidation}} -{{#performBeanValidation}} -import org.hibernate.validator.constraints.*; -{{/performBeanValidation}} - -{{#models}} -{{#model}} -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>oneof_model}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>anyof_model}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>pojo}}{{/anyOf}}{{/oneOf}}{{/isEnum}} -{{/model}} -{{/models}} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/oneof_model.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/oneof_model.mustache deleted file mode 100644 index ce88e9a78..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ /dev/null @@ -1,242 +0,0 @@ -import javax.ws.rs.core.GenericType; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; - -import {{invokerPackage}}.JSON; - -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} -public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { - private static final Logger log = Logger.getLogger({{classname}}.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes '{{classname}}' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - {{#oneOf}} - final TypeAdapter<{{.}}> adapter{{.}} = gson.getDelegateAdapter(this, TypeToken.get({{.}}.class)); - {{/oneOf}} - - return (TypeAdapter) new TypeAdapter<{{classname}}>() { - @Override - public void write(JsonWriter out, {{classname}} value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - {{#oneOf}} - // check if the actual instance is of the type `{{.}}` - if (value.getActualInstance() instanceof {{.}}) { - JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - {{/oneOf}} - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); - } - - @Override - public {{classname}} read(JsonReader in) throws IOException { - Object deserialized = null; - JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - - {{#useOneOfDiscriminatorLookup}} - {{#discriminator}} - // use discriminator value for faster oneOf lookup - {{classname}} new{{classname}} = new {{classname}}(); - String discriminatorValue = elementAdapter.read(in).getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); - switch (discriminatorValue) { - {{#mappedModels}} - case "{{{mappingName}}}": - deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); - new{{classname}}.setActualInstance(deserialized); - return new{{classname}}; - {{/mappedModels}} - default: - log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); - } - - {{/discriminator}} - {{/useOneOfDiscriminatorLookup}} - int match = 0; - TypeAdapter actualAdapter = elementAdapter; - - {{#oneOf}} - // deserialize {{{.}}} - try { - // validate the JSON object to see if any excpetion is thrown - {{.}}.validateJsonObject(jsonObject); - actualAdapter = adapter{{.}}; - match++; - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); - } - - {{/oneOf}} - if (match == 1) { - {{classname}} ret = new {{classname}}(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); - return ret; - } - - throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); - - public {{classname}}() { - super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - } - - {{#oneOf}} - public {{classname}}({{{.}}} o) { - super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); - setActualInstance(o); - } - - {{/oneOf}} - static { - {{#oneOf}} - schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { - }); - {{/oneOf}} - } - - @Override - public Map getSchemas() { - return {{classname}}.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} - * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). - */ - @Override - public void setActualInstance(Object instance) { - {{#isNullable}} - if (instance == null) { - super.setActualInstance(instance); - return; - } - - {{/isNullable}} - {{#oneOf}} - if (instance instanceof {{{.}}}) { - super.setActualInstance(instance); - return; - } - - {{/oneOf}} - throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); - } - - /** - * Get the actual instance, which can be the following: - * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} - * - * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - {{#oneOf}} - /** - * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `{{{.}}}` - * @throws ClassCastException if the instance is not `{{{.}}}` - */ - public {{{.}}} get{{{.}}}() throws ClassCastException { - return ({{{.}}})super.getActualInstance(); - } - - {{/oneOf}} - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to {{classname}} - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - {{#oneOf}} - // validate the json string with {{{.}}} - try { - {{{.}}}.validateJsonObject(jsonObj); - validCount++; - } catch (Exception e) { - // continue to the next one - } - {{/oneOf}} - if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); - } - } - - /** - * Create an instance of {{classname}} given an JSON string - * - * @param jsonString JSON string - * @return An instance of {{classname}} - * @throws IOException if the JSON string is invalid with respect to {{classname}} - */ - public static {{{classname}}} fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); - } - - /** - * Convert an instance of {{classname}} to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/pojo.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/pojo.mustache deleted file mode 100644 index b30ce069f..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/pojo.mustache +++ /dev/null @@ -1,541 +0,0 @@ -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import {{invokerPackage}}.JSON; - -/** - * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} - * @deprecated{{/isDeprecated}} - */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} -{{#jackson}} -@JsonPropertyOrder({ -{{#vars}} - {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} -{{/vars}} -}) -@JsonTypeName("{{name}}") -{{/jackson}} -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} -public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ -{{#serializableModel}} - private static final long serialVersionUID = 1L; - -{{/serializableModel}} - {{#vars}} - {{#isEnum}} - {{^isContainer}} -{{>modelInnerEnum}} - {{/isContainer}} - {{#isContainer}} - {{#mostInnerItems}} -{{>modelInnerEnum}} - {{/mostInnerItems}} - {{/isContainer}} - {{/isEnum}} - {{#gson}} - public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; - {{/gson}} - {{#jackson}} - public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; - {{/jackson}} - {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} - {{/withXml}} - {{#gson}} - @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) - {{/gson}} - {{#vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); - {{/isContainer}} - {{^isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; - {{/isContainer}} - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; - {{/isContainer}} - {{^isContainer}} - {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; - {{/isContainer}} - {{/vendorExtensions.x-is-jackson-optional-nullable}} - - {{/vars}} - public {{classname}}() { {{#parent}}{{#parcelableModel}} - super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} - this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} - }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} - - {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} - public {{classname}}( - {{#readOnlyVars}} - {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} - {{/readOnlyVars}} - ) { - this(); - {{#readOnlyVars}} - this.{{name}} = {{name}}; - {{/readOnlyVars}} - }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} - {{#vars}} - - {{^isReadOnly}} - public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { - {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = {{name}};{{/vendorExtensions.x-is-jackson-optional-nullable}} - return this; - } - {{#isArray}} - - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); - } - try { - this.{{name}}.get().add({{name}}Item); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present - } - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; - } - {{/required}} - this.{{name}}.add({{name}}Item); - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - {{/isArray}} - {{#isMap}} - - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); - } - try { - this.{{name}}.get().put(key, {{name}}Item); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present - } - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} - if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; - } - {{/required}} - this.{{name}}.put(key, {{name}}Item); - return this; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - {{/isMap}} - - {{/isReadOnly}} - /** - {{#description}} - * {{.}} - {{/description}} - {{^description}} - * Get {{name}} - {{/description}} - {{#minimum}} - * minimum: {{.}} - {{/minimum}} - {{#maximum}} - * maximum: {{.}} - {{/maximum}} - * @return {{name}} - {{#deprecated}} - * @deprecated - {{/deprecated}} - **/ -{{#deprecated}} - @Deprecated -{{/deprecated}} -{{#required}} -{{#isNullable}} - @javax.annotation.Nullable -{{/isNullable}} -{{^isNullable}} - @javax.annotation.Nonnull -{{/isNullable}} -{{/required}} -{{^required}} - @javax.annotation.Nullable -{{/required}} -{{#jsonb}} - @JsonbProperty("{{baseName}}") -{{/jsonb}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") -{{#vendorExtensions.x-extra-annotation}} - {{{vendorExtensions.x-extra-annotation}}} -{{/vendorExtensions.x-extra-annotation}} -{{#vendorExtensions.x-is-jackson-optional-nullable}} - {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} - @JsonIgnore -{{/vendorExtensions.x-is-jackson-optional-nullable}} -{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} - public {{{datatypeWithEnum}}} {{getter}}() { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} - if ({{name}} == null) { - {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; - } - {{/isReadOnly}} - return {{name}}.orElse(null); - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - return {{name}}; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - - {{#vendorExtensions.x-is-jackson-optional-nullable}} -{{> jackson_annotations}} - public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { - return {{name}}; - } - {{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}} - @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) - {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { - {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} - this.{{name}} = {{name}}; - } - {{/vendorExtensions.x-is-jackson-optional-nullable}} - - {{^isReadOnly}} -{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} -{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { - {{#vendorExtensions.x-is-jackson-optional-nullable}} - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); - {{/vendorExtensions.x-is-jackson-optional-nullable}} - {{^vendorExtensions.x-is-jackson-optional-nullable}} - this.{{name}} = {{name}}; - {{/vendorExtensions.x-is-jackson-optional-nullable}} - } - {{/isReadOnly}} - - {{/vars}} - - @Override - public boolean equals(Object o) { - {{#useReflectionEqualsHashCode}} - return EqualsBuilder.reflectionEquals(this, o, false, null, true); - {{/useReflectionEqualsHashCode}} - {{^useReflectionEqualsHashCode}} - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - }{{#hasVars}} - {{classname}} {{classVarName}} = ({{classname}}) o; - return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} && - {{/-last}}{{/vars}}{{#parent}} && - super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} - return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} - {{/useReflectionEqualsHashCode}} - }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} - - @Override - public int hashCode() { - {{#useReflectionEqualsHashCode}} - return HashCodeBuilder.reflectionHashCode(this); - {{/useReflectionEqualsHashCode}} - {{^useReflectionEqualsHashCode}} - return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); - {{/useReflectionEqualsHashCode}} - }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class {{classname}} {\n"); - {{#parent}} - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - {{/parent}} - {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); - {{/vars}} - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -{{#parcelableModel}} - - public void writeToParcel(Parcel out, int flags) { -{{#model}} -{{#isArray}} - out.writeList(this); -{{/isArray}} -{{^isArray}} -{{#parent}} - super.writeToParcel(out, flags); -{{/parent}} -{{#vars}} - out.writeValue({{name}}); -{{/vars}} -{{/isArray}} -{{/model}} - } - - {{classname}}(Parcel in) { -{{#isArray}} - in.readTypedList(this, {{arrayModelType}}.CREATOR); -{{/isArray}} -{{^isArray}} -{{#parent}} - super(in); -{{/parent}} -{{#vars}} -{{#isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); -{{/isPrimitiveType}} -{{^isPrimitiveType}} - {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); -{{/isPrimitiveType}} -{{/vars}} -{{/isArray}} - } - - public int describeContents() { - return 0; - } - - public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { - public {{classname}} createFromParcel(Parcel in) { -{{#model}} -{{#isArray}} - {{classname}} result = new {{classname}}(); - result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); - return result; -{{/isArray}} -{{^isArray}} - return new {{classname}}(in); -{{/isArray}} -{{/model}} - } - public {{classname}}[] newArray(int size) { - return new {{classname}}[size]; - } - }; -{{/parcelableModel}} - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - {{#allVars}} - openapiFields.add("{{baseName}}"); - {{/allVars}} - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - {{#requiredVars}} - openapiRequiredFields.add("{{baseName}}"); - {{/requiredVars}} - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to {{classname}} - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if ({{classname}}.openapiRequiredFields.isEmpty()) { - return; - } else { // has reuqired fields - throw new IllegalArgumentException(String.format("The required field(s) %s in {{{classname}}} is not found in the empty JSON string", {{classname}}.openapiRequiredFields.toString())); - } - } - {{^hasChildren}} - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!{{classname}}.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - {{#requiredVars}} - {{#-first}} - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : {{classname}}.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - {{/-first}} - {{/requiredVars}} - {{/hasChildren}} - {{^discriminator}} - {{#vars}} - {{#isArray}} - {{#items.isModel}} - JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); - {{#isRequired}} - // validate the required field `{{{baseName}}}` (array) - for (int i = 0; i < jsonArray{{name}}.size(); i++) { - {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); - }; - {{/isRequired}} - {{^isRequired}} - // validate the optional field `{{{baseName}}}` (array) - if (jsonArray{{name}} != null) { - for (int i = 0; i < jsonArray{{name}}.size(); i++) { - {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); - }; - } - {{/isRequired}} - {{/items.isModel}} - {{/isArray}} - {{^isContainer}} - {{#isModel}} - {{#isRequired}} - // validate the required field `{{{baseName}}}` - {{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}")); - {{/isRequired}} - {{^isRequired}} - // validate the optional field `{{{baseName}}}` - if (jsonObj.getAsJsonObject("{{{baseName}}}") != null) { - {{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}")); - } - {{/isRequired}} - {{/isModel}} - {{/isContainer}} - {{/vars}} - {{/discriminator}} - {{#hasChildren}} - {{#discriminator}} - - String discriminatorValue = jsonObj.get("{{{propertyBaseName}}}").getAsString(); - switch (discriminatorValue) { - {{#mappedModels}} - case "{{mappingName}}": - {{modelName}}.validateJsonObject(jsonObj); - break; - {{/mappedModels}} - default: - throw new IllegalArgumentException(String.format("The value of the `{{{propertyBaseName}}}` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); - } - {{/discriminator}} - {{/hasChildren}} - } - -{{^hasChildren}} - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes '{{classname}}' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter<{{classname}}> thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get({{classname}}.class)); - - return (TypeAdapter) new TypeAdapter<{{classname}}>() { - @Override - public void write(JsonWriter out, {{classname}} value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public {{classname}} read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } -{{/hasChildren}} - - /** - * Create an instance of {{classname}} given an JSON string - * - * @param jsonString JSON string - * @return An instance of {{classname}} - * @throws IOException if the JSON string is invalid with respect to {{classname}} - */ - public static {{{classname}}} fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); - } - - /** - * Convert an instance of {{classname}} to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/pom.mustache b/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/pom.mustache deleted file mode 100644 index 10dfc15ab..000000000 --- a/sdks/java-v2/templates/libraries/okhttp-gson-nextgen/pom.mustache +++ /dev/null @@ -1,420 +0,0 @@ - - 4.0.0 - {{groupId}} - {{artifactId}} - jar - {{artifactId}} - {{artifactVersion}} - {{artifactUrl}} - {{artifactDescription}} - - {{scmConnection}} - {{scmDeveloperConnection}} - {{scmUrl}} - -{{#parentOverridden}} - - {{{parentGroupId}}} - {{{parentArtifactId}}} - {{{parentVersion}}} - -{{/parentOverridden}} - - - - {{licenseName}} - {{licenseUrl}} - repo - - - - - - {{developerName}} - {{developerEmail}} - {{developerOrganization}} - {{developerOrganizationUrl}} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - true - 128m - 512m - - -Xlint:all - -J-Xss4m - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M5 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - 10 - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.0 - - - - test-jar - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.2.0 - - - add_sources - generate-sources - - add-source - - - - {{{sourceFolder}}} - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.3.1 - - - attach-javadocs - - jar - - - - - none - - - http.response.details - a - Http Response Details: - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.0 - - - attach-sources - - jar-no-fork - - - - - - - com.diffplug.spotless - spotless-maven-plugin - ${spotless.version} - - - - - - - .gitignore - - - - - - true - 4 - - - - - - - - - - 1.8 - - true - - - - - - - - - - - - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.squareup.okhttp3 - okhttp - ${okhttp-version} - - - com.squareup.okhttp3 - logging-interceptor - ${okhttp-version} - - - com.google.code.gson - gson - ${gson-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - {{#hasOAuthMethods}} - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - 1.0.1 - - {{/hasOAuthMethods}} - - org.apache.commons - commons-lang3 - ${commons-lang3-version} - - {{#joda}} - - joda-time - joda-time - ${jodatime-version} - - {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} - {{#dynamicOperations}} - - io.swagger.parser.v3 - swagger-parser-v3 - 2.0.28 - - {{/dynamicOperations}} - {{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - {{/useBeanValidation}} - {{#performBeanValidation}} - - - org.hibernate - hibernate-validator - 5.4.3.Final - - - jakarta.el - jakarta.el-api - ${jakarta.el-version} - - {{/performBeanValidation}} - {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - - {{/parcelableModel}} - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - provided - - {{#openApiNullable}} - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - {{/openApiNullable}} - - javax.ws.rs - jsr311-api - 1.1.1 - - - javax.ws.rs - javax.ws.rs-api - 2.0 - - - - junit - junit - ${junit-version} - test - - - org.mockito - mockito-core - 3.12.4 - test - - - - 1.8 - ${java.version} - ${java.version} - 1.8.5 - 1.6.3 - 4.9.2 - 2.8.8 - 3.12.0 - {{#openApiNullable}} - 0.2.2 - {{/openApiNullable}} - {{#joda}} - 2.10.9 - {{/joda}} - {{#threetenbp}} - 1.5.0 - {{/threetenbp}} - 1.3.5 -{{#performBeanValidation}} - 3.0.3 -{{/performBeanValidation}} -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 4.13.2 - UTF-8 - 2.17.3 - - diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache new file mode 100644 index 000000000..8d11435be --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache @@ -0,0 +1,135 @@ +{{>licenseInfo}} + +package {{modelPackage}}; + +import {{invokerPackage}}.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +{{>generatedAnnotation}} +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + +{{>libraries/jersey2/additional_properties}} + +} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/ApiClient.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/ApiClient.mustache index 421b7782e..c5e7ae225 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/ApiClient.mustache @@ -23,11 +23,6 @@ import org.joda.time.DateTime; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormatter; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#hasOAuthMethods}} import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; import org.apache.oltu.oauth2.common.message.types.GrantType; @@ -52,14 +47,13 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -72,6 +66,9 @@ import {{invokerPackage}}.auth.OAuth; import {{invokerPackage}}.auth.RetryingOAuth; import {{invokerPackage}}.auth.OAuthFlow; {{/hasOAuthMethods}} +{{#withAWSV4Signature}} +import {{invokerPackage}}.auth.AWS4Auth; +{{/withAWSV4Signature}} /** *

ApiClient class.

@@ -79,6 +76,33 @@ import {{invokerPackage}}.auth.OAuthFlow; public class ApiClient { private String basePath = "{{{basePath}}}"; + protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + new HashMap(){{#variables}}{{#-first}} {{ +{{/-first}} put("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new HashSet( + {{#enumValues}} + {{#-first}} + Arrays.asList( + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + ) + {{/-last}} + {{/enumValues}} + ) + )); + {{#-last}} + }}{{/-last}}{{/variables}} + ){{^-last}},{{/-last}} + {{#-last}} + ){{/-last}}{{/servers}}); + protected Integer serverIndex = 0; + protected Map serverVariables = null; private boolean debugging = false; private Map defaultHeaderMap = new HashMap(); private Map defaultCookieMap = new HashMap(); @@ -112,10 +136,11 @@ public class ApiClient { initHttpClient(); // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}{{#withAWSV4Signature}} + authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -131,10 +156,11 @@ public class ApiClient { httpClient = client; // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}{{#withAWSV4Signature}} + authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -186,8 +212,7 @@ public class ApiClient { this.basePath = basePath; } -{{#hasOAuthMethods}} - String tokenUrl = "{{tokenUrl}}"; + String tokenUrl = "{{{tokenUrl}}}"; if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { URI uri = URI.create(getBasePath()); tokenUrl = uri.getScheme() + ":" + @@ -197,17 +222,17 @@ public class ApiClient { throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); } } - RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{flow}}, clientSecret, parameters); + RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, clientSecret, parameters); authentications.put( "{{name}}", retryingOAuth ); initHttpClient(Collections.singletonList(retryingOAuth)); -{{/hasOAuthMethods}} // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}}{{#withAWSV4Signature}} + authentications.put("AWS4Auth", new AWS4Auth());{{/withAWSV4Signature}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); @@ -267,6 +292,34 @@ public class ApiClient { */ public ApiClient setBasePath(String basePath) { this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; return this; } @@ -391,10 +444,10 @@ public class ApiClient { *

Setter for the field dateFormat.

* * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setDateFormat(DateFormat dateFormat) { - this.json.setDateFormat(dateFormat); + JSON.setDateFormat(dateFormat); return this; } @@ -402,21 +455,21 @@ public class ApiClient { *

Set SqlDateFormat.

* * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link org.openapitools.client.ApiClient} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); + JSON.setSqlDateFormat(dateFormat); return this; } {{#joda}} public ApiClient setDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setDateTimeFormat(dateFormat); + JSON.setDateTimeFormat(dateFormat); return this; } public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -425,22 +478,22 @@ public class ApiClient { /** *

Set OffsetDateTimeFormat.

* - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - this.json.setOffsetDateTimeFormat(dateFormat); + JSON.setOffsetDateTimeFormat(dateFormat); return this; } /** *

Set LocalDateFormat.

* - * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object - * @return a {@link org.openapitools.client.ApiClient} object + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - this.json.setLocalDateFormat(dateFormat); + JSON.setLocalDateFormat(dateFormat); return this; } @@ -449,10 +502,10 @@ public class ApiClient { *

Set LenientOnJson.

* * @param lenientOnJson a boolean - * @return a {@link org.openapitools.client.ApiClient} object + * @return a {@link {{invokerPackage}}.ApiClient} object */ public ApiClient setLenientOnJson(boolean lenientOnJson) { - this.json.setLenientOnJson(lenientOnJson); + JSON.setLenientOnJson(lenientOnJson); return this; } @@ -476,14 +529,23 @@ public class ApiClient { } {{#hasHttpBearerMethods}} - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ public void setBearerToken(String bearerToken) { + setBearerToken(() -> bearerToken); + } + + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setBearerToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); return; } } @@ -568,6 +630,51 @@ public class ApiClient { throw new RuntimeException("No OAuth2 authentication configured!"); } + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + {{#withAWSV4Signature}} + for (Authentication auth : authentications.values()) { + if (auth instanceof AWS4Auth) { + ((AWS4Auth) auth).setCredentials(accessKey, secretKey); + ((AWS4Auth) auth).setRegion(region); + ((AWS4Auth) auth).setService(service); + return; + } + } + {{/withAWSV4Signature}} + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + {{#withAWSV4Signature}} + for (Authentication auth : authentications.values()) { + if (auth instanceof AWS4Auth) { + ((AWS4Auth) auth).setCredentials(accessKey, secretKey, sessionToken); + ((AWS4Auth) auth).setRegion(region); + ((AWS4Auth) auth).setService(service); + return; + } + } + {{/withAWSV4Signature}} + throw new RuntimeException("No AWS4 authentication configured!"); + } + /** * Set the User-Agent header's value (by adding to the default header map). * @@ -752,7 +859,7 @@ public class ApiClient { return ""; } else if (param instanceof Date {{#joda}}|| param instanceof DateTime || param instanceof LocalDate{{/joda}}{{#jsr310}}|| param instanceof OffsetDateTime || param instanceof LocalDate{{/jsr310}}) { //Serialize to json string and remove the " enclosing characters - String jsonStr = json.serialize(param); + String jsonStr = JSON.serialize(param); return jsonStr.substring(1, jsonStr.length() - 1); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); @@ -760,7 +867,7 @@ public class ApiClient { if (b.length() > 0) { b.append(","); } - b.append(String.valueOf(o)); + b.append(o); } return b.toString(); } else { @@ -845,7 +952,7 @@ public class ApiClient { List params = new ArrayList(); // preconditions - if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) { + if (param == null || param.getName() == null || param.getName().isEmpty() || value == null || value.isEmpty()) { return params; } @@ -880,6 +987,30 @@ public class ApiClient { } {{/dynamicOperations}} + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + /** * Formats the specified collection path parameter to a string value. * @@ -1011,7 +1142,7 @@ public class ApiClient { * @param response HTTP response * @param returnType The type of the Java object * @return The deserialized Java object - * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * @throws {{invokerPackage}}.ApiException If fail to deserialize response body, i.e. cannot read response body * or the Content-Type of the response is not supported. */ @SuppressWarnings("unchecked") @@ -1052,7 +1183,7 @@ public class ApiClient { contentType = "application/json"; } if (isJsonMime(contentType)) { - return json.deserialize(respBody, returnType); + return JSON.deserialize(respBody, returnType); } else if (returnType.equals(String.class)) { // Expecting string, return the raw response body. return (T) respBody; @@ -1072,7 +1203,7 @@ public class ApiClient { * @param obj The Java object * @param contentType The request Content-Type * @return The serialized request body - * @throws org.openapitools.client.ApiException If fail to serialize the given object + * @throws {{invokerPackage}}.ApiException If fail to serialize the given object */ public RequestBody serialize(Object obj, String contentType) throws ApiException { if (obj instanceof byte[]) { @@ -1086,11 +1217,13 @@ public class ApiClient { } else if (isJsonMime(contentType)) { String content; if (obj != null) { - content = json.serialize(obj); + content = JSON.serialize(obj); } else { content = null; } return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else { throw new ApiException("Content type \"" + contentType + "\" is not supported"); } @@ -1100,7 +1233,7 @@ public class ApiClient { * Download file from the given response. * * @param response An instance of the Response object - * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk + * @throws {{invokerPackage}}.ApiException If fail to read file content from response and write to disk * @return Downloaded file */ public File downloadFileFromResponse(Response response) throws ApiException { @@ -1164,7 +1297,7 @@ public class ApiClient { * @param Type * @param call An instance of the Call object * @return ApiResponse<T> - * @throws org.openapitools.client.ApiException If fail to execute the call + * @throws {{invokerPackage}}.ApiException If fail to execute the call */ public ApiResponse execute(Call call) throws ApiException { return execute(call, null); @@ -1179,7 +1312,7 @@ public class ApiClient { * @return ApiResponse object containing response status, headers and * data, which is a Java object deserialized from response body and would be null * when returnType is null. - * @throws org.openapitools.client.ApiException If fail to execute the call + * @throws {{invokerPackage}}.ApiException If fail to execute the call */ public ApiResponse execute(Call call, Type returnType) throws ApiException { try { @@ -1198,13 +1331,13 @@ public class ApiClient { * @param call a {@link okhttp3.Call} object * @param returnType a {@link java.lang.reflect.Type} object * @return a {@link java.io.InputStream} object - * @throws org.openapitools.client.ApiException if any. + * @throws {{invokerPackage}}.ApiException if any. */ public InputStream executeStream(Call call, Type returnType) throws ApiException { try { Response response = call.execute(); if (!response.isSuccessful()) { - throw new ApiException(response.code(), response.message()); + throw new ApiException(response.code(), response.message(), response.headers().toMultimap(), null); } if (response.body() == null) { return null; @@ -1268,7 +1401,7 @@ public class ApiClient { * @param response Response * @param returnType Return type * @return Type - * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or + * @throws {{invokerPackage}}.ApiException If the response has an unsuccessful status code or * fail to deserialize the response body */ public T handleResponse(Response response, Type returnType) throws ApiException { @@ -1303,6 +1436,7 @@ public class ApiClient { /** * Build HTTP call with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1314,7 +1448,7 @@ public class ApiClient { * @param authNames The authentications to apply * @param callback Callback for upload/download progress * @return The HTTP call - * @throws org.openapitools.client.ApiException If fail to serialize the request body object + * @throws {{invokerPackage}}.ApiException If fail to serialize the request body object */ public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); @@ -1325,6 +1459,7 @@ public class ApiClient { /** * Build an HTTP request with the given options. * + * @param baseUrl The base URL * @param path The sub-path of the HTTP URL * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" * @param queryParams The query parameters @@ -1336,24 +1471,23 @@ public class ApiClient { * @param authNames The authentications to apply * @param callback Callback for upload/download progress * @return The HTTP request - * @throws org.openapitools.client.ApiException If fail to serialize the request body object + * @throws {{invokerPackage}}.ApiException If fail to serialize the request body object */ public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body RequestBody reqBody; String contentType = headerParams.get("Content-Type"); - + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } if (!HttpMethod.permitsRequestBody(method)) { reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentType)) { + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentType)) { + } else if ("multipart/form-data".equals(contentTypePure)) { reqBody = buildRequestBodyMultipart(formParams); } else if (body == null) { if ("DELETE".equals(method)) { @@ -1361,16 +1495,18 @@ public class ApiClient { reqBody = null; } else { // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", MediaType.parse(contentType)); + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); } } else { reqBody = serialize(body, contentType); } + List updatedQueryParams = new ArrayList<>(queryParams); + // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - final Request.Builder reqBuilder = new Request.Builder().url(url); + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); processHeaderParams(headerParams, reqBuilder); processCookieParams(cookieParams, reqBuilder); @@ -1393,6 +1529,7 @@ public class ApiClient { /** * Build full URL by concatenating base path, the given sub path and query parameters. * + * @param baseUrl The base URL * @param path The sub path * @param queryParams The query parameters * @param collectionQueryParams The collection query parameters @@ -1403,7 +1540,18 @@ public class ApiClient { if (baseUrl != null) { url.append(baseUrl).append(path); } else { - url.append(basePath).append(path); + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); } if (queryParams != null && !queryParams.isEmpty()) { @@ -1487,6 +1635,7 @@ public class ApiClient { * @param payload HTTP request body * @param method HTTP method * @param uri URI + * @throws {{invokerPackage}}.ApiException If fails to update the parameters */ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { @@ -1525,12 +1674,18 @@ public class ApiClient { for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } } else { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); - mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); } } return mpBuilder.build(); @@ -1551,6 +1706,44 @@ public class ApiClient { } } + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + /** * Get network interceptor to add it to the httpClient to track download progress for * async requests. @@ -1618,7 +1811,7 @@ public class ApiClient { KeyStore caKeyStore = newEmptyKeyStore(password); int index = 0; for (Certificate certificate : certificates) { - String certificateAlias = "ca" + Integer.toString(index++); + String certificateAlias = "ca" + (index++); caKeyStore.setCertificateEntry(certificateAlias, certificate); } trustManagerFactory.init(caKeyStore); @@ -1693,7 +1886,7 @@ public class ApiClient { if (entry.getKey().equals(param.getName())) { switch (param.getIn()) { case "path": - path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString())); + path = path.replace("{" + param.getName() + "}", escapeString(value.toString())); break; case "query": if (value instanceof Collection) { @@ -1722,9 +1915,9 @@ public class ApiClient { /** * Convert the HTTP request body to a string. * - * @param request The HTTP request object + * @param requestBody The HTTP request object * @return The string representation of the HTTP request body - * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + * @throws {{invokerPackage}}.ApiException If fail to serialize the request body object into a string */ private String requestBodyToString(RequestBody requestBody) throws ApiException { if (requestBody != null) { diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/JSON.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/JSON.mustache new file mode 100644 index 000000000..6cf7ec789 --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/JSON.mustache @@ -0,0 +1,534 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; +{{#joda}} +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.DateTimeFormatterBuilder; +import org.joda.time.format.ISODateTimeFormat; +{{/joda}} + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + {{#joda}} + private static DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + {{/joda}} + {{#jsr310}} + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + {{/jsr310}} + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + {{#models}} + {{#model}} + {{#discriminator}} + .registerTypeSelector({{modelPackage}}.{{classname}}.class, new TypeSelector<{{modelPackage}}.{{classname}}>() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + {{#mappedModels}} + classByDiscriminatorValue.put("{{mappingName}}"{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}, {{modelPackage}}.{{modelName}}.class); + {{/mappedModels}} + classByDiscriminatorValue.put("{{name}}"{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}, {{modelPackage}}.{{classname}}.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "{{{propertyBaseName}}}")); + } + }) + {{/discriminator}} + {{/model}} + {{/models}} + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + {{#disableHtmlEscaping}} + builder.disableHtmlEscaping(); + {{/disableHtmlEscaping}} + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + {{#joda}} + gsonBuilder.registerTypeAdapter(DateTime.class, dateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + {{/joda}} + {{#jsr310}} + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + {{/jsr310}} + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + {{#models}} + {{#model}} + {{^isEnum}} + {{^hasChildren}} + gsonBuilder.registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()); + {{/hasChildren}} + {{/isEnum}} + {{/model}} + {{/models}} + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + {{#joda}} + /** + * Gson TypeAdapter for Joda DateTime type + */ + public static class DateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public DateTimeTypeAdapter() { + this(new DateTimeFormatterBuilder() + .append(ISODateTimeFormat.dateTime().getPrinter(), ISODateTimeFormat.dateOptionalTimeParser().getParser()) + .toFormatter()); + } + + public DateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, DateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.print(date)); + } + } + + @Override + public DateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return formatter.parseDateTime(date); + } + } + } + + /** + * Gson TypeAdapter for Joda LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(ISODateTimeFormat.date()); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.print(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return formatter.parseLocalDate(date); + } + } + } + + public static void setDateTimeFormat(DateTimeFormatter dateFormat) { + dateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + {{/joda}} + {{#jsr310}} + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + {{/jsr310}} + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/README.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/README.mustache index a1a142bd4..8dbdf2451 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/README.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/README.mustache @@ -5,6 +5,7 @@ {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} + - Generator version: {{generatorVersion}} {{{appDescriptionWithNewLines}}} @@ -18,7 +19,7 @@ ## Requirements Building the API client library requires: -1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ +1. Java 1.8+ 2. Maven (3.8.3+)/Gradle (7.2+) ## Installation @@ -96,6 +97,10 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("{{{basePath}}}"); + {{#withAWSV4Signature}} + // Configure AWS Signature V4 authorization + defaultClient.setAWS4Configuration("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", "REGION", "SERVICE") + {{/withAWSV4Signature}} {{#hasAuthMethods}} {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} @@ -151,18 +156,25 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} + ## Documentation for Authorization -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} {{#isApiKey}}- **Type**: API key - **API key parameter name**: {{keyParamName}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/additional_properties.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/additional_properties.mustache new file mode 100644 index 000000000..bca54f84d --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/additional_properties.mustache @@ -0,0 +1,46 @@ +{{#isAdditionalPropertiesTrue}} + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the {{classname}} instance itself + */ + public {{classname}} putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } +{{/isAdditionalPropertiesTrue}} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/anyof_model.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/anyof_model.mustache new file mode 100644 index 000000000..18447fc12 --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/anyof_model.mustache @@ -0,0 +1,398 @@ + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import {{invokerPackage}}.JSON; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + {{#composedSchemas}} + {{#anyOf}} + {{^isArray}} + {{^vendorExtensions.x-duplicated-data-type}} + final TypeAdapter<{{{dataType}}}> adapter{{{dataType}}} = gson.getDelegateAdapter(this, TypeToken.get({{{dataType}}}.class)); + {{/vendorExtensions.x-duplicated-data-type}} + {{/isArray}} + {{#isArray}} + + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); + {{/isArray}} + {{/anyOf}} + {{/composedSchemas}} + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // check if the actual instance is of the type `{{{dataType}}}` + if (value.getActualInstance() instanceof {{#isArray}}List{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) { + {{#isPrimitiveType}} + JsonPrimitive primitive = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isArray}} + List list = (List) value.getActualInstance(); + if (list.get(0) instanceof {{{items.dataType}}}) { + JsonArray array = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonArray(); + elementAdapter.write(out, array); + return; + } + {{/isArray}} + {{/isPrimitiveType}} + {{^isArray}} + {{^isPrimitiveType}} + JsonElement element = adapter{{{dataType}}}.toJsonTree(({{{dataType}}})value.getActualInstance()); + elementAdapter.write(out, element); + return; + {{/isPrimitiveType}} + {{/isArray}} + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^hasVars}} + // deserialize {{{dataType}}} + try { + // validate the JSON object to see if any exception is thrown + {{^isArray}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isArray}} + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); + } + {{/hasVars}} + {{#hasVars}} + // deserialize {{{.}}} + try { + // validate the JSON object to see if any exception is thrown + {{.}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{.}}; + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{.}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + } + {{/hasVars}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + + throw new IOException(String.format("Failed deserialization for {{classname}}: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public {{classname}}() { + super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + } + + public {{classname}}(Object o) { + super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + + static { + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + schemas.put("{{{dataType}}}", {{{baseType}}}.class); + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + } + + @Override + public Map> getSchemas() { + return {{classname}}.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + {{#isNullable}} + if (instance == null) { + super.setActualInstance(instance); + return; + } + + {{/isNullable}} + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (instance instanceof {{#isArray}}List{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) { + {{#isArray}} + List list = (List) instance; + if (list.get(0) instanceof {{{items.dataType}}}) { + super.setActualInstance(instance); + return; + } + {{/isArray}} + {{^isArray}} + super.setActualInstance(instance); + return; + {{/isArray}} + } + + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + throw new RuntimeException("Invalid instance type. Must be {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + } + + /** + * Get the actual instance, which can be the following: + * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * + * @return The actual instance ({{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + /** + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` + */ + public {{{dataType}}} get{{#isArray}}{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to {{classname}} + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + {{#composedSchemas}} + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // validate the json string with {{{dataType}}} + try { + {{^hasVars}} + {{^isArray}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isArray}} + {{/hasVars}} + {{#hasVars}} + {{{.}}}.validateJsonElement(jsonElement); + return; + {{/hasVars}} + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + // continue to the next one + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + {{/composedSchemas}} + throw new IOException(String.format("The JSON string is invalid for {{classname}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/api.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/api.mustache index e81f874f1..96757ed64 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/api.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/api.mustache @@ -26,13 +26,14 @@ import io.swagger.v3.oas.models.parameters.Parameter; import java.io.IOException; {{#useBeanValidation}} -import javax.validation.constraints.*; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.ValidatorFactory; -import javax.validation.executable.ExecutableValidator; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.ValidatorFactory; +import jakarta.validation.executable.ExecutableValidator; import java.util.Set; import java.lang.reflect.Method; import java.lang.reflect.Type; @@ -42,7 +43,6 @@ import java.lang.reflect.Type; {{/imports}} import java.lang.reflect.Type; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -50,7 +50,6 @@ import java.util.Map; {{#supportStreaming}} import java.io.InputStream; {{/supportStreaming}} -{{/fullJavaUtil}} {{#operations}} public class {{classname}} { @@ -119,7 +118,6 @@ public class {{classname}} { {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { String basePath = null; - // Operation Servers String[] localBasePaths = new String[] { {{#servers}}"{{{url}}}"{{^-last}}, {{/-last}}{{/servers}} }; @@ -137,7 +135,7 @@ public class {{classname}} { // create path and map variables {{^dynamicOperations}} String localVarPath = "{{{path}}}"{{#pathParams}} - .replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; + .replace("{" + "{{baseName}}" + "}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; {{/dynamicOperations}} {{#dynamicOperations}} ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}"); @@ -156,11 +154,11 @@ public class {{classname}} { {{/allParams}} {{/dynamicOperations}} - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#formParams}} if ({{paramName}} != null) { @@ -171,29 +169,52 @@ public class {{classname}} { {{^dynamicOperations}} {{#queryParams}} if ({{paramName}} != null) { - {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{#isFreeFormObject}}localVarQueryParams.addAll(localVarApiClient.freeFormParameterToPairs({{paramName}}));{{/isFreeFormObject}}{{^isFreeFormObject}}{{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}}));{{/isFreeFormObject}} } {{/queryParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarCollectionQueryParams.add(new Pair("{{baseName}}", {{#_enum}}"{{{.}}}"{{/_enum}})); + + {{/isQueryParam}} + {{/constantParams}} {{#headerParams}} if ({{paramName}} != null) { localVarHeaderParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); } {{/headerParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarHeaderParams.put("{{baseName}}", {{#_enum}}"{{{.}}}"{{/_enum}}); + + {{/isHeaderParam}} + {{/constantParams}} {{#cookieParams}} if ({{paramName}} != null) { localVarCookieParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); } {{/cookieParams}} + {{#constantParams}} + {{#isCookieParam}} + // Set client side default value of Cookie Param "{{baseName}}". + localVarCookieParams.put("{{baseName}}", {{#_enum}}"{{{.}}}"{{/_enum}}); + + {{/isCookieParam}} + {{/constantParams}} {{/dynamicOperations}} {{#dynamicOperations}} localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); {{/dynamicOperations}} final String[] localVarAccepts = { - {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -201,14 +222,16 @@ public class {{classname}} { } final String[] localVarContentTypes = { - {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + String[] localVarAuthNames = new String[] { {{#withAWSV4Signature}}"AWS4Auth"{{/withAWSV4Signature}}{{#authMethods}}{{#-first}}{{#withAWSV4Signature}}, {{/withAWSV4Signature}}{{/-first}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; return localVarApiClient.buildCall(basePath, localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @@ -218,15 +241,16 @@ public class {{classname}} { @SuppressWarnings("rawtypes") private okhttp3.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { {{^performBeanValidation}} - {{#allParams}}{{#required}} + {{#allParams}} + {{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)"); } - {{/required}}{{/allParams}} - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; + {{/required}} + {{/allParams}} + return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); {{/performBeanValidation}} {{#performBeanValidation}} @@ -240,9 +264,7 @@ public class {{classname}} { parameterValues); if (violations.size() == 0) { - okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); - return localVarCall; - + return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); } else { throw new BeanValidationException((Set) violations); } @@ -253,7 +275,6 @@ public class {{classname}} { e.printStackTrace(); throw new ApiException(e.getMessage()); } - {{/performBeanValidation}} } @@ -326,13 +347,42 @@ public class {{classname}} { {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType);{{/returnType}} + {{#returnType}} + {{#errorObjectType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}>(){}.getType())); + throw e; + } + {{/errorObjectType}} + {{^errorObjectType}} + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + {{/errorObjectType}} + {{/returnType}} } {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType);{{/returnType}}{{^returnType}}return localVarApiClient.execute(localVarCall);{{/returnType}} + {{^returnType}} + return localVarApiClient.execute(localVarCall); + {{/returnType}} + {{#returnType}} + {{#errorObjectType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}>(){}.getType())); + throw e; + } + {{/errorObjectType}} + {{^errorObjectType}} + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + {{/errorObjectType}} + {{/returnType}} } {{/vendorExtensions.x-streaming}} @@ -443,10 +493,17 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} + {{^vendorExtensions.x-streaming}} public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} return localVarResp.getData();{{/returnType}} } + {{/vendorExtensions.x-streaming}} + {{#vendorExtensions.x-streaming}} + public InputStream execute() throws ApiException { + return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/vendorExtensions.x-streaming}} /** * Execute {{operationId}} request with HTTP info returned @@ -468,9 +525,16 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} + {{^vendorExtensions.x-streaming}} public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } + {{/vendorExtensions.x-streaming}} + {{#vendorExtensions.x-streaming}} + public InputStream executeWithHttpInfo() throws ApiException { + return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/vendorExtensions.x-streaming}} /** * Execute {{operationId}} request (asynchronously) diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/apiException.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/apiException.mustache index 4bec51da9..3cd6edaf7 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/apiException.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/apiException.mustache @@ -9,16 +9,22 @@ import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} + /** *

ApiException class.

*/ @SuppressWarnings("serial") {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - + {{#errorObjectType}} + private {{{errorObjectType}}} errorObject = null; + {{/errorObjectType}} + /** *

Constructor for ApiException.

*/ @@ -96,7 +102,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us * @param responseBody the response body */ public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); } /** @@ -156,4 +162,34 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } + {{#errorObjectType}} + + /** + * Get the error object. + * + * @return Error object + */ + public {{{errorObjectType}}} getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject({{{errorObjectType}}} errorObject) { + this.errorObject = errorObject; + } + {{/errorObjectType}} } diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/api_doc.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/api_doc.mustache index 5a4e3969c..dea75bd2b 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/api_doc.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/api_doc.mustache @@ -3,14 +3,14 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} {{#operation}} - + # **{{operationId}}**{{^vendorExtensions.x-group-parameters}} > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} @@ -33,6 +33,10 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("{{{basePath}}}"); + {{#withAWSV4Signature}} + // Configure AWS Signature V4 authorization + defaultClient.setAWS4Configuration("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", "REGION", "SERVICE") + {{/withAWSV4Signature}} {{#hasAuthMethods}} {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} @@ -75,9 +79,9 @@ public class Example { ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type @@ -98,7 +102,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| {{#responses}} -**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | {{/responses}} {{/responses.0}} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/api_test.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/api_test.mustache index 98a30a60c..29f682678 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/api_test.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/api_test.mustache @@ -5,10 +5,9 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -16,24 +15,32 @@ import java.util.Map; {{#supportStreaming}} import java.io.InputStream; {{/supportStreaming}} -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); - {{#operations}}{{#operation}} + {{#operations}} + {{#operation}} /** + {{#summary}} * {{summary}} * + {{/summary}} + {{#notes}} * {{notes}} * - * @throws ApiException - * if the Api call fails + {{/notes}} + * @throws ApiException if the Api call fails */ @Test public void {{operationId}}Test() throws ApiException { @@ -41,16 +48,18 @@ public class {{classname}}Test { {{{dataType}}} {{paramName}} = null; {{/allParams}} {{#vendorExtensions.x-streaming}} - InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{paramName}}({{paramName}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}} {{/vendorExtensions.x-streaming}} {{^vendorExtensions.x-streaming}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{paramName}}({{paramName}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}} {{/vendorExtensions.x-streaming}} // TODO: test validations } - {{/operation}}{{/operations}} + + {{/operation}} + {{/operations}} } diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/auth/AWS4Auth.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/auth/AWS4Auth.mustache new file mode 100644 index 000000000..24bfb4c1f --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/auth/AWS4Auth.mustache @@ -0,0 +1,104 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.List; +import java.util.stream.Collectors; + +import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.auth.credentials.AwsSessionCredentials; +import software.amazon.awssdk.auth.credentials.AwsCredentials; +import software.amazon.awssdk.auth.signer.Aws4Signer; +import software.amazon.awssdk.auth.signer.params.Aws4SignerParams; +import software.amazon.awssdk.http.ContentStreamProvider; +import software.amazon.awssdk.http.SdkHttpFullRequest; +import software.amazon.awssdk.http.SdkHttpMethod; +import software.amazon.awssdk.regions.Region; + +import okio.Buffer; + +{{>generatedAnnotation}} +public class AWS4Auth implements Authentication { + + private AwsCredentials credentials; + private String region; + private String service; + + public AWS4Auth() { + this.credentials = AnonymousCredentialsProvider.create().resolveCredentials(); + } + + public void setCredentials(String accessKey, String secretKey) { + this.credentials = AwsBasicCredentials.create(accessKey, secretKey); + } + + public void setCredentials(String accessKey, String secretKey, String sessionToken) { + this.credentials = AwsSessionCredentials.create(accessKey, secretKey, sessionToken); + } + + public void setRegion(String region) { + this.region = region; + } + + public void setService(String service) { + this.service = service; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) + throws ApiException { + + SdkHttpFullRequest.Builder requestBuilder = + SdkHttpFullRequest.builder().uri(uri).method(SdkHttpMethod.fromValue(method)); + + ContentStreamProvider provider = new ContentStreamProvider() { + @Override + public InputStream newStream() { + InputStream is = new ByteArrayInputStream(payload.getBytes(StandardCharsets.UTF_8)); + return is; + } + }; + + requestBuilder = requestBuilder.contentStreamProvider(provider); + + SdkHttpFullRequest signableRequest = sign(requestBuilder); + + Map headers = signableRequest.headers().entrySet().stream() + .collect(Collectors.toMap(s -> s.getKey(), e -> e.getValue().get(0))); + + headerParams.putAll(headers); + } + + /** + * AWS Signature Version 4 signing. + * + * @param request {@link SdkHttpFullRequest.Builder} + * @return {@link SdkHttpFullRequest} + */ + private SdkHttpFullRequest sign(final SdkHttpFullRequest.Builder request) { + + SdkHttpFullRequest req = request.build(); + + if (this.service != null && this.region != null && this.credentials != null) { + Aws4SignerParams params = Aws4SignerParams.builder().signingName(this.service) + .signingRegion(Region.of(this.region)).awsCredentials(this.credentials).build(); + + Aws4Signer signer = Aws4Signer.create(); + + req = signer.sign(req, params); + } + + return req; + } +} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache index 417a89e34..41f336707 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/auth/HttpBasicAuth.mustache @@ -11,8 +11,6 @@ import java.net.URI; import java.util.Map; import java.util.List; -import java.io.UnsupportedEncodingException; - public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache index c8a9fce29..abe1cb8b8 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/auth/HttpBearerAuth.mustache @@ -6,13 +6,15 @@ import {{invokerPackage}}.ApiException; import {{invokerPackage}}.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; {{>generatedAnnotation}} public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -24,7 +26,7 @@ public class HttpBearerAuth implements Authentication { * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** @@ -33,12 +35,22 @@ public class HttpBearerAuth implements Authentication { * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); if (bearerToken == null) { return; } diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache index cb0e82505..67d7f720d 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/auth/OAuthOkHttpClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + {{#hasOAuthMethods}} package {{invokerPackage}}.auth; @@ -56,6 +58,7 @@ public class OAuthOkHttpClient implements HttpClient { response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache index 137e266b5..fbe73e729 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/auth/RetryingOAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + {{#hasOAuthMethods}} package {{invokerPackage}}.auth; @@ -29,22 +31,31 @@ public class RetryingOAuth extends OAuth implements Interceptor { private TokenRequestBuilder tokenRequestBuilder; + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); this.tokenRequestBuilder = tokenRequestBuilder; } + /** + * @param tokenRequestBuilder A token request builder + */ public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { this(new OkHttpClient(), tokenRequestBuilder); } /** - @param tokenUrl The token URL to be used for this OAuth2 flow. - Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". - The value must be an absolute URL. - @param clientId The OAuth2 client ID for the "clientCredentials" flow. - @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. - */ + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ public RetryingOAuth( String tokenUrl, String clientId, @@ -57,24 +68,29 @@ public class RetryingOAuth extends OAuth implements Interceptor { .setClientSecret(clientSecret)); setFlow(flow); if (parameters != null) { - for (String paramName : parameters.keySet()) { - tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); } } } + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: + case ACCESS_CODE: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case implicit: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: @@ -116,8 +132,8 @@ public class RetryingOAuth extends OAuth implements Interceptor { } Map headers = oAuthRequest.getHeaders(); - for (String headerName : headers.keySet()) { - requestBuilder.addHeader(headerName, headers.get(headerName)); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); } requestBuilder.url(oAuthRequest.getLocationUri()); @@ -148,8 +164,12 @@ public class RetryingOAuth extends OAuth implements Interceptor { } } - /* + /** * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { @@ -166,10 +186,20 @@ public class RetryingOAuth extends OAuth implements Interceptor { return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); } + /** + * Gets the token request builder + * + * @return A token request builder + */ public TokenRequestBuilder getTokenRequestBuilder() { return tokenRequestBuilder; } + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { this.tokenRequestBuilder = tokenRequestBuilder; } diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/build.gradle.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/build.gradle.mustache index c97cb873e..eb67fc112 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/build.gradle.mustache @@ -14,8 +14,8 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -66,10 +66,10 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) } } @@ -110,31 +110,33 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.5.24' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'io.gsonfire:gson-fire:1.8.4' + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.9.0' + implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' {{#openApiNullable}} - implementation 'org.openapitools:jackson-databind-nullable:0.2.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' {{/openApiNullable}} + {{#withAWSV4Signature}} + implementation 'software.amazon.awssdk:auth:2.20.157' + {{/withAWSV4Signature}} {{#hasOAuthMethods}} - implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' {{/hasOAuthMethods}} - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' {{#joda}} implementation 'joda-time:joda-time:2.9.9' {{/joda}} - {{#threetenbp}} - implementation 'org.threeten:threetenbp:1.4.3' - {{/threetenbp}} {{#dynamicOperations}} - implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.23' + implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30' {{/dynamicOperations}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:3.11.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { @@ -167,3 +169,17 @@ spotless { importOrder() } } + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/build.sbt.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/build.sbt.mustache index 5e0c74c55..2045b8474 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/build.sbt.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/build.sbt.mustache @@ -9,31 +9,33 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.24", - "com.squareup.okhttp3" % "okhttp" % "4.9.1", - "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", - "com.google.code.gson" % "gson" % "2.8.6", - "org.apache.commons" % "commons-lang3" % "3.10", + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.12.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", {{/openApiNullable}} + {{#withAWSV4Signature}} + "software.amazon.awssdk" % "auth" % "2.20.157", + {{/withAWSV4Signature}} {{#hasOAuthMethods}} - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", {{/hasOAuthMethods}} {{#joda}} "joda-time" % "joda-time" % "2.9.9" % "compile", {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", - {{/threetenbp}} {{#dynamicOperations}} - "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" + "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.30" % "compile" {{/dynamicOperations}} - "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" ) ) diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/model.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/model.mustache new file mode 100644 index 000000000..c82b0fbe2 --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/model.mustache @@ -0,0 +1,35 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#useReflectionEqualsHashCode}} +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +{{/useReflectionEqualsHashCode}} +import java.util.Objects; +{{#imports}} +import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#withXml}} +import {{javaxPackage}}.xml.bind.annotation.*; +{{/withXml}} +{{#parcelableModel}} +import android.os.Parcelable; +import android.os.Parcel; +{{/parcelableModel}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} +{{#performBeanValidation}} +import org.hibernate.validator.constraints.*; +{{/performBeanValidation}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>oneof_model}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>anyof_model}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>pojo}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/modelEnum.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/modelEnum.mustache new file mode 100644 index 000000000..b955e53f1 --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/modelEnum.mustache @@ -0,0 +1,85 @@ +import java.io.IOException; +{{#isUri}} +import java.net.URI; +{{/isUri}} +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class) +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + } + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}}{{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isUri}}URI.create({{/isUri}}jsonElement.{{#isNumber}}getAsString(){{/isNumber}}{{#isInteger}}getAsInt(){{/isInteger}}{{#isUri}}getAsString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}getAs{{{dataType}}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +{{/supportUrlQuery}} +} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/modelInnerEnum.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/modelInnerEnum.mustache new file mode 100644 index 000000000..06912e9b1 --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/modelInnerEnum.mustache @@ -0,0 +1,66 @@ + /** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ + @JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.Adapter.class) +{{#withXml}} + @XmlType(name="{{datatypeWithEnum}}") + @XmlEnum({{dataType}}.class) +{{/withXml}} + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + } + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} {{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isUri}}URI.create({{/isUri}}jsonElement.{{#isNumber}}getAsString(){{/isNumber}}{{#isInteger}}getAsInt(){{/isInteger}}{{#isUri}}getAsString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}getAs{{{dataType}}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/model_test.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/model_test.mustache new file mode 100644 index 000000000..040d319bf --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/model_test.mustache @@ -0,0 +1,42 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for {{classname}} + */ +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/oneof_model.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/oneof_model.mustache new file mode 100644 index 000000000..31c63263e --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/oneof_model.mustache @@ -0,0 +1,512 @@ + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import {{invokerPackage}}.JSON; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}} implements {{{.}}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + {{#composedSchemas}} + {{#oneOf}} + {{^isArray}} + {{^isMap}} + {{^vendorExtensions.x-duplicated-data-type}} + final TypeAdapter<{{{dataType}}}> adapter{{{dataType}}} = gson.getDelegateAdapter(this, TypeToken.get({{{dataType}}}.class)); + {{/vendorExtensions.x-duplicated-data-type}} + {{/isMap}} + {{/isArray}} + {{#isArray}} + + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); + {{/isArray}} + {{#isMap}} + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); + {{/isMap}} + {{/oneOf}} + {{/composedSchemas}} + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // check if the actual instance is of the type `{{{dataType}}}` + if (value.getActualInstance() instanceof {{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}{{^isMap}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isMap}}) { + {{#isPrimitiveType}} + {{^isMap}} + JsonPrimitive primitive = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + {{/isMap}} + {{#isMap}} + JsonObject object = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, object); + return; + {{/isMap}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isArray}} + List list = (List) value.getActualInstance(); + if (list.get(0) instanceof {{{items.dataType}}}) { + JsonArray array = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonArray(); + elementAdapter.write(out, array); + return; + } + {{/isArray}} + {{/isPrimitiveType}} + {{^isMap}} + {{^isArray}} + {{^isPrimitiveType}} + JsonElement element = adapter{{{dataType}}}.toJsonTree(({{{dataType}}})value.getActualInstance()); + elementAdapter.write(out, element); + return; + {{/isPrimitiveType}} + {{/isArray}} + {{/isMap}} + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + JsonObject jsonObject = jsonElement.getAsJsonObject(); + + // use discriminator value for faster oneOf lookup + {{classname}} new{{classname}} = new {{classname}}(); + if (jsonObject.get("{{{propertyBaseName}}}") == null) { + log.log(Level.WARNING, "Failed to lookup discriminator value for {{classname}} as `{{{propertyBaseName}}}` was not found in the payload or the payload is empty."); + } else { + // look up the discriminator value in the field `{{{propertyBaseName}}}` + switch (jsonObject.get("{{{propertyBaseName}}}").getAsString()) { + {{#mappedModels}} + case "{{{mappingName}}}": + deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); + new{{classname}}.setActualInstance(deserialized); + return new{{classname}}; + {{/mappedModels}} + default: + log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", jsonObject.get("{{{propertyBaseName}}}").getAsString())); + } + } + + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^hasVars}} + // deserialize {{{dataType}}} + try { + // validate the JSON object to see if any exception is thrown + {{^isArray}} + {{^isMap}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isPrimitiveType}} + {{/isNumber}} + {{/isMap}} + {{/isArray}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isArray}} + {{#isMap}} + if (!jsonElement.isJsonObject()) { + throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString())); + } + + {{^isFreeFormObject}} + Map map = jsonElement.getAsJsonObject().asMap(); + // validate map items + for(JsonElement element : map.values()) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isFreeFormObject}} + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isMap}} + match++; + log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{dataType}}}'", e); + } + {{/hasVars}} + {{#hasVars}} + // deserialize {{{.}}} + try { + // validate the JSON object to see if any exception is thrown + {{.}}.validateJsonElement(jsonElement); + actualAdapter = adapter{{.}}; + match++; + log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for {{{.}}} failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + } + {{/hasVars}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + + if (match == 1) { + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public {{classname}}() { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + } + + public {{classname}}(Object o) { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + + static { + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + schemas.put("{{{dataType}}}", {{{baseType}}}.class); + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + } + + @Override + public Map> getSchemas() { + return {{classname}}.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + {{#isNullable}} + if (instance == null) { + super.setActualInstance(instance); + return; + } + + {{/isNullable}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if (instance instanceof {{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}{{^isMap}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isMap}}) { + {{#isArray}} + List list = (List) instance; + if (list.get(0) instanceof {{{items.dataType}}}) { + super.setActualInstance(instance); + return; + } + {{/isArray}} + {{^isArray}} + super.setActualInstance(instance); + return; + {{/isArray}} + } + + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + } + + /** + * Get the actual instance, which can be the following: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + /** + * Get the actual instance of `{{{dataType}}}`. If the actual instance is not `{{{dataType}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{dataType}}}` + * @throws ClassCastException if the instance is not `{{{dataType}}}` + */ + public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException { + return ({{{dataType}}})super.getActualInstance(); + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to {{classname}} + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + // validate the json string with {{{dataType}}} + try { + {{^hasVars}} + {{^isMap}} + {{^isArray}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!jsonElement.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(jsonElement); + {{/isPrimitiveType}} + {{/isNumber}} + {{/isArray}} + {{/isMap}} + {{#isArray}} + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isArray}} + {{#isMap}} + if (!jsonElement.isJsonObject()) { + throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString())); + } + + {{^isFreeFormObject}} + Map map = jsonElement.getAsJsonObject().asMap(); + // validate map items + for(JsonElement element : map.values()) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isFreeFormObject}} + {{/isMap}} + {{/hasVars}} + {{#hasVars}} + {{{.}}}.validateJsonElement(jsonElement); + validCount++; + {{/hasVars}} + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for {{{dataType}}} failed with `%s`.", e.getMessage())); + // continue to the next one + } + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + {{/composedSchemas}} + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/pojo.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/pojo.mustache new file mode 100644 index 000000000..0a32ef099 --- /dev/null +++ b/sdks/java-v2/templates/libraries/okhttp-gson/pojo.mustache @@ -0,0 +1,591 @@ +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import {{invokerPackage}}.JSON; + +/** + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + */{{#isDeprecated}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +{{#serializableModel}} + private static final long serialVersionUID = 1L; + +{{/serializableModel}} + {{#vars}} + {{#isEnum}} + {{^isContainer}} +{{>modelInnerEnum}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>modelInnerEnum}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; + {{#withXml}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{/withXml}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} + {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + + {{/vars}} + public {{classname}}() { + {{#parent}} + {{#parcelableModel}} + super(); + {{/parcelableModel}} + {{/parent}} + {{#discriminator}} + {{^discriminator.isEnum}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator.isEnum}} + {{/discriminator}} + } + {{#vendorExtensions.x-has-readonly-properties}} + {{^withXml}} + + public {{classname}}( + {{#readOnlyVars}} + {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + } + {{/withXml}} + {{/vendorExtensions.x-has-readonly-properties}} + {{#vars}} + + {{^isReadOnly}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; + } + this.{{name}}.add({{name}}Item); + return this; + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; + } + this.{{name}}.put(key, {{name}}Item); + return this; + } + {{/isMap}} + + {{/isReadOnly}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + */ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#required}} +{{#isNullable}} + @{{javaxPackage}}.annotation.Nullable +{{/isNullable}} +{{^isNullable}} + @{{javaxPackage}}.annotation.Nonnull +{{/isNullable}} +{{/required}} +{{^required}} + @{{javaxPackage}}.annotation.Nullable +{{/required}} +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} + public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + } + + {{^isReadOnly}} +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#deprecated}} @Deprecated +{{/deprecated}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + } + {{/isReadOnly}} + + {{/vars}} +{{>libraries/okhttp-gson/additional_properties}} + + @Override + public boolean equals(Object o) { + {{#useReflectionEqualsHashCode}} + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} && + {{/-last}}{{/vars}}{{#isAdditionalPropertiesTrue}}&& + Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/isAdditionalPropertiesTrue}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public int hashCode() { + {{#useReflectionEqualsHashCode}} + return HashCodeBuilder.reflectionHashCode(this); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#isAdditionalPropertiesTrue}}{{#hasVars}}, {{/hasVars}}{{^hasVars}}{{#parent}}, {{/parent}}{{/hasVars}}additionalProperties{{/isAdditionalPropertiesTrue}}); + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}} + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + {{/parent}} + {{#vars}} + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); + {{/vars}} +{{#isAdditionalPropertiesTrue}} + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); +{{/isAdditionalPropertiesTrue}} + sb.append("}"); + return sb.toString(); + } + + /** + * 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 "); + } + +{{#parcelableModel}} + + public void writeToParcel(Parcel out, int flags) { +{{#model}} +{{#isArray}} + out.writeList(this); +{{/isArray}} +{{^isArray}} +{{#parent}} + super.writeToParcel(out, flags); +{{/parent}} +{{#vars}} + out.writeValue({{name}}); +{{/vars}} +{{/isArray}} +{{/model}} + } + + {{classname}}(Parcel in) { +{{#isArray}} + in.readTypedList(this, {{arrayModelType}}.CREATOR); +{{/isArray}} +{{^isArray}} +{{#parent}} + super(in); +{{/parent}} +{{#vars}} +{{#isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); +{{/isPrimitiveType}} +{{/vars}} +{{/isArray}} + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public {{classname}} createFromParcel(Parcel in) { +{{#model}} +{{#isArray}} + {{classname}} result = new {{classname}}(); + result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); + return result; +{{/isArray}} +{{^isArray}} + return new {{classname}}(in); +{{/isArray}} +{{/model}} + } + public {{classname}}[] newArray(int size) { + return new {{classname}}[size]; + } + }; +{{/parcelableModel}} + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + {{#allVars}} + openapiFields.add("{{baseName}}"); + {{/allVars}} + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + {{#requiredVars}} + openapiRequiredFields.add("{{baseName}}"); + {{/requiredVars}} + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to {{classname}} + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!{{classname}}.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in {{{classname}}} is not found in the empty JSON string", {{classname}}.openapiRequiredFields.toString())); + } + } + {{^hasChildren}} + {{^isAdditionalPropertiesTrue}} + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!{{classname}}.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + {{/isAdditionalPropertiesTrue}} + {{#requiredVars}} + {{#-first}} + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : {{classname}}.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + {{/-first}} + {{/requiredVars}} + {{/hasChildren}} + {{^discriminator}} + {{#hasVars}} + JsonObject jsonObj = jsonElement.getAsJsonObject(); + {{/hasVars}} + {{#vars}} + {{#isArray}} + {{#items.isModel}} + {{#required}} + // ensure the json data is an array + if (!jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + + JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); + // validate the required field `{{{baseName}}}` (array) + for (int i = 0; i < jsonArray{{name}}.size(); i++) { + {{{items.dataType}}}.validateJsonElement(jsonArray{{name}}.get(i)); + }; + {{/required}} + {{^required}} + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); + if (jsonArray{{name}} != null) { + // ensure the json data is an array + if (!jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + + // validate the optional field `{{{baseName}}}` (array) + for (int i = 0; i < jsonArray{{name}}.size(); i++) { + {{{items.dataType}}}.validateJsonElement(jsonArray{{name}}.get(i)); + }; + } + } + {{/required}} + {{/items.isModel}} + {{^items.isModel}} + {{^required}} + // ensure the optional json data is an array if present + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull() && !jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + {{/required}} + {{#required}} + // ensure the required json array is present + if (jsonObj.get("{{{baseName}}}") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("{{{baseName}}}").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + {{/required}} + {{/items.isModel}} + {{/isArray}} + {{^isContainer}} + {{#isString}} + if ({{#notRequiredOrIsNullable}}(jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) && {{/notRequiredOrIsNullable}}!jsonObj.get("{{{baseName}}}").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be a primitive type in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + } + {{/isString}} + {{#isModel}} + {{#required}} + // validate the required field `{{{baseName}}}` + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + } + {{/required}} + {{/isModel}} + {{#isEnum}} + {{#required}} + // validate the required field `{{{baseName}}}` + {{{datatypeWithEnum}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + {{{datatypeWithEnum}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + } + {{/required}} + {{/isEnum}} + {{#isEnumRef}} + {{#required}} + // validate the required field `{{{baseName}}}` + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + {{/required}} + {{^required}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.get("{{{baseName}}}") != null && !jsonObj.get("{{{baseName}}}").isJsonNull()) { + {{{dataType}}}.validateJsonElement(jsonObj.get("{{{baseName}}}")); + } + {{/required}} + {{/isEnumRef}} + {{/isContainer}} + {{/vars}} + {{/discriminator}} + {{#hasChildren}} + {{#discriminator}} + + String discriminatorValue = jsonElement.getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); + switch (discriminatorValue) { + {{#mappedModels}} + case "{{mappingName}}": + {{modelName}}.validateJsonElement(jsonElement); + break; + {{/mappedModels}} + default: + throw new IllegalArgumentException(String.format("The value of the `{{{propertyBaseName}}}` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + {{/discriminator}} + {{/hasChildren}} + } + +{{^hasChildren}} + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<{{classname}}> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get({{classname}}.class)); + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + {{#isAdditionalPropertiesTrue}} + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + {{/isAdditionalPropertiesTrue}} + elementAdapter.write(out, obj); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + {{#isAdditionalPropertiesTrue}} + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + {{classname}} instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + {{/isAdditionalPropertiesTrue}} + {{^isAdditionalPropertiesTrue}} + return thisAdapter.fromJsonTree(jsonElement); + {{/isAdditionalPropertiesTrue}} + } + + }.nullSafe(); + } + } +{{/hasChildren}} + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/sdks/java-v2/templates/libraries/okhttp-gson/pom.mustache b/sdks/java-v2/templates/libraries/okhttp-gson/pom.mustache index 94c057b14..def53f2fc 100644 --- a/sdks/java-v2/templates/libraries/okhttp-gson/pom.mustache +++ b/sdks/java-v2/templates/libraries/okhttp-gson/pom.mustache @@ -57,7 +57,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.4.1 enforce-maven @@ -77,21 +77,30 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin + 3.6.1 package @@ -108,7 +117,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -122,7 +131,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.5.0 add_sources @@ -153,7 +162,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.6.3 attach-javadocs @@ -176,7 +185,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.3.0 attach-sources @@ -239,7 +248,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.2.1 sign-artifacts @@ -256,11 +265,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations - ${swagger-core-version} + ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -291,7 +309,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.client - 1.0.1 + 1.0.2 {{/hasOAuthMethods}} @@ -306,18 +324,11 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#dynamicOperations}} io.swagger.parser.v3 swagger-parser-v3 - 2.0.28 + 2.0.30 {{/dynamicOperations}} {{#useBeanValidation}} @@ -364,17 +375,29 @@ ${jackson-databind-nullable-version} {{/openApiNullable}} + {{#withAWSV4Signature}} + + software.amazon.awssdk + auth + 2.20.157 + + {{/withAWSV4Signature}} + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} + - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test - org.mockito - mockito-core - 3.12.4 + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} test @@ -382,29 +405,39 @@ 1.8 ${java.version} ${java.version} - 1.8.5 - 1.6.3 - 4.9.2 - 2.8.8 - 3.12.0 + 1.9.0 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 4.12.0 + 2.10.1 + 3.14.0 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} {{#joda}} - 2.10.9 + 2.12.0 {{/joda}} - {{#threetenbp}} - 1.5.0 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#performBeanValidation}} + {{/useJakartaEe}} + {{#performBeanValidation}} 3.0.3 -{{/performBeanValidation}} -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 4.13.2 + {{/performBeanValidation}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 5.10.3 + 1.10.0 + 2.1.6 + 1.1.1 UTF-8 - 2.17.3 + 2.43.0 diff --git a/sdks/java-v2/templates/libraries/rest-assured/ApiClient.mustache b/sdks/java-v2/templates/libraries/rest-assured/ApiClient.mustache index 2a0f41737..aa84b2b9e 100644 --- a/sdks/java-v2/templates/libraries/rest-assured/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/rest-assured/ApiClient.mustache @@ -6,7 +6,6 @@ import {{apiPackage}}.*; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import io.restassured.builder.RequestSpecBuilder; import java.util.function.Consumer; import java.util.function.Supplier; @@ -15,8 +14,6 @@ import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jackson}}JacksonObjectMapper.jackson{{/jackson}}; -{{/fullJavaUtil}} - public class ApiClient { {{#basePath}} public static final String BASE_URI = "{{.}}"; diff --git a/sdks/java-v2/templates/libraries/rest-assured/JacksonObjectMapper.mustache b/sdks/java-v2/templates/libraries/rest-assured/JacksonObjectMapper.mustache index 6af705a9d..8919eda30 100644 --- a/sdks/java-v2/templates/libraries/rest-assured/JacksonObjectMapper.mustache +++ b/sdks/java-v2/templates/libraries/rest-assured/JacksonObjectMapper.mustache @@ -2,23 +2,15 @@ package {{invokerPackage}}; -{{#threetenbp}} -import org.threeten.bp.*; -{{/threetenbp}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -{{#java8}} import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -{{/java8}} {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} -{{#threetenbp}} -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -{{/threetenbp}} import io.restassured.internal.mapping.Jackson2Mapper; import io.restassured.path.json.mapper.factory.Jackson2ObjectMapperFactory; @@ -41,19 +33,10 @@ public class JacksonObjectMapper extends Jackson2Mapper { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); - {{#java8}} mapper.registerModule(new JavaTimeModule()); - {{/java8}} {{#joda}} mapper.registerModule(new JodaModule()); {{/joda}} - {{#threetenbp}} - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{/threetenbp}} {{#openApiNullable}} JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); @@ -65,4 +48,4 @@ public class JacksonObjectMapper extends Jackson2Mapper { public static JacksonObjectMapper jackson() { return new JacksonObjectMapper(); } -} \ No newline at end of file +} diff --git a/sdks/java-v2/templates/libraries/rest-assured/api.mustache b/sdks/java-v2/templates/libraries/rest-assured/api.mustache index 8d4602511..5ae6e5057 100644 --- a/sdks/java-v2/templates/libraries/rest-assured/api.mustache +++ b/sdks/java-v2/templates/libraries/rest-assured/api.mustache @@ -8,7 +8,6 @@ import com.google.gson.reflect.TypeToken; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -22,19 +21,37 @@ import io.restassured.common.mapper.TypeRef; {{/jackson}} import io.restassured.http.Method; import io.restassured.response.Response; +{{#swagger1AnnotationLibrary}} import io.swagger.annotations.*; +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.*; +import io.swagger.v3.oas.annotations.security.*; +{{/swagger2AnnotationLibrary}} + +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} import java.lang.reflect.Type; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; -{{/fullJavaUtil}} {{#gson}} import {{invokerPackage}}.JSON; {{/gson}} import static io.restassured.http.Method.*; +{{#swagger1AnnotationLibrary}} @Api(value = "{{{baseName}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +@Tag(name = "{{{baseName}}}") +{{/swagger2AnnotationLibrary}} public class {{classname}} { private Supplier reqSpecSupplier; @@ -68,12 +85,22 @@ public class {{classname}} { {{#operations}} {{#operation}} +{{#swagger1AnnotationLibrary}} @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", nickname = "{{{operationId}}}", tags = { {{#tags}}{{#name}}"{{{.}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} }) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}") {{^-last}},{{/-last}}{{/responses}} }) +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Operation(summary = "{{{summary}}}", + description = "{{{notes}}}", + operationId = "{{{operationId}}}", + tags = { {{#tags}}{{#name}}"{{{.}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} }) + @ApiResponses(value = { {{#responses}} + @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}") {{^-last}},{{/-last}}{{/responses}} }) +{{/swagger2AnnotationLibrary}} {{#isDeprecated}} @Deprecated {{/isDeprecated}} @@ -127,12 +154,10 @@ public class {{classname}} { public {{operationIdCamelCase}}Oper(RequestSpecBuilder reqSpec) { this.reqSpec = reqSpec; {{#vendorExtensions}} - {{#x-contentType}} - reqSpec.setContentType("{{x-contentType}}"); - {{/x-contentType}} - {{#x-accepts}} - reqSpec.setAccept("{{x-accepts}}"); - {{/x-accepts}} + {{#x-content-type}} + reqSpec.setContentType("{{x-content-type}}"); + {{/x-content-type}} + reqSpec.setAccept("{{#x-accepts}}{{.}}{{^-last}},{{/-last}}{{/x-accepts}}"); {{/vendorExtensions}} this.respSpec = new ResponseSpecBuilder(); } diff --git a/sdks/java-v2/templates/libraries/rest-assured/api_doc.mustache b/sdks/java-v2/templates/libraries/rest-assured/api_doc.mustache index c000bc962..42d223aea 100644 --- a/sdks/java-v2/templates/libraries/rest-assured/api_doc.mustache +++ b/sdks/java-v2/templates/libraries/rest-assured/api_doc.mustache @@ -3,14 +3,14 @@ All URIs are relative to *{{basePath}}* -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}} {{#operations}} {{#operation}} - + # **{{operationId}}** > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) @@ -40,9 +40,9 @@ api.{{operationId}}(){{#allParams}}{{#required}}{{#isPathParam}} ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type diff --git a/sdks/java-v2/templates/libraries/rest-assured/api_test.mustache b/sdks/java-v2/templates/libraries/rest-assured/api_test.mustache index 74a1c9f7e..d7d9dae2b 100644 --- a/sdks/java-v2/templates/libraries/rest-assured/api_test.mustache +++ b/sdks/java-v2/templates/libraries/rest-assured/api_test.mustache @@ -8,16 +8,22 @@ import {{invokerPackage}}.ApiClient; import {{apiPackage}}.{{classname}}; import io.restassured.builder.RequestSpecBuilder; import io.restassured.filter.log.ErrorLoggingFilter; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} + +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jackson}}JacksonObjectMapper.jackson{{/jackson}}; @@ -25,12 +31,12 @@ import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jacks /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void createApi() { api = ApiClient.api(ApiClient.Config.apiConfig().reqSpecSupplier( () -> new RequestSpecBuilder() @@ -63,4 +69,4 @@ public class {{classname}}Test { {{/responses}} {{/operation}} {{/operations}} -} \ No newline at end of file +} diff --git a/sdks/java-v2/templates/libraries/rest-assured/build.gradle.mustache b/sdks/java-v2/templates/libraries/rest-assured/build.gradle.mustache index e80ea1813..3ddee4535 100644 --- a/sdks/java-v2/templates/libraries/rest-assured/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/rest-assured/build.gradle.mustache @@ -57,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -97,35 +97,39 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.21" - rest_assured_version = "4.3.0" - junit_version = "4.13.1" + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.6" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.15" + {{/swagger2AnnotationLibrary}} + rest_assured_version = "5.3.2" + junit_version = "5.10.3" {{#jackson}} - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threetenbp_version = "2.10.0" - {{/threetenbp}} {{/jackson}} {{#gson}} - gson_version = "2.8.6" - gson_fire_version = "1.8.4" + gson_version = "2.10.1" + gson_fire_version = "1.9.0" {{/gson}} {{#joda}} jodatime_version = "2.10.5" {{/joda}} -{{#threetenbp}} - threetenbp_version = "1.4.3" -{{/threetenbp}} - okio_version = "1.17.5" + okio_version = "3.6.0" + jakarta_annotation_version = "1.3.5" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.rest-assured:rest-assured:$rest_assured_version" {{#jackson}} @@ -142,12 +146,7 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - {{/threetenbp}} {{/jackson}} {{#gson}} implementation "io.gsonfire:gson-fire:$gson_fire_version" @@ -156,16 +155,13 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} -{{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" -{{/threetenbp}} implementation "com.squareup.okio:okio:$okio_version" {{#useBeanValidation}} - implementation "jakarta.validation:jakarta.validation-api:2.0.2" + implementation "jakarta.validation:jakarta.validation-api:3.0.2" {{/useBeanValidation}} {{#performBeanValidation}} implementation "org.hibernate:hibernate-validator:6.0.19.Final" {{/performBeanValidation}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/sdks/java-v2/templates/libraries/rest-assured/build.sbt.mustache b/sdks/java-v2/templates/libraries/rest-assured/build.sbt.mustache index 6a048b92f..ce4037ac5 100644 --- a/sdks/java-v2/templates/libraries/rest-assured/build.sbt.mustache +++ b/sdks/java-v2/templates/libraries/rest-assured/build.sbt.mustache @@ -9,49 +9,41 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.21", - "io.rest-assured" % "rest-assured" % "4.3.0", - "io.rest-assured" % "scala-support" % "4.3.0", + "io.swagger" % "swagger-annotations" % "1.6.6", + "io.rest-assured" % "rest-assured" % "4.5.1", + "io.rest-assured" % "scala-support" % "4.5.1", "com.google.code.findbugs" % "jsr305" % "3.0.2", {{#jackson}} - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3", + "com.fasterxml.jackson.core" % "jackson-core" % "2.13.4", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.4", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.4.2", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.2", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", {{/openApiNullable}} {{#withXml}} - "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.10.3", + "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.13.4.1", {{/withXml}} {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.3", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.4.1", {{/joda}} - {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.3", - {{/java8}} - {{#threetenbp}} - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.10.0", - {{/threetenbp}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.4.1", {{/jackson}} {{#gson}} - "com.google.code.gson" % "gson" % "2.8.6", - "io.gsonfire" % "gson-fire" % "1.8.4" % "compile", + "com.google.code.gson" % "gson" % "2.8.9", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", {{/gson}} {{#joda}} "joda-time" % "joda-time" % "2.10.5" % "compile", {{/joda}} -{{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.3" % "compile", -{{/threetenbp}} "com.squareup.okio" % "okio" % "1.17.5" % "compile", {{#useBeanValidation}} - "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", + "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", {{/useBeanValidation}} {{#performBeanValidation}} "org.hibernate" % "hibernate-validator" % "6.0.19.Final" % "compile", {{/performBeanValidation}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/sdks/java-v2/templates/libraries/rest-assured/pom.mustache b/sdks/java-v2/templates/libraries/rest-assured/pom.mustache index c6e924ecb..396dd69c2 100644 --- a/sdks/java-v2/templates/libraries/rest-assured/pom.mustache +++ b/sdks/java-v2/templates/libraries/rest-assured/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 2.22.2 - + loggerPath conf/log4j.properties - + false 1C @@ -150,7 +150,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.3.2 none 1.8 @@ -219,11 +219,20 @@ {{/jackson}} + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -255,13 +264,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#gson}} io.gsonfire @@ -300,19 +302,10 @@ jackson-datatype-joda {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} {{/jackson}} com.squareup.okio @@ -338,36 +331,41 @@ {{/performBeanValidation}} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.5.21 - 4.3.0 - 2.8.6 - 1.8.4 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 5.3.2 + 2.10.1 + 1.9.0 {{#joda}} 2.10.5 {{/joda}} - {{#threetenbp}} - 1.4.3 - {{/threetenbp}} {{#jackson}} - 2.10.3 - 0.2.2 - {{#threetenbp}} - 2.10.0 - {{/threetenbp}} + 2.17.1 + 2.17.1 + 0.2.6 {{/jackson}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} - 1.17.5 - 4.13.1 + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + 3.6.0 + 5.10.3 diff --git a/sdks/java-v2/templates/libraries/restclient/ApiClient.mustache b/sdks/java-v2/templates/libraries/restclient/ApiClient.mustache new file mode 100644 index 000000000..14b1af4af --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/ApiClient.mustache @@ -0,0 +1,756 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +{{/withXml}} +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.util.function.Consumer; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +{{#withXml}} + import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter; +{{/withXml}} +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestClientException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestClient.ResponseSpec; +import java.util.Optional; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; + +import {{javaxPackage}}.annotation.Nullable; + +{{#jsr310}} +import java.time.OffsetDateTime; +{{/jsr310}} + +import {{invokerPackage}}.auth.Authentication; +import {{invokerPackage}}.auth.HttpBasicAuth; +import {{invokerPackage}}.auth.HttpBearerAuth; +import {{invokerPackage}}.auth.ApiKeyAuth; +{{#hasOAuthMethods}} +import {{invokerPackage}}.auth.OAuth; +{{/hasOAuthMethods}} + +{{>generatedAnnotation}} +public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private final HttpHeaders defaultHeaders = new HttpHeaders(); + private final MultiValueMap defaultCookies = new LinkedMultiValueMap<>(); + + private String basePath = "{{basePath}}"; + + private final RestClient restClient; + private final DateFormat dateFormat; + private final ObjectMapper objectMapper; + + private Map authentications; + + + public ApiClient() { + this.dateFormat = createDefaultDateFormat(); + this.objectMapper = createDefaultObjectMapper(this.dateFormat); + this.restClient = buildRestClient(this.objectMapper); + this.init(); + } + + public ApiClient(RestClient restClient) { + this(Optional.ofNullable(restClient).orElseGet(ApiClient::buildRestClient), createDefaultDateFormat()); + } + + public ApiClient(ObjectMapper mapper, DateFormat format) { + this(buildRestClient(mapper.copy()), format); + } + + public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { + this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format); + } + + private ApiClient(RestClient restClient, DateFormat format) { + this.restClient = restClient; + this.dateFormat = format; + this.objectMapper = createDefaultObjectMapper(format); + this.init(); + } + + public static DateFormat createDefaultDateFormat() { + DateFormat dateFormat = new RFC3339DateFormat(); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat; + } + + public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) { + if (null == dateFormat) { + dateFormat = createDefaultDateFormat(); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.setDateFormat(dateFormat); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + {{#openApiNullable}} + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + {{/openApiNullable}} + return mapper; + } + + protected void init() { + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { + {{#withXml}} + XmlMapper xmlMapper = new XmlMapper(); + xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true); + {{#openApiNullable}} + xmlMapper.registerModule(new JsonNullableModule()); + {{/openApiNullable}} + + {{/withXml}} + Consumer>> messageConverters = converters -> { + converters.add(new MappingJackson2HttpMessageConverter(mapper)); + {{#withXml}} + converters.add(new MappingJackson2XmlHttpMessageConverter(xmlMapper)); + {{/withXml}} + }; + + return RestClient.builder().messageConverters(messageConverters); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder() { + return buildRestClientBuilder(createDefaultObjectMapper(null)); + } + + /** + * Build the RestClient used to make HTTP requests. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient buildRestClient(ObjectMapper mapper) { + return buildRestClientBuilder(mapper).build(); + } + + /** + * Build the RestClient used to make HTTP requests. + * @return RestClient + */ + public static RestClient buildRestClient() { + return buildRestClientBuilder(createDefaultObjectMapper(null)).build(); + } + + /** + * Get the current base path + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username the username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password the password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix the API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + {{#hasOAuthMethods}} + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken the access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + {{/hasOAuthMethods}} + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Get the ObjectMapper used to make HTTP requests. + * @return ObjectMapper objectMapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Get the RestClient used to make HTTP requests. + * @return RestClient restClient + */ + public RestClient getRestClient() { + return restClient; + } + + /** + * Format the given parameter object into string. + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } {{#jsr310}}else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } {{/jsr310}}else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection) param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap<>(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList<>(); + for(Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return The response body in chosen type + */ + public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final RestClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + return requestBuilder.retrieve(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + if (value != null) { + String templatizedKey = name + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + }); + return queryBuilder.toString(); + } + + private RestClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, + MultiValueMap queryParams, Object body, HttpHeaders headerParams, + MultiValueMap cookieParams, MultiValueMap formParams, List accept, + MediaType contentType, String[] authNames) { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); + + String finalUri = builder.build(false).toUriString(); + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + + final RestClient.RequestBodySpec requestBuilder = restClient.method(method).uri(finalUri, uriParams); + + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if(contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + var selectedBody = selectBody(body, formParams, contentType); + if (selectedBody != null) { + requestBuilder.body(selectedBody); + } + + return requestBuilder; + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, RestClient.RequestBodySpec requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for(String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, RestClient.RequestBodySpec requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + * @param cookieParams the cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } +} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/restclient/README.mustache b/sdks/java-v2/templates/libraries/restclient/README.mustache new file mode 100644 index 000000000..ec6244a82 --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/README.mustache @@ -0,0 +1,216 @@ +# {{artifactId}} + +{{appName}} + +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +- Generator version: {{generatorVersion}} + +{{{appDescriptionWithNewLines}}} + +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 17+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + {{{groupId}}} + {{{artifactId}}} + {{{artifactVersion}}} + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central. + mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo. + } + + dependencies { + implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import {{{invokerPackage}}}.*; +import {{{invokerPackage}}}.auth.*; +import {{{modelPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +public class {{{classname}}}Example { + + public static void main(String[] args) { + ApiClient defaultClient = new ApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}} + // Configure HTTP signature authorization: {{{name}}} + HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}"); + // All the HTTP signature parameters below should be customized to your environment. + // Configure the keyId + {{{name}}}.setKeyId("YOUR KEY ID"); + // Configure the signature algorithm + {{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019); + // Configure the specific cryptographic algorithm + {{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256); + // Configure the cryptographic algorithm parameters, if applicable + {{{name}}}.setAlgorithmParameterSpec(null); + // Set the cryptographic digest algorithm. + {{{name}}}.setDigestAlgorithm("SHA-256"); + // Set the HTTP headers that should be included in the HTTP signature. + {{{name}}}.setHeaders(Arrays.asList("date", "host")); + // Set the private key used to sign the HTTP messages + {{{name}}}.setPrivateKey();{{/isHttpSignature}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (HttpStatusCodeException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getStatusCode().value()); + System.err.println("Reason: " + e.getResponseBodyAsString()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation for Models + +{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) +{{/model}}{{/models}} + + +## Documentation for Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}} + +- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}} + +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}} + +- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} +{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/sdks/java-v2/templates/libraries/restclient/api.mustache b/sdks/java-v2/templates/libraries/restclient/api.mustache new file mode 100644 index 000000000..1475fc0f4 --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/api.mustache @@ -0,0 +1,185 @@ +package {{package}}; + +import {{invokerPackage}}.ApiClient; + +{{#imports}}import {{import}}; +{{/imports}} + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}} { + private ApiClient apiClient; + + public {{classname}}() { + this(new ApiClient()); + } + + @Autowired + public {{classname}}(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + {{#operation}} + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return {{.}} +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} +{{#isDeprecated}} + * @deprecated +{{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + private ResponseSpec {{operationId}}RequestCreation({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) { + throw new RestClientResponseException("Missing the required parameter '{{paramName}}' when calling {{operationId}}", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + {{/required}} + {{/allParams}} + // create path and map variables + final Map pathParams = new HashMap<>(); + {{#hasPathParams}} + + {{#pathParams}} + pathParams.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), {{/collectionFormat}}{{{paramName}}}{{#collectionFormat}}){{/collectionFormat}}); + {{/pathParams}} + {{/hasPathParams}} + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + {{#hasQueryParams}} + + {{#queryParams}}{{#isExplode}}{{#hasVars}}{{#vars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}}{{/hasVars}}{{^hasVars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/hasVars}}{{/isExplode}}{{^isExplode}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} + + {{#headerParams}} + if ({{paramName}} != null) + headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + {{/-last}} + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasCookieParams}} + + {{#cookieParams}} + cookieParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/cookieParams}} + {{/hasCookieParams}} + {{#hasFormParams}} + + {{#formParams}} + if ({{paramName}} != null) + formParams.add{{#collectionFormat}}All{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}); + {{/formParams}} + {{/hasFormParams}} + + final String[] localVarAccepts = { {{#hasProduces}} + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{/hasProduces}}}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { {{#hasConsumes}} + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{/hasConsumes}}}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return {{.}} +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + {{#returnType}}return {{/returnType}}{{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).body(localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return ResponseEntity<{{.}}> +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#returnType}}ResponseEntity<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}ResponseEntity{{/returnType}} {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).toEntity(localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}} + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public ResponseSpec {{operationId}}WithResponseSpec({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/restclient/api_test.mustache b/sdks/java-v2/templates/libraries/restclient/api_test.mustache new file mode 100644 index 000000000..dc3408341 --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/api_test.mustache @@ -0,0 +1,40 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for {{classname}} + */ +@Ignore +public class {{classname}}Test { + + private final {{classname}} api = new {{classname}}(); + + {{#operations}}{{#operation}} + /** + * {{summary}} + * + * {{notes}} + */ + @Test + public void {{operationId}}Test() { + {{#allParams}} + {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; + {{/allParams}} + {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + // TODO: test validations + } + {{/operation}}{{/operations}} +} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/restclient/auth/ApiKeyAuth.mustache b/sdks/java-v2/templates/libraries/restclient/auth/ApiKeyAuth.mustache new file mode 100644 index 000000000..d32930336 --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/auth/ApiKeyAuth.mustache @@ -0,0 +1,64 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/sdks/java-v2/templates/libraries/restclient/auth/Authentication.mustache b/sdks/java-v2/templates/libraries/restclient/auth/Authentication.mustache new file mode 100644 index 000000000..0636a6d96 --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/auth/Authentication.mustache @@ -0,0 +1,16 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/sdks/java-v2/templates/libraries/restclient/auth/HttpBasicAuth.mustache b/sdks/java-v2/templates/libraries/restclient/auth/HttpBasicAuth.mustache new file mode 100644 index 000000000..fba126558 --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/auth/HttpBasicAuth.mustache @@ -0,0 +1,40 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/sdks/java-v2/templates/libraries/restclient/auth/HttpBearerAuth.mustache b/sdks/java-v2/templates/libraries/restclient/auth/HttpBearerAuth.mustache new file mode 100644 index 000000000..ecf258a23 --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/auth/HttpBearerAuth.mustache @@ -0,0 +1,58 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/sdks/java-v2/templates/libraries/restclient/auth/OAuth.mustache b/sdks/java-v2/templates/libraries/restclient/auth/OAuth.mustache new file mode 100644 index 000000000..1e1e6247c --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/auth/OAuth.mustache @@ -0,0 +1,26 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (accessToken != null) { + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); + } + } +} diff --git a/sdks/java-v2/templates/libraries/restclient/auth/OAuthFlow.mustache b/sdks/java-v2/templates/libraries/restclient/auth/OAuthFlow.mustache new file mode 100644 index 000000000..759f354f5 --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/auth/OAuthFlow.mustache @@ -0,0 +1,7 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/restclient/build.gradle.mustache b/sdks/java-v2/templates/libraries/restclient/build.gradle.mustache new file mode 100644 index 000000000..4aec430eb --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/build.gradle.mustache @@ -0,0 +1,159 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = '{{groupId}}' +version = '{{artifactVersion}}' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +repositories { + mavenCentral() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + archiveClassifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' + from components.java + } + } + } + + task execute(type:JavaExec) { + mainClass = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + {{#openApiNullable}} + jackson_databind_nullable_version = "0.2.6" + {{/openApiNullable}} + spring_web_version = "6.1.6" + jakarta_annotation_version = "2.1.1" + jodatime_version = "2.9.9" + junit_version = "5.10.2" +} + +dependencies { + {{#swagger1AnnotationLibrary}} + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework:spring-web:$spring_web_version" + implementation "org.springframework:spring-context:$spring_web_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + {{#openApiNullable}} + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + {{/openApiNullable}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{#joda}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" + implementation "joda-time:joda-time:$jodatime_version" + {{/joda}} + {{#withXml}} + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" + {{/withXml}} + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/sdks/java-v2/templates/libraries/restclient/pom.mustache b/sdks/java-v2/templates/libraries/restclient/pom.mustache new file mode 100644 index 000000000..d3f6ab650 --- /dev/null +++ b/sdks/java-v2/templates/libraries/restclient/pom.mustache @@ -0,0 +1,374 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + {{artifactUrl}} + {{artifactDescription}} + + {{scmConnection}} + {{scmDeveloperConnection}} + {{scmUrl}} + +{{#parentOverridden}} + + {{{parentGroupId}}} + {{{parentArtifactId}}} + {{{parentVersion}}} + +{{/parentOverridden}} + + + + {{licenseName}} + {{licenseUrl}} + repo + + + + + + {{developerName}} + {{developerEmail}} + {{developerOrganization}} + {{developerOrganizationUrl}} + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + true + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 17 + 17 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + {{#swagger1AnnotationLibrary}} + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.springframework + spring-web + ${spring-web-version} + + + org.springframework + spring-context + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} + {{#withXml}} + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + + + io.github.threeten-jaxb + threeten-jaxb-core + 1.2 + + {{/withXml}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + {{#joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + + {{/joda}} + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + {{#performBeanValidation}} + + + org.hibernate + hibernate-validator + ${hibernate-validator-version} + + {{/performBeanValidation}} + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + UTF-8 + {{#swagger1AnnotationLibrary}} + 1.6.9 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 6.1.6 + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + 2.1.1 + {{#joda}} + 2.9.9 + {{/joda}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + {{#performBeanValidation}} + 5.4.3.Final + {{/performBeanValidation}} + 5.10.2 + 1.10.0 + + diff --git a/sdks/java-v2/templates/libraries/resteasy/ApiClient.mustache b/sdks/java-v2/templates/libraries/resteasy/ApiClient.mustache index 7bdb6e8e2..fc59766f3 100644 --- a/sdks/java-v2/templates/libraries/resteasy/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/resteasy/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.File; @@ -24,24 +26,20 @@ import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; +import {{javaxPackage}}.ws.rs.client.Client; +import {{javaxPackage}}.ws.rs.client.ClientBuilder; +import {{javaxPackage}}.ws.rs.client.Entity; +import {{javaxPackage}}.ws.rs.client.Invocation; +import {{javaxPackage}}.ws.rs.client.WebTarget; +import {{javaxPackage}}.ws.rs.core.Form; +import {{javaxPackage}}.ws.rs.core.GenericEntity; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.Response.Status; import org.jboss.logging.Logger; import org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration; @@ -90,8 +88,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -502,15 +500,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (param.getValue() instanceof File) { File file = (File) param.getValue(); try { - multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE); + multipart.addFormData(param.getKey(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE, file.getName()); } catch (FileNotFoundException e) { throw new ApiException("Could not serialize multipart/form-data "+e.getMessage()); } } else { - multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); + multipart.addFormData(param.getKey(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); } } - entity = Entity.entity(multipart.getFormData(), MediaType.MULTIPART_FORM_DATA_TYPE); + GenericEntity genericEntity = new GenericEntity(multipart) { }; + entity = Entity.entity(genericEntity, MediaType.MULTIPART_FORM_DATA_TYPE); } else if (contentType.startsWith("application/x-www-form-urlencoded")) { Form form = new Form(); for (Entry param: formParams.entrySet()) { @@ -677,6 +676,38 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { Entity entity = serialize(body, formParams, contentType); + try (Response response = invoke(invocationBuilder, method, entity)) { + statusCode = response.getStatusInfo().getStatusCode(); + responseHeaders = buildResponseHeaders(response); + + if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { + return null; + } else if (response.getStatusInfo().getFamily().equals(Status.Family.SUCCESSFUL)) { + if (returnType == null) + return null; + else + return deserialize(response, returnType); + } else { + String message = "error"; + String respBody = null; + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), + message, + buildResponseHeaders(response), + respBody); + } + } + } + + private Response invoke(Invocation.Builder invocationBuilder, String method, Entity entity) throws ApiException { Response response = null; if ("GET".equals(method)) { @@ -699,36 +730,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new ApiException(500, "unknown method type " + method); } - statusCode = response.getStatusInfo().getStatusCode(); - responseHeaders = buildResponseHeaders(response); - - if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { - return null; - } else if (response.getStatusInfo().getFamily().equals(Status.Family.SUCCESSFUL)) { - if (returnType == null) - return null; - else - return deserialize(response, returnType); - } else { - String message = "error"; - String respBody = null; - if (response.hasEntity()) { - try { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; - } catch (RuntimeException e) { - // e.printStackTrace(); - } - } - throw new ApiException( - response.getStatus(), - message, - buildResponseHeaders(response), - respBody); - } + return response; } - /** + /** * Build the Client used to make HTTP requests. */ private Client buildHttpClient(boolean debugging) { diff --git a/sdks/java-v2/templates/libraries/resteasy/JSON.mustache b/sdks/java-v2/templates/libraries/resteasy/JSON.mustache index 71bd624f7..b57283048 100644 --- a/sdks/java-v2/templates/libraries/resteasy/JSON.mustache +++ b/sdks/java-v2/templates/libraries/resteasy/JSON.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.annotation.*; @@ -9,7 +11,7 @@ import com.fasterxml.jackson.datatype.jsr310.*; import java.text.DateFormat; -import javax.ws.rs.ext.ContextResolver; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; {{>generatedAnnotation}} public class JSON implements ContextResolver { diff --git a/sdks/java-v2/templates/libraries/resteasy/api.mustache b/sdks/java-v2/templates/libraries/resteasy/api.mustache index 9194b7541..773fc51ce 100644 --- a/sdks/java-v2/templates/libraries/resteasy/api.mustache +++ b/sdks/java-v2/templates/libraries/resteasy/api.mustache @@ -5,17 +5,15 @@ import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.Configuration; import {{invokerPackage}}.Pair; -import javax.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.GenericType; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} {{>generatedAnnotation}} {{#operations}} @@ -69,10 +67,10 @@ public class {{classname}} { .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; // query params - {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); - {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); - {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); {{#queryParams}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); diff --git a/sdks/java-v2/templates/libraries/resteasy/build.gradle.mustache b/sdks/java-v2/templates/libraries/resteasy/build.gradle.mustache index 0a801b9ff..de86eb0bd 100644 --- a/sdks/java-v2/templates/libraries/resteasy/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/resteasy/build.gradle.mustache @@ -57,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -98,15 +98,16 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.6.3" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" resteasy_version = "4.5.11.Final" - junit_version = "4.13" + assertj_version = "3.23.1" + junit_version = "5.10.2" } dependencies { @@ -124,5 +125,6 @@ dependencies { {{/openApiNullable}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.assertj:assertj-core:$assertj_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/sdks/java-v2/templates/libraries/resteasy/build.sbt.mustache b/sdks/java-v2/templates/libraries/resteasy/build.sbt.mustache index 957990ebf..8ebcd9092 100644 --- a/sdks/java-v2/templates/libraries/resteasy/build.sbt.mustache +++ b/sdks/java-v2/templates/libraries/resteasy/build.sbt.mustache @@ -13,13 +13,14 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "4.5.11.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "4.5.11.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.15.2" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.17.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13" % "test", + "org.assertj" % "assertj-core" % "3.23.1" % "test", + "junit" % "junit" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/sdks/java-v2/templates/libraries/resteasy/pom.mustache b/sdks/java-v2/templates/libraries/resteasy/pom.mustache index cf39a160c..1b0dec8c4 100644 --- a/sdks/java-v2/templates/libraries/resteasy/pom.mustache +++ b/sdks/java-v2/templates/libraries/resteasy/pom.mustache @@ -61,17 +61,16 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods - pertest @@ -149,7 +148,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none 1.8 @@ -166,11 +165,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} com.google.code.findbugs @@ -239,6 +247,11 @@ jackson-dataformat-xml ${jackson-version} + + io.github.threeten-jaxb + threeten-jaxb-core + 1.2 + {{/withXml}} @@ -264,24 +277,41 @@ - junit - junit + org.assertj + assertj-core + ${assertj-version} + test + + + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.6.3 - 4.5.11.Final - 2.10.5 - 2.10.5.1 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 4.7.6.Final + 2.17.1 + 2.17.1 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} 2.9.10 1.0.0 - 4.13 + 3.23.1 + 5.10.2 diff --git a/sdks/java-v2/templates/libraries/resttemplate/ApiClient.mustache b/sdks/java-v2/templates/libraries/resttemplate/ApiClient.mustache index f868eaa6d..e4711ca05 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; {{#withXml}} @@ -31,17 +33,12 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.util.StringUtils; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpServerErrorException; import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.DefaultUriBuilderFactory; -{{#threetenbp}} -import org.threeten.bp.*; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; -import com.fasterxml.jackson.databind.ObjectMapper; -{{/threetenbp}} {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} @@ -69,9 +66,10 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; -{{#jsr310}}{{^threetenbp}} +import java.util.function.Supplier; +{{#jsr310}} import java.time.OffsetDateTime; -{{/threetenbp}}{{/jsr310}} +{{/jsr310}} import {{invokerPackage}}.auth.Authentication; {{#hasHttpBasicMethods}} @@ -88,7 +86,9 @@ import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} {{>generatedAnnotation}} +{{#generateClientAsBean}} @Component("{{invokerPackage}}.ApiClient") +{{/generateClientAsBean}} public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public enum CollectionFormat { CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); @@ -109,6 +109,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private HttpHeaders defaultHeaders = new HttpHeaders(); private MultiValueMap defaultCookies = new LinkedMultiValueMap(); + private int maxAttemptsForRetry = {{maxAttemptsForRetry}}; + + private long waitTimeMillis = {{waitTimeMillis}}; + private String basePath = "{{basePath}}"; private RestTemplate restTemplate; @@ -122,7 +126,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { init(); } + {{#generateClientAsBean}} @Autowired + {{/generateClientAsBean}} public ApiClient(RestTemplate restTemplate) { this.restTemplate = restTemplate; init(); @@ -141,8 +147,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -169,6 +175,46 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { return this; } + /** + * Get the max attempts for retry + * + * @return int the max attempts + */ + public int getMaxAttemptsForRetry() { + return maxAttemptsForRetry; + } + + /** + * Set the max attempts for retry + * + * @param maxAttemptsForRetry the max attempts for retry + * @return ApiClient this client + */ + public ApiClient setMaxAttemptsForRetry(int maxAttemptsForRetry) { + this.maxAttemptsForRetry = maxAttemptsForRetry; + return this; + } + + /** + * Get the wait time in milliseconds + * + * @return long wait time in milliseconds + */ + public long getWaitTimeMillis() { + return waitTimeMillis; + } + + /** + * Set the wait time in milliseconds + * + * @param waitTimeMillis the wait time in milliseconds + * @return ApiClient this client + */ + public ApiClient setWaitTimeMillis(long waitTimeMillis) { + this.waitTimeMillis = waitTimeMillis; + return this; + } + /** * Get authentications (key: authentication name, value: authentication). * @@ -190,14 +236,23 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { {{#hasHttpBearerMethods}} /** - * Helper method to set token for HTTP bearer authentication. + * Helper method to set access token for the first Bearer authentication. * - * @param bearerToken the token + * @param bearerToken Bearer token */ public void setBearerToken(String bearerToken) { + setBearerToken(() -> bearerToken); + } + + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setBearerToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); return; } } @@ -278,9 +333,18 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param accessToken Access token */ public void setAccessToken(String accessToken) { + setAccessToken(() -> accessToken); + } + + /** + * Helper method to set the supplier of access tokens for OAuth2 authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setAccessToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); + ((OAuth) auth).setAccessToken(tokenSupplier); return; } } @@ -377,14 +441,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; - {{#threetenbp}} - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter) { - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - mapper.setDateFormat(dateFormat); - } - } - {{/threetenbp}} return this; } @@ -623,12 +679,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return path with placeholders replaced by variables */ public String expandPath(String pathTemplate, Map variables) { - // disable default URL encoding - DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); - uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); - final RestTemplate restTemplate = new RestTemplate(); - restTemplate.setUriTemplateHandler(uriBuilderFactory); - return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); } @@ -658,8 +708,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { queryBuilder.append(encodedName); if (value != null) { String templatizedKey = encodedName + valueItemCounter++; - final String encodedValue = URLEncoder.encode(value.toString(), "UTF-8"); - uriParams.put(templatizedKey, encodedValue); + uriParams.put(templatizedKey, value.toString()); queryBuilder.append('=').append("{").append(templatizedKey).append("}"); } } @@ -693,7 +742,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { public ResponseEntity invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - Map uriParams = new HashMap<>(); + Map uriParams = new HashMap<>(); uriParams.putAll(pathParams); String finalUri = path; @@ -714,7 +763,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { throw new RestClientException("Could not build URL: " + builder.toUriString(), ex); } - final BodyBuilder requestBuilder = RequestEntity.method(method, uri); + final BodyBuilder requestBuilder = RequestEntity.method(method, UriComponentsBuilder.fromHttpUrl(basePath).toUriString() + finalUri, uriParams); if (accept != null) { requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); } @@ -729,7 +778,36 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { RequestEntity requestEntity = requestBuilder.body(selectBody(body, formParams, contentType)); - ResponseEntity responseEntity = restTemplate.exchange(requestEntity, returnType); + ResponseEntity responseEntity = null; + int attempts = 0; + while (attempts < maxAttemptsForRetry) { + try { + responseEntity = restTemplate.exchange(requestEntity, returnType); + break; + } catch (HttpServerErrorException | HttpClientErrorException ex) { + if (ex instanceof HttpServerErrorException + || ((HttpClientErrorException) ex) + .getStatusCode() + .equals(HttpStatus.TOO_MANY_REQUESTS)) { + attempts++; + if (attempts < maxAttemptsForRetry) { + try { + Thread.sleep(waitTimeMillis); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } else { + throw ex; + } + } else { + throw ex; + } + } + } + + if (responseEntity == null) { + throw new RestClientException("ResponseEntity is null"); + } if (responseEntity.getStatusCode().is2xxSuccessful()) { return responseEntity; @@ -801,23 +879,13 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { RestTemplate restTemplate = new RestTemplate(messageConverters); {{/withXml}}{{^withXml}}RestTemplate restTemplate = new RestTemplate();{{/withXml}} - {{#threetenbp}} - for (HttpMessageConverter converter : restTemplate.getMessageConverters()) { - if (converter instanceof AbstractJackson2HttpMessageConverter){ - ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter) converter).getObjectMapper(); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - {{#openApiNullable}} - mapper.registerModule(new JsonNullableModule()); - {{/openApiNullable}} - } - } - {{/threetenbp}} // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); + + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.VALUES_ONLY); + restTemplate.setUriTemplateHandler(uriBuilderFactory); return restTemplate; } @@ -857,13 +925,16 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } private void logResponse(ClientHttpResponse response) throws IOException { - log.info("HTTP Status Code: " + response.getRawStatusCode()); + log.info("HTTP Status Code: " + response.getStatusCode().value()); log.info("Status Text: " + response.getStatusText()); log.info("HTTP Headers: " + headersToString(response.getHeaders())); log.info("Response Body: " + bodyToString(response.getBody())); } private String headersToString(HttpHeaders headers) { + if(headers == null || headers.isEmpty()) { + return ""; + } StringBuilder builder = new StringBuilder(); for (Entry> entry : headers.entrySet()) { builder.append(entry.getKey()).append("=["); diff --git a/sdks/java-v2/templates/libraries/resttemplate/BaseApi.mustache b/sdks/java-v2/templates/libraries/resttemplate/BaseApi.mustache new file mode 100644 index 000000000..3b47979ed --- /dev/null +++ b/sdks/java-v2/templates/libraries/resttemplate/BaseApi.mustache @@ -0,0 +1,76 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import org.springframework.web.client.RestClientException; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; + +{{>generatedAnnotation}} +public abstract class BaseApi { + + protected ApiClient apiClient; + + public BaseApi() { + this(new ApiClient()); + } + + public BaseApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method) throws RestClientException { + return invokeAPI(url, method, null, new ParameterizedTypeReference() {}); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method, Object request) throws RestClientException { + return invokeAPI(url, method, request, new ParameterizedTypeReference() {}); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param returnType The return type. + * @return ResponseEntity in the specified type. + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method, ParameterizedTypeReference returnType) throws RestClientException { + return invokeAPI(url, method, null, returnType); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @return ResponseEntity in the specified type. + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public abstract ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException; +} diff --git a/sdks/java-v2/templates/libraries/resttemplate/api.mustache b/sdks/java-v2/templates/libraries/resttemplate/api.mustache index cc207bd1b..aa1a98fd3 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/api.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/api.mustache @@ -1,17 +1,23 @@ package {{package}}; import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.BaseApi; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}}import java.util.Collections; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.stream.Collectors;{{/fullJavaUtil}} +import java.util.stream.Collectors; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.LinkedMultiValueMap; @@ -27,26 +33,21 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; {{>generatedAnnotation}} +{{#generateClientAsBean}} @Component("{{package}}.{{classname}}") +{{/generateClientAsBean}} {{#operations}} -public class {{classname}} { - private ApiClient apiClient; +public class {{classname}} extends BaseApi { public {{classname}}() { - this(new ApiClient()); + super(new ApiClient()); } + {{#generateClientAsBean}} @Autowired + {{/generateClientAsBean}} public {{classname}}(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + super(apiClient); } {{#operation}} @@ -74,7 +75,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + public {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { {{#returnType}} return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).getBody(); {{/returnType}} @@ -105,8 +106,8 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ResponseEntity<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { - Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + public ResponseEntity<{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { @@ -117,40 +118,71 @@ public class {{classname}} { final Map uriVariables = new HashMap();{{#pathParams}} uriVariables.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase()), {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}});{{/pathParams}}{{/hasPathParams}} - final MultiValueMap queryParams = new LinkedMultiValueMap(); - final HttpHeaders headerParams = new HttpHeaders(); - final MultiValueMap cookieParams = new LinkedMultiValueMap(); - final MultiValueMap formParams = new LinkedMultiValueMap();{{#hasQueryParams}} + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap();{{#hasQueryParams}} - {{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{^-last}} - {{/-last}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} + {{#queryParams}}{{#isExplode}}{{#hasVars}} + if ({{paramName}} != null) { + {{#vars}} localVarQueryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}}}{{/hasVars}}{{^hasVars}}localVarQueryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/hasVars}}{{/isExplode}}{{^isExplode}}localVarQueryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} {{#headerParams}}if ({{paramName}} != null) - headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + localVarHeaderParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} {{/-last}}{{/headerParams}}{{/hasHeaderParams}}{{#hasCookieParams}} {{#cookieParams}}if ({{paramName}} != null) - cookieParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + localVarCookieParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} {{/-last}}{{/cookieParams}}{{/hasCookieParams}}{{#hasFormParams}} {{#formParams}}if ({{paramName}} != null) - formParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}addAll{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{^-last}} + localVarFormParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}addAll{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{^-last}} {{/-last}}{{/formParams}}{{/hasFormParams}} final String[] localVarAccepts = { {{#hasProduces}} {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} {{/hasProduces}} }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] contentTypes = { {{#hasConsumes}} + final String[] localVarContentTypes = { {{#hasConsumes}} + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{/hasConsumes}} }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + + {{#returnType}}ParameterizedTypeReference<{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}}{{/returnType}}> localReturnType = new ParameterizedTypeReference<{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}}{{/returnType}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};{{/returnType}} + return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.emptyMap(){{/hasPathParams}}, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + } + {{#-last}} + + @Override + public ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException { + String localVarPath = url.replace(apiClient.getBasePath(), ""); + Object localVarPostBody = request; + + final Map uriVariables = new HashMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { {{#hasProduces}} + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{/hasProduces}} }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { {{#hasConsumes}} {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} {{/hasConsumes}} }; - final MediaType localVarContentType = apiClient.selectHeaderContentType(contentTypes); + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - {{#returnType}}ParameterizedTypeReference<{{{returnType}}}> returnType = new ParameterizedTypeReference<{{{returnType}}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};{{/returnType}} - return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.emptyMap(){{/hasPathParams}}, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType); + return apiClient.invokeAPI(localVarPath, method, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, returnType); } + {{/-last}} {{/operation}} } {{/operations}} diff --git a/sdks/java-v2/templates/libraries/resttemplate/api_test.mustache b/sdks/java-v2/templates/libraries/resttemplate/api_test.mustache index 865572ae8..04a19f1f1 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/api_test.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/api_test.mustache @@ -4,21 +4,27 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.web.client.RestClientException; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore -public class {{classname}}Test { +@Disabled +class {{classname}}Test { private final {{classname}} api = new {{classname}}(); @@ -28,15 +34,16 @@ public class {{classname}}Test { * * {{notes}} * - * @throws ApiException + * @throws RestClientException * if the Api call fails */ @Test - public void {{operationId}}Test() { + void {{operationId}}Test() { {{#allParams}} {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/sdks/java-v2/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache b/sdks/java-v2/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache index 857403b27..d32930336 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/sdks/java-v2/templates/libraries/resttemplate/auth/Authentication.mustache b/sdks/java-v2/templates/libraries/resttemplate/auth/Authentication.mustache index 8e53c2ba0..0636a6d96 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/auth/Authentication.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/auth/Authentication.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/sdks/java-v2/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache b/sdks/java-v2/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache index 5b07cb907..fba126558 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/auth/HttpBasicAuth.mustache @@ -1,10 +1,11 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; +import java.util.Base64; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} @@ -34,6 +35,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64Utils.encodeToString(str.getBytes(StandardCharsets.UTF_8))); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); } } diff --git a/sdks/java-v2/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache b/sdks/java-v2/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache index 1d1610c61..ecf258a23 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/auth/HttpBearerAuth.mustache @@ -1,31 +1,51 @@ -package {{invokerPackage}}.auth; +{{>licenseInfo}} -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; +package {{invokerPackage}}.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; } + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); if (bearerToken == null) { return; } diff --git a/sdks/java-v2/templates/libraries/resttemplate/auth/OAuth.mustache b/sdks/java-v2/templates/libraries/resttemplate/auth/OAuth.mustache index 7889f1582..1e8204285 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/auth/OAuth.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/auth/OAuth.mustache @@ -1,24 +1,50 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; +import java.util.Optional; +import java.util.function.Supplier; import org.springframework.http.HttpHeaders; import org.springframework.util.MultiValueMap; +/** + * Provides support for RFC 6750 - Bearer Token usage for OAUTH 2.0 Authorization. + */ {{>generatedAnnotation}} public class OAuth implements Authentication { - private String accessToken; + private Supplier tokenSupplier; + /** + * Returns the bearer token used for Authorization. + * + * @return The bearer token + */ public String getAccessToken() { - return accessToken; + return tokenSupplier.get(); } + /** + * Sets the bearer access token used for Authorization. + * + * @param bearerToken The bearer token to send in the Authorization header + */ public void setAccessToken(String accessToken) { - this.accessToken = accessToken; + setAccessToken(() -> accessToken); + } + + /** + * Sets the supplier of bearer tokens used for Authorization. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setAccessToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { - if (accessToken != null) { - headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); - } + Optional.ofNullable(tokenSupplier).map(Supplier::get).ifPresent(accessToken -> + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken) + ); } } diff --git a/sdks/java-v2/templates/libraries/resttemplate/auth/OAuthFlow.mustache b/sdks/java-v2/templates/libraries/resttemplate/auth/OAuthFlow.mustache index 7ab35f6d8..759f354f5 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/auth/OAuthFlow.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/auth/OAuthFlow.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; public enum OAuthFlow { diff --git a/sdks/java-v2/templates/libraries/resttemplate/build.gradle.mustache b/sdks/java-v2/templates/libraries/resttemplate/build.gradle.mustache index 75b4478ea..a900fc806 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/build.gradle.mustache @@ -32,14 +32,14 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} } // Rename the aar correctly @@ -63,16 +63,16 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -84,14 +84,14 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} publishing { publications { @@ -103,29 +103,42 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} + {{#useJakartaEe}} + spring_web_version = "6.1.5" + jakarta_annotation_version = "2.1.1" + {{/useJakartaEe}} + {{^useJakartaEe}} + spring_web_version = "5.3.33" jakarta_annotation_version = "1.3.5" - spring_web_version = "5.2.5.RELEASE" + {{/useJakartaEe}} jodatime_version = "2.9.9" - junit_version = "4.13.1" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} + junit_version = "5.10.2" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "org.springframework:spring-web:$spring_web_version" implementation "org.springframework:spring-context:$spring_web_version" @@ -136,19 +149,29 @@ dependencies { {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threeten_version" - {{/threetenbp}} {{#withXml}} implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" {{/withXml}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + } diff --git a/sdks/java-v2/templates/libraries/resttemplate/pom.mustache b/sdks/java-v2/templates/libraries/resttemplate/pom.mustache index 6bd56372d..250417d78 100644 --- a/sdks/java-v2/templates/libraries/resttemplate/pom.mustache +++ b/sdks/java-v2/templates/libraries/resttemplate/pom.mustache @@ -43,7 +43,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.4.0 enforce-maven @@ -63,18 +63,27 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.1.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest + true + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin @@ -95,11 +104,10 @@ org.apache.maven.plugins maven-jar-plugin - 2.2 + 3.3.0 - jar test-jar @@ -111,7 +119,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.10 + 3.4.0 add_sources @@ -142,22 +150,22 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.11.0 - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} + {{#useJakartaEe}} + 17 + 17 + {{/useJakartaEe}} + {{^useJakartaEe}} + 1.8 + 1.8 + {{/useJakartaEe}} org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.5.0 none @@ -173,7 +181,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.0 attach-sources @@ -211,11 +219,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -252,52 +269,75 @@ jackson-databind ${jackson-databind-version} + {{^useJakartaEe}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + {{/useJakartaEe}} + {{#useJakartaEe}} + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{/useJakartaEe}} + {{#openApiNullable}} org.openapitools jackson-databind-nullable ${jackson-databind-nullable-version} + {{/openApiNullable}} {{#withXml}} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + + + io.github.threeten-jaxb + threeten-jaxb-core + 1.2 + {{/withXml}} - {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - {{/java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - - joda-time - joda-time - ${jodatime-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + {{/joda}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + {{#performBeanValidation}} + + + org.hibernate + hibernate-validator + ${hibernate-validator-version} + + {{/performBeanValidation}} jakarta.annotation jakarta.annotation-api @@ -307,27 +347,53 @@ - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + UTF-8 - 1.5.22 - 5.2.5.RELEASE - 2.10.5 - 2.10.5.1 - 0.2.2 + {{#swagger1AnnotationLibrary}} + 1.6.9 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + {{#useJakartaEe}} + 6.1.5 + {{/useJakartaEe}} + {{^useJakartaEe}} + 5.3.33 + {{/useJakartaEe}} + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} - 1.0.0 - 4.13.1 + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + {{#performBeanValidation}} + 5.4.3.Final + {{/performBeanValidation}} + 5.10.2 + 1.10.0 diff --git a/sdks/java-v2/templates/libraries/retrofit/ApiClient.mustache b/sdks/java-v2/templates/libraries/retrofit/ApiClient.mustache deleted file mode 100644 index ad3057e9c..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/ApiClient.mustache +++ /dev/null @@ -1,448 +0,0 @@ -package {{invokerPackage}}; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Type; -import java.util.LinkedHashMap; -import java.util.Map; - -{{#hasOAuthMethods}} -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -{{/hasOAuthMethods}} - -import org.joda.time.DateTime; -import org.joda.time.LocalDate; -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import retrofit.RestAdapter; -import retrofit.client.OkClient; -import retrofit.converter.ConversionException; -import retrofit.converter.Converter; -import retrofit.converter.GsonConverter; -import retrofit.mime.TypedByteArray; -import retrofit.mime.TypedInput; -import retrofit.mime.TypedOutput; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.OkHttpClient; - -import {{invokerPackage}}.auth.HttpBasicAuth; -import {{invokerPackage}}.auth.HttpBearerAuth; -import {{invokerPackage}}.auth.ApiKeyAuth; -{{#hasOAuthMethods}} -import {{invokerPackage}}.auth.OAuth; -import {{invokerPackage}}.auth.OAuth.AccessTokenListener; -import {{invokerPackage}}.auth.OAuthFlow; -{{/hasOAuthMethods}} - -public class ApiClient { - - private Map apiAuthorizations; - private OkHttpClient okClient; - private RestAdapter.Builder adapterBuilder; - - public ApiClient() { - apiAuthorizations = new LinkedHashMap(); - createDefaultAdapter(); - } - - public ApiClient(String[] authNames) { - this(); - for(String authName : authNames) { - {{#hasAuthMethods}} - Interceptor auth; - {{#authMethods}}if ("{{name}}".equals(authName)) { - {{#isBasic}} - {{#isBasicBasic}} - auth = new HttpBasicAuth(); - {{/isBasicBasic}} - {{^isBasicBasic}} - auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}} - {{/isBasic}} - {{#isApiKey}} - auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); - {{/isApiKey}} - {{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); - {{/isOAuth}} - } else {{/authMethods}}{ - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); - } - addAuthorization(authName, auth); - {{/hasAuthMethods}} - {{^hasAuthMethods}} - throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); - {{/hasAuthMethods}} - } - } - - /** - * Basic constructor for single auth name - * @param authName Authentication name - */ - public ApiClient(String authName) { - this(new String[]{authName}); - } - - /** - * Helper constructor for single api key - * @param authName Authentication name - * @param apiKey API key - */ - public ApiClient(String authName, String apiKey) { - this(authName); - this.setApiKey(apiKey); - } - - /** - * Helper constructor for single basic auth or password oauth2 - * @param authName Authentication name - * @param username Username - * @param password Password - */ - public ApiClient(String authName, String username, String password) { - this(authName); - this.setCredentials(username, password); - } - - {{#hasOAuthMethods}} - /** - * Helper constructor for single password oauth2 - * @param authName Authentication name - * @param clientId Client ID - * @param secret Client secret - * @param username Username - * @param password Password - */ - public ApiClient(String authName, String clientId, String secret, String username, String password) { - this(authName); - this.getTokenEndPoint() - .setClientId(clientId) - .setClientSecret(secret) - .setUsername(username) - .setPassword(password); - } - - {{/hasOAuthMethods}} - public void createDefaultAdapter() { - Gson gson = new GsonBuilder() - .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") - .registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter()) - .registerTypeAdapter(LocalDate.class, new LocalDateTypeAdapter()) - .create(); - - okClient = new OkHttpClient(); - - adapterBuilder = new RestAdapter - .Builder() - .setEndpoint("{{{basePath}}}") - .setClient(new OkClient(okClient)) - .setConverter(new GsonConverterWrapper(gson)); - } - - public S createService(Class serviceClass) { - return adapterBuilder.build().create(serviceClass); - - } - - /** - * Helper method to configure the first api key found - * @param apiKey API key - */ - private void setApiKey(String apiKey) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof ApiKeyAuth) { - ApiKeyAuth keyAuth = (ApiKeyAuth) apiAuthorization; - keyAuth.setApiKey(apiKey); - return; - } - } - } - - /** - * Helper method to set token for the first Http Bearer authentication found. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBearerAuth) { - ((HttpBearerAuth) apiAuthorization).setBearerToken(bearerToken); - return; - } - } - } - - /** - * Helper method to configure the username/password for basic auth or password oauth - * @param username Username - * @param password Password - */ - private void setCredentials(String username, String password) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBasicAuth) { - HttpBasicAuth basicAuth = (HttpBasicAuth) apiAuthorization; - basicAuth.setCredentials(username, password); - return; - } - {{#hasOAuthMethods}} - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder().setUsername(username).setPassword(password); - return; - } - {{/hasOAuthMethods}} - } - } - - {{#hasOAuthMethods}} - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - public TokenRequestBuilder getTokenEndPoint() { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getTokenRequestBuilder(); - } - } - return null; - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - public AuthenticationRequestBuilder getAuthorizationEndPoint() { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getAuthenticationRequestBuilder(); - } - } - return null; - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.setAccessToken(accessToken); - return; - } - } - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - */ - public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder() - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI); - oauth.getAuthenticationRequestBuilder() - .setClientId(clientId) - .setRedirectURI(redirectURI); - return; - } - } - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - */ - public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.registerAccessTokenListener(accessTokenListener); - return; - } - } - } - {{/hasOAuthMethods}} - - /** - * Adds an authorization to be used by the client - * @param authName Authentication name - * @param authorization Authorization - */ - public void addAuthorization(String authName, Interceptor authorization) { - if (apiAuthorizations.containsKey(authName)) { - throw new RuntimeException("auth name \"" + authName + "\" already in api authorizations"); - } - apiAuthorizations.put(authName, authorization); - okClient.interceptors().add(authorization); - } - - public Map getApiAuthorizations() { - return apiAuthorizations; - } - - public void setApiAuthorizations(Map apiAuthorizations) { - this.apiAuthorizations = apiAuthorizations; - } - - public RestAdapter.Builder getAdapterBuilder() { - return adapterBuilder; - } - - public void setAdapterBuilder(RestAdapter.Builder adapterBuilder) { - this.adapterBuilder = adapterBuilder; - } - - public OkHttpClient getOkClient() { - return okClient; - } - - public void addAuthsToOkClient(OkHttpClient okClient) { - for(Interceptor apiAuthorization : apiAuthorizations.values()) { - okClient.interceptors().add(apiAuthorization); - } - } - - /** - * Clones the okClient given in parameter, adds the auth interceptors and uses it to configure the RestAdapter - * @param okClient OkHttp client - */ - public void configureFromOkclient(OkHttpClient okClient) { - OkHttpClient clone = okClient.clone(); - addAuthsToOkClient(clone); - adapterBuilder.setClient(new OkClient(clone)); - } -} - -/** - * This wrapper is to take care of this case: - * when the deserialization fails due to JsonParseException and the - * expected type is String, then just return the body string. - */ -class GsonConverterWrapper implements Converter { - private GsonConverter converter; - - public GsonConverterWrapper(Gson gson) { - converter = new GsonConverter(gson); - } - - @Override public Object fromBody(TypedInput body, Type type) throws ConversionException { - byte[] bodyBytes = readInBytes(body); - TypedByteArray newBody = new TypedByteArray(body.mimeType(), bodyBytes); - try { - return converter.fromBody(newBody, type); - } catch (ConversionException e) { - if (e.getCause() instanceof JsonParseException && type.equals(String.class)) { - return new String(bodyBytes); - } else { - throw e; - } - } - } - - @Override public TypedOutput toBody(Object object) { - return converter.toBody(object); - } - - private byte[] readInBytes(TypedInput body) throws ConversionException { - InputStream in = null; - try { - in = body.in(); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - byte[] buffer = new byte[0xFFFF]; - for (int len; (len = in.read(buffer)) != -1;) - os.write(buffer, 0, len); - os.flush(); - return os.toByteArray(); - } catch (IOException e) { - throw new ConversionException(e); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException ignored) { - } - } - } - - } -} - -/** - * Gson TypeAdapter for Joda DateTime type - */ -class DateTimeTypeAdapter extends TypeAdapter { - - private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser(); - private final DateTimeFormatter printFormatter = ISODateTimeFormat.dateTime(); - - @Override - public void write(JsonWriter out, DateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(printFormatter.print(date)); - } - } - - @Override - public DateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return parseFormatter.parseDateTime(date); - } - } -} - -/** - * Gson TypeAdapter for Joda DateTime type - */ -class LocalDateTypeAdapter extends TypeAdapter { - - private final DateTimeFormatter formatter = ISODateTimeFormat.date(); - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.print(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return formatter.parseLocalDate(date); - } - } -} diff --git a/sdks/java-v2/templates/libraries/retrofit/CollectionFormats.mustache b/sdks/java-v2/templates/libraries/retrofit/CollectionFormats.mustache deleted file mode 100644 index dbfa4ae76..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/CollectionFormats.mustache +++ /dev/null @@ -1,99 +0,0 @@ -package {{invokerPackage}}; - -import java.util.Arrays; -import java.util.List; - -public class CollectionFormats { - - public static class CSVParams { - - protected List params; - - public CSVParams() { - } - - public CSVParams(List params) { - this.params = params; - } - - public CSVParams(String... params) { - this.params = Arrays.asList(params); - } - - public List getParams() { - return params; - } - - public void setParams(List params) { - this.params = params; - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), ","); - } - - } - - public static class SPACEParams extends SSVParams { - - } - - public static class SSVParams extends CSVParams { - - public SSVParams() { - } - - public SSVParams(List params) { - super(params); - } - - public SSVParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), " "); - } - } - - public static class TSVParams extends CSVParams { - - public TSVParams() { - } - - public TSVParams(List params) { - super(params); - } - - public TSVParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join( params.toArray(new String[0]), "\t"); - } - } - - public static class PIPESParams extends CSVParams { - - public PIPESParams() { - } - - public PIPESParams(List params) { - super(params); - } - - public PIPESParams(String... params) { - super(params); - } - - @Override - public String toString() { - return StringUtil.join(params.toArray(new String[0]), "|"); - } - } - -} diff --git a/sdks/java-v2/templates/libraries/retrofit/README.mustache b/sdks/java-v2/templates/libraries/retrofit/README.mustache deleted file mode 100644 index c9877589b..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/README.mustache +++ /dev/null @@ -1,42 +0,0 @@ -# {{artifactId}} - -## Requirements - -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. - -## Installation & Usage - -To install the API client library to your local Maven repository, simply execute: - -```shell -mvn install -``` - -To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: - -```shell -mvn deploy -``` - -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. - -After the client library is installed/deployed, you can use it in your Maven project by adding the following to your *pom.xml*: - -```xml - - {{groupId}} - {{artifactId}} - {{artifactVersion}} - compile - - -``` - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/sdks/java-v2/templates/libraries/retrofit/api.mustache b/sdks/java-v2/templates/libraries/retrofit/api.mustache deleted file mode 100644 index 79e4ff137..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/api.mustache +++ /dev/null @@ -1,74 +0,0 @@ -package {{package}}; - -import {{invokerPackage}}.CollectionFormats.*; - -import retrofit.Callback; -import retrofit.http.*; -import retrofit.mime.*; - -{{#imports}}import {{import}}; -{{/imports}} - -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} - -{{#operations}} -public interface {{classname}} { - {{#operation}} - /** - * {{summary}} - * Sync method - * {{notes}} -{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} -{{/allParams}} - * @return {{returnType}}{{^returnType}}Void{{/returnType}} -{{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation -{{/externalDocs}} -{{#isDeprecated}} - * @deprecated -{{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#formParams}}{{#-first}} - {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{{path}}}") - {{{returnType}}}{{^returnType}}Void{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}} - {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{^-last}}, {{/-last}}{{#-last}} - );{{/-last}}{{/allParams}} - - /** - * {{summary}} - * Async method -{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} -{{/allParams}} - * @param cb callback method -{{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation -{{/externalDocs}} -{{#isDeprecated}} - * @deprecated -{{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - {{#formParams}}{{#-first}} - {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} - @{{httpMethod}}("{{{path}}}") - void {{operationId}}( - {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}, {{/allParams}}Callback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> cb - ); - {{/operation}} -} -{{/operations}} diff --git a/sdks/java-v2/templates/libraries/retrofit/api_test.mustache b/sdks/java-v2/templates/libraries/retrofit/api_test.mustache deleted file mode 100644 index 112d7f73a..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/api_test.mustache +++ /dev/null @@ -1,44 +0,0 @@ -package {{package}}; - -import {{invokerPackage}}.ApiClient; -{{#imports}}import {{import}}; -{{/imports}} -import org.junit.Before; -import org.junit.Test; - -{{^fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} - -/** - * API tests for {{classname}} - */ -public class {{classname}}Test { - - private {{classname}} api; - - @Before - public void setup() { - api = new ApiClient().createService({{classname}}.class); - } - - {{#operations}}{{#operation}} - /** - * {{summary}} - * - * {{notes}} - */ - @Test - public void {{operationId}}Test() { - {{#allParams}} - {{{dataType}}} {{paramName}} = null; - {{/allParams}} - // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - - // TODO: test validations - } - {{/operation}}{{/operations}} -} diff --git a/sdks/java-v2/templates/libraries/retrofit/auth/ApiKeyAuth.mustache b/sdks/java-v2/templates/libraries/retrofit/auth/ApiKeyAuth.mustache deleted file mode 100644 index 69205bb20..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/auth/ApiKeyAuth.mustache +++ /dev/null @@ -1,72 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class ApiKeyAuth implements Interceptor { - private final String location; - private final String paramName; - - private String apiKey; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - @Override - public Response intercept(Chain chain) throws IOException { - String paramValue; - Request request = chain.request(); - - if ("query".equals(location)) { - String newQuery = request.uri().getQuery(); - paramValue = paramName + "=" + apiKey; - if (newQuery == null) { - newQuery = paramValue; - } else { - newQuery += "&" + paramValue; - } - - URI newUri; - try { - newUri = new URI(request.uri().getScheme(), request.uri().getAuthority(), - request.uri().getPath(), newQuery, request.uri().getFragment()); - } catch (URISyntaxException e) { - throw new IOException(e); - } - - request = request.newBuilder().url(newUri.toURL()).build(); - } else if ("header".equals(location)) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build(); - } else if ("cookie".equals(location)) { - request = request.newBuilder() - .addHeader("Cookie", String.format("%s=%s", paramName, apiKey)) - .build(); - } - return chain.proceed(request); - } -} diff --git a/sdks/java-v2/templates/libraries/retrofit/auth/HttpBasicAuth.mustache b/sdks/java-v2/templates/libraries/retrofit/auth/HttpBasicAuth.mustache deleted file mode 100644 index cf82b2775..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/auth/HttpBasicAuth.mustache +++ /dev/null @@ -1,49 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; - -import com.squareup.okhttp.Credentials; -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class HttpBasicAuth implements Interceptor { - - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public void setCredentials(String username, String password) { - this.username = username; - this.password = password; - } - - @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") == null) { - String credentials = Credentials.basic(username, password); - request = request.newBuilder() - .addHeader("Authorization", credentials) - .build(); - } - return chain.proceed(request); - } -} diff --git a/sdks/java-v2/templates/libraries/retrofit/auth/HttpBearerAuth.mustache b/sdks/java-v2/templates/libraries/retrofit/auth/HttpBearerAuth.mustache deleted file mode 100644 index 9b910c461..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/auth/HttpBearerAuth.mustache +++ /dev/null @@ -1,42 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; - -public class HttpBearerAuth implements Interceptor { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - public String getBearerToken() { - return bearerToken; - } - - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") == null && bearerToken != null) { - request = request.newBuilder() - .addHeader("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken) - .build(); - } - return chain.proceed(request); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } - -} diff --git a/sdks/java-v2/templates/libraries/retrofit/auth/OAuth.mustache b/sdks/java-v2/templates/libraries/retrofit/auth/OAuth.mustache deleted file mode 100644 index 57bfd3df2..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/auth/OAuth.mustache +++ /dev/null @@ -1,185 +0,0 @@ -package {{invokerPackage}}.auth; - -import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; -import static java.net.HttpURLConnection.HTTP_FORBIDDEN; - -import java.io.IOException; -import java.util.Map; - -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; -import org.apache.oltu.oauth2.common.token.BasicOAuthToken; - -import com.squareup.okhttp.Interceptor; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Request.Builder; -import com.squareup.okhttp.Response; - -public class OAuth implements Interceptor { - - public interface AccessTokenListener { - public void notify(BasicOAuthToken token); - } - - private volatile String accessToken; - private OAuthClient oauthClient; - - private TokenRequestBuilder tokenRequestBuilder; - private AuthenticationRequestBuilder authenticationRequestBuilder; - - private AccessTokenListener accessTokenListener; - - public OAuth( OkHttpClient client, TokenRequestBuilder requestBuilder ) { - this.oauthClient = new OAuthClient(new OAuthOkHttpClient(client)); - this.tokenRequestBuilder = requestBuilder; - } - - public OAuth(TokenRequestBuilder requestBuilder ) { - this(new OkHttpClient(), requestBuilder); - } - - public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { - this(OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes)); - setFlow(flow); - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); - } - - public void setFlow(OAuthFlow flow) { - switch(flow) { - case accessCode: - case implicit: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case password: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case application: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - } - - @Override - public Response intercept(Chain chain) - throws IOException { - - return retryingIntercept(chain, true); - } - - private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { - Request request = chain.request(); - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request); - } - - // If first time, get the token - OAuthClientRequest oAuthRequest; - if (getAccessToken() == null) { - updateAccessToken(null); - } - - if (getAccessToken() != null) { - // Build the request - Builder rb = request.newBuilder(); - - String requestAccessToken = new String(getAccessToken()); - try { - oAuthRequest = new OAuthBearerClientRequest(request.urlString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage(); - } catch (OAuthSystemException e) { - throw new IOException(e); - } - - for ( Map.Entry header : oAuthRequest.getHeaders().entrySet() ) { - rb.addHeader(header.getKey(), header.getValue()); - } - rb.url( oAuthRequest.getLocationUri()); - - //Execute the request - Response response = chain.proceed(rb.build()); - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ( response != null && (response.code() == HTTP_UNAUTHORIZED || response.code() == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure ) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body().close(); - return retryingIntercept( chain, false ); - } - } catch (Exception e) { - response.body().close(); - throw e; - } - } - return response; - } else { - return chain.proceed(chain.request()); - } - } - - /* - * Returns true if the access token has been updated - */ - public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { - try { - OAuthJSONAccessTokenResponse accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()); - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken()); - if (accessTokenListener != null) { - accessTokenListener.notify((BasicOAuthToken) accessTokenResponse.getOAuthToken()); - } - return !getAccessToken().equals(requestAccessToken); - } else { - return false; - } - } catch (OAuthSystemException e) { - throw new IOException(e); - } catch (OAuthProblemException e) { - throw new IOException(e); - } - } - return true; - } - - public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - this.accessTokenListener = accessTokenListener; - } - - public synchronized String getAccessToken() { - return accessToken; - } - - public synchronized void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } - - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - public AuthenticationRequestBuilder getAuthenticationRequestBuilder() { - return authenticationRequestBuilder; - } - - public void setAuthenticationRequestBuilder(AuthenticationRequestBuilder authenticationRequestBuilder) { - this.authenticationRequestBuilder = authenticationRequestBuilder; - } - -} diff --git a/sdks/java-v2/templates/libraries/retrofit/auth/OAuthOkHttpClient.mustache b/sdks/java-v2/templates/libraries/retrofit/auth/OAuthOkHttpClient.mustache deleted file mode 100644 index 48fc7ea4c..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/auth/OAuthOkHttpClient.mustache +++ /dev/null @@ -1,69 +0,0 @@ -package {{invokerPackage}}.auth; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; - -import com.squareup.okhttp.MediaType; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.RequestBody; -import com.squareup.okhttp.Response; - - -public class OAuthOkHttpClient implements HttpClient { - - private OkHttpClient client; - - public OAuthOkHttpClient() { - this.client = new OkHttpClient(); - } - - public OAuthOkHttpClient(OkHttpClient client) { - this.client = client; - } - - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - MediaType mediaType = MediaType.parse("application/json"); - Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); - - if(headers != null) { - for (Entry entry : headers.entrySet()) { - if (entry.getKey().equalsIgnoreCase("Content-Type")) { - mediaType = MediaType.parse(entry.getValue()); - } else { - requestBuilder.addHeader(entry.getKey(), entry.getValue()); - } - } - } - - RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; - requestBuilder.method(requestMethod, body); - - try { - Response response = client.newCall(requestBuilder.build()).execute(); - return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), - response.body().contentType().toString(), - response.code(), - responseClass); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - } - - public void shutdown() { - // Nothing to do here - } - -} diff --git a/sdks/java-v2/templates/libraries/retrofit/bodyParams.mustache b/sdks/java-v2/templates/libraries/retrofit/bodyParams.mustache deleted file mode 100644 index 81de324b6..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/bodyParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isBodyParam}}@retrofit.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/retrofit/build.gradle.mustache b/sdks/java-v2/templates/libraries/retrofit/build.gradle.mustache deleted file mode 100644 index 1266cde37..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/build.gradle.mustache +++ /dev/null @@ -1,130 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' - -group = '{{groupId}}' -version = '{{artifactVersion}}' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - } -} - -repositories { - mavenCentral() -} - - -if(hasProperty('target') && target == 'android') { - - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' - - android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 25 - } - compileOptions { - {{#java8}} - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} - } - - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } - - dependencies { - provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - } - } - - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven-publish' - - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - - publishing { - publications { - maven(MavenPublication) { - artifactId = '{{artifactId}}' - from components.java - } - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - okhttp_version = "2.7.5" - oltu_version = "1.0.1" - retrofit_version = "1.9.0" - swagger_annotations_version = "1.5.21" - jakarta_annotation_version = "1.3.5" - junit_version = "4.13.1" - jodatime_version = "2.9.3" - {{#threetenbp}} - threetenbp_version = "1.4.0" - {{/threetenbp}} -} - -dependencies { - implementation "com.squareup.okhttp:okhttp:$okhttp_version" - implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation "com.squareup.retrofit:retrofit:$retrofit_version" - implementation "io.swagger:swagger-annotations:$swagger_annotations_version" - implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" - implementation "joda-time:joda-time:$jodatime_version" - {{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" - {{/threetenbp}} - implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" -} diff --git a/sdks/java-v2/templates/libraries/retrofit/build.sbt.mustache b/sdks/java-v2/templates/libraries/retrofit/build.sbt.mustache deleted file mode 100644 index b27931765..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/build.sbt.mustache +++ /dev/null @@ -1,24 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "{{groupId}}", - name := "{{artifactId}}", - version := "{{artifactVersion}}", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "com.squareup.okhttp" % "okhttp" % "2.7.5" % "compile", - "com.squareup.retrofit" % "retrofit" % "1.9.0" % "compile", - "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "joda-time" % "joda-time" % "2.9.3" % "compile", - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.0" % "compile", - {{/threetenbp}} - "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" - ) - ) diff --git a/sdks/java-v2/templates/libraries/retrofit/formParams.mustache b/sdks/java-v2/templates/libraries/retrofit/formParams.mustache deleted file mode 100644 index 851072b3f..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/formParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isFormParam}}{{^isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") TypedFile {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/retrofit/headerParams.mustache b/sdks/java-v2/templates/libraries/retrofit/headerParams.mustache deleted file mode 100644 index 5d6da4a94..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/headerParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isHeaderParam}}@retrofit.http.Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/retrofit/pathParams.mustache b/sdks/java-v2/templates/libraries/retrofit/pathParams.mustache deleted file mode 100644 index 7b8be8442..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/pathParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isPathParam}}@retrofit.http.Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/retrofit/pom.mustache b/sdks/java-v2/templates/libraries/retrofit/pom.mustache deleted file mode 100644 index 1566db9a1..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/pom.mustache +++ /dev/null @@ -1,295 +0,0 @@ - - 4.0.0 - {{groupId}} - {{artifactId}} - jar - {{artifactId}} - {{artifactVersion}} - {{artifactUrl}} - {{artifactDescription}} - - {{scmConnection}} - {{scmDeveloperConnection}} - {{scmUrl}} - -{{#parentOverridden}} - - {{{parentGroupId}}} - {{{parentArtifactId}}} - {{{parentVersion}}} - -{{/parentOverridden}} - - - - {{licenseName}} - {{licenseUrl}} - repo - - - - - - {{developerName}} - {{developerEmail}} - {{developerOrganization}} - {{developerOrganizationUrl}} - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.1.1 - - none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} - - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - - - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.squareup.retrofit - retrofit - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - com.squareup.okhttp - okhttp - ${okhttp-version} - - - joda-time - joda-time - ${jodatime-version} - - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} - {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - - {{/parcelableModel}} - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation-version} - provided - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.21 - 1.9.0 - 2.7.5 - 2.9.9 - {{#threetenbp}} - 1.4.0 - {{/threetenbp}} - 1.0.1 - 1.3.5 - 1.0.0 - 4.13.1 - - diff --git a/sdks/java-v2/templates/libraries/retrofit/queryParams.mustache b/sdks/java-v2/templates/libraries/retrofit/queryParams.mustache deleted file mode 100644 index 2a580ab34..000000000 --- a/sdks/java-v2/templates/libraries/retrofit/queryParams.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#isQueryParam}}@retrofit.http.Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/retrofit2/ApiClient.mustache b/sdks/java-v2/templates/libraries/retrofit2/ApiClient.mustache index 57c977263..077e8d692 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/ApiClient.mustache @@ -1,8 +1,12 @@ +{{>licenseInfo}} + package {{invokerPackage}}; +{{#gson}} import com.google.gson.Gson; import com.google.gson.JsonParseException; import com.google.gson.JsonElement; +{{/gson}} import okhttp3.Interceptor; import okhttp3.OkHttpClient; import okhttp3.RequestBody; @@ -14,18 +18,20 @@ import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuil {{#joda}} import org.joda.time.format.DateTimeFormatter; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} import retrofit2.Converter; import retrofit2.Retrofit; {{#useRxJava2}} import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; {{/useRxJava2}} {{#useRxJava3}} -import hu.akarnokd.rxjava3.retrofit.RxJava3CallAdapterFactory; +import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory; {{/useRxJava3}} +{{#gson}} import retrofit2.converter.gson.GsonConverterFactory; +{{/gson}} +{{#jackson}} +import retrofit2.converter.jackson.JacksonConverterFactory; +{{/jackson}} import retrofit2.converter.scalars.ScalarsConverterFactory; import {{invokerPackage}}.auth.HttpBasicAuth; import {{invokerPackage}}.auth.HttpBearerAuth; @@ -40,9 +46,7 @@ import java.io.IOException; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; -{{#java8}} import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; @@ -71,24 +75,25 @@ public class ApiClient { this(); for(String authName : authNames) { {{#hasAuthMethods}} - Interceptor auth; + Interceptor auth = null; {{#authMethods}}if ("{{name}}".equals(authName)) { - {{#isBasic}}{{#isBasicBasic}} + {{#isBasicBasic}} auth = new HttpBasicAuth(); - {{/isBasicBasic}}{{^isBasicBasic}} + {{/isBasicBasic}}{{#isBasicBearer}} auth = new HttpBearerAuth("{{scheme}}"); - {{/isBasicBasic}}{{/isBasic}} + {{/isBasicBearer}} {{#isApiKey}} auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); {{/isApiKey}} {{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); + auth = new OAuth(OAuthFlow.{{#lambda.uppercase}}{{#lambda.snakecase}}{{flow}}{{/lambda.snakecase}}{{/lambda.uppercase}}, "{{{authorizationUrl}}}", "{{{tokenUrl}}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } - - addAuthorization(authName, auth); + if (auth != null) { + addAuthorization(authName, auth); + } {{/hasAuthMethods}} {{^hasAuthMethods}} throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); @@ -161,7 +166,12 @@ public class ApiClient { .addCallAdapterFactory(RxJava3CallAdapterFactory.create()) {{/useRxJava3}} .addConverterFactory(ScalarsConverterFactory.create()) + {{#jackson}} + .addConverterFactory(JacksonConverterFactory.create(json.getMapper())); + {{/jackson}} + {{#gson}} .addConverterFactory(GsonCustomConverterFactory.create(json.getGson())); + {{/gson}} } public S createService(Class serviceClass) { @@ -177,6 +187,7 @@ public class ApiClient { return this; } + {{#gson}} public ApiClient setSqlDateFormat(DateFormat dateFormat) { this.json.setSqlDateFormat(dateFormat); return this; @@ -204,8 +215,9 @@ public class ApiClient { this.json.setLocalDateFormat(dateFormat); return this; } - {{/jsr310}} + {{/gson}} + /** * Helper method to configure the first api key found @@ -405,6 +417,7 @@ public class ApiClient { } } +{{#gson}} /** * This wrapper is to take care of this case: * when the deserialization fails due to JsonParseException and the @@ -459,3 +472,4 @@ class GsonCustomConverterFactory extends Converter.Factory return gsonConverterFactory.requestBodyConverter(type, parameterAnnotations, methodAnnotations, retrofit); } } +{{/gson}} \ No newline at end of file diff --git a/sdks/java-v2/templates/libraries/retrofit2/CollectionFormats.mustache b/sdks/java-v2/templates/libraries/retrofit2/CollectionFormats.mustache index dbfa4ae76..d63c8a864 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/CollectionFormats.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/CollectionFormats.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.Arrays; diff --git a/sdks/java-v2/templates/libraries/retrofit2/JSON.mustache b/sdks/java-v2/templates/libraries/retrofit2/JSON.mustache index 9ba7567bf..2ff8b1cb7 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/JSON.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/JSON.mustache @@ -19,11 +19,6 @@ import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; {{/joda}} -{{#threetenbp}} -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; -{{/threetenbp}} {{#models.0}} import {{modelPackage}}.*; @@ -35,11 +30,9 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; -{{#java8}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -{{/java8}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/sdks/java-v2/templates/libraries/retrofit2/JSON_jackson.mustache b/sdks/java-v2/templates/libraries/retrofit2/JSON_jackson.mustache new file mode 100644 index 000000000..525fe5d13 --- /dev/null +++ b/sdks/java-v2/templates/libraries/retrofit2/JSON_jackson.mustache @@ -0,0 +1,263 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +{{#joda}} +import com.fasterxml.jackson.datatype.joda.JodaModule; +{{/joda}} +{{#models.0}} +import {{modelPackage}}.*; +{{/models.0}} + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; + +{{>generatedAnnotation}} +public class JSON implements ContextResolver { + private ObjectMapper mapper; + + public JSON() { + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + {{#joda}} + .addModule(new JodaModule()) + {{/joda}} + {{#openApiNullable}} + .addModule(new JsonNullableModule()) + {{/openApiNullable}} + .build(); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet<>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap<>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (GenericType childType : descendants.values()) { + if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static + { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/sdks/java-v2/templates/libraries/retrofit2/api.mustache b/sdks/java-v2/templates/libraries/retrofit2/api.mustache index 82c3fe068..dd521a5fc 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/api.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/api.mustache @@ -28,13 +28,17 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +import java.util.Set; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} {{#operations}} public interface {{classname}} { {{#operation}} diff --git a/sdks/java-v2/templates/libraries/retrofit2/api_test.mustache b/sdks/java-v2/templates/libraries/retrofit2/api_test.mustache index 3f60dd13d..dab62f328 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/api_test.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/api_test.mustache @@ -3,16 +3,22 @@ package {{package}}; import {{invokerPackage}}.ApiClient; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ @@ -20,7 +26,7 @@ public class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void setup() { api = new ApiClient().createService({{classname}}.class); } diff --git a/sdks/java-v2/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache b/sdks/java-v2/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache index bcc62b284..d87c2e4c6 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/sdks/java-v2/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache b/sdks/java-v2/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache index 9bd756eb8..ac0347648 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/auth/HttpBasicAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/sdks/java-v2/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache b/sdks/java-v2/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache index da1bef57a..764c8f216 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/auth/HttpBearerAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/sdks/java-v2/templates/libraries/retrofit2/auth/OAuth.mustache b/sdks/java-v2/templates/libraries/retrofit2/auth/OAuth.mustache index 88e4e62bf..6ea77b78d 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/auth/OAuth.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/auth/OAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; @@ -54,14 +56,14 @@ public class OAuth implements Interceptor { public void setFlow(OAuthFlow flow) { switch(flow) { - case accessCode: - case implicit: + case ACCESS_CODE: + case IMPLICIT: tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); break; - case password: + case PASSWORD: tokenRequestBuilder.setGrantType(GrantType.PASSWORD); break; - case application: + case APPLICATION: tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); break; default: diff --git a/sdks/java-v2/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache b/sdks/java-v2/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache index a499c7b8b..5fe013184 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/auth/OAuthOkHttpClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import java.io.IOException; diff --git a/sdks/java-v2/templates/libraries/retrofit2/build.gradle.mustache b/sdks/java-v2/templates/libraries/retrofit2/build.gradle.mustache index a5c716b18..407e97a33 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/build.gradle.mustache @@ -32,14 +32,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} } // Rename the aar correctly @@ -63,9 +57,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } @@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} publishing { publications { @@ -110,18 +98,21 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" + retrofit_version = "2.11.0" + {{#jackson}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + javax_ws_rs_api_version = "2.1.1" + {{#openApiNullable}} + jackson_databind_nullable_version = "0.2.6" + {{/openApiNullable}} + {{/jackson}} {{#usePlayWS}} - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" - {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" - {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" play_version = "2.6.7" {{/usePlayWS}} + jakarta_annotation_version = "1.3.5" swagger_annotations_version = "1.5.22" - junit_version = "4.13.1" + junit_version = "5.10.3" {{#useRxJava2}} rx_java_version = "2.1.1" {{/useRxJava2}} @@ -131,10 +122,7 @@ ext { {{#joda}} jodatime_version = "2.9.9" {{/joda}} - {{#threetenbp}} - threetenbp_version = "1.4.0" - {{/threetenbp}} - json_fire_version = "1.8.0" + json_fire_version = "1.9.0" } dependencies { @@ -146,7 +134,7 @@ dependencies { implementation "io.reactivex.rxjava2:rxjava:$rx_java_version" {{/useRxJava2}} {{#useRxJava3}} - implementation 'com.github.akarnokd:rxjava3-retrofit-adapter:3.0.0' + implementation 'com.squareup.retrofit2:adapter-rxjava3:$$retrofit_version' implementation "io.reactivex.rxjava3:rxjava:$rx_java_version" {{/useRxJava3}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" @@ -158,21 +146,21 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#threetenbp}} - implementation "org.threeten:threetenbp:$threetenbp_version" - {{/threetenbp}} {{#usePlayWS}} implementation "com.typesafe.play:play-ahc-ws_2.12:$play_version" - implementation "jakarta.validation:jakarta.validation-api:2.0.2" + {{/usePlayWS}} + {{#jackson}} + implementation "jakarta.validation:jakarta.validation-api:3.0.2" implementation "com.squareup.retrofit2:converter-jackson:$retrofit_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "javax.ws.rs:javax.ws.rs-api:$javax_ws_rs_api_version" {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} - implementation "com.fasterxml.jackson.datatype:jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}:$jackson_version" - {{/usePlayWS}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{/jackson}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/sdks/java-v2/templates/libraries/retrofit2/build.sbt.mustache b/sdks/java-v2/templates/libraries/retrofit2/build.sbt.mustache index a572f4b93..03b8653d0 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/build.sbt.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/build.sbt.mustache @@ -9,25 +9,25 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "retrofit" % "2.11.0" % "compile", + "com.squareup.retrofit2" % "converter-scalars" % "2.11.0" % "compile", {{^usePlayWS}} - "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.11.0" % "compile", {{/usePlayWS}} {{#usePlayWS}} "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", - "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", - "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile", + "jakarta.validation" % "jakarta.validation-api" % "3.0.2" % "compile", + "com.squareup.retrofit2" % "converter-jackson" % "2.11.0" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.17.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1" % "compile", {{/usePlayWS}} {{#useRxJava2}} - "com.squareup.retrofit2" % "adapter-rxjava2" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "adapter-rxjava2" % "2.11.0" % "compile", "io.reactivex.rxjava2" % "rxjava" % "2.1.1" % "compile", {{/useRxJava2}} {{#useRxJava3}} - "com.github.akarnokd" % "rxjava3-retrofit-adapter" % "3.0.0" % "compile", + "com.squareup.retrofit2" % "adapter-rxjava3" % "2.11.0" % "compile", "io.reactivex.rxjava3" % "rxjava" % "3.0.4" % "compile", {{/useRxJava3}} "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", @@ -35,12 +35,9 @@ lazy val root = (project in file(".")). {{#joda}} "joda-time" % "joda-time" % "2.9.9" % "compile", {{/joda}} - {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.4.0" % "compile", - {{/threetenbp}} - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) ) diff --git a/sdks/java-v2/templates/libraries/retrofit2/play24/ApiClient.mustache b/sdks/java-v2/templates/libraries/retrofit2/play24/ApiClient.mustache index c43f800a4..78e3f8510 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play24/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play24/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.IOException; @@ -45,8 +47,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - // authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + // authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/sdks/java-v2/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache b/sdks/java-v2/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache index d9ed3330f..d6411f26f 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import play.libs.F; diff --git a/sdks/java-v2/templates/libraries/retrofit2/play24/Play24CallFactory.mustache b/sdks/java-v2/templates/libraries/retrofit2/play24/Play24CallFactory.mustache index b17ac6415..2808f262a 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play24/Play24CallFactory.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play24/Play24CallFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import okhttp3.*; diff --git a/sdks/java-v2/templates/libraries/retrofit2/play24/api.mustache b/sdks/java-v2/templates/libraries/retrofit2/play24/api.mustache index 2b7512d19..f793699be 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play24/api.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play24/api.mustache @@ -14,12 +14,10 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} import play.libs.F; import retrofit2.Response; diff --git a/sdks/java-v2/templates/libraries/retrofit2/play25/ApiClient.mustache b/sdks/java-v2/templates/libraries/retrofit2/play25/ApiClient.mustache index 849e0665e..22d48bd78 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play25/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play25/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.IOException; @@ -44,8 +46,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<>();{{#authMethods}}{{#isBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} + authentications = new HashMap<>();{{#authMethods}}{{#isBasicBasic}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"query"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/sdks/java-v2/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache b/sdks/java-v2/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache index 62360bf98..b431690f9 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.concurrent.CompletionStage; diff --git a/sdks/java-v2/templates/libraries/retrofit2/play25/Play25CallFactory.mustache b/sdks/java-v2/templates/libraries/retrofit2/play25/Play25CallFactory.mustache index a9f19474f..d7d27d2f8 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play25/Play25CallFactory.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play25/Play25CallFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import okhttp3.*; diff --git a/sdks/java-v2/templates/libraries/retrofit2/play25/api.mustache b/sdks/java-v2/templates/libraries/retrofit2/play25/api.mustache index d4e97cc34..de6a6f6d9 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play25/api.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play25/api.mustache @@ -14,12 +14,10 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} import java.util.concurrent.*; import retrofit2.Response; diff --git a/sdks/java-v2/templates/libraries/retrofit2/play26/ApiClient.mustache b/sdks/java-v2/templates/libraries/retrofit2/play26/ApiClient.mustache index b752b433d..ef1b75d44 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play26/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play26/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.io.File; @@ -59,8 +61,8 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<>();{{#authMethods}}{{#isBasic}} - // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} + authentications = new HashMap<>();{{#authMethods}}{{#isBasicBasic}} + // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. diff --git a/sdks/java-v2/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache b/sdks/java-v2/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache index 05c725474..2b7739fe8 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play26/Play26CallAdapterFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import java.util.concurrent.CompletionStage; diff --git a/sdks/java-v2/templates/libraries/retrofit2/play26/Play26CallFactory.mustache b/sdks/java-v2/templates/libraries/retrofit2/play26/Play26CallFactory.mustache index f65c921a7..c309dee98 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play26/Play26CallFactory.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play26/Play26CallFactory.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import okhttp3.*; diff --git a/sdks/java-v2/templates/libraries/retrofit2/play26/api.mustache b/sdks/java-v2/templates/libraries/retrofit2/play26/api.mustache index dd3339ff8..e78bd985a 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/play26/api.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/play26/api.mustache @@ -17,12 +17,15 @@ import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; +{{/useBeanValidation}} + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} import java.util.concurrent.*; import retrofit2.Response; diff --git a/sdks/java-v2/templates/libraries/retrofit2/pom.mustache b/sdks/java-v2/templates/libraries/retrofit2/pom.mustache index 5c0006171..b02a5fb2e 100644 --- a/sdks/java-v2/templates/libraries/retrofit2/pom.mustache +++ b/sdks/java-v2/templates/libraries/retrofit2/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 2.12 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest @@ -144,28 +144,17 @@ maven-compiler-plugin 3.6.1 - {{#java8}} 1.8 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -228,11 +217,13 @@ jsr305 3.0.2 + {{#gson}} com.squareup.retrofit2 converter-gson ${retrofit-version} + {{/gson}} com.squareup.retrofit2 retrofit @@ -254,11 +245,13 @@ + {{#gson}} io.gsonfire gson-fire ${gson-fire-version} + {{/gson}} {{#joda}} joda-time @@ -266,13 +259,6 @@ ${jodatime-version} {{/joda}} - {{#threetenbp}} - - org.threeten - threetenbp - ${threetenbp-version} - - {{/threetenbp}} {{#useRxJava2}} io.reactivex.rxjava2 @@ -292,12 +278,12 @@ ${rxjava-version} - com.github.akarnokd - rxjava3-retrofit-adapter - 3.0.0 + com.squareup.retrofit2 + adapter-rxjava3 + ${retrofit-version} {{/useRxJava3}} - {{#usePlayWS}} + {{#jackson}} com.squareup.retrofit2 @@ -317,7 +303,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} {{#openApiNullable}} @@ -328,7 +314,7 @@ {{/openApiNullable}} com.fasterxml.jackson.datatype - jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}} + jackson-datatype-jsr310 ${jackson-version} {{#withXml}} @@ -339,6 +325,20 @@ ${jackson-version} {{/withXml}} + {{#useBeanValidation}} + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + + {{/useBeanValidation}} + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + {{/jackson}} + {{#usePlayWS}} com.typesafe.play play-ahc-ws_2.12 @@ -367,27 +367,33 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + 1.8 ${java.version} ${java.version} - 1.8.3 + {{#gson}} + 1.9.0 + {{/gson}} 1.6.3 + {{#jackson}} + 2.17.1 + 2.17.1 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + 2.1.1 + {{/jackson}} {{#usePlayWS}} - 2.12.1 2.6.7 - {{#openApiNullable}} - 0.2.2 - {{/openApiNullable}} {{/usePlayWS}} - 2.5.0 + 2.11.0 {{#useRxJava2}} 2.1.1 {{/useRxJava2}} @@ -397,14 +403,16 @@ {{#joda}} 2.9.9 {{/joda}} - {{#threetenbp}} - 1.4.0 - {{/threetenbp}} + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 -{{#useBeanValidation}} - 2.0.2 -{{/useBeanValidation}} + {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} 1.0.1 - 4.13.1 + 5.10.3 diff --git a/sdks/java-v2/templates/libraries/vertx/ApiClient.mustache b/sdks/java-v2/templates/libraries/vertx/ApiClient.mustache index b3668e995..6607107ab 100644 --- a/sdks/java-v2/templates/libraries/vertx/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/vertx/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import {{invokerPackage}}.auth.Authentication; @@ -34,12 +36,7 @@ import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import java.text.DateFormat; import java.util.*; @@ -98,8 +95,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { // Setup authentications (key: authentication name, value: authentication). this.authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -685,54 +682,54 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private final Map authentications = new LinkedHashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String username, String password) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String username, String password) { HttpBasicAuth auth = new HttpBasicAuth(); auth.setUsername(username); auth.setPassword(password); authentications.put("{{name}}", auth); - }{{/isBasicBasic}}{{^isBasicBasic}} + }{{/isBasicBasic}}{{#isBasicBearer}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String bearerToken) { HttpBearerAuth auth = new HttpBearerAuth("{{scheme}}"); auth.setBearerToken(bearerToken); authentications.put("{{name}}", auth); - }{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + }{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String apikey, String apiKeyPrefix) { ApiKeyAuth auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}},"{{keyParamName}}"); auth.setApiKey(apikey); auth.setApiKeyPrefix(apiKeyPrefix); authentications.put("{{name}}", auth); }{{/isApiKey}}{{#isOAuth}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String accessToken) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String accessToken) { OAuth auth = new OAuth(); auth.setAccessToken(accessToken); authentications.put("{{name}}", auth); }{{/isOAuth}}{{/authMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}(String username, String password) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}(String username, String password) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(username, password); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(username, password); return authInfo; - }{{/isBasicBasic}}{{^isBasicBasic}} + }{{/isBasicBasic}}{{#isBasicBearer}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String bearerToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(bearerToken); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(bearerToken); return authInfo; - }{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + }{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String apikey, String apiKeyPrefix) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(apikey, apiKeyPrefix); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(apikey, apiKeyPrefix); return authInfo; }{{/isApiKey}}{{#isOAuth}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String accessToken) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String accessToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(accessToken); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(accessToken); return authInfo; }{{/isOAuth}}{{/authMethods}} } diff --git a/sdks/java-v2/templates/libraries/vertx/Configuration.mustache b/sdks/java-v2/templates/libraries/vertx/Configuration.mustache index 17710ae16..5f26ea84b 100644 --- a/sdks/java-v2/templates/libraries/vertx/Configuration.mustache +++ b/sdks/java-v2/templates/libraries/vertx/Configuration.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import io.vertx.core.Vertx; @@ -6,6 +8,7 @@ import io.vertx.core.json.JsonObject; import java.util.Objects; public class Configuration { + public static final String VERSION = "{{{artifactVersion}}}"; private static ApiClient defaultApiClient = null; diff --git a/sdks/java-v2/templates/libraries/vertx/apiException.mustache b/sdks/java-v2/templates/libraries/vertx/apiException.mustache index 6e9bbdbb8..9ce810156 100644 --- a/sdks/java-v2/templates/libraries/vertx/apiException.mustache +++ b/sdks/java-v2/templates/libraries/vertx/apiException.mustache @@ -8,6 +8,8 @@ import io.vertx.core.MultiMap; {{>generatedAnnotation}} public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 1L; + private int code = 0; private MultiMap responseHeaders = null; private String responseBody = null; diff --git a/sdks/java-v2/templates/libraries/vertx/api_test.mustache b/sdks/java-v2/templates/libraries/vertx/api_test.mustache index 5eb2ec727..1469d11fb 100644 --- a/sdks/java-v2/templates/libraries/vertx/api_test.mustache +++ b/sdks/java-v2/templates/libraries/vertx/api_test.mustache @@ -6,11 +6,10 @@ package {{package}}; import {{invokerPackage}}.Configuration; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -21,34 +20,28 @@ import io.vertx.ext.unit.junit.RunTestOnContext; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.Async; -{{^fullJavaUtil}} +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} /** * API tests for {{classname}} */ -@RunWith(VertxUnitRunner.class) -@Ignore +@Disabled public class {{classname}}Test { private {{classname}} api; - @Rule - public RunTestOnContext rule = new RunTestOnContext(); - - @BeforeClass + @BeforeAll public void setupApiClient() { - JsonObject config = new JsonObject(); - Vertx vertx = rule.vertx(); - Configuration.setupDefaultApiClient(vertx, config); - api = new {{classname}}Impl(); } - {{#operations}}{{#operation}} + + {{#operations}} + {{#operation}} /** * {{summary}} * {{notes}} @@ -66,5 +59,6 @@ public class {{classname}}Test { async.complete(); }); } - {{/operation}}{{/operations}} + {{/operation}} + {{/operations}} } diff --git a/sdks/java-v2/templates/libraries/vertx/build.gradle.mustache b/sdks/java-v2/templates/libraries/vertx/build.gradle.mustache index bc33a0774..0e8fd590c 100644 --- a/sdks/java-v2/templates/libraries/vertx/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/vertx/build.gradle.mustache @@ -30,17 +30,14 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.10.5" - jackson_databind_version = "2.10.5.1" - vertx_version = "3.4.2" - junit_version = "4.13.1" + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" + vertx_version = "3.5.2" + junit_version = "5.10.3" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - {{#threetenbp}} - jackson_threeten_version = "2.9.10" - {{/threetenbp}} } dependencies { @@ -54,16 +51,11 @@ dependencies { {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{#threetenbp}} - implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:jackson_threeten_version" - {{/threetenbp}} {{#openApiNullable}} implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" {{/openApiNullable}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testImplementation "io.vertx:vertx-unit:$vertx_version" } diff --git a/sdks/java-v2/templates/libraries/vertx/pom.mustache b/sdks/java-v2/templates/libraries/vertx/pom.mustache index 2306edbfe..b9b44cd85 100644 --- a/sdks/java-v2/templates/libraries/vertx/pom.mustache +++ b/sdks/java-v2/templates/libraries/vertx/pom.mustache @@ -65,12 +65,12 @@ maven-surefire-plugin 2.12 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest @@ -151,15 +151,10 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -211,11 +206,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -266,20 +270,11 @@ ${jackson-version} {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - 2.9.10 - - {{/threetenbp}} jakarta.annotation jakarta.annotation-api @@ -289,8 +284,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -304,12 +299,22 @@ UTF-8 - 3.4.2 - 1.5.22 - 2.10.5 - 2.10.5.1 - 0.2.2 + 3.5.2 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.17.1 + 2.17.1 + 0.2.6 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 - 4.13.1 + {{/useJakartaEe}} + 5.10.3 diff --git a/sdks/java-v2/templates/libraries/webclient/ApiClient.mustache b/sdks/java-v2/templates/libraries/webclient/ApiClient.mustache index 2fa35f524..9072a8859 100644 --- a/sdks/java-v2/templates/libraries/webclient/ApiClient.mustache +++ b/sdks/java-v2/templates/libraries/webclient/ApiClient.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -6,8 +8,6 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -45,7 +45,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.text.DateFormat; @@ -62,15 +61,10 @@ import java.util.Map; import java.util.Map.Entry; import java.util.TimeZone; -import javax.annotation.Nullable; +import {{javaxPackage}}.annotation.Nullable; {{#jsr310}} -{{#threetenbp}} -import org.threeten.bp.OffsetDateTime; -{{/threetenbp}} -{{^threetenbp}} import java.time.OffsetDateTime; -{{/threetenbp}} {{/jsr310}} import {{invokerPackage}}.auth.Authentication; @@ -160,8 +154,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { protected void init() { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} // Prevent the authentications from being modified. @@ -522,7 +516,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return boolean true if the MediaType represents JSON, false otherwise */ public boolean isJsonMime(MediaType mediaType) { - return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$")); + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); } /** diff --git a/sdks/java-v2/templates/libraries/webclient/api.mustache b/sdks/java-v2/templates/libraries/webclient/api.mustache index 166a4fbcd..65600dbfc 100644 --- a/sdks/java-v2/templates/libraries/webclient/api.mustache +++ b/sdks/java-v2/templates/libraries/webclient/api.mustache @@ -4,15 +4,18 @@ import {{invokerPackage}}.ApiClient; {{#imports}}import {{import}}; {{/imports}} -{{^fullJavaUtil}} import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.stream.Collectors; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; @@ -94,11 +97,10 @@ public class {{classname}} { final MultiValueMap formParams = new LinkedMultiValueMap(); {{#hasQueryParams}} - {{#queryParams}} - queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); - {{/queryParams}} - {{/hasQueryParams}} - {{#hasHeaderParams}} + {{#queryParams}}{{#isExplode}}{{#hasVars}}{{#vars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}}{{/hasVars}}{{^hasVars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/hasVars}}{{/isExplode}}{{^isExplode}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} {{#headerParams}} if ({{paramName}} != null) @@ -131,7 +133,7 @@ public class {{classname}} { String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - {{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} + {{#returnType}}ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}> localVarReturnType = new ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } @@ -147,14 +149,43 @@ public class {{classname}} { * @see {{summary}} Documentation {{/externalDocs}} */ - public {{#returnType}}{{#isArray}}Flux<{{{returnBaseType}}}>{{/isArray}}{{^isArray}}Mono<{{{returnType}}}>{{/isArray}} {{/returnType}}{{^returnType}}Mono {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { - {{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} - return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#isArray}}bodyToFlux{{/isArray}}{{^isArray}}bodyToMono{{/isArray}}(localVarReturnType); + public {{#returnType}}{{#vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}}{{^vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}Flux<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}Mono<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}} {{/returnType}}{{^returnType}}{{#vendorExtensions.x-webclient-blocking}}void{{/vendorExtensions.x-webclient-blocking}}{{^vendorExtensions.x-webclient-blocking}}Mono{{/vendorExtensions.x-webclient-blocking}} {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}> localVarReturnType = new ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} + {{^returnType}}{{^vendorExtensions.x-webclient-blocking}}return {{/vendorExtensions.x-webclient-blocking}}{{/returnType}}{{#returnType}}return {{/returnType}}{{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#vendorExtensions.x-webclient-return-except-list-of-string}}bodyToFlux{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}bodyToMono{{/vendorExtensions.x-webclient-return-except-list-of-string}}(localVarReturnType){{#vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}.block(){{/vendorExtensions.x-webclient-blocking}}; + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return ResponseEntity<{{.}}> +{{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#vendorExtensions.x-webclient-blocking}}{{#returnType}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}ResponseEntity>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}ResponseEntity<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/returnType}}{{^returnType}}ResponseEntity{{/returnType}} {{/vendorExtensions.x-webclient-blocking}}{{^vendorExtensions.x-webclient-blocking}}{{#returnType}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}Mono>>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}Mono>{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/returnType}}{{^returnType}}Mono>{{/returnType}} {{/vendorExtensions.x-webclient-blocking}}{{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}> localVarReturnType = new ParameterizedTypeReference<{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnBaseType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnBaseType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}{{/vendorExtensions.x-webclient-return-except-list-of-string}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#vendorExtensions.x-webclient-return-except-list-of-string}}toEntityList{{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}toEntity{{/vendorExtensions.x-webclient-return-except-list-of-string}}(localVarReturnType){{#vendorExtensions.x-webclient-blocking}}.block(){{/vendorExtensions.x-webclient-blocking}}; } - public {{#returnType}}{{#isArray}}Mono>>{{/isArray}}{{^isArray}}Mono>{{/isArray}} {{/returnType}}{{^returnType}}Mono> {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { - {{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} - return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#isArray}}toEntityList{{/isArray}}{{^isArray}}toEntity{{/isArray}}(localVarReturnType); + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}} + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public ResponseSpec {{operationId}}WithResponseSpec({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } {{/operation}} } diff --git a/sdks/java-v2/templates/libraries/webclient/api_test.mustache b/sdks/java-v2/templates/libraries/webclient/api_test.mustache index b9aea5320..c5d568617 100644 --- a/sdks/java-v2/templates/libraries/webclient/api_test.mustache +++ b/sdks/java-v2/templates/libraries/webclient/api_test.mustache @@ -4,21 +4,25 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -{{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -{{/fullJavaUtil}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); @@ -31,10 +35,11 @@ public class {{classname}}Test { */ @Test public void {{operationId}}Test() { + // uncomment below to test the function {{#allParams}} - {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; + //{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#isArray}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/isArray}}{{^isArray}}.block(){{/isArray}}; + //{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{^vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}.block(){{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}}; // TODO: test validations } diff --git a/sdks/java-v2/templates/libraries/webclient/auth/ApiKeyAuth.mustache b/sdks/java-v2/templates/libraries/webclient/auth/ApiKeyAuth.mustache index 857403b27..d32930336 100644 --- a/sdks/java-v2/templates/libraries/webclient/auth/ApiKeyAuth.mustache +++ b/sdks/java-v2/templates/libraries/webclient/auth/ApiKeyAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/sdks/java-v2/templates/libraries/webclient/auth/Authentication.mustache b/sdks/java-v2/templates/libraries/webclient/auth/Authentication.mustache index 8e53c2ba0..0636a6d96 100644 --- a/sdks/java-v2/templates/libraries/webclient/auth/Authentication.mustache +++ b/sdks/java-v2/templates/libraries/webclient/auth/Authentication.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/sdks/java-v2/templates/libraries/webclient/auth/HttpBasicAuth.mustache b/sdks/java-v2/templates/libraries/webclient/auth/HttpBasicAuth.mustache index 5b07cb907..fba126558 100644 --- a/sdks/java-v2/templates/libraries/webclient/auth/HttpBasicAuth.mustache +++ b/sdks/java-v2/templates/libraries/webclient/auth/HttpBasicAuth.mustache @@ -1,10 +1,11 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; +import java.util.Base64; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} @@ -34,6 +35,6 @@ public class HttpBasicAuth implements Authentication { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64Utils.encodeToString(str.getBytes(StandardCharsets.UTF_8))); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); } } diff --git a/sdks/java-v2/templates/libraries/webclient/auth/HttpBearerAuth.mustache b/sdks/java-v2/templates/libraries/webclient/auth/HttpBearerAuth.mustache index 027c128f4..45931f953 100644 --- a/sdks/java-v2/templates/libraries/webclient/auth/HttpBearerAuth.mustache +++ b/sdks/java-v2/templates/libraries/webclient/auth/HttpBearerAuth.mustache @@ -1,10 +1,8 @@ -package {{invokerPackage}}.auth; +{{>licenseInfo}} -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; +package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; -import org.springframework.util.Base64Utils; import org.springframework.util.MultiValueMap; {{>generatedAnnotation}} diff --git a/sdks/java-v2/templates/libraries/webclient/auth/OAuth.mustache b/sdks/java-v2/templates/libraries/webclient/auth/OAuth.mustache index 7889f1582..1e1e6247c 100644 --- a/sdks/java-v2/templates/libraries/webclient/auth/OAuth.mustache +++ b/sdks/java-v2/templates/libraries/webclient/auth/OAuth.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; import org.springframework.http.HttpHeaders; diff --git a/sdks/java-v2/templates/libraries/webclient/auth/OAuthFlow.mustache b/sdks/java-v2/templates/libraries/webclient/auth/OAuthFlow.mustache index 7ab35f6d8..759f354f5 100644 --- a/sdks/java-v2/templates/libraries/webclient/auth/OAuthFlow.mustache +++ b/sdks/java-v2/templates/libraries/webclient/auth/OAuthFlow.mustache @@ -1,3 +1,5 @@ +{{>licenseInfo}} + package {{invokerPackage}}.auth; public enum OAuthFlow { diff --git a/sdks/java-v2/templates/libraries/webclient/build.gradle.mustache b/sdks/java-v2/templates/libraries/webclient/build.gradle.mustache index 8481b945b..597411638 100644 --- a/sdks/java-v2/templates/libraries/webclient/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/webclient/build.gradle.mustache @@ -32,14 +32,14 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} } // Rename the aar correctly @@ -63,16 +63,16 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task); } } task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier = 'sources' } artifacts { @@ -84,14 +84,14 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven-publish' - {{#java8}} + {{#useJakartaEe}} + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + {{/useJakartaEe}} + {{^useJakartaEe}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} + {{/useJakartaEe}} publishing { publications { @@ -103,17 +103,17 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') + mainClass = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } @@ -124,26 +124,46 @@ if(hasProperty('target') && target == 'android') { } ext { + {{#swagger1AnnotationLibrary}} swagger_annotations_version = "1.6.3" - spring_web_version = "2.4.3" - jackson_version = "2.11.4" - jackson_databind_version = "2.11.4" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + {{#useJakartaEe}} + spring_boot_version = "3.0.12" + jakarta_annotation_version = "2.1.1" + reactor_version = "3.5.12" + reactor_netty_version = "1.1.13" + {{/useJakartaEe}} + {{^useJakartaEe}} + spring_boot_version = "2.7.17" + jakarta_annotation_version = "1.3.5" + reactor_version = "3.4.34" + reactor_netty_version = "1.0.39" + {{/useJakartaEe}} + jackson_version = "2.17.1" + jackson_databind_version = "2.17.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.2" + jackson_databind_nullable_version = "0.2.6" {{/openApiNullable}} - jakarta_annotation_version = "1.3.5" - reactor_version = "3.4.3" - reactor_netty_version = "0.7.15.RELEASE" + {{#joda}} jodatime_version = "2.9.9" - junit_version = "4.13.1" + {{/joda}} + junit_version = "5.10.2" } dependencies { + {{#swagger1AnnotationLibrary}} implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" implementation "io.projectreactor:reactor-core:$reactor_version" - implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_web_version" - implementation "io.projectreactor.ipc:reactor-netty:$reactor_netty_version" + implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" + implementation "io.projectreactor.netty:reactor-netty-http:$reactor_netty_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" @@ -154,12 +174,7 @@ dependencies { {{#joda}} implementation "joda-time:joda-time:$jodatime_version" {{/joda}} - {{#java8}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" - {{/java8}} - {{^java8}} - implementation "com.brsanthu:migbase64:2.2" - {{/java8}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/sdks/java-v2/templates/libraries/webclient/pom.mustache b/sdks/java-v2/templates/libraries/webclient/pom.mustache index b5e01dff5..4180b2d5f 100644 --- a/sdks/java-v2/templates/libraries/webclient/pom.mustache +++ b/sdks/java-v2/templates/libraries/webclient/pom.mustache @@ -43,16 +43,22 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.13.0 + {{#useJakartaEe}} + 17 + 17 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.8 1.8 + {{/useJakartaEe}} org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -66,11 +72,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -89,12 +104,12 @@ org.springframework.boot spring-boot-starter-webflux - ${spring-web-version} + ${spring-boot-version} - io.projectreactor.ipc - reactor-netty + io.projectreactor.netty + reactor-netty-http ${reactor-netty-version} @@ -112,13 +127,11 @@ {{/openApiNullable}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} {{#joda}} com.fasterxml.jackson.datatype @@ -140,25 +153,38 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test UTF-8 - 1.6.3 - 2.4.3 - 2.11.3 - 2.11.4 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 2.17.1 + 2.17.1 {{#openApiNullable}} - 0.2.2 + 0.2.6 {{/openApiNullable}} + {{#useJakartaEe}} + 3.0.12 + 2.1.1 + 3.5.12 + 1.1.13 + {{/useJakartaEe}} + {{^useJakartaEe}} + 2.7.17 1.3.5 - 4.13.1 - 3.4.3 - 0.7.15.RELEASE + 3.4.34 + 1.0.39 + {{/useJakartaEe}} + 5.10.2 {{#joda}} 2.9.9 {{/joda}} diff --git a/sdks/java-v2/templates/maven.yml.mustache b/sdks/java-v2/templates/maven.yml.mustache new file mode 100644 index 000000000..69ad41543 --- /dev/null +++ b/sdks/java-v2/templates/maven.yml.mustache @@ -0,0 +1,31 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build {{{appName}}} + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + {{=< >=}} + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/sdks/java-v2/templates/model.mustache b/sdks/java-v2/templates/model.mustache index 0c4d165f6..b50416793 100644 --- a/sdks/java-v2/templates/model.mustache +++ b/sdks/java-v2/templates/model.mustache @@ -25,21 +25,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jackson}} {{#withXml}} -import javax.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.adapters.*; +import io.github.threetenjaxb.core.*; {{/withXml}} {{#jsonb}} import java.lang.reflect.Type; -import javax.json.bind.annotation.JsonbTypeDeserializer; -import javax.json.bind.annotation.JsonbTypeSerializer; -import javax.json.bind.serializer.DeserializationContext; -import javax.json.bind.serializer.JsonbDeserializer; -import javax.json.bind.serializer.JsonbSerializer; -import javax.json.bind.serializer.SerializationContext; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.bind.annotation.JsonbProperty; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{javaxPackage}}.json.bind.serializer.DeserializationContext; +import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer; +import {{javaxPackage}}.json.bind.serializer.JsonbSerializer; +import {{javaxPackage}}.json.bind.serializer.SerializationContext; +import {{javaxPackage}}.json.stream.JsonGenerator; +import {{javaxPackage}}.json.stream.JsonParser; +import {{javaxPackage}}.json.bind.annotation.JsonbProperty; {{#vendorExtensions.x-has-readonly-properties}} -import javax.json.bind.annotation.JsonbCreator; +import {{javaxPackage}}.json.bind.annotation.JsonbCreator; {{/vendorExtensions.x-has-readonly-properties}} {{/jsonb}} {{#parcelableModel}} @@ -47,12 +49,17 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; {{/performBeanValidation}} +{{#supportUrlQuery}} +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; +{{/supportUrlQuery}} {{#models}} {{#model}} diff --git a/sdks/java-v2/templates/modelEnum.mustache b/sdks/java-v2/templates/modelEnum.mustache index f81c7c93f..d1ba359d9 100644 --- a/sdks/java-v2/templates/modelEnum.mustache +++ b/sdks/java-v2/templates/modelEnum.mustache @@ -9,6 +9,9 @@ import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; {{/gson}} +{{#isUri}} +import java.net.URI; +{{/isUri}} /** * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} @@ -56,28 +59,29 @@ import com.google.gson.stream.JsonWriter; {{/jackson}} public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (b.value.equals(value)) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } {{#gson}} public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { @Override public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); } @Override public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { - {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; - return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}}{{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } {{/gson}} {{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { @@ -97,4 +101,20 @@ import com.google.gson.stream.JsonWriter; } } {{/jsonb}} +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } +{{/supportUrlQuery}} } diff --git a/sdks/java-v2/templates/modelInnerEnum.mustache b/sdks/java-v2/templates/modelInnerEnum.mustache index a9c99783f..0096d8407 100644 --- a/sdks/java-v2/templates/modelInnerEnum.mustache +++ b/sdks/java-v2/templates/modelInnerEnum.mustache @@ -51,23 +51,23 @@ {{/jackson}} public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (b.value.equals(value)) { + if (b.value.{{^isString}}equals{{/isString}}{{#isString}}{{#useEnumCaseInsensitive}}equalsIgnoreCase{{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}equals{{/useEnumCaseInsensitive}}{{/isString}}(value)) { return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } {{#gson}} public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { @Override public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); + jsonWriter.value(enumeration.getValue(){{#isUri}}.toASCIIString(){{/isUri}}); } @Override public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { - {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isInteger}}{{/isNumber}}; + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} {{#isUri}}URI.create({{/isUri}}jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{#isUri}}nextString()){{/isUri}}{{^isNumber}}{{^isInteger}}{{^isUri}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isUri}}{{/isInteger}}{{/isNumber}}; return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } diff --git a/sdks/java-v2/templates/model_test.mustache b/sdks/java-v2/templates/model_test.mustache index 07468db56..931a5da03 100644 --- a/sdks/java-v2/templates/model_test.mustache +++ b/sdks/java-v2/templates/model_test.mustache @@ -4,21 +4,14 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - -{{#fullJavaUtil}} -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -{{/fullJavaUtil}} +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for {{classname}} */ -public class {{classname}}Test { +class {{classname}}Test { {{#models}} {{#model}} {{^vendorExtensions.x-is-one-of-interface}} @@ -30,7 +23,7 @@ public class {{classname}}Test { * Model tests for {{classname}} */ @Test - public void test{{classname}}() { + void test{{classname}}() { // TODO: test {{classname}} } @@ -39,7 +32,7 @@ public class {{classname}}Test { * Test the property '{{name}}' */ @Test - public void {{name}}Test() { + void {{name}}Test() { // TODO: test {{name}} } diff --git a/sdks/java-v2/templates/oneof_interface.mustache b/sdks/java-v2/templates/oneof_interface.mustache index 02deb483d..d67277274 100644 --- a/sdks/java-v2/templates/oneof_interface.mustache +++ b/sdks/java-v2/templates/oneof_interface.mustache @@ -1,4 +1,4 @@ -{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}} +{{>additionalOneOfTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}} public interface {{classname}} {{#vendorExtensions.x-implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { {{#discriminator}} public {{propertyType}} {{propertyGetter}}(); diff --git a/sdks/java-v2/templates/pojo.mustache b/sdks/java-v2/templates/pojo.mustache index 7ca5cedee..05be7e5c5 100644 --- a/sdks/java-v2/templates/pojo.mustache +++ b/sdks/java-v2/templates/pojo.mustache @@ -2,17 +2,33 @@ * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} -@Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{.}}}"){{/description}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) +{{#isClassnameSanitized}} +{{^hasDiscriminatorWithNonEmptyMapping}} @JsonTypeName("{{name}}") +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/isClassnameSanitized}} {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -36,65 +52,87 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; {{/jackson}} {{#withXml}} - {{#isXmlAttribute}} - @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlAttribute}} - {{^isXmlAttribute}} - {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isContainer}} - {{#isContainer}} - // Is a container wrapped={{isXmlWrapped}} - {{#items}} - // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} - // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/items}} - {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") - {{/isXmlWrapped}} - {{/isContainer}} - {{/isXmlAttribute}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{^isXmlAttribute}} + {{#isDateTime}} + @XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class) + {{/isDateTime}} + {{/isXmlAttribute}} {{/withXml}} {{#gson}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); {{/isContainer}} {{^isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{^isContainer}} - {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{/vars}} - public {{classname}}() { {{#parent}}{{#parcelableModel}} - super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} - this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} - }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} - + public {{classname}}() { + {{#parent}} + {{#parcelableModel}} + super();{{/parcelableModel}} + {{/parent}} + {{#gson}} + {{#discriminator}} + {{#discriminator.isEnum}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator.isEnum}} + {{/discriminator}} + {{/gson}} + } + {{#vendorExtensions.x-has-readonly-properties}} + {{^withXml}} + /** + * Constructor with only readonly parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}} + */ {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} public {{classname}}( {{#readOnlyVars}} - {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} {{/readOnlyVars}} ) { this(); {{#readOnlyVars}} - this.{{name}} = {{name}}; + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; {{/readOnlyVars}} - }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} + } + {{/withXml}} + {{/vendorExtensions.x-has-readonly-properties}} +{{#vendorExtensions.x-java-all-args-constructor}} + + /** + * Constructor with all args parameters + */ + public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) { +{{#parent}} + super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}}); +{{/parent}} {{#vars}} + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; +{{/vars}} + } +{{/vendorExtensions.x-java-all-args-constructor}} +{{#vars}} {{^isReadOnly}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -103,10 +141,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); } try { this.{{name}}.get().add({{name}}Item); @@ -116,11 +154,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} - {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.add({{name}}Item); return this; {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -128,10 +164,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { - this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } try { this.{{name}}.get().put(key, {{name}}Item); @@ -143,7 +179,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{^vendorExtensions.x-is-jackson-optional-nullable}} {{^required}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } {{/required}} this.{{name}}.put(key, {{name}}Item); @@ -153,7 +189,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isMap}} {{/isReadOnly}} - /** + /** {{#description}} * {{.}} {{/description}} @@ -170,25 +206,33 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#deprecated}} * @deprecated {{/deprecated}} - **/ + */ {{#deprecated}} @Deprecated {{/deprecated}} {{#required}} {{#isNullable}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/isNullable}} {{^isNullable}} - @javax.annotation.Nonnull + @{{javaxPackage}}.annotation.Nonnull {{/isNullable}} {{/required}} {{^required}} - @javax.annotation.Nullable + @{{javaxPackage}}.annotation.Nullable {{/required}} {{#jsonb}} @JsonbProperty("{{baseName}}") {{/jsonb}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} @@ -237,7 +281,23 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isReadOnly}} {{/vars}} + {{#parent}} + {{#readWriteVars}} + {{#isOverridden}} + @Override + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}(JsonNullable.<{{{datatypeWithEnum}}}>of({{name}})); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{/isOverridden}} + {{/readWriteVars}} + {{/parent}} @Override public boolean equals(Object o) { {{#useReflectionEqualsHashCode}} @@ -287,7 +347,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens sb.append(" ").append(toIndentedString(super.toString())).append("\n"); {{/parent}} {{#vars}} - sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); {{/vars}} sb.append("}"); return sb.toString(); @@ -303,7 +363,200 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } return o.toString().replace("\n", "\n "); } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#allVars}} + // add `{{baseName}}` to the URL query string + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{^items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + {{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/items.isModel}} + {{#items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + if ({{getter}}().get(_key) != null) { + joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isModel}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if ({{getter}}() != null) { + joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + {{/allVars}} + return joiner.toString(); + } +{{/supportUrlQuery}} {{#parcelableModel}} public void writeToParcel(Parcel out, int flags) { @@ -363,4 +616,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } }; {{/parcelableModel}} +{{#generateBuilders}} + + {{>javaBuilder}} +{{/generateBuilders}} + } diff --git a/sdks/java-v2/templates/pojo_doc.mustache b/sdks/java-v2/templates/pojo_doc.mustache index 2c4eac3d5..1617ec546 100644 --- a/sdks/java-v2/templates/pojo_doc.mustache +++ b/sdks/java-v2/templates/pojo_doc.mustache @@ -1,22 +1,40 @@ # {{#vendorExtensions.x-is-one-of-interface}}Interface {{/vendorExtensions.x-is-one-of-interface}}{{classname}} +{{^useCustomTemplateCode}} +{{#description}}{{&description}} +{{/description}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{unescapedDescription}} +{{/useCustomTemplateCode}} {{^vendorExtensions.x-is-one-of-interface}} ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +{{^useCustomTemplateCode}} +{{#vars}}|**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} | +{{/vars}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#vars}}| `{{name}}`{{#required}}*_required_{{/required}} | {{#isEnum}}[```{{datatypeWithEnum}}```](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}```{{baseType}}{{#items}}<{{dataType}}>```{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}```Map```{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}```{{dataType}}```{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{#isReadOnly}} [readonly]{{/isReadOnly}} | {{/vars}} +{{/useCustomTemplateCode}} {{#vars}}{{#isEnum}} ## Enum: {{datatypeWithEnum}} -Name | Value +| Name | Value | +{{^useCustomTemplateCode}} +|---- | -----|{{#allowableValues}}{{#enumVars}} +| {{name}} | {{value}} |{{/enumVars}}{{/allowableValues}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ---- | -----{{#allowableValues}}{{#enumVars}} | {{name}} | {{value}} |{{/enumVars}}{{/allowableValues}} +{{/useCustomTemplateCode}} {{/isEnum}}{{/vars}} {{#vendorExtensions.x-implements.0}} diff --git a/sdks/java-v2/templates/pom.mustache b/sdks/java-v2/templates/pom.mustache index 5705ea7df..b733ab9bb 100644 --- a/sdks/java-v2/templates/pom.mustache +++ b/sdks/java-v2/templates/pom.mustache @@ -45,6 +45,8 @@ maven-compiler-plugin 3.8.1 + 1.8 + 1.8 true 128m 512m @@ -80,16 +82,24 @@ maven-surefire-plugin 2.12 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods pertest + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + maven-dependency-plugin @@ -154,33 +164,13 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - {{#java8}} - 1.8 - 1.8 - {{/java8}} - {{^java8}} - 1.7 - 1.7 - {{/java8}} - - org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.3.2 none - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} + 1.8 @@ -232,11 +222,20 @@ + {{#swagger1AnnotationLibrary}} io.swagger swagger-annotations ${swagger-annotations-version} + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} @@ -272,13 +271,22 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-version} + ${jackson-databind-version} + {{^useJakartaEe}} com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider ${jackson-version} + {{/useJakartaEe}} + {{#useJakartaEe}} + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{/useJakartaEe}} {{#withXml}} @@ -296,28 +304,11 @@ ${jackson-version} {{/joda}} - {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} - {{/java8}} - {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - {{/threetenbp}} - {{^java8}} - - - com.brsanthu - migbase64 - 2.2 - - {{/java8}} {{#useBeanValidation}} @@ -352,25 +343,40 @@ - junit - junit + org.junit.jupiter + junit-jupiter-engine ${junit-version} test + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + UTF-8 - 1.6.3 + {{#swagger1AnnotationLibrary}} + 1.6.6 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} 1.19.4 - 2.12.5 - {{#threetenbp}} - 2.9.10 - {{/threetenbp}} + 2.17.1 + 2.17.1 + {{#useJakartaEe}} + 2.1.1 + {{/useJakartaEe}} + {{^useJakartaEe}} 1.3.5 + {{/useJakartaEe}} {{#useBeanValidation}} - 2.0.2 + 3.0.2 {{/useBeanValidation}} 1.0.0 - 4.13.1 + 5.10.2 + 1.10.0 diff --git a/sdks/java-v2/templates/typeInfoAnnotation.mustache b/sdks/java-v2/templates/typeInfoAnnotation.mustache index 63eb42ea5..c21efb490 100644 --- a/sdks/java-v2/templates/typeInfoAnnotation.mustache +++ b/sdks/java-v2/templates/typeInfoAnnotation.mustache @@ -1,6 +1,21 @@ {{#jackson}} +@JsonIgnoreProperties( +{{^useCustomTemplateCode}} + value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + allowSetters = true, // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization + ignoreUnknown = true +{{/useCustomTemplateCode}} +) +{{^useCustomTemplateCode}} +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +{{/useCustomTemplateCode}} {{#discriminator.mappedModels}} {{#-first}} @JsonSubTypes({ @@ -10,7 +25,4 @@ }) {{/-last}} {{/discriminator.mappedModels}} -{{#isClassnameSanitized}} -@JsonTypeName("{{name}}") -{{/isClassnameSanitized}} {{/jackson}} diff --git a/sdks/node/.gitignore b/sdks/node/.gitignore index 78cc8efe1..9954e5824 100644 --- a/sdks/node/.gitignore +++ b/sdks/node/.gitignore @@ -1,10 +1,12 @@ wwwroot/*.js node_modules typings +dist +# CUSTOM - BEGIN test.* *.tgz .openapi-generator - .composer tmp_docs vendor +# CUSTOM - END diff --git a/sdks/node/.prettierrc.cjs b/sdks/node/.prettierrc.cjs new file mode 100644 index 000000000..405eedf4d --- /dev/null +++ b/sdks/node/.prettierrc.cjs @@ -0,0 +1,3 @@ +module.exports = { + plugins: [require.resolve('prettier-plugin-organize-imports')] +}; diff --git a/sdks/node/README.md b/sdks/node/README.md index 0d019cc7a..4aca5d208 100644 --- a/sdks/node/README.md +++ b/sdks/node/README.md @@ -120,6 +120,13 @@ 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 | +| *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 | +| *FaxLineApi* | [**faxLineDelete**](./docs/api/FaxLineApi.md#faxlinedelete) | **DELETE** /fax_line | Delete Fax Line | +| *FaxLineApi* | [**faxLineGet**](./docs/api/FaxLineApi.md#faxlineget) | **GET** /fax_line | Get Fax Line | +| *FaxLineApi* | [**faxLineList**](./docs/api/FaxLineApi.md#faxlinelist) | **GET** /fax_line/list | List Fax Lines | +| *FaxLineApi* | [**faxLineRemoveUser**](./docs/api/FaxLineApi.md#faxlineremoveuser) | **PUT** /fax_line/remove_user | Remove Fax Line Access | | *OAuthApi* | [**oauthTokenGenerate**](./docs/api/OAuthApi.md#oauthtokengenerate) | **POST** /oauth/token | OAuth Token Generate | | *OAuthApi* | [**oauthTokenRefresh**](./docs/api/OAuthApi.md#oauthtokenrefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh | | *ReportApi* | [**reportCreate**](./docs/api/ReportApi.md#reportcreate) | **POST** /report/create | Create Report | @@ -201,6 +208,17 @@ 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) +- [FaxLineAddUserRequest](./docs/model/FaxLineAddUserRequest.md) +- [FaxLineAreaCodeGetCountryEnum](./docs/model/FaxLineAreaCodeGetCountryEnum.md) +- [FaxLineAreaCodeGetProvinceEnum](./docs/model/FaxLineAreaCodeGetProvinceEnum.md) +- [FaxLineAreaCodeGetResponse](./docs/model/FaxLineAreaCodeGetResponse.md) +- [FaxLineAreaCodeGetStateEnum](./docs/model/FaxLineAreaCodeGetStateEnum.md) +- [FaxLineCreateRequest](./docs/model/FaxLineCreateRequest.md) +- [FaxLineDeleteRequest](./docs/model/FaxLineDeleteRequest.md) +- [FaxLineListResponse](./docs/model/FaxLineListResponse.md) +- [FaxLineRemoveUserRequest](./docs/model/FaxLineRemoveUserRequest.md) +- [FaxLineResponse](./docs/model/FaxLineResponse.md) +- [FaxLineResponseFaxLine](./docs/model/FaxLineResponseFaxLine.md) - [FileResponse](./docs/model/FileResponse.md) - [FileResponseDataUri](./docs/model/FileResponseDataUri.md) - [ListInfoResponse](./docs/model/ListInfoResponse.md) diff --git a/sdks/node/VERSION b/sdks/node/VERSION index 6f3dd2f48..78ca9a102 100644 --- a/sdks/node/VERSION +++ b/sdks/node/VERSION @@ -1 +1 @@ -1.5-dev +1.6-dev diff --git a/sdks/node/api/accountApi.ts b/sdks/node/api/accountApi.ts index 200d3567a..8d322b0f9 100644 --- a/sdks/node/api/accountApi.ts +++ b/sdks/node/api/accountApi.ts @@ -22,35 +22,30 @@ * SOFTWARE. */ -import axios, { AxiosError, AxiosRequestConfig } from "axios"; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; -/* tslint:disable:no-unused-locals */ import { - ObjectSerializer, - Authentication, - VoidAuth, - Interceptor, - HttpBasicAuth, - HttpBearerAuth, - ApiKeyAuth, - OAuth, AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, - ErrorResponse, + Authentication, + HttpBasicAuth, + HttpBearerAuth, + Interceptor, + ObjectSerializer, + VoidAuth, } from "../model"; import { + generateFormData, HttpError, optionsI, + queryParamsSerializer, returnTypeT, - returnTypeI, - generateFormData, toFormData, - queryParamsSerializer, USER_AGENT, } from "./"; @@ -64,9 +59,7 @@ export enum AccountApiApiKeys {} export class AccountApi { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - "User-Agent": USER_AGENT, - }; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; protected _useQuerystring: boolean = false; protected authentications = { @@ -92,7 +85,7 @@ export class AccountApi { } set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; } get defaultHeaders() { @@ -137,17 +130,10 @@ export class AccountApi { accountCreateRequest: AccountCreateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - accountCreateRequest !== null && - accountCreateRequest !== undefined && - accountCreateRequest.constructor.name !== "AccountCreateRequest" - ) { - accountCreateRequest = ObjectSerializer.deserialize( - accountCreateRequest, - "AccountCreateRequest" - ); - } - + accountCreateRequest = deserializeIfNeeded( + accountCreateRequest, + "AccountCreateRequest" + ); const localVarPath = this.basePath + "/account/create"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -237,21 +223,12 @@ export class AccountApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "AccountCreateResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "AccountCreateResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -259,32 +236,25 @@ export class AccountApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "AccountCreateResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -380,18 +350,12 @@ export class AccountApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "AccountGetResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "AccountGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -399,32 +363,25 @@ export class AccountApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "AccountGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -444,17 +401,10 @@ export class AccountApi { accountUpdateRequest: AccountUpdateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - accountUpdateRequest !== null && - accountUpdateRequest !== undefined && - accountUpdateRequest.constructor.name !== "AccountUpdateRequest" - ) { - accountUpdateRequest = ObjectSerializer.deserialize( - accountUpdateRequest, - "AccountUpdateRequest" - ); - } - + accountUpdateRequest = deserializeIfNeeded( + accountUpdateRequest, + "AccountUpdateRequest" + ); const localVarPath = this.basePath + "/account"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -543,18 +493,12 @@ export class AccountApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "AccountGetResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "AccountGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -562,32 +506,25 @@ export class AccountApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "AccountGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -607,17 +544,10 @@ export class AccountApi { accountVerifyRequest: AccountVerifyRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - accountVerifyRequest !== null && - accountVerifyRequest !== undefined && - accountVerifyRequest.constructor.name !== "AccountVerifyRequest" - ) { - accountVerifyRequest = ObjectSerializer.deserialize( - accountVerifyRequest, - "AccountVerifyRequest" - ); - } - + accountVerifyRequest = deserializeIfNeeded( + accountVerifyRequest, + "AccountVerifyRequest" + ); const localVarPath = this.basePath + "/account/verify"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -707,21 +637,12 @@ export class AccountApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "AccountVerifyResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "AccountVerifyResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -729,32 +650,25 @@ export class AccountApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "AccountVerifyResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -766,3 +680,73 @@ export class AccountApi { }); } } + +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/apiAppApi.ts b/sdks/node/api/apiAppApi.ts index 6a99af859..b7bb4b961 100644 --- a/sdks/node/api/apiAppApi.ts +++ b/sdks/node/api/apiAppApi.ts @@ -22,33 +22,29 @@ * SOFTWARE. */ -import axios, { AxiosError, AxiosRequestConfig } from "axios"; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; -/* tslint:disable:no-unused-locals */ import { - ObjectSerializer, - Authentication, - VoidAuth, - Interceptor, - HttpBasicAuth, - HttpBearerAuth, - ApiKeyAuth, - OAuth, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppUpdateRequest, - ErrorResponse, + Authentication, + HttpBasicAuth, + HttpBearerAuth, + Interceptor, + ObjectSerializer, + VoidAuth, } from "../model"; import { + generateFormData, HttpError, optionsI, - returnTypeT, + queryParamsSerializer, returnTypeI, - generateFormData, + returnTypeT, toFormData, - queryParamsSerializer, USER_AGENT, } from "./"; @@ -62,9 +58,7 @@ export enum ApiAppApiApiKeys {} export class ApiAppApi { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - "User-Agent": USER_AGENT, - }; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; protected _useQuerystring: boolean = false; protected authentications = { @@ -90,7 +84,7 @@ export class ApiAppApi { } set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; } get defaultHeaders() { @@ -135,17 +129,10 @@ export class ApiAppApi { apiAppCreateRequest: ApiAppCreateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - apiAppCreateRequest !== null && - apiAppCreateRequest !== undefined && - apiAppCreateRequest.constructor.name !== "ApiAppCreateRequest" - ) { - apiAppCreateRequest = ObjectSerializer.deserialize( - apiAppCreateRequest, - "ApiAppCreateRequest" - ); - } - + apiAppCreateRequest = deserializeIfNeeded( + apiAppCreateRequest, + "ApiAppCreateRequest" + ); const localVarPath = this.basePath + "/api_app"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -234,18 +221,12 @@ export class ApiAppApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "ApiAppGetResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "ApiAppGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -253,32 +234,25 @@ export class ApiAppApi { return; } - const response = error.response; - - let body; - - if (response.status === 201) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 201, "ApiAppGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -369,17 +343,7 @@ export class ApiAppApi { return new Promise((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse(resolve, reject, response); }, (error: AxiosError) => { if (error.response == null) { @@ -387,22 +351,14 @@ export class ApiAppApi { return; } - const response = error.response; - - let body; - - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -493,18 +449,12 @@ export class ApiAppApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "ApiAppGetResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "ApiAppGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -512,32 +462,25 @@ export class ApiAppApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "ApiAppGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -632,18 +575,12 @@ export class ApiAppApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "ApiAppListResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "ApiAppListResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -651,32 +588,25 @@ export class ApiAppApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "ApiAppListResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -698,17 +628,10 @@ export class ApiAppApi { apiAppUpdateRequest: ApiAppUpdateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - apiAppUpdateRequest !== null && - apiAppUpdateRequest !== undefined && - apiAppUpdateRequest.constructor.name !== "ApiAppUpdateRequest" - ) { - apiAppUpdateRequest = ObjectSerializer.deserialize( - apiAppUpdateRequest, - "ApiAppUpdateRequest" - ); - } - + apiAppUpdateRequest = deserializeIfNeeded( + apiAppUpdateRequest, + "ApiAppUpdateRequest" + ); const localVarPath = this.basePath + "/api_app/{client_id}".replace( @@ -809,18 +732,12 @@ export class ApiAppApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "ApiAppGetResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "ApiAppGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -828,32 +745,25 @@ export class ApiAppApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "ApiAppGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -864,3 +774,73 @@ export class ApiAppApi { }); } } + +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/apis.ts b/sdks/node/api/apis.ts index 40be80373..5059bbea6 100644 --- a/sdks/node/api/apis.ts +++ b/sdks/node/api/apis.ts @@ -1,17 +1,9 @@ -import { - AttributeTypeMap, - ObjectSerializer, - RequestDetailedFile, -} from "../model"; -import * as http from "http"; -import { AxiosResponse } from "axios"; -import formData from "form-data"; -import Qs from "qs"; +import { ErrorResponse } from "../model"; export class HttpError extends Error { constructor( public response: AxiosResponse, - public body: any, + public body: ErrorResponse, public statusCode?: number ) { super("HTTP request failed"); @@ -19,15 +11,24 @@ export class HttpError extends Error { } } +export { RequestFile } from "../model"; + +import { AxiosResponse } from "axios"; +import formData from "form-data"; +import Qs from "qs"; +import { + AttributeTypeMap, + ObjectSerializer, + RequestDetailedFile, +} from "../model"; + export interface optionsI { headers: { [name: string]: string }; } - export interface returnTypeT { response: AxiosResponse; body: T; } - export interface returnTypeI { response: AxiosResponse; body?: any; @@ -37,9 +38,7 @@ export const queryParamsSerializer = (params) => { return Qs.stringify(params, { arrayFormat: "brackets" }); }; -export { RequestFile } from "../model"; - -export const USER_AGENT = "OpenAPI-Generator/1.5-dev/node"; +export const USER_AGENT = "OpenAPI-Generator/1.6-dev/node"; /** * Generates an object containing form data. diff --git a/sdks/node/api/bulkSendJobApi.ts b/sdks/node/api/bulkSendJobApi.ts index 2a9bfacee..650400586 100644 --- a/sdks/node/api/bulkSendJobApi.ts +++ b/sdks/node/api/bulkSendJobApi.ts @@ -22,31 +22,24 @@ * SOFTWARE. */ -import axios, { AxiosError, AxiosRequestConfig } from "axios"; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; -/* tslint:disable:no-unused-locals */ import { - ObjectSerializer, Authentication, - VoidAuth, - Interceptor, - HttpBasicAuth, - HttpBearerAuth, - ApiKeyAuth, - OAuth, BulkSendJobGetResponse, BulkSendJobListResponse, - ErrorResponse, + HttpBasicAuth, + HttpBearerAuth, + Interceptor, + ObjectSerializer, + VoidAuth, } from "../model"; import { HttpError, optionsI, - returnTypeT, - returnTypeI, - generateFormData, - toFormData, queryParamsSerializer, + returnTypeT, USER_AGENT, } from "./"; @@ -60,9 +53,7 @@ export enum BulkSendJobApiApiKeys {} export class BulkSendJobApi { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - "User-Agent": USER_AGENT, - }; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; protected _useQuerystring: boolean = false; protected authentications = { @@ -88,7 +79,7 @@ export class BulkSendJobApi { } set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; } get defaultHeaders() { @@ -223,21 +214,12 @@ export class BulkSendJobApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "BulkSendJobGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "BulkSendJobGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -245,32 +227,25 @@ export class BulkSendJobApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "BulkSendJobGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -367,21 +342,12 @@ export class BulkSendJobApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "BulkSendJobListResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "BulkSendJobListResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -389,32 +355,25 @@ export class BulkSendJobApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "BulkSendJobListResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -426,3 +385,73 @@ export class BulkSendJobApi { }); } } + +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/embeddedApi.ts b/sdks/node/api/embeddedApi.ts index f7cc6d573..17d3b9615 100644 --- a/sdks/node/api/embeddedApi.ts +++ b/sdks/node/api/embeddedApi.ts @@ -22,32 +22,27 @@ * SOFTWARE. */ -import axios, { AxiosError, AxiosRequestConfig } from "axios"; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; -/* tslint:disable:no-unused-locals */ import { - ObjectSerializer, Authentication, - VoidAuth, - Interceptor, - HttpBasicAuth, - HttpBearerAuth, - ApiKeyAuth, - OAuth, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedSignUrlResponse, - ErrorResponse, + HttpBasicAuth, + HttpBearerAuth, + Interceptor, + ObjectSerializer, + VoidAuth, } from "../model"; import { + generateFormData, HttpError, optionsI, + queryParamsSerializer, returnTypeT, - returnTypeI, - generateFormData, toFormData, - queryParamsSerializer, USER_AGENT, } from "./"; @@ -61,9 +56,7 @@ export enum EmbeddedApiApiKeys {} export class EmbeddedApi { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - "User-Agent": USER_AGENT, - }; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; protected _useQuerystring: boolean = false; protected authentications = { @@ -89,7 +82,7 @@ export class EmbeddedApi { } set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; } get defaultHeaders() { @@ -136,17 +129,10 @@ export class EmbeddedApi { embeddedEditUrlRequest: EmbeddedEditUrlRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - embeddedEditUrlRequest !== null && - embeddedEditUrlRequest !== undefined && - embeddedEditUrlRequest.constructor.name !== "EmbeddedEditUrlRequest" - ) { - embeddedEditUrlRequest = ObjectSerializer.deserialize( - embeddedEditUrlRequest, - "EmbeddedEditUrlRequest" - ); - } - + embeddedEditUrlRequest = deserializeIfNeeded( + embeddedEditUrlRequest, + "EmbeddedEditUrlRequest" + ); const localVarPath = this.basePath + "/embedded/edit_url/{template_id}".replace( @@ -251,21 +237,12 @@ export class EmbeddedApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "EmbeddedEditUrlResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "EmbeddedEditUrlResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -273,32 +250,25 @@ export class EmbeddedApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "EmbeddedEditUrlResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -391,21 +361,12 @@ export class EmbeddedApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "EmbeddedSignUrlResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "EmbeddedSignUrlResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -413,32 +374,25 @@ export class EmbeddedApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "EmbeddedSignUrlResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -450,3 +404,73 @@ export class EmbeddedApi { }); } } + +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/faxLineApi.ts b/sdks/node/api/faxLineApi.ts new file mode 100644 index 000000000..634f6149a --- /dev/null +++ b/sdks/node/api/faxLineApi.ts @@ -0,0 +1,1206 @@ +/** + * 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, + FaxLineAddUserRequest, + FaxLineAreaCodeGetResponse, + FaxLineCreateRequest, + FaxLineDeleteRequest, + FaxLineListResponse, + FaxLineRemoveUserRequest, + FaxLineResponse, + 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 FaxLineApiApiKeys {} + +export class FaxLineApi { + 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); + } + + /** + * Grants a user access to the specified Fax Line. + * @summary Add Fax Line User + * @param faxLineAddUserRequest + * @param options + */ + public async faxLineAddUser( + faxLineAddUserRequest: FaxLineAddUserRequest, + options: optionsI = { headers: {} } + ): Promise> { + faxLineAddUserRequest = deserializeIfNeeded( + faxLineAddUserRequest, + "FaxLineAddUserRequest" + ); + const localVarPath = this.basePath + "/fax_line/add_user"; + 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 'faxLineAddUserRequest' is not null or undefined + if (faxLineAddUserRequest === null || faxLineAddUserRequest === undefined) { + 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 formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + faxLineAddUserRequest, + "FaxLineAddUserRequest" + ); + } + + let localVarRequestOptions: AxiosRequestConfig = { + method: "PUT", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + 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, + "FaxLineResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxLineResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + }); + }); + } + /** + * Returns a response with the area codes available for a given state/provice and city. + * @summary Get Available Fax Line Area Codes + * @param country Filter area codes by country. + * @param state Filter area codes by state. + * @param province Filter area codes by province. + * @param city Filter area codes by city. + * @param options + */ + public async faxLineAreaCodeGet( + country: "CA" | "US" | "UK", + 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", + province?: + | "AB" + | "BC" + | "MB" + | "NB" + | "NL" + | "NT" + | "NS" + | "NU" + | "ON" + | "PE" + | "QC" + | "SK" + | "YT", + city?: string, + options: optionsI = { headers: {} } + ): Promise> { + const localVarPath = this.basePath + "/fax_line/area_codes"; + 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 'country' is not null or undefined + if (country === null || country === undefined) { + throw new Error( + "Required parameter country was null or undefined when calling faxLineAreaCodeGet." + ); + } + + if (country !== undefined) { + localVarQueryParameters["country"] = ObjectSerializer.serialize( + country, + "'CA' | 'US' | 'UK'" + ); + } + + if (state !== undefined) { + 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 !== undefined) { + localVarQueryParameters["province"] = ObjectSerializer.serialize( + province, + "'AB' | 'BC' | 'MB' | 'NB' | 'NL' | 'NT' | 'NS' | 'NU' | 'ON' | 'PE' | 'QC' | 'SK' | 'YT'" + ); + } + + if (city !== undefined) { + localVarQueryParameters["city"] = ObjectSerializer.serialize( + city, + "string" + ); + } + + (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, + "FaxLineAreaCodeGetResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxLineAreaCodeGetResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + } + ); + }); + } + /** + * Purchases a new Fax Line. + * @summary Purchase Fax Line + * @param faxLineCreateRequest + * @param options + */ + public async faxLineCreate( + faxLineCreateRequest: FaxLineCreateRequest, + options: optionsI = { headers: {} } + ): Promise> { + faxLineCreateRequest = deserializeIfNeeded( + faxLineCreateRequest, + "FaxLineCreateRequest" + ); + const localVarPath = this.basePath + "/fax_line/create"; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + // give precedence to 'application/json' + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams: any = {}; + let localVarBodyParams: any = undefined; + + // verify required parameter 'faxLineCreateRequest' is not null or undefined + if (faxLineCreateRequest === null || faxLineCreateRequest === undefined) { + throw new Error( + "Required parameter faxLineCreateRequest was null or undefined when calling faxLineCreate." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + faxLineCreateRequest, + FaxLineCreateRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + faxLineCreateRequest, + "FaxLineCreateRequest" + ); + } + + 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, + "FaxLineResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxLineResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + }); + }); + } + /** + * Deletes the specified Fax Line from the subscription. + * @summary Delete Fax Line + * @param faxLineDeleteRequest + * @param options + */ + public async faxLineDelete( + faxLineDeleteRequest: FaxLineDeleteRequest, + options: optionsI = { headers: {} } + ): Promise { + faxLineDeleteRequest = deserializeIfNeeded( + faxLineDeleteRequest, + "FaxLineDeleteRequest" + ); + const localVarPath = this.basePath + "/fax_line"; + 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 'faxLineDeleteRequest' is not null or undefined + if (faxLineDeleteRequest === null || faxLineDeleteRequest === undefined) { + throw new Error( + "Required parameter faxLineDeleteRequest was null or undefined when calling faxLineDelete." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + faxLineDeleteRequest, + FaxLineDeleteRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + faxLineDeleteRequest, + "FaxLineDeleteRequest" + ); + } + + let localVarRequestOptions: AxiosRequestConfig = { + method: "DELETE", + 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); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + }); + }); + } + /** + * Returns the properties and settings of a Fax Line. + * @summary Get Fax Line + * @param number The Fax Line number. + * @param options + */ + public async faxLineGet( + number: string, + options: optionsI = { headers: {} } + ): Promise> { + const localVarPath = this.basePath + "/fax_line"; + 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 'number' is not null or undefined + if (number === null || number === undefined) { + throw new Error( + "Required parameter number was null or undefined when calling faxLineGet." + ); + } + + if (number !== undefined) { + localVarQueryParameters["number"] = ObjectSerializer.serialize( + number, + "string" + ); + } + + (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, + "FaxLineResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxLineResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + }); + }); + } + /** + * Returns the properties and settings of multiple Fax Lines. + * @summary List Fax Lines + * @param accountId Account ID + * @param page Page + * @param pageSize Page size + * @param showTeamLines Show team lines + * @param options + */ + public async faxLineList( + accountId?: string, + page?: number, + pageSize?: number, + showTeamLines?: boolean, + options: optionsI = { headers: {} } + ): Promise> { + const localVarPath = this.basePath + "/fax_line/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 (accountId !== undefined) { + localVarQueryParameters["account_id"] = ObjectSerializer.serialize( + accountId, + "string" + ); + } + + if (page !== undefined) { + localVarQueryParameters["page"] = ObjectSerializer.serialize( + page, + "number" + ); + } + + if (pageSize !== undefined) { + localVarQueryParameters["page_size"] = ObjectSerializer.serialize( + pageSize, + "number" + ); + } + + if (showTeamLines !== undefined) { + localVarQueryParameters["show_team_lines"] = ObjectSerializer.serialize( + showTeamLines, + "boolean" + ); + } + + (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, + "FaxLineListResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxLineListResponse" + ) + ) { + return; + } + + if ( + handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + ) + ) { + return; + } + + reject(error); + } + ); + } + ); + }); + } + /** + * Removes a user\'s access to the specified Fax Line. + * @summary Remove Fax Line Access + * @param faxLineRemoveUserRequest + * @param options + */ + public async faxLineRemoveUser( + faxLineRemoveUserRequest: FaxLineRemoveUserRequest, + options: optionsI = { headers: {} } + ): Promise> { + faxLineRemoveUserRequest = deserializeIfNeeded( + faxLineRemoveUserRequest, + "FaxLineRemoveUserRequest" + ); + const localVarPath = this.basePath + "/fax_line/remove_user"; + 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 'faxLineRemoveUserRequest' is not null or undefined + if ( + faxLineRemoveUserRequest === null || + faxLineRemoveUserRequest === undefined + ) { + throw new Error( + "Required parameter faxLineRemoveUserRequest was null or undefined when calling faxLineRemoveUser." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + const result = generateFormData( + faxLineRemoveUserRequest, + FaxLineRemoveUserRequest.attributeTypeMap + ); + localVarUseFormData = result.localVarUseFormData; + + let data = {}; + if (localVarUseFormData) { + const formData = toFormData(result.data); + data = formData; + localVarHeaderParams = { + ...localVarHeaderParams, + ...formData.getHeaders(), + }; + } else { + data = ObjectSerializer.serialize( + faxLineRemoveUserRequest, + "FaxLineRemoveUserRequest" + ); + } + + let localVarRequestOptions: AxiosRequestConfig = { + method: "PUT", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring + ? queryParamsSerializer + : undefined, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + 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, + "FaxLineResponse" + ); + }, + (error: AxiosError) => { + if (error.response == null) { + reject(error); + return; + } + + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "FaxLineResponse" + ) + ) { + 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 fa778faf6..1304b009a 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 { FaxLineApi } from "./faxLineApi"; import { OAuthApi } from "./oAuthApi"; import { ReportApi } from "./reportApi"; import { SignatureRequestApi } from "./signatureRequestApi"; @@ -14,6 +15,7 @@ export { ApiAppApi, BulkSendJobApi, EmbeddedApi, + FaxLineApi, OAuthApi, ReportApi, SignatureRequestApi, @@ -23,13 +25,13 @@ export { }; export { + generateFormData, HttpError, optionsI, - returnTypeT, + queryParamsSerializer, returnTypeI, - generateFormData, + returnTypeT, toFormData, - queryParamsSerializer, USER_AGENT, } from "./apis"; @@ -38,6 +40,7 @@ export const APIS = [ ApiAppApi, BulkSendJobApi, EmbeddedApi, + FaxLineApi, OAuthApi, ReportApi, SignatureRequestApi, diff --git a/sdks/node/api/oAuthApi.ts b/sdks/node/api/oAuthApi.ts index 0b2ecde87..c1b080359 100644 --- a/sdks/node/api/oAuthApi.ts +++ b/sdks/node/api/oAuthApi.ts @@ -22,31 +22,27 @@ * SOFTWARE. */ -import axios, { AxiosError, AxiosRequestConfig } from "axios"; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; -/* tslint:disable:no-unused-locals */ import { - ObjectSerializer, Authentication, - VoidAuth, - Interceptor, HttpBasicAuth, HttpBearerAuth, - ApiKeyAuth, - OAuth, + Interceptor, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, + ObjectSerializer, + VoidAuth, } from "../model"; import { + generateFormData, HttpError, optionsI, + queryParamsSerializer, returnTypeT, - returnTypeI, - generateFormData, toFormData, - queryParamsSerializer, USER_AGENT, } from "./"; @@ -60,9 +56,7 @@ export enum OAuthApiApiKeys {} export class OAuthApi { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - "User-Agent": USER_AGENT, - }; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; protected _useQuerystring: boolean = false; protected authentications = { @@ -88,7 +82,7 @@ export class OAuthApi { } set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; } get defaultHeaders() { @@ -133,17 +127,10 @@ export class OAuthApi { oAuthTokenGenerateRequest: OAuthTokenGenerateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - oAuthTokenGenerateRequest !== null && - oAuthTokenGenerateRequest !== undefined && - oAuthTokenGenerateRequest.constructor.name !== "OAuthTokenGenerateRequest" - ) { - oAuthTokenGenerateRequest = ObjectSerializer.deserialize( - oAuthTokenGenerateRequest, - "OAuthTokenGenerateRequest" - ); - } - + oAuthTokenGenerateRequest = deserializeIfNeeded( + oAuthTokenGenerateRequest, + "OAuthTokenGenerateRequest" + ); const localVarPath = this.basePath + "/oauth/token"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -225,18 +212,12 @@ export class OAuthApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "OAuthTokenResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "OAuthTokenResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -244,17 +225,14 @@ export class OAuthApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "OAuthTokenResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -274,17 +252,10 @@ export class OAuthApi { oAuthTokenRefreshRequest: OAuthTokenRefreshRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - oAuthTokenRefreshRequest !== null && - oAuthTokenRefreshRequest !== undefined && - oAuthTokenRefreshRequest.constructor.name !== "OAuthTokenRefreshRequest" - ) { - oAuthTokenRefreshRequest = ObjectSerializer.deserialize( - oAuthTokenRefreshRequest, - "OAuthTokenRefreshRequest" - ); - } - + oAuthTokenRefreshRequest = deserializeIfNeeded( + oAuthTokenRefreshRequest, + "OAuthTokenRefreshRequest" + ); const localVarPath = this.basePath + "/oauth/token?refresh"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -366,18 +337,12 @@ export class OAuthApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "OAuthTokenResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "OAuthTokenResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -385,17 +350,14 @@ export class OAuthApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "OAuthTokenResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -406,3 +368,73 @@ export class OAuthApi { }); } } + +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/reportApi.ts b/sdks/node/api/reportApi.ts index 46ce8cb4a..94eea7973 100644 --- a/sdks/node/api/reportApi.ts +++ b/sdks/node/api/reportApi.ts @@ -22,31 +22,26 @@ * SOFTWARE. */ -import axios, { AxiosError, AxiosRequestConfig } from "axios"; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; -/* tslint:disable:no-unused-locals */ import { - ObjectSerializer, Authentication, - VoidAuth, - Interceptor, HttpBasicAuth, HttpBearerAuth, - ApiKeyAuth, - OAuth, - ErrorResponse, + Interceptor, + ObjectSerializer, ReportCreateRequest, ReportCreateResponse, + VoidAuth, } from "../model"; import { + generateFormData, HttpError, optionsI, + queryParamsSerializer, returnTypeT, - returnTypeI, - generateFormData, toFormData, - queryParamsSerializer, USER_AGENT, } from "./"; @@ -60,9 +55,7 @@ export enum ReportApiApiKeys {} export class ReportApi { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - "User-Agent": USER_AGENT, - }; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; protected _useQuerystring: boolean = false; protected authentications = { @@ -88,7 +81,7 @@ export class ReportApi { } set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; } get defaultHeaders() { @@ -133,17 +126,10 @@ export class ReportApi { reportCreateRequest: ReportCreateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - reportCreateRequest !== null && - reportCreateRequest !== undefined && - reportCreateRequest.constructor.name !== "ReportCreateRequest" - ) { - reportCreateRequest = ObjectSerializer.deserialize( - reportCreateRequest, - "ReportCreateRequest" - ); - } - + reportCreateRequest = deserializeIfNeeded( + reportCreateRequest, + "ReportCreateRequest" + ); const localVarPath = this.basePath + "/report/create"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -228,21 +214,12 @@ export class ReportApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "ReportCreateResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "ReportCreateResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -250,32 +227,25 @@ export class ReportApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "ReportCreateResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -287,3 +257,73 @@ export class ReportApi { }); } } + +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/signatureRequestApi.ts b/sdks/node/api/signatureRequestApi.ts index 5e5677ffa..51ccd93bf 100644 --- a/sdks/node/api/signatureRequestApi.ts +++ b/sdks/node/api/signatureRequestApi.ts @@ -22,22 +22,17 @@ * SOFTWARE. */ -import axios, { AxiosError, AxiosRequestConfig } from "axios"; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; -/* tslint:disable:no-unused-locals */ import { - ObjectSerializer, Authentication, - VoidAuth, - Interceptor, - HttpBasicAuth, - HttpBearerAuth, - ApiKeyAuth, - OAuth, BulkSendJobSendResponse, - ErrorResponse, FileResponse, FileResponseDataUri, + HttpBasicAuth, + HttpBearerAuth, + Interceptor, + ObjectSerializer, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, @@ -48,16 +43,17 @@ import { SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest, + VoidAuth, } from "../model"; import { + generateFormData, HttpError, optionsI, - returnTypeT, + queryParamsSerializer, returnTypeI, - generateFormData, + returnTypeT, toFormData, - queryParamsSerializer, USER_AGENT, } from "./"; @@ -71,9 +67,7 @@ export enum SignatureRequestApiApiKeys {} export class SignatureRequestApi { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - "User-Agent": USER_AGENT, - }; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; protected _useQuerystring: boolean = false; protected authentications = { @@ -99,7 +93,7 @@ export class SignatureRequestApi { } set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; } get defaultHeaders() { @@ -144,19 +138,10 @@ export class SignatureRequestApi { signatureRequestBulkCreateEmbeddedWithTemplateRequest: SignatureRequestBulkCreateEmbeddedWithTemplateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - signatureRequestBulkCreateEmbeddedWithTemplateRequest !== null && - signatureRequestBulkCreateEmbeddedWithTemplateRequest !== undefined && - signatureRequestBulkCreateEmbeddedWithTemplateRequest.constructor.name !== - "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" - ) { - signatureRequestBulkCreateEmbeddedWithTemplateRequest = - ObjectSerializer.deserialize( - signatureRequestBulkCreateEmbeddedWithTemplateRequest, - "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" - ); - } - + signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded( + signatureRequestBulkCreateEmbeddedWithTemplateRequest, + "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" + ); const localVarPath = this.basePath + "/signature_request/bulk_create_embedded_with_template"; let localVarQueryParameters: any = {}; @@ -245,21 +230,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "BulkSendJobSendResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "BulkSendJobSendResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -267,32 +243,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "BulkSendJobSendResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -313,19 +282,10 @@ export class SignatureRequestApi { signatureRequestBulkSendWithTemplateRequest: SignatureRequestBulkSendWithTemplateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - signatureRequestBulkSendWithTemplateRequest !== null && - signatureRequestBulkSendWithTemplateRequest !== undefined && - signatureRequestBulkSendWithTemplateRequest.constructor.name !== - "SignatureRequestBulkSendWithTemplateRequest" - ) { - signatureRequestBulkSendWithTemplateRequest = - ObjectSerializer.deserialize( - signatureRequestBulkSendWithTemplateRequest, - "SignatureRequestBulkSendWithTemplateRequest" - ); - } - + signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded( + signatureRequestBulkSendWithTemplateRequest, + "SignatureRequestBulkSendWithTemplateRequest" + ); const localVarPath = this.basePath + "/signature_request/bulk_send_with_template"; let localVarQueryParameters: any = {}; @@ -419,21 +379,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "BulkSendJobSendResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "BulkSendJobSendResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -441,32 +392,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "BulkSendJobSendResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -558,17 +502,7 @@ export class SignatureRequestApi { return new Promise((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse(resolve, reject, response); }, (error: AxiosError) => { if (error.response == null) { @@ -576,22 +510,14 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -611,18 +537,10 @@ export class SignatureRequestApi { signatureRequestCreateEmbeddedRequest: SignatureRequestCreateEmbeddedRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - signatureRequestCreateEmbeddedRequest !== null && - signatureRequestCreateEmbeddedRequest !== undefined && - signatureRequestCreateEmbeddedRequest.constructor.name !== - "SignatureRequestCreateEmbeddedRequest" - ) { - signatureRequestCreateEmbeddedRequest = ObjectSerializer.deserialize( - signatureRequestCreateEmbeddedRequest, - "SignatureRequestCreateEmbeddedRequest" - ); - } - + signatureRequestCreateEmbeddedRequest = deserializeIfNeeded( + signatureRequestCreateEmbeddedRequest, + "SignatureRequestCreateEmbeddedRequest" + ); const localVarPath = this.basePath + "/signature_request/create_embedded"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -715,21 +633,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -737,32 +646,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "SignatureRequestGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -783,19 +685,10 @@ export class SignatureRequestApi { signatureRequestCreateEmbeddedWithTemplateRequest: SignatureRequestCreateEmbeddedWithTemplateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - signatureRequestCreateEmbeddedWithTemplateRequest !== null && - signatureRequestCreateEmbeddedWithTemplateRequest !== undefined && - signatureRequestCreateEmbeddedWithTemplateRequest.constructor.name !== - "SignatureRequestCreateEmbeddedWithTemplateRequest" - ) { - signatureRequestCreateEmbeddedWithTemplateRequest = - ObjectSerializer.deserialize( - signatureRequestCreateEmbeddedWithTemplateRequest, - "SignatureRequestCreateEmbeddedWithTemplateRequest" - ); - } - + signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded( + signatureRequestCreateEmbeddedWithTemplateRequest, + "SignatureRequestCreateEmbeddedWithTemplateRequest" + ); const localVarPath = this.basePath + "/signature_request/create_embedded_with_template"; let localVarQueryParameters: any = {}; @@ -889,21 +782,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -911,32 +795,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "SignatureRequestGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1037,18 +914,12 @@ export class SignatureRequestApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "Buffer"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "Buffer" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1056,29 +927,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize(response.data, "RequestFile"); - - reject(new HttpError(response, body, response.status)); + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "RequestFile" + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1170,21 +1037,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "FileResponseDataUri" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "FileResponseDataUri" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1192,32 +1050,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "FileResponseDataUri" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1318,18 +1169,12 @@ export class SignatureRequestApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "FileResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "FileResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1337,32 +1182,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "FileResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1454,21 +1292,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1476,32 +1305,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "SignatureRequestGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1616,21 +1438,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestListResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestListResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1638,32 +1451,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "SignatureRequestListResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1756,21 +1562,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1778,32 +1575,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "SignatureRequestGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1826,18 +1616,10 @@ export class SignatureRequestApi { signatureRequestRemindRequest: SignatureRequestRemindRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - signatureRequestRemindRequest !== null && - signatureRequestRemindRequest !== undefined && - signatureRequestRemindRequest.constructor.name !== - "SignatureRequestRemindRequest" - ) { - signatureRequestRemindRequest = ObjectSerializer.deserialize( - signatureRequestRemindRequest, - "SignatureRequestRemindRequest" - ); - } - + signatureRequestRemindRequest = deserializeIfNeeded( + signatureRequestRemindRequest, + "SignatureRequestRemindRequest" + ); const localVarPath = this.basePath + "/signature_request/remind/{signature_request_id}".replace( @@ -1942,21 +1724,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1964,32 +1737,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "SignatureRequestGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -2076,17 +1842,7 @@ export class SignatureRequestApi { return new Promise((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse(resolve, reject, response); }, (error: AxiosError) => { if (error.response == null) { @@ -2094,22 +1850,14 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -2129,18 +1877,10 @@ export class SignatureRequestApi { signatureRequestSendRequest: SignatureRequestSendRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - signatureRequestSendRequest !== null && - signatureRequestSendRequest !== undefined && - signatureRequestSendRequest.constructor.name !== - "SignatureRequestSendRequest" - ) { - signatureRequestSendRequest = ObjectSerializer.deserialize( - signatureRequestSendRequest, - "SignatureRequestSendRequest" - ); - } - + signatureRequestSendRequest = deserializeIfNeeded( + signatureRequestSendRequest, + "SignatureRequestSendRequest" + ); const localVarPath = this.basePath + "/signature_request/send"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -2233,21 +1973,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -2255,32 +1986,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "SignatureRequestGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -2301,18 +2025,10 @@ export class SignatureRequestApi { signatureRequestSendWithTemplateRequest: SignatureRequestSendWithTemplateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - signatureRequestSendWithTemplateRequest !== null && - signatureRequestSendWithTemplateRequest !== undefined && - signatureRequestSendWithTemplateRequest.constructor.name !== - "SignatureRequestSendWithTemplateRequest" - ) { - signatureRequestSendWithTemplateRequest = ObjectSerializer.deserialize( - signatureRequestSendWithTemplateRequest, - "SignatureRequestSendWithTemplateRequest" - ); - } - + signatureRequestSendWithTemplateRequest = deserializeIfNeeded( + signatureRequestSendWithTemplateRequest, + "SignatureRequestSendWithTemplateRequest" + ); const localVarPath = this.basePath + "/signature_request/send_with_template"; let localVarQueryParameters: any = {}; @@ -2406,21 +2122,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -2428,32 +2135,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "SignatureRequestGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -2476,18 +2176,10 @@ export class SignatureRequestApi { signatureRequestUpdateRequest: SignatureRequestUpdateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - signatureRequestUpdateRequest !== null && - signatureRequestUpdateRequest !== undefined && - signatureRequestUpdateRequest.constructor.name !== - "SignatureRequestUpdateRequest" - ) { - signatureRequestUpdateRequest = ObjectSerializer.deserialize( - signatureRequestUpdateRequest, - "SignatureRequestUpdateRequest" - ); - } - + signatureRequestUpdateRequest = deserializeIfNeeded( + signatureRequestUpdateRequest, + "SignatureRequestUpdateRequest" + ); const localVarPath = this.basePath + "/signature_request/update/{signature_request_id}".replace( @@ -2592,21 +2284,12 @@ export class SignatureRequestApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -2614,32 +2297,25 @@ export class SignatureRequestApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "SignatureRequestGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -2651,3 +2327,73 @@ export class SignatureRequestApi { }); } } + +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/teamApi.ts b/sdks/node/api/teamApi.ts index 5eedd533f..d912160c9 100644 --- a/sdks/node/api/teamApi.ts +++ b/sdks/node/api/teamApi.ts @@ -22,19 +22,14 @@ * SOFTWARE. */ -import axios, { AxiosError, AxiosRequestConfig } from "axios"; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; -/* tslint:disable:no-unused-locals */ import { - ObjectSerializer, Authentication, - VoidAuth, - Interceptor, HttpBasicAuth, HttpBearerAuth, - ApiKeyAuth, - OAuth, - ErrorResponse, + Interceptor, + ObjectSerializer, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, @@ -44,16 +39,17 @@ import { TeamRemoveMemberRequest, TeamSubTeamsResponse, TeamUpdateRequest, + VoidAuth, } from "../model"; import { + generateFormData, HttpError, optionsI, - returnTypeT, + queryParamsSerializer, returnTypeI, - generateFormData, + returnTypeT, toFormData, - queryParamsSerializer, USER_AGENT, } from "./"; @@ -67,9 +63,7 @@ export enum TeamApiApiKeys {} export class TeamApi { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - "User-Agent": USER_AGENT, - }; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; protected _useQuerystring: boolean = false; protected authentications = { @@ -95,7 +89,7 @@ export class TeamApi { } set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; } get defaultHeaders() { @@ -142,17 +136,10 @@ export class TeamApi { teamId?: string, options: optionsI = { headers: {} } ): Promise> { - if ( - teamAddMemberRequest !== null && - teamAddMemberRequest !== undefined && - teamAddMemberRequest.constructor.name !== "TeamAddMemberRequest" - ) { - teamAddMemberRequest = ObjectSerializer.deserialize( - teamAddMemberRequest, - "TeamAddMemberRequest" - ); - } - + teamAddMemberRequest = deserializeIfNeeded( + teamAddMemberRequest, + "TeamAddMemberRequest" + ); const localVarPath = this.basePath + "/team/add_member"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -248,18 +235,12 @@ export class TeamApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "TeamGetResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TeamGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -267,32 +248,25 @@ export class TeamApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TeamGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -312,17 +286,10 @@ export class TeamApi { teamCreateRequest: TeamCreateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - teamCreateRequest !== null && - teamCreateRequest !== undefined && - teamCreateRequest.constructor.name !== "TeamCreateRequest" - ) { - teamCreateRequest = ObjectSerializer.deserialize( - teamCreateRequest, - "TeamCreateRequest" - ); - } - + teamCreateRequest = deserializeIfNeeded( + teamCreateRequest, + "TeamCreateRequest" + ); const localVarPath = this.basePath + "/team/create"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -408,18 +375,12 @@ export class TeamApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "TeamGetResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TeamGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -427,32 +388,25 @@ export class TeamApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TeamGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -529,17 +483,7 @@ export class TeamApi { return new Promise((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse(resolve, reject, response); }, (error: AxiosError) => { if (error.response == null) { @@ -547,22 +491,14 @@ export class TeamApi { return; } - const response = error.response; - - let body; - - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -639,18 +575,12 @@ export class TeamApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "TeamGetResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TeamGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -658,32 +588,25 @@ export class TeamApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TeamGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -770,21 +693,12 @@ export class TeamApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TeamGetInfoResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TeamGetInfoResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -792,32 +706,25 @@ export class TeamApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TeamGetInfoResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -905,21 +812,12 @@ export class TeamApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TeamInvitesResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TeamInvitesResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -927,32 +825,25 @@ export class TeamApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TeamInvitesResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1063,21 +954,12 @@ export class TeamApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TeamMembersResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TeamMembersResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1085,32 +967,25 @@ export class TeamApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TeamMembersResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1131,17 +1006,10 @@ export class TeamApi { teamRemoveMemberRequest: TeamRemoveMemberRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - teamRemoveMemberRequest !== null && - teamRemoveMemberRequest !== undefined && - teamRemoveMemberRequest.constructor.name !== "TeamRemoveMemberRequest" - ) { - teamRemoveMemberRequest = ObjectSerializer.deserialize( - teamRemoveMemberRequest, - "TeamRemoveMemberRequest" - ); - } - + teamRemoveMemberRequest = deserializeIfNeeded( + teamRemoveMemberRequest, + "TeamRemoveMemberRequest" + ); const localVarPath = this.basePath + "/team/remove_member"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -1233,18 +1101,12 @@ export class TeamApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "TeamGetResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TeamGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1252,32 +1114,25 @@ export class TeamApi { return; } - const response = error.response; - - let body; - - if (response.status === 201) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 201, "TeamGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1387,21 +1242,12 @@ export class TeamApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TeamSubTeamsResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TeamSubTeamsResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1409,32 +1255,25 @@ export class TeamApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TeamSubTeamsResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1455,17 +1294,10 @@ export class TeamApi { teamUpdateRequest: TeamUpdateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - teamUpdateRequest !== null && - teamUpdateRequest !== undefined && - teamUpdateRequest.constructor.name !== "TeamUpdateRequest" - ) { - teamUpdateRequest = ObjectSerializer.deserialize( - teamUpdateRequest, - "TeamUpdateRequest" - ); - } - + teamUpdateRequest = deserializeIfNeeded( + teamUpdateRequest, + "TeamUpdateRequest" + ); const localVarPath = this.basePath + "/team"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -1551,18 +1383,12 @@ export class TeamApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "TeamGetResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TeamGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1570,32 +1396,25 @@ export class TeamApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TeamGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1606,3 +1425,73 @@ export class TeamApi { }); } } + +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/templateApi.ts b/sdks/node/api/templateApi.ts index 6cebb7592..50ff0b4e7 100644 --- a/sdks/node/api/templateApi.ts +++ b/sdks/node/api/templateApi.ts @@ -22,21 +22,16 @@ * SOFTWARE. */ -import axios, { AxiosError, AxiosRequestConfig } from "axios"; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; -/* tslint:disable:no-unused-locals */ import { - ObjectSerializer, Authentication, - VoidAuth, - Interceptor, - HttpBasicAuth, - HttpBearerAuth, - ApiKeyAuth, - OAuth, - ErrorResponse, FileResponse, FileResponseDataUri, + HttpBasicAuth, + HttpBearerAuth, + Interceptor, + ObjectSerializer, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, @@ -47,16 +42,17 @@ import { TemplateRemoveUserRequest, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse, + VoidAuth, } from "../model"; import { + generateFormData, HttpError, optionsI, - returnTypeT, + queryParamsSerializer, returnTypeI, - generateFormData, + returnTypeT, toFormData, - queryParamsSerializer, USER_AGENT, } from "./"; @@ -70,9 +66,7 @@ export enum TemplateApiApiKeys {} export class TemplateApi { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - "User-Agent": USER_AGENT, - }; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; protected _useQuerystring: boolean = false; protected authentications = { @@ -98,7 +92,7 @@ export class TemplateApi { } set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; } get defaultHeaders() { @@ -145,17 +139,10 @@ export class TemplateApi { templateAddUserRequest: TemplateAddUserRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - templateAddUserRequest !== null && - templateAddUserRequest !== undefined && - templateAddUserRequest.constructor.name !== "TemplateAddUserRequest" - ) { - templateAddUserRequest = ObjectSerializer.deserialize( - templateAddUserRequest, - "TemplateAddUserRequest" - ); - } - + templateAddUserRequest = deserializeIfNeeded( + templateAddUserRequest, + "TemplateAddUserRequest" + ); const localVarPath = this.basePath + "/template/add_user/{template_id}".replace( @@ -260,21 +247,12 @@ export class TemplateApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TemplateGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TemplateGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -282,32 +260,25 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TemplateGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -328,17 +299,10 @@ export class TemplateApi { templateCreateRequest: TemplateCreateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - templateCreateRequest !== null && - templateCreateRequest !== undefined && - templateCreateRequest.constructor.name !== "TemplateCreateRequest" - ) { - templateCreateRequest = ObjectSerializer.deserialize( - templateCreateRequest, - "TemplateCreateRequest" - ); - } - + templateCreateRequest = deserializeIfNeeded( + templateCreateRequest, + "TemplateCreateRequest" + ); const localVarPath = this.basePath + "/template/create"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -428,21 +392,12 @@ export class TemplateApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TemplateCreateResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TemplateCreateResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -450,32 +405,25 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TemplateCreateResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -496,18 +444,10 @@ export class TemplateApi { templateCreateEmbeddedDraftRequest: TemplateCreateEmbeddedDraftRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - templateCreateEmbeddedDraftRequest !== null && - templateCreateEmbeddedDraftRequest !== undefined && - templateCreateEmbeddedDraftRequest.constructor.name !== - "TemplateCreateEmbeddedDraftRequest" - ) { - templateCreateEmbeddedDraftRequest = ObjectSerializer.deserialize( - templateCreateEmbeddedDraftRequest, - "TemplateCreateEmbeddedDraftRequest" - ); - } - + templateCreateEmbeddedDraftRequest = deserializeIfNeeded( + templateCreateEmbeddedDraftRequest, + "TemplateCreateEmbeddedDraftRequest" + ); const localVarPath = this.basePath + "/template/create_embedded_draft"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -600,21 +540,12 @@ export class TemplateApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TemplateCreateEmbeddedDraftResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TemplateCreateEmbeddedDraftResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -622,32 +553,25 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TemplateCreateEmbeddedDraftResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -739,17 +663,7 @@ export class TemplateApi { return new Promise((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse(resolve, reject, response); }, (error: AxiosError) => { if (error.response == null) { @@ -757,22 +671,14 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -872,18 +778,12 @@ export class TemplateApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "Buffer"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "Buffer" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -891,29 +791,25 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize(response.data, "RequestFile"); - - reject(new HttpError(response, body, response.status)); + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, + "RequestFile" + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1005,21 +901,12 @@ export class TemplateApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "FileResponseDataUri" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "FileResponseDataUri" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1027,32 +914,25 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "FileResponseDataUri" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1153,18 +1033,12 @@ export class TemplateApi { return new Promise>((resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize(body, "FileResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "FileResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1172,32 +1046,25 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "FileResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1289,21 +1156,12 @@ export class TemplateApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TemplateGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TemplateGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1311,32 +1169,25 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TemplateGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1451,21 +1302,12 @@ export class TemplateApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TemplateListResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TemplateListResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1473,32 +1315,25 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TemplateListResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1521,17 +1356,10 @@ export class TemplateApi { templateRemoveUserRequest: TemplateRemoveUserRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - templateRemoveUserRequest !== null && - templateRemoveUserRequest !== undefined && - templateRemoveUserRequest.constructor.name !== "TemplateRemoveUserRequest" - ) { - templateRemoveUserRequest = ObjectSerializer.deserialize( - templateRemoveUserRequest, - "TemplateRemoveUserRequest" - ); - } - + templateRemoveUserRequest = deserializeIfNeeded( + templateRemoveUserRequest, + "TemplateRemoveUserRequest" + ); const localVarPath = this.basePath + "/template/remove_user/{template_id}".replace( @@ -1636,21 +1464,12 @@ export class TemplateApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TemplateGetResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TemplateGetResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1658,32 +1477,25 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TemplateGetResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1706,18 +1518,10 @@ export class TemplateApi { templateUpdateFilesRequest: TemplateUpdateFilesRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - templateUpdateFilesRequest !== null && - templateUpdateFilesRequest !== undefined && - templateUpdateFilesRequest.constructor.name !== - "TemplateUpdateFilesRequest" - ) { - templateUpdateFilesRequest = ObjectSerializer.deserialize( - templateUpdateFilesRequest, - "TemplateUpdateFilesRequest" - ); - } - + templateUpdateFilesRequest = deserializeIfNeeded( + templateUpdateFilesRequest, + "TemplateUpdateFilesRequest" + ); const localVarPath = this.basePath + "/template/update_files/{template_id}".replace( @@ -1822,21 +1626,12 @@ export class TemplateApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "TemplateUpdateFilesResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "TemplateUpdateFilesResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -1844,32 +1639,25 @@ export class TemplateApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "TemplateUpdateFilesResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -1881,3 +1669,73 @@ export class TemplateApi { }); } } + +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/unclaimedDraftApi.ts b/sdks/node/api/unclaimedDraftApi.ts index 3adda9b79..c121d17bb 100644 --- a/sdks/node/api/unclaimedDraftApi.ts +++ b/sdks/node/api/unclaimedDraftApi.ts @@ -22,34 +22,29 @@ * SOFTWARE. */ -import axios, { AxiosError, AxiosRequestConfig } from "axios"; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios"; -/* tslint:disable:no-unused-locals */ import { - ObjectSerializer, Authentication, - VoidAuth, - Interceptor, HttpBasicAuth, HttpBearerAuth, - ApiKeyAuth, - OAuth, - ErrorResponse, + Interceptor, + ObjectSerializer, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, + VoidAuth, } from "../model"; import { + generateFormData, HttpError, optionsI, + queryParamsSerializer, returnTypeT, - returnTypeI, - generateFormData, toFormData, - queryParamsSerializer, USER_AGENT, } from "./"; @@ -63,9 +58,7 @@ export enum UnclaimedDraftApiApiKeys {} export class UnclaimedDraftApi { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - "User-Agent": USER_AGENT, - }; + protected _defaultHeaders: any = { "User-Agent": USER_AGENT }; protected _useQuerystring: boolean = false; protected authentications = { @@ -91,7 +84,7 @@ export class UnclaimedDraftApi { } set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; } get defaultHeaders() { @@ -136,18 +129,10 @@ export class UnclaimedDraftApi { unclaimedDraftCreateRequest: UnclaimedDraftCreateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - unclaimedDraftCreateRequest !== null && - unclaimedDraftCreateRequest !== undefined && - unclaimedDraftCreateRequest.constructor.name !== - "UnclaimedDraftCreateRequest" - ) { - unclaimedDraftCreateRequest = ObjectSerializer.deserialize( - unclaimedDraftCreateRequest, - "UnclaimedDraftCreateRequest" - ); - } - + unclaimedDraftCreateRequest = deserializeIfNeeded( + unclaimedDraftCreateRequest, + "UnclaimedDraftCreateRequest" + ); const localVarPath = this.basePath + "/unclaimed_draft/create"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -240,21 +225,12 @@ export class UnclaimedDraftApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "UnclaimedDraftCreateResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "UnclaimedDraftCreateResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -262,32 +238,25 @@ export class UnclaimedDraftApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "UnclaimedDraftCreateResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -308,18 +277,10 @@ export class UnclaimedDraftApi { unclaimedDraftCreateEmbeddedRequest: UnclaimedDraftCreateEmbeddedRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - unclaimedDraftCreateEmbeddedRequest !== null && - unclaimedDraftCreateEmbeddedRequest !== undefined && - unclaimedDraftCreateEmbeddedRequest.constructor.name !== - "UnclaimedDraftCreateEmbeddedRequest" - ) { - unclaimedDraftCreateEmbeddedRequest = ObjectSerializer.deserialize( - unclaimedDraftCreateEmbeddedRequest, - "UnclaimedDraftCreateEmbeddedRequest" - ); - } - + unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded( + unclaimedDraftCreateEmbeddedRequest, + "UnclaimedDraftCreateEmbeddedRequest" + ); const localVarPath = this.basePath + "/unclaimed_draft/create_embedded"; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign( @@ -412,21 +373,12 @@ export class UnclaimedDraftApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "UnclaimedDraftCreateResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "UnclaimedDraftCreateResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -434,32 +386,25 @@ export class UnclaimedDraftApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "UnclaimedDraftCreateResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -480,19 +425,10 @@ export class UnclaimedDraftApi { unclaimedDraftCreateEmbeddedWithTemplateRequest: UnclaimedDraftCreateEmbeddedWithTemplateRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - unclaimedDraftCreateEmbeddedWithTemplateRequest !== null && - unclaimedDraftCreateEmbeddedWithTemplateRequest !== undefined && - unclaimedDraftCreateEmbeddedWithTemplateRequest.constructor.name !== - "UnclaimedDraftCreateEmbeddedWithTemplateRequest" - ) { - unclaimedDraftCreateEmbeddedWithTemplateRequest = - ObjectSerializer.deserialize( - unclaimedDraftCreateEmbeddedWithTemplateRequest, - "UnclaimedDraftCreateEmbeddedWithTemplateRequest" - ); - } - + unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded( + unclaimedDraftCreateEmbeddedWithTemplateRequest, + "UnclaimedDraftCreateEmbeddedWithTemplateRequest" + ); const localVarPath = this.basePath + "/unclaimed_draft/create_embedded_with_template"; let localVarQueryParameters: any = {}; @@ -586,21 +522,12 @@ export class UnclaimedDraftApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "UnclaimedDraftCreateResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "UnclaimedDraftCreateResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -608,32 +535,25 @@ export class UnclaimedDraftApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "UnclaimedDraftCreateResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -656,18 +576,10 @@ export class UnclaimedDraftApi { unclaimedDraftEditAndResendRequest: UnclaimedDraftEditAndResendRequest, options: optionsI = { headers: {} } ): Promise> { - if ( - unclaimedDraftEditAndResendRequest !== null && - unclaimedDraftEditAndResendRequest !== undefined && - unclaimedDraftEditAndResendRequest.constructor.name !== - "UnclaimedDraftEditAndResendRequest" - ) { - unclaimedDraftEditAndResendRequest = ObjectSerializer.deserialize( - unclaimedDraftEditAndResendRequest, - "UnclaimedDraftEditAndResendRequest" - ); - } - + unclaimedDraftEditAndResendRequest = deserializeIfNeeded( + unclaimedDraftEditAndResendRequest, + "UnclaimedDraftEditAndResendRequest" + ); const localVarPath = this.basePath + "/unclaimed_draft/edit_and_resend/{signature_request_id}".replace( @@ -772,21 +684,12 @@ export class UnclaimedDraftApi { (resolve, reject) => { axios.request(localVarRequestOptions).then( (response) => { - let body = response.data; - - if ( - response.status && - response.status >= 200 && - response.status <= 299 - ) { - body = ObjectSerializer.deserialize( - body, - "UnclaimedDraftCreateResponse" - ); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse( + resolve, + reject, + response, + "UnclaimedDraftCreateResponse" + ); }, (error: AxiosError) => { if (error.response == null) { @@ -794,32 +697,25 @@ export class UnclaimedDraftApi { return; } - const response = error.response; - - let body; - - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, + if ( + handleErrorCodeResponse( + reject, + error.response, + 200, "UnclaimedDraftCreateResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); if ( - response.status >= rangeCodeLeft && - response.status <= rangeCodeRight - ) { - body = ObjectSerializer.deserialize( - response.data, + handleErrorRangeResponse( + reject, + error.response, + "4XX", "ErrorResponse" - ); - - reject(new HttpError(response, body, response.status)); + ) + ) { return; } @@ -831,3 +727,73 @@ export class UnclaimedDraftApi { }); } } + +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/bin/replace b/sdks/node/bin/replace index b56f6c8fd..7d3427ff8 100755 --- a/sdks/node/bin/replace +++ b/sdks/node/bin/replace @@ -28,9 +28,9 @@ rm -rf "${ROOT_DIR}/docs/model/"*AllOf* printf "\n" printf "Fixing broken enum references ...\n" -rep 'LegalVersionEnum_Terms1' \ +rep 'LegalVersionEnum.Terms1' \ 'SubWhiteLabelingOptions.LegalVersionEnum.Terms1' -rep 'TypeEnum_RequestSignature' \ +rep 'TypeEnum.RequestSignature' \ 'UnclaimedDraftCreateEmbeddedRequest.TypeEnum.RequestSignature' printf "\n\n" diff --git a/sdks/node/dist/api.js b/sdks/node/dist/api.js index bb1cd3b0d..69fdca0c9 100644 --- a/sdks/node/dist/api.js +++ b/sdks/node/dist/api.js @@ -1,7 +1,9 @@ "use strict"; var __create = Object.create; var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __getProtoOf = Object.getPrototypeOf; @@ -19,6 +21,7 @@ var __spreadValues = (a, b) => { } return a; }; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; @@ -577,6 +580,10 @@ var require_db = __commonJS({ "application/cfw": { source: "iana" }, + "application/city+json": { + source: "iana", + compressible: true + }, "application/clr": { source: "iana" }, @@ -620,7 +627,8 @@ var require_db = __commonJS({ }, "application/cpl+xml": { source: "iana", - compressible: true + compressible: true, + extensions: ["cpl"] }, "application/csrattrs": { source: "iana" @@ -655,6 +663,11 @@ var require_db = __commonJS({ compressible: true, extensions: ["mpd"] }, + "application/dash-patch+xml": { + source: "iana", + compressible: true, + extensions: ["mpp"] + }, "application/dashdelta": { source: "iana" }, @@ -1195,7 +1208,8 @@ var require_db = __commonJS({ }, "application/media-policy-dataset+xml": { source: "iana", - compressible: true + compressible: true, + extensions: ["mpf"] }, "application/media_control+xml": { source: "iana", @@ -1351,6 +1365,9 @@ var require_db = __commonJS({ "application/oauth-authz-req+jwt": { source: "iana" }, + "application/oblivious-dns-message": { + source: "iana" + }, "application/ocsp-request": { source: "iana" }, @@ -1443,7 +1460,8 @@ var require_db = __commonJS({ extensions: ["pgp"] }, "application/pgp-keys": { - source: "iana" + source: "iana", + extensions: ["asc"] }, "application/pgp-signature": { source: "iana", @@ -2974,6 +2992,10 @@ var require_db = __commonJS({ "application/vnd.ecip.rlp": { source: "iana" }, + "application/vnd.eclipse.ditto+json": { + source: "iana", + compressible: true + }, "application/vnd.ecowin.chart": { source: "iana", extensions: ["mag"] @@ -3131,6 +3153,10 @@ var require_db = __commonJS({ "application/vnd.etsi.tsl.der": { source: "iana" }, + "application/vnd.eu.kasparian.car+json": { + source: "iana", + compressible: true + }, "application/vnd.eudora.data": { source: "iana" }, @@ -3161,6 +3187,10 @@ var require_db = __commonJS({ "application/vnd.f-secure.mobile": { source: "iana" }, + "application/vnd.familysearch.gedcom+zip": { + source: "iana", + compressible: false + }, "application/vnd.fastcopy-disk-image": { source: "iana" }, @@ -3451,6 +3481,16 @@ var require_db = __commonJS({ source: "iana", extensions: ["les"] }, + "application/vnd.hl7cda+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.hl7v2+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, "application/vnd.hp-hpgl": { source: "iana", extensions: ["hpgl"] @@ -3864,6 +3904,10 @@ var require_db = __commonJS({ source: "iana", compressible: true }, + "application/vnd.maxar.archive.3tz+zip": { + source: "iana", + compressible: false + }, "application/vnd.maxmind.maxmind-db": { source: "iana" }, @@ -5484,6 +5528,10 @@ var require_db = __commonJS({ source: "iana", compressible: true }, + "application/vnd.syft+json": { + source: "iana", + compressible: true + }, "application/vnd.symbian.install": { source: "apache", extensions: ["sis", "sisx"] @@ -5874,7 +5922,8 @@ var require_db = __commonJS({ }, "application/watcherinfo+xml": { source: "iana", - compressible: true + compressible: true, + extensions: ["wif"] }, "application/webpush-options+json": { source: "iana", @@ -7294,10 +7343,12 @@ var require_db = __commonJS({ extensions: ["apng"] }, "image/avci": { - source: "iana" + source: "iana", + extensions: ["avci"] }, "image/avcs": { - source: "iana" + source: "iana", + extensions: ["avcs"] }, "image/avif": { source: "iana", @@ -9729,7 +9780,7 @@ var require_common = __commonJS({ } namespaces = split[i].replace(/\*/g, ".*?"); if (namespaces[0] === "-") { - createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$")); + createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); } else { createDebug.names.push(new RegExp("^" + namespaces + "$")); } @@ -9882,7 +9933,8 @@ var require_browser = __commonJS({ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); + let m; + return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } function formatArgs(args) { args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); @@ -10202,7 +10254,7 @@ var require_node = __commonJS({ return new Date().toISOString() + " "; } function log(...args) { - return process.stderr.write(util2.format(...args) + "\n"); + return process.stderr.write(util2.formatWithOptions(exports.inspectOpts, ...args) + "\n"); } function save(namespaces) { if (namespaces) { @@ -10275,6 +10327,25 @@ var require_follow_redirects = __commonJS({ var Writable = require("stream").Writable; var assert = require("assert"); var debug = require_debug(); + var useNativeURL = false; + try { + assert(new URL2()); + } catch (error) { + useNativeURL = error.code === "ERR_INVALID_URL"; + } + var preservedUrlFields = [ + "auth", + "host", + "hostname", + "href", + "path", + "pathname", + "port", + "protocol", + "query", + "search", + "hash" + ]; var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; var eventHandlers = /* @__PURE__ */ Object.create(null); events.forEach(function(event) { @@ -10293,7 +10364,8 @@ var require_follow_redirects = __commonJS({ ); var TooManyRedirectsError = createErrorType( "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded" + "Maximum number of redirects exceeded", + RedirectionError ); var MaxBodyLengthExceededError = createErrorType( "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", @@ -10319,7 +10391,11 @@ var require_follow_redirects = __commonJS({ } var self2 = this; this._onNativeResponse = function(response) { - self2._processResponse(response); + try { + self2._processResponse(response); + } catch (cause) { + self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); + } }; this._performRequest(); } @@ -10478,8 +10554,7 @@ var require_follow_redirects = __commonJS({ var protocol = this._options.protocol; var nativeProtocol = this._options.nativeProtocols[protocol]; if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; + throw new TypeError("Unsupported protocol " + protocol); } if (this._options.agents) { var scheme = protocol.slice(0, -1); @@ -10531,8 +10606,7 @@ var require_follow_redirects = __commonJS({ destroyRequest(this._currentRequest); response.destroy(); if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; + throw new TooManyRedirectsError(); } var requestHeaders; var beforeRedirect = this._options.beforeRedirect; @@ -10548,22 +10622,15 @@ var require_follow_redirects = __commonJS({ removeMatchingHeaders(/^content-/i, this._options.headers); } var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - var currentUrlParts = url2.parse(this._currentUrl); + var currentUrlParts = parseUrl(this._currentUrl); var currentHost = currentHostHeader || currentUrlParts.host; var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost })); - var redirectUrl; - try { - redirectUrl = url2.resolve(currentUrl, location); - } catch (cause) { - this.emit("error", new RedirectionError({ cause })); - return; - } - debug("redirecting to", redirectUrl); + var redirectUrl = resolveUrl(location, currentUrl); + debug("redirecting to", redirectUrl.href); this._isRedirect = true; - var redirectUrlParts = url2.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); - if (redirectUrlParts.protocol !== currentUrlParts.protocol && redirectUrlParts.protocol !== "https:" || redirectUrlParts.host !== currentHost && !isSubdomain(redirectUrlParts.host, currentHost)) { - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); + spreadUrlObject(redirectUrl, this._options); + if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { + removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); } if (isFunction2(beforeRedirect)) { var responseDetails = { @@ -10575,19 +10642,10 @@ var require_follow_redirects = __commonJS({ method, headers: requestHeaders }; - try { - beforeRedirect(this._options, responseDetails, requestDetails); - } catch (err) { - this.emit("error", err); - return; - } + beforeRedirect(this._options, responseDetails, requestDetails); this._sanitizeOptions(this._options); } - try { - this._performRequest(); - } catch (cause) { - this.emit("error", new RedirectionError({ cause })); - } + this._performRequest(); }; function wrap(protocols) { var exports2 = { @@ -10600,22 +10658,13 @@ var require_follow_redirects = __commonJS({ var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol); function request(input, options, callback) { - if (isString2(input)) { - var parsed; - try { - parsed = urlToOptions(new URL2(input)); - } catch (err) { - parsed = url2.parse(input); - } - if (!isString2(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - input = parsed; - } else if (URL2 && input instanceof URL2) { - input = urlToOptions(input); + if (isURL(input)) { + input = spreadUrlObject(input); + } else if (isString2(input)) { + input = spreadUrlObject(parseUrl(input)); } else { callback = options; - options = input; + options = validateUrl(input); input = { protocol }; } if (isFunction2(options)) { @@ -10648,20 +10697,43 @@ var require_follow_redirects = __commonJS({ } function noop2() { } - function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? urlObject.hostname.slice(1, -1) : urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); + function parseUrl(input) { + var parsed; + if (useNativeURL) { + parsed = new URL2(input); + } else { + parsed = validateUrl(url2.parse(input)); + if (!isString2(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } } - return options; + return parsed; + } + function resolveUrl(relative, base) { + return useNativeURL ? new URL2(relative, base) : parseUrl(url2.resolve(base, relative)); + } + function validateUrl(input) { + if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { + throw new InvalidUrlError({ input: input.href || input }); + } + if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { + throw new InvalidUrlError({ input: input.href || input }); + } + return input; + } + function spreadUrlObject(urlObject, target) { + var spread3 = target || {}; + for (var key of preservedUrlFields) { + spread3[key] = urlObject[key]; + } + if (spread3.hostname.startsWith("[")) { + spread3.hostname = spread3.hostname.slice(1, -1); + } + if (spread3.port !== "") { + spread3.port = Number(spread3.port); + } + spread3.path = spread3.search ? spread3.pathname + spread3.search : spread3.pathname; + return spread3; } function removeMatchingHeaders(regex, headers) { var lastValue; @@ -10681,8 +10753,16 @@ var require_follow_redirects = __commonJS({ this.message = this.cause ? message + ": " + this.cause.message : message; } CustomError.prototype = new (baseClass || Error)(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; + Object.defineProperties(CustomError.prototype, { + constructor: { + value: CustomError, + enumerable: false + }, + name: { + value: "Error [" + code + "]", + enumerable: false + } + }); return CustomError; } function destroyRequest(request, error) { @@ -10706,11 +10786,70 @@ var require_follow_redirects = __commonJS({ function isBuffer2(value) { return typeof value === "object" && "length" in value; } + function isURL(value) { + return URL2 && value instanceof URL2; + } module2.exports = wrap({ http: http2, https: https2 }); module2.exports.wrap = wrap; } }); +// node_modules/es-errors/index.js +var require_es_errors = __commonJS({ + "node_modules/es-errors/index.js"(exports, module2) { + "use strict"; + module2.exports = Error; + } +}); + +// node_modules/es-errors/eval.js +var require_eval = __commonJS({ + "node_modules/es-errors/eval.js"(exports, module2) { + "use strict"; + module2.exports = EvalError; + } +}); + +// node_modules/es-errors/range.js +var require_range = __commonJS({ + "node_modules/es-errors/range.js"(exports, module2) { + "use strict"; + module2.exports = RangeError; + } +}); + +// node_modules/es-errors/ref.js +var require_ref = __commonJS({ + "node_modules/es-errors/ref.js"(exports, module2) { + "use strict"; + module2.exports = ReferenceError; + } +}); + +// node_modules/es-errors/syntax.js +var require_syntax = __commonJS({ + "node_modules/es-errors/syntax.js"(exports, module2) { + "use strict"; + module2.exports = SyntaxError; + } +}); + +// node_modules/es-errors/type.js +var require_type = __commonJS({ + "node_modules/es-errors/type.js"(exports, module2) { + "use strict"; + module2.exports = TypeError; + } +}); + +// node_modules/es-errors/uri.js +var require_uri = __commonJS({ + "node_modules/es-errors/uri.js"(exports, module2) { + "use strict"; + module2.exports = URIError; + } +}); + // node_modules/has-symbols/shams.js var require_shams = __commonJS({ "node_modules/has-symbols/shams.js"(exports, module2) { @@ -10787,6 +10926,21 @@ var require_has_symbols = __commonJS({ } }); +// node_modules/has-proto/index.js +var require_has_proto = __commonJS({ + "node_modules/has-proto/index.js"(exports, module2) { + "use strict"; + var test2 = { + __proto__: null, + foo: {} + }; + var $Object = Object; + module2.exports = function hasProto() { + return { __proto__: test2 }.foo === test2.foo && !(test2 instanceof $Object); + }; + } +}); + // node_modules/function-bind/implementation.js var require_implementation = __commonJS({ "node_modules/function-bind/implementation.js"(exports, module2) { @@ -10872,12 +11026,14 @@ var require_function_bind = __commonJS({ } }); -// node_modules/has/src/index.js -var require_src2 = __commonJS({ - "node_modules/has/src/index.js"(exports, module2) { +// node_modules/hasown/index.js +var require_hasown = __commonJS({ + "node_modules/hasown/index.js"(exports, module2) { "use strict"; + var call = Function.prototype.call; + var $hasOwn = Object.prototype.hasOwnProperty; var bind2 = require_function_bind(); - module2.exports = bind2.call(Function.call, Object.prototype.hasOwnProperty); + module2.exports = bind2.call(call, $hasOwn); } }); @@ -10886,9 +11042,14 @@ var require_get_intrinsic = __commonJS({ "node_modules/get-intrinsic/index.js"(exports, module2) { "use strict"; var undefined2; - var $SyntaxError = SyntaxError; + var $Error = require_es_errors(); + var $EvalError = require_eval(); + var $RangeError = require_range(); + var $ReferenceError = require_ref(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type(); + var $URIError = require_uri(); var $Function = Function; - var $TypeError = TypeError; var getEvalledConstructor = function(expressionSyntax) { try { return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); @@ -10919,16 +11080,18 @@ var require_get_intrinsic = __commonJS({ } }() : throwTypeError; var hasSymbols = require_has_symbols()(); - var getProto = Object.getPrototypeOf || function(x) { + var hasProto = require_has_proto()(); + var getProto = Object.getPrototypeOf || (hasProto ? function(x) { return x.__proto__; - }; + } : null); var needsEval = {}; - var TypedArray = typeof Uint8Array === "undefined" ? undefined2 : getProto(Uint8Array); + var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); var INTRINSICS = { + __proto__: null, "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, "%Array%": Array, "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, - "%ArrayIteratorPrototype%": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2, + "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, "%AsyncFromSyncIteratorPrototype%": undefined2, "%AsyncFunction%": needsEval, "%AsyncGenerator%": needsEval, @@ -10936,6 +11099,8 @@ var require_get_intrinsic = __commonJS({ "%AsyncIteratorPrototype%": needsEval, "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, + "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, + "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, "%Boolean%": Boolean, "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, "%Date%": Date, @@ -10943,9 +11108,9 @@ var require_get_intrinsic = __commonJS({ "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, - "%Error%": Error, + "%Error%": $Error, "%eval%": eval, - "%EvalError%": EvalError, + "%EvalError%": $EvalError, "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, @@ -10956,10 +11121,10 @@ var require_get_intrinsic = __commonJS({ "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, "%isFinite%": isFinite, "%isNaN%": isNaN, - "%IteratorPrototype%": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2, + "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, "%JSON%": typeof JSON === "object" ? JSON : undefined2, "%Map%": typeof Map === "undefined" ? undefined2 : Map, - "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), + "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), "%Math%": Math, "%Number%": Number, "%Object%": Object, @@ -10967,15 +11132,15 @@ var require_get_intrinsic = __commonJS({ "%parseInt%": parseInt, "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, - "%RangeError%": RangeError, - "%ReferenceError%": ReferenceError, + "%RangeError%": $RangeError, + "%ReferenceError%": $ReferenceError, "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, "%RegExp%": RegExp, "%Set%": typeof Set === "undefined" ? undefined2 : Set, - "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), + "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, "%String%": String, - "%StringIteratorPrototype%": hasSymbols ? getProto(""[Symbol.iterator]()) : undefined2, + "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, "%Symbol%": hasSymbols ? Symbol : undefined2, "%SyntaxError%": $SyntaxError, "%ThrowTypeError%": ThrowTypeError, @@ -10985,11 +11150,20 @@ var require_get_intrinsic = __commonJS({ "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, - "%URIError%": URIError, + "%URIError%": $URIError, "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet }; + if (getProto) { + try { + null.error; + } catch (e) { + errorProto = getProto(getProto(e)); + INTRINSICS["%Error.prototype%"] = errorProto; + } + } + var errorProto; var doEval = function doEval2(name) { var value; if (name === "%AsyncFunction%") { @@ -11005,7 +11179,7 @@ var require_get_intrinsic = __commonJS({ } } else if (name === "%AsyncIteratorPrototype%") { var gen = doEval2("%AsyncGenerator%"); - if (gen) { + if (gen && getProto) { value = getProto(gen.prototype); } } @@ -11013,6 +11187,7 @@ var require_get_intrinsic = __commonJS({ return value; }; var LEGACY_ALIASES = { + __proto__: null, "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], "%ArrayPrototype%": ["Array", "prototype"], "%ArrayProto_entries%": ["Array", "prototype", "entries"], @@ -11066,11 +11241,12 @@ var require_get_intrinsic = __commonJS({ "%WeakSetPrototype%": ["WeakSet", "prototype"] }; var bind2 = require_function_bind(); - var hasOwn = require_src2(); + var hasOwn = require_hasown(); var $concat = bind2.call(Function.call, Array.prototype.concat); var $spliceApply = bind2.call(Function.apply, Array.prototype.splice); var $replace = bind2.call(Function.call, String.prototype.replace); var $strSlice = bind2.call(Function.call, String.prototype.slice); + var $exec = bind2.call(Function.call, RegExp.prototype.exec); var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; var stringToPath = function stringToPath2(string) { @@ -11117,6 +11293,9 @@ var require_get_intrinsic = __commonJS({ if (arguments.length > 1 && typeof allowMissing !== "boolean") { throw new $TypeError('"allowMissing" argument must be a boolean'); } + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); + } var parts = stringToPath(name); var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); @@ -11171,38 +11350,174 @@ var require_get_intrinsic = __commonJS({ } }); +// node_modules/es-define-property/index.js +var require_es_define_property = __commonJS({ + "node_modules/es-define-property/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var $defineProperty = GetIntrinsic("%Object.defineProperty%", true) || false; + if ($defineProperty) { + try { + $defineProperty({}, "a", { value: 1 }); + } catch (e) { + $defineProperty = false; + } + } + module2.exports = $defineProperty; + } +}); + +// node_modules/gopd/index.js +var require_gopd = __commonJS({ + "node_modules/gopd/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); + if ($gOPD) { + try { + $gOPD([], "length"); + } catch (e) { + $gOPD = null; + } + } + module2.exports = $gOPD; + } +}); + +// node_modules/define-data-property/index.js +var require_define_data_property = __commonJS({ + "node_modules/define-data-property/index.js"(exports, module2) { + "use strict"; + var $defineProperty = require_es_define_property(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type(); + var gopd = require_gopd(); + module2.exports = function defineDataProperty(obj, property, value) { + if (!obj || typeof obj !== "object" && typeof obj !== "function") { + throw new $TypeError("`obj` must be an object or a function`"); + } + if (typeof property !== "string" && typeof property !== "symbol") { + throw new $TypeError("`property` must be a string or a symbol`"); + } + if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) { + throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null"); + } + if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) { + throw new $TypeError("`nonWritable`, if provided, must be a boolean or null"); + } + if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) { + throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null"); + } + if (arguments.length > 6 && typeof arguments[6] !== "boolean") { + throw new $TypeError("`loose`, if provided, must be a boolean"); + } + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + var desc = !!gopd && gopd(obj, property); + if ($defineProperty) { + $defineProperty(obj, property, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) { + obj[property] = value; + } else { + throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); + } + }; + } +}); + +// node_modules/has-property-descriptors/index.js +var require_has_property_descriptors = __commonJS({ + "node_modules/has-property-descriptors/index.js"(exports, module2) { + "use strict"; + var $defineProperty = require_es_define_property(); + var hasPropertyDescriptors = function hasPropertyDescriptors2() { + return !!$defineProperty; + }; + hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + if (!$defineProperty) { + return null; + } + try { + return $defineProperty([], "length", { value: 1 }).length !== 1; + } catch (e) { + return true; + } + }; + module2.exports = hasPropertyDescriptors; + } +}); + +// node_modules/set-function-length/index.js +var require_set_function_length = __commonJS({ + "node_modules/set-function-length/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var define = require_define_data_property(); + var hasDescriptors = require_has_property_descriptors()(); + var gOPD = require_gopd(); + var $TypeError = require_type(); + var $floor = GetIntrinsic("%Math.floor%"); + module2.exports = function setFunctionLength(fn, length) { + if (typeof fn !== "function") { + throw new $TypeError("`fn` is not a function"); + } + if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) { + throw new $TypeError("`length` must be a positive 32-bit integer"); + } + var loose = arguments.length > 2 && !!arguments[2]; + var functionLengthIsConfigurable = true; + var functionLengthIsWritable = true; + if ("length" in fn && gOPD) { + var desc = gOPD(fn, "length"); + if (desc && !desc.configurable) { + functionLengthIsConfigurable = false; + } + if (desc && !desc.writable) { + functionLengthIsWritable = false; + } + } + if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { + if (hasDescriptors) { + define(fn, "length", length, true, true); + } else { + define(fn, "length", length); + } + } + return fn; + }; + } +}); + // node_modules/call-bind/index.js var require_call_bind = __commonJS({ "node_modules/call-bind/index.js"(exports, module2) { "use strict"; var bind2 = require_function_bind(); var GetIntrinsic = require_get_intrinsic(); + var setFunctionLength = require_set_function_length(); + var $TypeError = require_type(); var $apply = GetIntrinsic("%Function.prototype.apply%"); var $call = GetIntrinsic("%Function.prototype.call%"); var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind2.call($call, $apply); - var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); - var $defineProperty = GetIntrinsic("%Object.defineProperty%", true); + var $defineProperty = require_es_define_property(); var $max = GetIntrinsic("%Math.max%"); - if ($defineProperty) { - try { - $defineProperty({}, "a", { value: 1 }); - } catch (e) { - $defineProperty = null; - } - } module2.exports = function callBind(originalFunction) { - var func = $reflectApply(bind2, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, "length"); - if (desc.configurable) { - $defineProperty( - func, - "length", - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } + if (typeof originalFunction !== "function") { + throw new $TypeError("a function is required"); } - return func; + var func = $reflectApply(bind2, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); }; var applyBind = function applyBind2() { return $reflectApply(bind2, $apply, arguments); @@ -11293,8 +11608,9 @@ var require_object_inspect = __commonJS({ } return $replace.call(str, sepRegex, "$&_"); } - var inspectCustom = require_util_inspect().custom; - var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null; + var utilInspect = require_util_inspect(); + var inspectCustom = utilInspect.custom; + var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; module2.exports = function inspect_(obj, options, depth, seen) { var opts = options || {}; if (has(opts, "quoteStyle") && (opts.quoteStyle !== "single" && opts.quoteStyle !== "double")) { @@ -11366,7 +11682,7 @@ var require_object_inspect = __commonJS({ } return inspect_(value, opts, depth + 1, seen); } - if (typeof obj === "function") { + if (typeof obj === "function" && !isRegExp2(obj)) { var name = nameOf(obj); var keys = arrObjKeys(obj, inspect); return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : ""); @@ -11400,7 +11716,7 @@ var require_object_inspect = __commonJS({ } if (isError(obj)) { var parts = arrObjKeys(obj, inspect); - if ("cause" in obj && !isEnumerable.call(obj, "cause")) { + if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) { return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }"; } if (parts.length === 0) { @@ -11409,24 +11725,28 @@ var require_object_inspect = __commonJS({ return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }"; } if (typeof obj === "object" && customInspect) { - if (inspectSymbol && typeof obj[inspectSymbol] === "function") { - return obj[inspectSymbol](); + if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) { + return utilInspect(obj, { depth: maxDepth - depth }); } else if (customInspect !== "symbol" && typeof obj.inspect === "function") { return obj.inspect(); } } if (isMap(obj)) { var mapParts = []; - mapForEach.call(obj, function(value, key) { - mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj)); - }); + if (mapForEach) { + mapForEach.call(obj, function(value, key) { + mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj)); + }); + } return collectionOf("Map", mapSize.call(obj), mapParts, indent); } if (isSet(obj)) { var setParts = []; - setForEach.call(obj, function(value) { - setParts.push(inspect(value, obj)); - }); + if (setForEach) { + setForEach.call(obj, function(value) { + setParts.push(inspect(value, obj)); + }); + } return collectionOf("Set", setSize.call(obj), setParts, indent); } if (isWeakMap(obj)) { @@ -11450,6 +11770,12 @@ var require_object_inspect = __commonJS({ if (isString2(obj)) { return markBoxed(inspect(String(obj))); } + if (typeof window !== "undefined" && obj === window) { + return "{ [object Window] }"; + } + if (typeof globalThis !== "undefined" && obj === globalThis || typeof global !== "undefined" && obj === global) { + return "{ [object globalThis] }"; + } if (!isDate2(obj) && !isRegExp2(obj)) { var ys = arrObjKeys(obj, inspect); var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; @@ -11750,7 +12076,7 @@ var require_side_channel = __commonJS({ var GetIntrinsic = require_get_intrinsic(); var callBound = require_callBound(); var inspect = require_object_inspect(); - var $TypeError = GetIntrinsic("%TypeError%"); + var $TypeError = require_type(); var $WeakMap = GetIntrinsic("%WeakMap%", true); var $Map = GetIntrinsic("%Map%", true); var $weakMapGet = callBound("WeakMap.prototype.get", true); @@ -11760,7 +12086,9 @@ var require_side_channel = __commonJS({ var $mapSet = callBound("Map.prototype.set", true); var $mapHas = callBound("Map.prototype.has", true); var listGetNode = function(list, key) { - for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) { + var prev = list; + var curr; + for (; (curr = prev.next) !== null; prev = curr) { if (curr.key === key) { prev.next = curr.next; curr.next = list.next; @@ -11982,6 +12310,7 @@ var require_utils = __commonJS({ return strWithoutPlus; } }; + var limit = 1024; var encode3 = function encode4(str, defaultEncoder, charset, kind, format) { if (str.length === 0) { return str; @@ -11998,27 +12327,32 @@ var require_utils = __commonJS({ }); } var out = ""; - for (var i = 0; i < string.length; ++i) { - var c = string.charCodeAt(i); - if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) { - out += string.charAt(i); - continue; - } - if (c < 128) { - out = out + hexTable[c]; - continue; - } - if (c < 2048) { - out = out + (hexTable[192 | c >> 6] + hexTable[128 | c & 63]); - continue; - } - if (c < 55296 || c >= 57344) { - out = out + (hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]); - continue; + for (var j = 0; j < string.length; j += limit) { + var segment = string.length >= limit ? string.slice(j, j + limit) : string; + var arr = []; + for (var i = 0; i < segment.length; ++i) { + var c = segment.charCodeAt(i); + if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) { + arr[arr.length] = segment.charAt(i); + continue; + } + if (c < 128) { + arr[arr.length] = hexTable[c]; + continue; + } + if (c < 2048) { + arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63]; + continue; + } + if (c < 55296 || c >= 57344) { + arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]; + continue; + } + i += 1; + c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023); + arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]; } - i += 1; - c = 65536 + ((c & 1023) << 10 | string.charCodeAt(i) & 1023); - out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]; + out += arr.join(""); } return out; }; @@ -12099,7 +12433,6 @@ var require_stringify = __commonJS({ } }; var isArray2 = Array.isArray; - var split = String.prototype.split; var push = Array.prototype.push; var pushToArray = function(arr, valueOrArray) { push.apply(arr, isArray2(valueOrArray) ? valueOrArray : [valueOrArray]); @@ -12109,10 +12442,13 @@ var require_stringify = __commonJS({ var defaults2 = { addQueryPrefix: false, allowDots: false, + allowEmptyArrays: false, + arrayFormat: "indices", charset: "utf-8", charsetSentinel: false, delimiter: "&", encode: true, + encodeDotInKeys: false, encoder: utils.encode, encodeValuesOnly: false, format: defaultFormat, @@ -12128,7 +12464,7 @@ var require_stringify = __commonJS({ return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint"; }; var sentinel = {}; - var stringify = function stringify2(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter2, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { + var stringify = function stringify2(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter2, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { var obj = object; var tmpSc = sideChannel; var step = 0; @@ -12168,14 +12504,6 @@ var require_stringify = __commonJS({ if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults2.encoder, charset, "key", format); - if (generateArrayPrefix === "comma" && encodeValuesOnly) { - var valuesArray = split.call(String(obj), ","); - var valuesJoined = ""; - for (var i = 0; i < valuesArray.length; ++i) { - valuesJoined += (i === 0 ? "" : ",") + formatter(encoder(valuesArray[i], defaults2.encoder, charset, "value", format)); - } - return [formatter(keyValue) + "=" + valuesJoined]; - } return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults2.encoder, charset, "value", format))]; } return [formatter(prefix) + "=" + formatter(String(obj))]; @@ -12186,6 +12514,9 @@ var require_stringify = __commonJS({ } var objKeys; if (generateArrayPrefix === "comma" && isArray2(obj)) { + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }]; } else if (isArray2(filter2)) { objKeys = filter2; @@ -12193,13 +12524,19 @@ var require_stringify = __commonJS({ var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } + var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix; + var adjustedPrefix = commaRoundTrip && isArray2(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix; + if (allowEmptyArrays && isArray2(obj) && obj.length === 0) { + return adjustedPrefix + "[]"; + } for (var j = 0; j < objKeys.length; ++j) { var key = objKeys[j]; var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key]; if (skipNulls && value === null) { continue; } - var keyPrefix = isArray2(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(prefix, key) : prefix : prefix + (allowDots ? "." + key : "[" + key + "]"); + var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; + var keyPrefix = isArray2(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]"); sideChannel.set(object, step); var valueSideChannel = getSideChannel(); valueSideChannel.set(sentinel, sideChannel); @@ -12207,9 +12544,12 @@ var require_stringify = __commonJS({ value, keyPrefix, generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, strictNullHandling, skipNulls, - encoder, + encodeDotInKeys, + generateArrayPrefix === "comma" && encodeValuesOnly && isArray2(obj) ? null : encoder, filter2, sort, allowDots, @@ -12227,6 +12567,12 @@ var require_stringify = __commonJS({ if (!opts) { return defaults2; } + if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { + throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); + } + if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") { + throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); + } if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") { throw new TypeError("Encoder has to be a function."); } @@ -12246,13 +12592,29 @@ var require_stringify = __commonJS({ if (typeof opts.filter === "function" || isArray2(opts.filter)) { filter2 = opts.filter; } + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ("indices" in opts) { + arrayFormat = opts.indices ? "indices" : "repeat"; + } else { + arrayFormat = defaults2.arrayFormat; + } + if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { + throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); + } + var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; return { addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults2.addQueryPrefix, - allowDots: typeof opts.allowDots === "undefined" ? defaults2.allowDots : !!opts.allowDots, + allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, + arrayFormat, charset, charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, + commaRoundTrip: opts.commaRoundTrip, delimiter: typeof opts.delimiter === "undefined" ? defaults2.delimiter : opts.delimiter, encode: typeof opts.encode === "boolean" ? opts.encode : defaults2.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults2.encodeDotInKeys, encoder: typeof opts.encoder === "function" ? opts.encoder : defaults2.encoder, encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults2.encodeValuesOnly, filter: filter2, @@ -12280,15 +12642,8 @@ var require_stringify = __commonJS({ if (typeof obj !== "object" || obj === null) { return ""; } - var arrayFormat; - if (opts && opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if (opts && "indices" in opts) { - arrayFormat = opts.indices ? "indices" : "repeat"; - } else { - arrayFormat = "indices"; - } - var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip; if (!objKeys) { objKeys = Object.keys(obj); } @@ -12305,8 +12660,11 @@ var require_stringify = __commonJS({ obj[key], key, generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, + options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, @@ -12342,20 +12700,24 @@ var require_parse = __commonJS({ var isArray2 = Array.isArray; var defaults2 = { allowDots: false, + allowEmptyArrays: false, allowPrototypes: false, allowSparse: false, arrayLimit: 20, charset: "utf-8", charsetSentinel: false, comma: false, + decodeDotInKeys: false, decoder: utils.decode, delimiter: "&", depth: 5, + duplicates: "combine", ignoreQueryPrefix: false, interpretNumericEntities: false, parameterLimit: 1e3, parseArrays: true, plainObjects: false, + strictDepth: false, strictNullHandling: false }; var interpretNumericEntities = function(str) { @@ -12372,8 +12734,9 @@ var require_parse = __commonJS({ var isoSentinel = "utf8=%26%2310003%3B"; var charsetSentinel = "utf8=%E2%9C%93"; var parseValues = function parseQueryStringValues(str, options) { - var obj = {}; + var obj = { __proto__: null }; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str; + cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]"); var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); var skipIndex = -1; @@ -12418,9 +12781,10 @@ var require_parse = __commonJS({ if (part.indexOf("[]=") > -1) { val = isArray2(val) ? [val] : val; } - if (has.call(obj, key)) { + var existing = has.call(obj, key); + if (existing && options.duplicates === "combine") { obj[key] = utils.combine(obj[key], val); - } else { + } else if (!existing || options.duplicates === "last") { obj[key] = val; } } @@ -12432,18 +12796,19 @@ var require_parse = __commonJS({ var obj; var root = chain[i]; if (root === "[]" && options.parseArrays) { - obj = [].concat(leaf); + obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf); } else { obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root; - var index = parseInt(cleanRoot, 10); - if (!options.parseArrays && cleanRoot === "") { + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot; + var index = parseInt(decodedRoot, 10); + if (!options.parseArrays && decodedRoot === "") { obj = { 0: leaf }; - } else if (!isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) { + } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) { obj = []; obj[index] = leaf; - } else if (cleanRoot !== "__proto__") { - obj[cleanRoot] = leaf; + } else if (decodedRoot !== "__proto__") { + obj[decodedRoot] = leaf; } } leaf = obj; @@ -12479,6 +12844,9 @@ var require_parse = __commonJS({ keys.push(segment[1]); } if (segment) { + if (options.strictDepth === true) { + throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true"); + } keys.push("[" + key.slice(segment.index) + "]"); } return parseObject(keys, val, options, valuesParsed); @@ -12487,29 +12855,44 @@ var require_parse = __commonJS({ if (!opts) { return defaults2; } - if (opts.decoder !== null && opts.decoder !== void 0 && typeof opts.decoder !== "function") { + if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { + throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); + } + if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") { + throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided"); + } + if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") { throw new TypeError("Decoder has to be a function."); } if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); } var charset = typeof opts.charset === "undefined" ? defaults2.charset : opts.charset; + var duplicates = typeof opts.duplicates === "undefined" ? defaults2.duplicates : opts.duplicates; + if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") { + throw new TypeError("The duplicates option must be either combine, first, or last"); + } + var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; return { - allowDots: typeof opts.allowDots === "undefined" ? defaults2.allowDots : !!opts.allowDots, + allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults2.allowPrototypes, allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults2.allowSparse, arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults2.arrayLimit, charset, charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, comma: typeof opts.comma === "boolean" ? opts.comma : defaults2.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults2.decodeDotInKeys, decoder: typeof opts.decoder === "function" ? opts.decoder : defaults2.decoder, delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults2.delimiter, depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults2.depth, + duplicates, ignoreQueryPrefix: opts.ignoreQueryPrefix === true, interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults2.interpretNumericEntities, parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults2.parameterLimit, parseArrays: opts.parseArrays !== false, plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults2.plainObjects, + strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults2.strictDepth, strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling }; }; @@ -12593,6 +12976,18 @@ __export(api_exports, { EventCallbackRequest: () => EventCallbackRequest, EventCallbackRequestEvent: () => EventCallbackRequestEvent, EventCallbackRequestEventMetadata: () => EventCallbackRequestEventMetadata, + FaxLineAddUserRequest: () => FaxLineAddUserRequest, + FaxLineApi: () => FaxLineApi, + FaxLineAreaCodeGetCountryEnum: () => FaxLineAreaCodeGetCountryEnum, + FaxLineAreaCodeGetProvinceEnum: () => FaxLineAreaCodeGetProvinceEnum, + FaxLineAreaCodeGetResponse: () => FaxLineAreaCodeGetResponse, + FaxLineAreaCodeGetStateEnum: () => FaxLineAreaCodeGetStateEnum, + FaxLineCreateRequest: () => FaxLineCreateRequest, + FaxLineDeleteRequest: () => FaxLineDeleteRequest, + FaxLineListResponse: () => FaxLineListResponse, + FaxLineRemoveUserRequest: () => FaxLineRemoveUserRequest, + FaxLineResponse: () => FaxLineResponse, + FaxLineResponseFaxLine: () => FaxLineResponseFaxLine, FileResponse: () => FileResponse, FileResponseDataUri: () => FileResponseDataUri, HttpBasicAuth: () => HttpBasicAuth, @@ -12808,6 +13203,7 @@ var isFormData = (thing) => { return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]")); }; var isURLSearchParams = kindOfTest("URLSearchParams"); +var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function forEach(obj, fn, { allOwnKeys = false } = {}) { if (obj === null || typeof obj === "undefined") { @@ -13017,8 +13413,7 @@ var toObjectSet = (arrayOrString, delimiter) => { var noop = () => { }; var toFiniteNumber = (value, defaultValue) => { - value = +value; - return Number.isFinite(value) ? value : defaultValue; + return value != null && Number.isFinite(value = +value) ? value : defaultValue; }; var ALPHA = "abcdefghijklmnopqrstuvwxyz"; var DIGIT = "0123456789"; @@ -13062,6 +13457,26 @@ var toJSONObject = (obj) => { }; var isAsyncFn = kindOfTest("AsyncFunction"); var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); +var _setImmediate = ((setImmediateSupported, postMessageSupported) => { + if (setImmediateSupported) { + return setImmediate; + } + return postMessageSupported ? ((token, callbacks) => { + _global.addEventListener("message", ({ source, data }) => { + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, false); + return (cb) => { + callbacks.push(cb); + _global.postMessage(token, "*"); + }; + })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); +})( + typeof setImmediate === "function", + isFunction(_global.postMessage) +); +var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; var utils_default = { isArray, isArrayBuffer, @@ -13073,6 +13488,10 @@ var utils_default = { isBoolean, isObject, isPlainObject, + isReadableStream, + isRequest, + isResponse, + isHeaders, isUndefined, isDate, isFile, @@ -13113,7 +13532,9 @@ var utils_default = { isSpecCompliantForm, toJSONObject, isAsyncFn, - isThenable + isThenable, + setImmediate: _setImmediate, + asap }; // node_modules/axios/lib/core/AxiosError.js @@ -13129,7 +13550,10 @@ function AxiosError(message, code, config, request, response) { code && (this.code = code); config && (this.config = config); request && (this.request = request); - response && (this.response = response); + if (response) { + this.response = response; + this.status = response.status ? response.status : null; + } } utils_default.inherits(AxiosError, Error, { toJSON: function toJSON() { @@ -13144,7 +13568,7 @@ utils_default.inherits(AxiosError, Error, { stack: this.stack, config: utils_default.toJSONObject(this.config), code: this.code, - status: this.response && this.response.status ? this.response.status : null + status: this.status }; } }); @@ -13416,11 +13840,34 @@ var node_default = { protocols: ["http", "https", "file", "data"] }; +// node_modules/axios/lib/platform/common/utils.js +var utils_exports = {}; +__export(utils_exports, { + hasBrowserEnv: () => hasBrowserEnv, + hasStandardBrowserEnv: () => hasStandardBrowserEnv, + hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv, + navigator: () => _navigator, + origin: () => origin +}); +var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; +var _navigator = typeof navigator === "object" && navigator || void 0; +var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); +var hasStandardBrowserWebWorkerEnv = (() => { + return typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; +})(); +var origin = hasBrowserEnv && window.location.href || "http://localhost"; + +// node_modules/axios/lib/platform/index.js +var platform_default = { + ...utils_exports, + ...node_default +}; + // node_modules/axios/lib/helpers/toURLEncodedForm.js function toURLEncodedForm(data, options) { - return toFormData_default(data, new node_default.classes.URLSearchParams(), Object.assign({ + return toFormData_default(data, new platform_default.classes.URLSearchParams(), Object.assign({ visitor: function(value, key, path, helpers) { - if (node_default.isNode && utils_default.isBuffer(value)) { + if (platform_default.isNode && utils_default.isBuffer(value)) { this.append(key, value.toString("base64")); return false; } @@ -13450,6 +13897,8 @@ function arrayToObject(arr) { function formDataToJSON(formData2) { function buildPath(path, value, target, index) { let name = path[index++]; + if (name === "__proto__") + return true; const isNumericKey = Number.isFinite(+name); const isLast = index >= path.length; name = !name && utils_default.isArray(target) ? target.length : name; @@ -13497,7 +13946,7 @@ function stringifySafely(rawValue, parser, encoder) { } var defaults = { transitional: transitional_default, - adapter: ["xhr", "http"], + adapter: ["xhr", "http", "fetch"], transformRequest: [function transformRequest(data, headers) { const contentType = headers.getContentType() || ""; const hasJSONContentType = contentType.indexOf("application/json") > -1; @@ -13507,12 +13956,9 @@ var defaults = { } const isFormData2 = utils_default.isFormData(data); if (isFormData2) { - if (!hasJSONContentType) { - return data; - } return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data; } - if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) { + if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) { return data; } if (utils_default.isArrayBufferView(data)) { @@ -13546,6 +13992,9 @@ var defaults = { const transitional2 = this.transitional || defaults.transitional; const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing; const JSONRequested = this.responseType === "json"; + if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) { + return data; + } if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { const silentJSONParsing = transitional2 && transitional2.silentJSONParsing; const strictJSONParsing = !silentJSONParsing && JSONRequested; @@ -13568,8 +14017,8 @@ var defaults = { maxContentLength: -1, maxBodyLength: -1, env: { - FormData: node_default.classes.FormData, - Blob: node_default.classes.Blob + FormData: platform_default.classes.FormData, + Blob: platform_default.classes.Blob }, validateStatus: function validateStatus(status) { return status >= 200 && status < 300; @@ -13705,6 +14154,10 @@ var AxiosHeaders = class { setHeaders(header, valueOrRewrite); } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { setHeaders(parseHeaders_default(header), valueOrRewrite); + } else if (utils_default.isHeaders(header)) { + for (const [key, value] of header.entries()) { + setHeader(value, key, rewrite); + } } else { header != null && setHeader(valueOrRewrite, header, rewrite); } @@ -13900,7 +14353,7 @@ function isAbsoluteURL(url2) { // node_modules/axios/lib/helpers/combineURLs.js function combineURLs(baseURL, relativeURL) { - return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; + return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; } // node_modules/axios/lib/core/buildFullPath.js @@ -13920,7 +14373,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1); var import_zlib = __toESM(require("zlib"), 1); // node_modules/axios/lib/env/data.js -var VERSION = "1.6.0"; +var VERSION = "1.7.5"; // node_modules/axios/lib/helpers/parseProtocol.js function parseProtocol(url2) { @@ -13931,7 +14384,7 @@ function parseProtocol(url2) { // node_modules/axios/lib/helpers/fromDataURI.js var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; function fromDataURI(uri, asBlob, options) { - const _Blob = options && options.Blob || node_default.classes.Blob; + const _Blob = options && options.Blob || platform_default.classes.Blob; const protocol = parseProtocol(uri); if (asBlob === void 0 && _Blob) { asBlob = true; @@ -13962,70 +14415,6 @@ var import_stream4 = __toESM(require("stream"), 1); // node_modules/axios/lib/helpers/AxiosTransformStream.js var import_stream = __toESM(require("stream"), 1); - -// node_modules/axios/lib/helpers/throttle.js -function throttle(fn, freq) { - let timestamp = 0; - const threshold = 1e3 / freq; - let timer = null; - return function throttled(force, args) { - const now = Date.now(); - if (force || now - timestamp > threshold) { - if (timer) { - clearTimeout(timer); - timer = null; - } - timestamp = now; - return fn.apply(null, args); - } - if (!timer) { - timer = setTimeout(() => { - timer = null; - timestamp = Date.now(); - return fn.apply(null, args); - }, threshold - (now - timestamp)); - } - }; -} -var throttle_default = throttle; - -// node_modules/axios/lib/helpers/speedometer.js -function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - min = min !== void 0 ? min : 1e3; - return function push(chunkLength) { - const now = Date.now(); - const startedAt = timestamps[tail]; - if (!firstSampleTS) { - firstSampleTS = now; - } - bytes[head] = chunkLength; - timestamps[head] = now; - let i = tail; - let bytesCount = 0; - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - head = (head + 1) % samplesCount; - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - if (now - firstSampleTS < min) { - return; - } - const passed = startedAt && now - startedAt; - return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; - }; -} -var speedometer_default = speedometer; - -// node_modules/axios/lib/helpers/AxiosTransformStream.js var kInternals = Symbol("internals"); var AxiosTransformStream = class extends import_stream.default.Transform { constructor(options) { @@ -14042,11 +14431,8 @@ var AxiosTransformStream = class extends import_stream.default.Transform { super({ readableHighWaterMark: options.chunkSize }); - const self2 = this; const internals = this[kInternals] = { - length: options.length, timeWindow: options.timeWindow, - ticksRate: options.ticksRate, chunkSize: options.chunkSize, maxRate: options.maxRate, minChunkSize: options.minChunkSize, @@ -14057,7 +14443,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform { bytes: 0, onReadCallback: null }; - const _speedometer = speedometer_default(internals.ticksRate * options.samplesCount, internals.timeWindow); this.on("newListener", (event) => { if (event === "progress") { if (!internals.isCaptured) { @@ -14065,31 +14450,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform { } } }); - let bytesNotified = 0; - internals.updateProgress = throttle_default(function throttledHandler() { - const totalBytes = internals.length; - const bytesTransferred = internals.bytesSeen; - const progressBytes = bytesTransferred - bytesNotified; - if (!progressBytes || self2.destroyed) - return; - const rate = _speedometer(progressBytes); - bytesNotified = bytesTransferred; - process.nextTick(() => { - self2.emit("progress", { - "loaded": bytesTransferred, - "total": totalBytes, - "progress": totalBytes ? bytesTransferred / totalBytes : void 0, - "bytes": progressBytes, - "rate": rate ? rate : void 0, - "estimated": rate && totalBytes && bytesTransferred <= totalBytes ? (totalBytes - bytesTransferred) / rate : void 0 - }); - }); - }, internals.ticksRate); - const onFinish = () => { - internals.updateProgress(true); - }; - this.once("end", onFinish); - this.once("error", onFinish); } _read(size) { const internals = this[kInternals]; @@ -14099,7 +14459,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform { return super._read(size); } _transform(chunk, encoding, callback) { - const self2 = this; const internals = this[kInternals]; const maxRate = internals.maxRate; const readableHighWaterMark = this.readableHighWaterMark; @@ -14107,14 +14466,12 @@ var AxiosTransformStream = class extends import_stream.default.Transform { const divider = 1e3 / timeWindow; const bytesThreshold = maxRate / divider; const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; - function pushChunk(_chunk, _callback) { + const pushChunk = (_chunk, _callback) => { const bytes = Buffer.byteLength(_chunk); internals.bytesSeen += bytes; internals.bytes += bytes; - if (internals.isCaptured) { - internals.updateProgress(); - } - if (self2.push(_chunk)) { + internals.isCaptured && this.emit("progress", internals.bytesSeen); + if (this.push(_chunk)) { process.nextTick(_callback); } else { internals.onReadCallback = () => { @@ -14122,7 +14479,7 @@ var AxiosTransformStream = class extends import_stream.default.Transform { process.nextTick(_callback); }; } - } + }; const transformChunk = (_chunk, _callback) => { const chunkSize = Buffer.byteLength(_chunk); let chunkRemainder = null; @@ -14168,15 +14525,11 @@ var AxiosTransformStream = class extends import_stream.default.Transform { } }); } - setLength(length) { - this[kInternals].length = +length; - return this; - } }; var AxiosTransformStream_default = AxiosTransformStream; // node_modules/axios/lib/adapters/http.js -var import_events = __toESM(require("events"), 1); +var import_events = require("events"); // node_modules/axios/lib/helpers/formDataToStream.js var import_util = require("util"); @@ -14313,6 +14666,112 @@ var callbackify = (fn, reducer) => { }; var callbackify_default = callbackify; +// node_modules/axios/lib/helpers/speedometer.js +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + min = min !== void 0 ? min : 1e3; + return function push(chunkLength) { + const now = Date.now(); + const startedAt = timestamps[tail]; + if (!firstSampleTS) { + firstSampleTS = now; + } + bytes[head] = chunkLength; + timestamps[head] = now; + let i = tail; + let bytesCount = 0; + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + head = (head + 1) % samplesCount; + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + if (now - firstSampleTS < min) { + return; + } + const passed = startedAt && now - startedAt; + return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; + }; +} +var speedometer_default = speedometer; + +// node_modules/axios/lib/helpers/throttle.js +function throttle(fn, freq) { + let timestamp = 0; + let threshold = 1e3 / freq; + let lastArgs; + let timer; + const invoke = (args, now = Date.now()) => { + timestamp = now; + lastArgs = null; + if (timer) { + clearTimeout(timer); + timer = null; + } + fn.apply(null, args); + }; + const throttled = (...args) => { + const now = Date.now(); + const passed = now - timestamp; + if (passed >= threshold) { + invoke(args, now); + } else { + lastArgs = args; + if (!timer) { + timer = setTimeout(() => { + timer = null; + invoke(lastArgs); + }, threshold - passed); + } + } + }; + const flush = () => lastArgs && invoke(lastArgs); + return [throttled, flush]; +} +var throttle_default = throttle; + +// node_modules/axios/lib/helpers/progressEventReducer.js +var progressEventReducer = (listener, isDownloadStream, freq = 3) => { + let bytesNotified = 0; + const _speedometer = speedometer_default(50, 250); + return throttle_default((e) => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : void 0; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + bytesNotified = loaded; + const data = { + loaded, + total, + progress: total ? loaded / total : void 0, + bytes: progressBytes, + rate: rate ? rate : void 0, + estimated: rate && total && inRange ? (total - loaded) / rate : void 0, + event: e, + lengthComputable: total != null, + [isDownloadStream ? "download" : "upload"]: true + }; + listener(data); + }, freq); +}; +var progressEventDecorator = (total, throttled) => { + const lengthComputable = total != null; + return [(loaded) => throttled[0]({ + lengthComputable, + total, + loaded + }), throttled[1]]; +}; +var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args)); + // node_modules/axios/lib/adapters/http.js var zlibOptions = { flush: import_zlib.default.constants.Z_SYNC_FLUSH, @@ -14325,15 +14784,19 @@ var brotliOptions = { var isBrotliSupported = utils_default.isFunction(import_zlib.default.createBrotliDecompress); var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default; var isHttps = /https:?/; -var supportedProtocols = node_default.protocols.map((protocol) => { +var supportedProtocols = platform_default.protocols.map((protocol) => { return protocol + ":"; }); -function dispatchBeforeRedirect(options) { +var flushOnFinish = (stream4, [throttled, flush]) => { + stream4.on("end", flush).on("error", flush); + return throttled; +}; +function dispatchBeforeRedirect(options, responseDetails) { if (options.beforeRedirects.proxy) { options.beforeRedirects.proxy(options); } if (options.beforeRedirects.config) { - options.beforeRedirects.config(options); + options.beforeRedirects.config(options, responseDetails); } } function setProxy(options, configProxy, location) { @@ -14413,12 +14876,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]); lookup = (hostname, opt, cb) => { _lookup(hostname, opt, (err, arg0, arg1) => { + if (err) { + return cb(err); + } const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); }); }; } - const emitter = new import_events.default(); + const emitter = new import_events.EventEmitter(); const onFinished = () => { if (config.cancelToken) { config.cancelToken.unsubscribe(abort); @@ -14446,7 +14912,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { } } const fullPath = buildFullPath(config.baseURL, config.url); - const parsed = new URL(fullPath, "http://localhost"); + const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0); const protocol = parsed.protocol || supportedProtocols[0]; if (protocol === "data:") { let convertedData; @@ -14490,8 +14956,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { } const headers = AxiosHeaders_default.from(config.headers).normalize(); headers.set("User-Agent", "axios/" + VERSION, false); - const onDownloadProgress = config.onDownloadProgress; - const onUploadProgress = config.onUploadProgress; + const { onUploadProgress, onDownloadProgress } = config; const maxRate = config.maxRate; let maxUploadRate = void 0; let maxDownloadRate = void 0; @@ -14550,14 +15015,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { data = import_stream4.default.Readable.from(data, { objectMode: false }); } data = import_stream4.default.pipeline([data, new AxiosTransformStream_default({ - length: contentLength, maxRate: utils_default.toFiniteNumber(maxUploadRate) })], utils_default.noop); - onUploadProgress && data.on("progress", (progress) => { - onUploadProgress(Object.assign(progress, { - upload: true - })); - }); + onUploadProgress && data.on("progress", flushOnFinish( + data, + progressEventDecorator( + contentLength, + progressEventReducer(asyncDecorator(onUploadProgress), false, 3) + ) + )); } let auth = void 0; if (config.auth) { @@ -14638,16 +15104,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { return; const streams = [res]; const responseLength = +res.headers["content-length"]; - if (onDownloadProgress) { + if (onDownloadProgress || maxDownloadRate) { const transformStream = new AxiosTransformStream_default({ - length: utils_default.toFiniteNumber(responseLength), maxRate: utils_default.toFiniteNumber(maxDownloadRate) }); - onDownloadProgress && transformStream.on("progress", (progress) => { - onDownloadProgress(Object.assign(progress, { - download: true - })); - }); + onDownloadProgress && transformStream.on("progress", flushOnFinish( + transformStream, + progressEventDecorator( + responseLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) + ) + )); streams.push(transformStream); } let responseStream = res; @@ -14809,49 +15276,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { }); }; -// node_modules/axios/lib/helpers/cookies.js -var cookies_default = node_default.isStandardBrowserEnv ? function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - const cookie = []; - cookie.push(name + "=" + encodeURIComponent(value)); - if (utils_default.isNumber(expires)) { - cookie.push("expires=" + new Date(expires).toGMTString()); - } - if (utils_default.isString(path)) { - cookie.push("path=" + path); - } - if (utils_default.isString(domain)) { - cookie.push("domain=" + domain); - } - if (secure === true) { - cookie.push("secure"); - } - document.cookie = cookie.join("; "); - }, - read: function read(name) { - const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)")); - return match ? decodeURIComponent(match[3]) : null; - }, - remove: function remove(name) { - this.write(name, "", Date.now() - 864e5); - } - }; -}() : function nonStandardBrowserEnv() { - return { - write: function write() { - }, - read: function read() { - return null; - }, - remove: function remove() { - } - }; -}(); - // node_modules/axios/lib/helpers/isURLSameOrigin.js -var isURLSameOrigin_default = node_default.isStandardBrowserEnv ? function standardBrowserEnv2() { - const msie = /(msie|trident)/i.test(navigator.userAgent); +var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? function standardBrowserEnv() { + const msie = platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent); const urlParsingNode = document.createElement("a"); let originURL; function resolveURL(url2) { @@ -14877,109 +15304,211 @@ var isURLSameOrigin_default = node_default.isStandardBrowserEnv ? function stand const parsed = utils_default.isString(requestURL) ? resolveURL(requestURL) : requestURL; return parsed.protocol === originURL.protocol && parsed.host === originURL.host; }; -}() : function nonStandardBrowserEnv2() { +}() : function nonStandardBrowserEnv() { return function isURLSameOrigin() { return true; }; }(); -// node_modules/axios/lib/adapters/xhr.js -function progressEventReducer(listener, isDownloadStream) { - let bytesNotified = 0; - const _speedometer = speedometer_default(50, 250); - return (e) => { - const loaded = e.loaded; - const total = e.lengthComputable ? e.total : void 0; - const progressBytes = loaded - bytesNotified; - const rate = _speedometer(progressBytes); - const inRange = loaded <= total; - bytesNotified = loaded; - const data = { - loaded, - total, - progress: total ? loaded / total : void 0, - bytes: progressBytes, - rate: rate ? rate : void 0, - estimated: rate && total && inRange ? (total - loaded) / rate : void 0, - event: e - }; - data[isDownloadStream ? "download" : "upload"] = true; - listener(data); - }; -} -var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; -var xhr_default = isXHRAdapterSupported && function(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - let requestData = config.data; - const requestHeaders = AxiosHeaders_default.from(config.headers).normalize(); - const responseType = config.responseType; - let onCanceled; - function done() { - if (config.cancelToken) { - config.cancelToken.unsubscribe(onCanceled); - } - if (config.signal) { - config.signal.removeEventListener("abort", onCanceled); - } +// node_modules/axios/lib/helpers/cookies.js +var cookies_default = platform_default.hasStandardBrowserEnv ? { + write(name, value, expires, path, domain, secure) { + const cookie = [name + "=" + encodeURIComponent(value)]; + utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString()); + utils_default.isString(path) && cookie.push("path=" + path); + utils_default.isString(domain) && cookie.push("domain=" + domain); + secure === true && cookie.push("secure"); + document.cookie = cookie.join("; "); + }, + read(name) { + const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)")); + return match ? decodeURIComponent(match[3]) : null; + }, + remove(name) { + this.write(name, "", Date.now() - 864e5); + } +} : { + write() { + }, + read() { + return null; + }, + remove() { + } +}; + +// node_modules/axios/lib/core/mergeConfig.js +var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing; +function mergeConfig(config1, config2) { + config2 = config2 || {}; + const config = {}; + function getMergedValue(target, source, caseless) { + if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) { + return utils_default.merge.call({ caseless }, target, source); + } else if (utils_default.isPlainObject(source)) { + return utils_default.merge({}, source); + } else if (utils_default.isArray(source)) { + return source.slice(); } - let contentType; - if (utils_default.isFormData(requestData)) { - if (node_default.isStandardBrowserEnv || node_default.isStandardBrowserWebWorkerEnv) { - requestHeaders.setContentType(false); - } else if (!requestHeaders.getContentType(/^\s*multipart\/form-data/)) { - requestHeaders.setContentType("multipart/form-data"); - } else if (utils_default.isString(contentType = requestHeaders.getContentType())) { - requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, "$1")); - } + return source; + } + function mergeDeepProperties(a, b, caseless) { + if (!utils_default.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils_default.isUndefined(a)) { + return getMergedValue(void 0, a, caseless); } - let request = new XMLHttpRequest(); - if (config.auth) { - const username = config.auth.username || ""; - const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ""; - requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password)); + } + function valueFromConfig2(a, b) { + if (!utils_default.isUndefined(b)) { + return getMergedValue(void 0, b); } - const fullPath = buildFullPath(config.baseURL, config.url); - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); - request.timeout = config.timeout; - function onloadend() { - if (!request) { - return; - } - const responseHeaders = AxiosHeaders_default.from( - "getAllResponseHeaders" in request && request.getAllResponseHeaders() - ); - const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request - }; - settle(function _resolve(value) { - resolve(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); - request = null; + } + function defaultToConfig2(a, b) { + if (!utils_default.isUndefined(b)) { + return getMergedValue(void 0, b); + } else if (!utils_default.isUndefined(a)) { + return getMergedValue(void 0, a); } - if ("onloadend" in request) { - request.onloadend = onloadend; - } else { - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { - return; - } - setTimeout(onloadend); - }; + } + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(void 0, a); } - request.onabort = function handleAbort() { + } + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + const merge2 = mergeMap[prop] || mergeDeepProperties; + const configValue = merge2(config1[prop], config2[prop], prop); + utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); + }); + return config; +} + +// node_modules/axios/lib/helpers/resolveConfig.js +var resolveConfig_default = (config) => { + const newConfig = mergeConfig({}, config); + let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; + newConfig.headers = headers = AxiosHeaders_default.from(headers); + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer); + if (auth) { + headers.set( + "Authorization", + "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) + ); + } + let contentType; + if (utils_default.isFormData(data)) { + if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) { + headers.setContentType(void 0); + } else if ((contentType = headers.getContentType()) !== false) { + const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : []; + headers.setContentType([type || "multipart/form-data", ...tokens].join("; ")); + } + } + if (platform_default.hasStandardBrowserEnv) { + withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); + if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) { + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName); + if (xsrfValue) { + headers.set(xsrfHeaderName, xsrfValue); + } + } + } + return newConfig; +}; + +// node_modules/axios/lib/adapters/xhr.js +var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; +var xhr_default = isXHRAdapterSupported && function(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + const _config = resolveConfig_default(config); + let requestData = _config.data; + const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize(); + let { responseType, onUploadProgress, onDownloadProgress } = _config; + let onCanceled; + let uploadThrottled, downloadThrottled; + let flushUpload, flushDownload; + function done() { + flushUpload && flushUpload(); + flushDownload && flushDownload(); + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); + _config.signal && _config.signal.removeEventListener("abort", onCanceled); + } + let request = new XMLHttpRequest(); + request.open(_config.method.toUpperCase(), _config.url, true); + request.timeout = _config.timeout; + function onloadend() { + if (!request) { + return; + } + const responseHeaders = AxiosHeaders_default.from( + "getAllResponseHeaders" in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + request = null; + } + if ("onloadend" in request) { + request.onloadend = onloadend; + } else { + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { + return; + } + setTimeout(onloadend); + }; + } + request.onabort = function handleAbort() { if (!request) { return; } @@ -14991,10 +15520,10 @@ var xhr_default = isXHRAdapterSupported && function(config) { request = null; }; request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional2 = config.transitional || transitional_default; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; + let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; + const transitional2 = _config.transitional || transitional_default; + if (_config.timeoutErrorMessage) { + timeoutErrorMessage = _config.timeoutErrorMessage; } reject(new AxiosError_default( timeoutErrorMessage, @@ -15004,31 +15533,28 @@ var xhr_default = isXHRAdapterSupported && function(config) { )); request = null; }; - if (node_default.isStandardBrowserEnv) { - const xsrfValue = isURLSameOrigin_default(fullPath) && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName); - if (xsrfValue) { - requestHeaders.set(config.xsrfHeaderName, xsrfValue); - } - } requestData === void 0 && requestHeaders.setContentType(null); if ("setRequestHeader" in request) { utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { request.setRequestHeader(key, val); }); } - if (!utils_default.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; + if (!utils_default.isUndefined(_config.withCredentials)) { + request.withCredentials = !!_config.withCredentials; } if (responseType && responseType !== "json") { - request.responseType = config.responseType; + request.responseType = _config.responseType; } - if (typeof config.onDownloadProgress === "function") { - request.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true)); + if (onDownloadProgress) { + [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); + request.addEventListener("progress", downloadThrottled); } - if (typeof config.onUploadProgress === "function" && request.upload) { - request.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress)); + if (onUploadProgress && request.upload) { + [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); + request.upload.addEventListener("progress", uploadThrottled); + request.upload.addEventListener("loadend", flushUpload); } - if (config.cancelToken || config.signal) { + if (_config.cancelToken || _config.signal) { onCanceled = (cancel) => { if (!request) { return; @@ -15037,13 +15563,13 @@ var xhr_default = isXHRAdapterSupported && function(config) { request.abort(); request = null; }; - config.cancelToken && config.cancelToken.subscribe(onCanceled); - if (config.signal) { - config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled); + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) { + _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); } } - const protocol = parseProtocol(fullPath); - if (protocol && node_default.protocols.indexOf(protocol) === -1) { + const protocol = parseProtocol(_config.url); + if (protocol && platform_default.protocols.indexOf(protocol) === -1) { reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config)); return; } @@ -15051,10 +15577,269 @@ var xhr_default = isXHRAdapterSupported && function(config) { }); }; +// node_modules/axios/lib/helpers/composeSignals.js +var composeSignals = (signals, timeout) => { + let controller = new AbortController(); + let aborted; + const onabort = function(cancel) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = cancel instanceof Error ? cancel : this.reason; + controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err)); + } + }; + let timer = timeout && setTimeout(() => { + onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT)); + }, timeout); + const unsubscribe = () => { + if (signals) { + timer && clearTimeout(timer); + timer = null; + signals.forEach((signal2) => { + signal2 && (signal2.removeEventListener ? signal2.removeEventListener("abort", onabort) : signal2.unsubscribe(onabort)); + }); + signals = null; + } + }; + signals.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort)); + const { signal } = controller; + signal.unsubscribe = unsubscribe; + return [signal, () => { + timer && clearTimeout(timer); + timer = null; + }]; +}; +var composeSignals_default = composeSignals; + +// node_modules/axios/lib/helpers/trackStream.js +var streamChunk = function* (chunk, chunkSize) { + let len = chunk.byteLength; + if (!chunkSize || len < chunkSize) { + yield chunk; + return; + } + let pos = 0; + let end; + while (pos < len) { + end = pos + chunkSize; + yield chunk.slice(pos, end); + pos = end; + } +}; +var readBytes = async function* (iterable, chunkSize, encode3) { + for await (const chunk of iterable) { + yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : await encode3(String(chunk)), chunkSize); + } +}; +var trackStream = (stream4, chunkSize, onProgress, onFinish, encode3) => { + const iterator = readBytes(stream4, chunkSize, encode3); + let bytes = 0; + let done; + let _onFinish = (e) => { + if (!done) { + done = true; + onFinish && onFinish(e); + } + }; + return new ReadableStream({ + async pull(controller) { + try { + const { done: done2, value } = await iterator.next(); + if (done2) { + _onFinish(); + controller.close(); + return; + } + let len = value.byteLength; + if (onProgress) { + let loadedBytes = bytes += len; + onProgress(loadedBytes); + } + controller.enqueue(new Uint8Array(value)); + } catch (err) { + _onFinish(err); + throw err; + } + }, + cancel(reason) { + _onFinish(reason); + return iterator.return(); + } + }, { + highWaterMark: 2 + }); +}; + +// node_modules/axios/lib/adapters/fetch.js +var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function"; +var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function"; +var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer())); +var test = (fn, ...args) => { + try { + return !!fn(...args); + } catch (e) { + return false; + } +}; +var supportsRequestStream = isReadableStreamSupported && test(() => { + let duplexAccessed = false; + const hasContentType = new Request(platform_default.origin, { + body: new ReadableStream(), + method: "POST", + get duplex() { + duplexAccessed = true; + return "half"; + } + }).headers.has("Content-Type"); + return duplexAccessed && !hasContentType; +}); +var DEFAULT_CHUNK_SIZE = 64 * 1024; +var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body)); +var resolvers = { + stream: supportsResponseStream && ((res) => res.body) +}; +isFetchSupported && ((res) => { + ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { + !resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => { + throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config); + }); + }); +})(new Response()); +var getBodyLength = async (body) => { + if (body == null) { + return 0; + } + if (utils_default.isBlob(body)) { + return body.size; + } + if (utils_default.isSpecCompliantForm(body)) { + return (await new Request(body).arrayBuffer()).byteLength; + } + if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) { + return body.byteLength; + } + if (utils_default.isURLSearchParams(body)) { + body = body + ""; + } + if (utils_default.isString(body)) { + return (await encodeText(body)).byteLength; + } +}; +var resolveBodyLength = async (headers, body) => { + const length = utils_default.toFiniteNumber(headers.getContentLength()); + return length == null ? getBodyLength(body) : length; +}; +var fetch_default = isFetchSupported && (async (config) => { + let { + url: url2, + method, + data, + signal, + cancelToken, + timeout, + onDownloadProgress, + onUploadProgress, + responseType, + headers, + withCredentials = "same-origin", + fetchOptions + } = resolveConfig_default(config); + responseType = responseType ? (responseType + "").toLowerCase() : "text"; + let [composedSignal, stopTimeout] = signal || cancelToken || timeout ? composeSignals_default([signal, cancelToken], timeout) : []; + let finished, request; + const onFinish = () => { + !finished && setTimeout(() => { + composedSignal && composedSignal.unsubscribe(); + }); + finished = true; + }; + let requestContentLength; + try { + if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { + let _request = new Request(url2, { + method: "POST", + body: data, + duplex: "half" + }); + let contentTypeHeader; + if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { + headers.setContentType(contentTypeHeader); + } + if (_request.body) { + const [onProgress, flush] = progressEventDecorator( + requestContentLength, + progressEventReducer(asyncDecorator(onUploadProgress)) + ); + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText); + } + } + if (!utils_default.isString(withCredentials)) { + withCredentials = withCredentials ? "include" : "omit"; + } + const isCredentialsSupported = "credentials" in Request.prototype; + request = new Request(url2, { + ...fetchOptions, + signal: composedSignal, + method: method.toUpperCase(), + headers: headers.normalize().toJSON(), + body: data, + duplex: "half", + credentials: isCredentialsSupported ? withCredentials : void 0 + }); + let response = await fetch(request); + const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); + if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) { + const options = {}; + ["status", "statusText", "headers"].forEach((prop) => { + options[prop] = response[prop]; + }); + const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length")); + const [onProgress, flush] = onDownloadProgress && progressEventDecorator( + responseContentLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true) + ) || []; + response = new Response( + trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { + flush && flush(); + isStreamResponse && onFinish(); + }, encodeText), + options + ); + } + responseType = responseType || "text"; + let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config); + !isStreamResponse && onFinish(); + stopTimeout && stopTimeout(); + return await new Promise((resolve, reject) => { + settle(resolve, reject, { + data: responseData, + headers: AxiosHeaders_default.from(response.headers), + status: response.status, + statusText: response.statusText, + config, + request + }); + }); + } catch (err) { + onFinish(); + if (err && err.name === "TypeError" && /fetch/i.test(err.message)) { + throw Object.assign( + new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request), + { + cause: err.cause || err + } + ); + } + throw AxiosError_default.from(err, err && err.code, config, request); + } +}); + // node_modules/axios/lib/adapters/adapters.js var knownAdapters = { http: http_default, - xhr: xhr_default + xhr: xhr_default, + fetch: fetch_default }; utils_default.forEach(knownAdapters, (fn, value) => { if (fn) { @@ -15149,85 +15934,6 @@ function dispatchRequest(config) { }); } -// node_modules/axios/lib/core/mergeConfig.js -var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing; -function mergeConfig(config1, config2) { - config2 = config2 || {}; - const config = {}; - function getMergedValue(target, source, caseless) { - if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) { - return utils_default.merge.call({ caseless }, target, source); - } else if (utils_default.isPlainObject(source)) { - return utils_default.merge({}, source); - } else if (utils_default.isArray(source)) { - return source.slice(); - } - return source; - } - function mergeDeepProperties(a, b, caseless) { - if (!utils_default.isUndefined(b)) { - return getMergedValue(a, b, caseless); - } else if (!utils_default.isUndefined(a)) { - return getMergedValue(void 0, a, caseless); - } - } - function valueFromConfig2(a, b) { - if (!utils_default.isUndefined(b)) { - return getMergedValue(void 0, b); - } - } - function defaultToConfig2(a, b) { - if (!utils_default.isUndefined(b)) { - return getMergedValue(void 0, b); - } else if (!utils_default.isUndefined(a)) { - return getMergedValue(void 0, a); - } - } - function mergeDirectKeys(a, b, prop) { - if (prop in config2) { - return getMergedValue(a, b); - } else if (prop in config1) { - return getMergedValue(void 0, a); - } - } - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) - }; - utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { - const merge2 = mergeMap[prop] || mergeDeepProperties; - const configValue = merge2(config1[prop], config2[prop], prop); - utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); - }); - return config; -} - // node_modules/axios/lib/helpers/validator.js var validators = {}; ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => { @@ -15296,7 +16002,27 @@ var Axios = class { response: new InterceptorManager_default() }; } - request(configOrUrl, config) { + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy; + Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error(); + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; + try { + if (!err.stack) { + err.stack = stack; + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { + err.stack += "\n" + stack; + } + } catch (e) { + } + } + throw err; + } + } + _request(configOrUrl, config) { if (typeof configOrUrl === "string") { config = config || {}; config.url = configOrUrl; @@ -16812,13 +17538,34 @@ ErrorResponseError.attributeTypeMap = [ } ]; -// model/eventCallbackRequest.ts -var _EventCallbackRequest = class { - static getAttributeTypeMap() { - return _EventCallbackRequest.attributeTypeMap; - } - static init(data) { - return ObjectSerializer.deserialize(data, "EventCallbackRequest"); +// model/eventCallbackHelper.ts +var crypto = __toESM(require("crypto")); +var _EventCallbackHelper = class { +}; +var EventCallbackHelper = _EventCallbackHelper; +EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback"; +EventCallbackHelper.EVENT_TYPE_APP_CALLBACK = "app_callback"; +EventCallbackHelper.isValid = (apiKey, eventCallback) => { + const hmac = crypto.createHmac("sha256", apiKey); + hmac.update( + `${eventCallback.event.eventTime}${eventCallback.event.eventType}` + ); + return eventCallback.event.eventHash === hmac.digest("hex").toString(); +}; +EventCallbackHelper.getCallbackType = (eventCallback) => { + if (!eventCallback.event.eventMetadata || !eventCallback.event.eventMetadata.reportedForAppId) { + return _EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK; + } + return _EventCallbackHelper.EVENT_TYPE_APP_CALLBACK; +}; + +// model/eventCallbackRequest.ts +var _EventCallbackRequest = class { + static getAttributeTypeMap() { + return _EventCallbackRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "EventCallbackRequest"); } }; var EventCallbackRequest = _EventCallbackRequest; @@ -16945,333 +17692,829 @@ EventCallbackRequestEventMetadata.attributeTypeMap = [ } ]; -// model/fileResponse.ts -var _FileResponse = class { +// model/faxLineAddUserRequest.ts +var _FaxLineAddUserRequest = class { static getAttributeTypeMap() { - return _FileResponse.attributeTypeMap; + return _FaxLineAddUserRequest.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize(data, "FileResponse"); + return ObjectSerializer.deserialize(data, "FaxLineAddUserRequest"); } }; -var FileResponse = _FileResponse; -FileResponse.discriminator = void 0; -FileResponse.attributeTypeMap = [ +var FaxLineAddUserRequest = _FaxLineAddUserRequest; +FaxLineAddUserRequest.discriminator = void 0; +FaxLineAddUserRequest.attributeTypeMap = [ { - name: "fileUrl", - baseName: "file_url", + name: "number", + baseName: "number", type: "string" }, { - name: "expiresAt", - baseName: "expires_at", - type: "number" + name: "accountId", + baseName: "account_id", + type: "string" + }, + { + name: "emailAddress", + baseName: "email_address", + type: "string" } ]; -// model/fileResponseDataUri.ts -var _FileResponseDataUri = class { +// model/faxLineAreaCodeGetCountryEnum.ts +var FaxLineAreaCodeGetCountryEnum = /* @__PURE__ */ ((FaxLineAreaCodeGetCountryEnum2) => { + FaxLineAreaCodeGetCountryEnum2["Ca"] = "CA"; + FaxLineAreaCodeGetCountryEnum2["Us"] = "US"; + FaxLineAreaCodeGetCountryEnum2["Uk"] = "UK"; + return FaxLineAreaCodeGetCountryEnum2; +})(FaxLineAreaCodeGetCountryEnum || {}); + +// model/faxLineAreaCodeGetProvinceEnum.ts +var FaxLineAreaCodeGetProvinceEnum = /* @__PURE__ */ ((FaxLineAreaCodeGetProvinceEnum2) => { + FaxLineAreaCodeGetProvinceEnum2["Ab"] = "AB"; + FaxLineAreaCodeGetProvinceEnum2["Bc"] = "BC"; + FaxLineAreaCodeGetProvinceEnum2["Mb"] = "MB"; + FaxLineAreaCodeGetProvinceEnum2["Nb"] = "NB"; + FaxLineAreaCodeGetProvinceEnum2["Nl"] = "NL"; + FaxLineAreaCodeGetProvinceEnum2["Nt"] = "NT"; + FaxLineAreaCodeGetProvinceEnum2["Ns"] = "NS"; + FaxLineAreaCodeGetProvinceEnum2["Nu"] = "NU"; + FaxLineAreaCodeGetProvinceEnum2["On"] = "ON"; + FaxLineAreaCodeGetProvinceEnum2["Pe"] = "PE"; + FaxLineAreaCodeGetProvinceEnum2["Qc"] = "QC"; + FaxLineAreaCodeGetProvinceEnum2["Sk"] = "SK"; + FaxLineAreaCodeGetProvinceEnum2["Yt"] = "YT"; + return FaxLineAreaCodeGetProvinceEnum2; +})(FaxLineAreaCodeGetProvinceEnum || {}); + +// model/faxLineAreaCodeGetResponse.ts +var _FaxLineAreaCodeGetResponse = class { static getAttributeTypeMap() { - return _FileResponseDataUri.attributeTypeMap; + return _FaxLineAreaCodeGetResponse.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize(data, "FileResponseDataUri"); + return ObjectSerializer.deserialize(data, "FaxLineAreaCodeGetResponse"); } }; -var FileResponseDataUri = _FileResponseDataUri; -FileResponseDataUri.discriminator = void 0; -FileResponseDataUri.attributeTypeMap = [ +var FaxLineAreaCodeGetResponse = _FaxLineAreaCodeGetResponse; +FaxLineAreaCodeGetResponse.discriminator = void 0; +FaxLineAreaCodeGetResponse.attributeTypeMap = [ { - name: "dataUri", - baseName: "data_uri", - type: "string" + name: "areaCodes", + baseName: "area_codes", + type: "Array" } ]; -// model/listInfoResponse.ts -var _ListInfoResponse = class { +// model/faxLineAreaCodeGetStateEnum.ts +var FaxLineAreaCodeGetStateEnum = /* @__PURE__ */ ((FaxLineAreaCodeGetStateEnum2) => { + FaxLineAreaCodeGetStateEnum2["Ak"] = "AK"; + FaxLineAreaCodeGetStateEnum2["Al"] = "AL"; + FaxLineAreaCodeGetStateEnum2["Ar"] = "AR"; + FaxLineAreaCodeGetStateEnum2["Az"] = "AZ"; + FaxLineAreaCodeGetStateEnum2["Ca"] = "CA"; + FaxLineAreaCodeGetStateEnum2["Co"] = "CO"; + FaxLineAreaCodeGetStateEnum2["Ct"] = "CT"; + FaxLineAreaCodeGetStateEnum2["Dc"] = "DC"; + FaxLineAreaCodeGetStateEnum2["De"] = "DE"; + FaxLineAreaCodeGetStateEnum2["Fl"] = "FL"; + FaxLineAreaCodeGetStateEnum2["Ga"] = "GA"; + FaxLineAreaCodeGetStateEnum2["Hi"] = "HI"; + FaxLineAreaCodeGetStateEnum2["Ia"] = "IA"; + FaxLineAreaCodeGetStateEnum2["Id"] = "ID"; + FaxLineAreaCodeGetStateEnum2["Il"] = "IL"; + FaxLineAreaCodeGetStateEnum2["In"] = "IN"; + FaxLineAreaCodeGetStateEnum2["Ks"] = "KS"; + FaxLineAreaCodeGetStateEnum2["Ky"] = "KY"; + FaxLineAreaCodeGetStateEnum2["La"] = "LA"; + FaxLineAreaCodeGetStateEnum2["Ma"] = "MA"; + FaxLineAreaCodeGetStateEnum2["Md"] = "MD"; + FaxLineAreaCodeGetStateEnum2["Me"] = "ME"; + FaxLineAreaCodeGetStateEnum2["Mi"] = "MI"; + FaxLineAreaCodeGetStateEnum2["Mn"] = "MN"; + FaxLineAreaCodeGetStateEnum2["Mo"] = "MO"; + FaxLineAreaCodeGetStateEnum2["Ms"] = "MS"; + FaxLineAreaCodeGetStateEnum2["Mt"] = "MT"; + FaxLineAreaCodeGetStateEnum2["Nc"] = "NC"; + FaxLineAreaCodeGetStateEnum2["Nd"] = "ND"; + FaxLineAreaCodeGetStateEnum2["Ne"] = "NE"; + FaxLineAreaCodeGetStateEnum2["Nh"] = "NH"; + FaxLineAreaCodeGetStateEnum2["Nj"] = "NJ"; + FaxLineAreaCodeGetStateEnum2["Nm"] = "NM"; + FaxLineAreaCodeGetStateEnum2["Nv"] = "NV"; + FaxLineAreaCodeGetStateEnum2["Ny"] = "NY"; + FaxLineAreaCodeGetStateEnum2["Oh"] = "OH"; + FaxLineAreaCodeGetStateEnum2["Ok"] = "OK"; + FaxLineAreaCodeGetStateEnum2["Or"] = "OR"; + FaxLineAreaCodeGetStateEnum2["Pa"] = "PA"; + FaxLineAreaCodeGetStateEnum2["Ri"] = "RI"; + FaxLineAreaCodeGetStateEnum2["Sc"] = "SC"; + FaxLineAreaCodeGetStateEnum2["Sd"] = "SD"; + FaxLineAreaCodeGetStateEnum2["Tn"] = "TN"; + FaxLineAreaCodeGetStateEnum2["Tx"] = "TX"; + FaxLineAreaCodeGetStateEnum2["Ut"] = "UT"; + FaxLineAreaCodeGetStateEnum2["Va"] = "VA"; + FaxLineAreaCodeGetStateEnum2["Vt"] = "VT"; + FaxLineAreaCodeGetStateEnum2["Wa"] = "WA"; + FaxLineAreaCodeGetStateEnum2["Wi"] = "WI"; + FaxLineAreaCodeGetStateEnum2["Wv"] = "WV"; + FaxLineAreaCodeGetStateEnum2["Wy"] = "WY"; + return FaxLineAreaCodeGetStateEnum2; +})(FaxLineAreaCodeGetStateEnum || {}); + +// model/faxLineCreateRequest.ts +var _FaxLineCreateRequest = class { static getAttributeTypeMap() { - return _ListInfoResponse.attributeTypeMap; + return _FaxLineCreateRequest.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize(data, "ListInfoResponse"); + return ObjectSerializer.deserialize(data, "FaxLineCreateRequest"); } }; -var ListInfoResponse = _ListInfoResponse; -ListInfoResponse.discriminator = void 0; -ListInfoResponse.attributeTypeMap = [ +var FaxLineCreateRequest = _FaxLineCreateRequest; +FaxLineCreateRequest.discriminator = void 0; +FaxLineCreateRequest.attributeTypeMap = [ { - name: "numPages", - baseName: "num_pages", + name: "areaCode", + baseName: "area_code", type: "number" }, { - name: "numResults", - baseName: "num_results", - type: "number" + name: "country", + baseName: "country", + type: "FaxLineCreateRequest.CountryEnum" }, { - name: "page", - baseName: "page", - type: "number" + name: "city", + baseName: "city", + type: "string" }, { - name: "pageSize", - baseName: "page_size", - type: "number" + name: "accountId", + baseName: "account_id", + type: "string" } ]; - -// model/oAuthTokenGenerateRequest.ts -var _OAuthTokenGenerateRequest = class { - constructor() { - this["grantType"] = "authorization_code"; - } +((FaxLineCreateRequest2) => { + let CountryEnum; + ((CountryEnum2) => { + CountryEnum2["Ca"] = "CA"; + CountryEnum2["Us"] = "US"; + CountryEnum2["Uk"] = "UK"; + })(CountryEnum = FaxLineCreateRequest2.CountryEnum || (FaxLineCreateRequest2.CountryEnum = {})); +})(FaxLineCreateRequest || (FaxLineCreateRequest = {})); + +// model/faxLineDeleteRequest.ts +var _FaxLineDeleteRequest = class { static getAttributeTypeMap() { - return _OAuthTokenGenerateRequest.attributeTypeMap; + return _FaxLineDeleteRequest.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize(data, "OAuthTokenGenerateRequest"); + return ObjectSerializer.deserialize(data, "FaxLineDeleteRequest"); } }; -var OAuthTokenGenerateRequest = _OAuthTokenGenerateRequest; -OAuthTokenGenerateRequest.discriminator = void 0; -OAuthTokenGenerateRequest.attributeTypeMap = [ +var FaxLineDeleteRequest = _FaxLineDeleteRequest; +FaxLineDeleteRequest.discriminator = void 0; +FaxLineDeleteRequest.attributeTypeMap = [ { - name: "clientId", - baseName: "client_id", + name: "number", + baseName: "number", type: "string" + } +]; + +// model/faxLineListResponse.ts +var _FaxLineListResponse = class { + static getAttributeTypeMap() { + return _FaxLineListResponse.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "FaxLineListResponse"); + } +}; +var FaxLineListResponse = _FaxLineListResponse; +FaxLineListResponse.discriminator = void 0; +FaxLineListResponse.attributeTypeMap = [ + { + name: "listInfo", + baseName: "list_info", + type: "ListInfoResponse" }, { - name: "clientSecret", - baseName: "client_secret", - type: "string" + name: "faxLines", + baseName: "fax_lines", + type: "Array" }, { - name: "code", - baseName: "code", + name: "warnings", + baseName: "warnings", + type: "WarningResponse" + } +]; + +// model/faxLineRemoveUserRequest.ts +var _FaxLineRemoveUserRequest = class { + static getAttributeTypeMap() { + return _FaxLineRemoveUserRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "FaxLineRemoveUserRequest"); + } +}; +var FaxLineRemoveUserRequest = _FaxLineRemoveUserRequest; +FaxLineRemoveUserRequest.discriminator = void 0; +FaxLineRemoveUserRequest.attributeTypeMap = [ + { + name: "number", + baseName: "number", type: "string" }, { - name: "grantType", - baseName: "grant_type", + name: "accountId", + baseName: "account_id", type: "string" }, { - name: "state", - baseName: "state", + name: "emailAddress", + baseName: "email_address", type: "string" } ]; -// model/oAuthTokenRefreshRequest.ts -var _OAuthTokenRefreshRequest = class { - constructor() { - this["grantType"] = "refresh_token"; - } +// model/faxLineResponse.ts +var _FaxLineResponse = class { static getAttributeTypeMap() { - return _OAuthTokenRefreshRequest.attributeTypeMap; + return _FaxLineResponse.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize(data, "OAuthTokenRefreshRequest"); + return ObjectSerializer.deserialize(data, "FaxLineResponse"); } }; -var OAuthTokenRefreshRequest = _OAuthTokenRefreshRequest; -OAuthTokenRefreshRequest.discriminator = void 0; -OAuthTokenRefreshRequest.attributeTypeMap = [ +var FaxLineResponse = _FaxLineResponse; +FaxLineResponse.discriminator = void 0; +FaxLineResponse.attributeTypeMap = [ { - name: "grantType", - baseName: "grant_type", - type: "string" + name: "faxLine", + baseName: "fax_line", + type: "FaxLineResponseFaxLine" }, { - name: "refreshToken", - baseName: "refresh_token", - type: "string" + name: "warnings", + baseName: "warnings", + type: "WarningResponse" } ]; -// model/oAuthTokenResponse.ts -var _OAuthTokenResponse = class { +// model/faxLineResponseFaxLine.ts +var _FaxLineResponseFaxLine = class { static getAttributeTypeMap() { - return _OAuthTokenResponse.attributeTypeMap; + return _FaxLineResponseFaxLine.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize(data, "OAuthTokenResponse"); + return ObjectSerializer.deserialize(data, "FaxLineResponseFaxLine"); } }; -var OAuthTokenResponse = _OAuthTokenResponse; -OAuthTokenResponse.discriminator = void 0; -OAuthTokenResponse.attributeTypeMap = [ - { - name: "accessToken", - baseName: "access_token", - type: "string" - }, +var FaxLineResponseFaxLine = _FaxLineResponseFaxLine; +FaxLineResponseFaxLine.discriminator = void 0; +FaxLineResponseFaxLine.attributeTypeMap = [ { - name: "tokenType", - baseName: "token_type", + name: "number", + baseName: "number", type: "string" }, { - name: "refreshToken", - baseName: "refresh_token", - type: "string" + name: "createdAt", + baseName: "created_at", + type: "number" }, { - name: "expiresIn", - baseName: "expires_in", + name: "updatedAt", + baseName: "updated_at", type: "number" }, { - name: "state", - baseName: "state", - type: "string" + name: "accounts", + baseName: "accounts", + type: "Array" } ]; -// model/reportCreateRequest.ts -var _ReportCreateRequest = class { +// model/fileResponse.ts +var _FileResponse = class { static getAttributeTypeMap() { - return _ReportCreateRequest.attributeTypeMap; + return _FileResponse.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize(data, "ReportCreateRequest"); + return ObjectSerializer.deserialize(data, "FileResponse"); } }; -var ReportCreateRequest = _ReportCreateRequest; -ReportCreateRequest.discriminator = void 0; -ReportCreateRequest.attributeTypeMap = [ +var FileResponse = _FileResponse; +FileResponse.discriminator = void 0; +FileResponse.attributeTypeMap = [ { - name: "endDate", - baseName: "end_date", + name: "fileUrl", + baseName: "file_url", type: "string" }, { - name: "reportType", - baseName: "report_type", - type: "Array" - }, - { - name: "startDate", - baseName: "start_date", - type: "string" + name: "expiresAt", + baseName: "expires_at", + type: "number" } ]; -((ReportCreateRequest2) => { - let ReportTypeEnum; - ((ReportTypeEnum2) => { - ReportTypeEnum2["UserActivity"] = "user_activity"; - ReportTypeEnum2["DocumentStatus"] = "document_status"; - })(ReportTypeEnum = ReportCreateRequest2.ReportTypeEnum || (ReportCreateRequest2.ReportTypeEnum = {})); -})(ReportCreateRequest || (ReportCreateRequest = {})); -// model/reportCreateResponse.ts -var _ReportCreateResponse = class { +// model/fileResponseDataUri.ts +var _FileResponseDataUri = class { static getAttributeTypeMap() { - return _ReportCreateResponse.attributeTypeMap; + return _FileResponseDataUri.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize(data, "ReportCreateResponse"); + return ObjectSerializer.deserialize(data, "FileResponseDataUri"); } }; -var ReportCreateResponse = _ReportCreateResponse; -ReportCreateResponse.discriminator = void 0; -ReportCreateResponse.attributeTypeMap = [ - { - name: "report", - baseName: "report", - type: "ReportResponse" - }, +var FileResponseDataUri = _FileResponseDataUri; +FileResponseDataUri.discriminator = void 0; +FileResponseDataUri.attributeTypeMap = [ { - name: "warnings", - baseName: "warnings", - type: "Array" + name: "dataUri", + baseName: "data_uri", + type: "string" } ]; -// model/reportResponse.ts -var _ReportResponse = class { +// model/listInfoResponse.ts +var _ListInfoResponse = class { static getAttributeTypeMap() { - return _ReportResponse.attributeTypeMap; + return _ListInfoResponse.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize(data, "ReportResponse"); + return ObjectSerializer.deserialize(data, "ListInfoResponse"); } }; -var ReportResponse = _ReportResponse; -ReportResponse.discriminator = void 0; -ReportResponse.attributeTypeMap = [ +var ListInfoResponse = _ListInfoResponse; +ListInfoResponse.discriminator = void 0; +ListInfoResponse.attributeTypeMap = [ { - name: "success", - baseName: "success", - type: "string" - }, + name: "numPages", + baseName: "num_pages", + type: "number" + }, { - name: "startDate", - baseName: "start_date", - type: "string" + name: "numResults", + baseName: "num_results", + type: "number" }, { - name: "endDate", - baseName: "end_date", - type: "string" + name: "page", + baseName: "page", + type: "number" }, { - name: "reportType", - baseName: "report_type", - type: "Array" + name: "pageSize", + baseName: "page_size", + type: "number" } ]; -((ReportResponse2) => { - let ReportTypeEnum; - ((ReportTypeEnum2) => { - ReportTypeEnum2["UserActivity"] = "user_activity"; - ReportTypeEnum2["DocumentStatus"] = "document_status"; - })(ReportTypeEnum = ReportResponse2.ReportTypeEnum || (ReportResponse2.ReportTypeEnum = {})); -})(ReportResponse || (ReportResponse = {})); -// model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts -var _SignatureRequestBulkCreateEmbeddedWithTemplateRequest = class { +// model/models.ts +var primitives = [ + "string", + "boolean", + "double", + "integer", + "long", + "float", + "number", + "any" +]; +var ObjectSerializer = class { + static findCorrectType(data, expectedType) { + if (data == void 0) { + return expectedType; + } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) { + return expectedType; + } else if (expectedType === "Date") { + return expectedType; + } else { + if (enumsMap[expectedType]) { + return expectedType; + } + if (!typeMap[expectedType]) { + return expectedType; + } + let discriminatorProperty = typeMap[expectedType].discriminator; + let discriminatorValue = data[discriminatorProperty]; + if (typeMap[expectedType].hasOwnProperty("discriminatorClassName")) { + let discriminatorClass = typeMap[expectedType].discriminatorClassName(discriminatorValue); + if (discriminatorClass) { + return discriminatorClass; + } + } + if (discriminatorProperty == null) { + return expectedType; + } else { + if (data[discriminatorProperty]) { + var discriminatorType = data[discriminatorProperty]; + if (typeMap[discriminatorType]) { + return discriminatorType; + } else { + return expectedType; + } + } else { + return expectedType; + } + } + } + } + static serialize(data, type) { + if (data == void 0) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.lastIndexOf("Array<", 0) === 0) { + let subType = type.replace("Array<", ""); + subType = subType.substring(0, subType.length - 1); + let transformedData = []; + for (let index = 0; index < data.length; index++) { + let datum = data[index]; + transformedData.push(ObjectSerializer.serialize(datum, subType)); + } + return transformedData; + } else if (type === "Date") { + return data.toISOString(); + } else { + if (enumsMap[type]) { + return data; + } + if (!typeMap[type]) { + return data; + } + type = this.findCorrectType(data, type); + let attributeTypes = typeMap[type].getAttributeTypeMap(); + let instance = {}; + for (let index = 0; index < attributeTypes.length; index++) { + let attributeType = attributeTypes[index]; + let value = ObjectSerializer.serialize( + data[attributeType.name], + attributeType.type + ); + if (value !== void 0) { + instance[attributeType.baseName] = value; + } + } + return instance; + } + } + static deserialize(data, type) { + type = ObjectSerializer.findCorrectType(data, type); + if (data == void 0) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.lastIndexOf("Array<", 0) === 0) { + let subType = type.replace("Array<", ""); + subType = subType.substring(0, subType.length - 1); + let transformedData = []; + for (let index = 0; index < data.length; index++) { + let datum = data[index]; + transformedData.push(ObjectSerializer.deserialize(datum, subType)); + } + return transformedData; + } else if (type === "Date") { + return new Date(data); + } else { + if (enumsMap[type]) { + return data; + } + if (!typeMap[type]) { + return data; + } + let instance = new typeMap[type](); + let attributeTypes = typeMap[type].getAttributeTypeMap(); + for (let index = 0; index < attributeTypes.length; index++) { + let attributeType = attributeTypes[index]; + const propertyKey = data[attributeType.baseName] !== void 0 ? attributeType.baseName : attributeType.name; + instance[attributeType.name] = ObjectSerializer.deserialize( + data[propertyKey], + attributeType.type + ); + } + return instance; + } + } +}; +var HttpBasicAuth = class { constructor() { - this["allowDecline"] = false; - this["testMode"] = false; + this.username = ""; + this.password = ""; + } + applyToRequest(requestOptions) { + requestOptions.auth = { + username: this.username, + password: this.password + }; + } +}; +var HttpBearerAuth = class { + constructor() { + this.accessToken = ""; + } + applyToRequest(requestOptions) { + if (requestOptions && requestOptions.headers) { + const accessToken = typeof this.accessToken === "function" ? this.accessToken() : this.accessToken; + requestOptions.headers["Authorization"] = "Bearer " + accessToken; + } + } +}; +var ApiKeyAuth = class { + constructor(location, paramName) { + this.location = location; + this.paramName = paramName; + this.apiKey = ""; + } + applyToRequest(requestOptions) { + if (this.location == "query") { + requestOptions.params[this.paramName] = this.apiKey; + } else if (this.location == "header" && requestOptions && requestOptions.headers) { + requestOptions.headers[this.paramName] = this.apiKey; + } else if (this.location == "cookie" && requestOptions && requestOptions.headers) { + if (requestOptions.headers["Cookie"]) { + requestOptions.headers["Cookie"] += "; " + this.paramName + "=" + encodeURIComponent(this.apiKey); + } else { + requestOptions.headers["Cookie"] = this.paramName + "=" + encodeURIComponent(this.apiKey); + } + } + } +}; +var OAuth = class { + constructor() { + this.accessToken = ""; + } + applyToRequest(requestOptions) { + if (requestOptions && requestOptions.headers) { + requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; + } + } +}; +var VoidAuth = class { + constructor() { + this.username = ""; + this.password = ""; + } + applyToRequest(_) { + } +}; + +// model/oAuthTokenGenerateRequest.ts +var _OAuthTokenGenerateRequest = class { + constructor() { + this["grantType"] = "authorization_code"; } static getAttributeTypeMap() { - return _SignatureRequestBulkCreateEmbeddedWithTemplateRequest.attributeTypeMap; + return _OAuthTokenGenerateRequest.attributeTypeMap; } static init(data) { - return ObjectSerializer.deserialize( - data, - "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" - ); + return ObjectSerializer.deserialize(data, "OAuthTokenGenerateRequest"); } }; -var SignatureRequestBulkCreateEmbeddedWithTemplateRequest = _SignatureRequestBulkCreateEmbeddedWithTemplateRequest; -SignatureRequestBulkCreateEmbeddedWithTemplateRequest.discriminator = void 0; -SignatureRequestBulkCreateEmbeddedWithTemplateRequest.attributeTypeMap = [ - { - name: "templateIds", - baseName: "template_ids", - type: "Array" - }, +var OAuthTokenGenerateRequest = _OAuthTokenGenerateRequest; +OAuthTokenGenerateRequest.discriminator = void 0; +OAuthTokenGenerateRequest.attributeTypeMap = [ { name: "clientId", baseName: "client_id", type: "string" }, { - name: "signerFile", - baseName: "signer_file", - type: "RequestFile" + name: "clientSecret", + baseName: "client_secret", + type: "string" }, { - name: "signerList", - baseName: "signer_list", - type: "Array" + name: "code", + baseName: "code", + type: "string" }, { - name: "allowDecline", + name: "grantType", + baseName: "grant_type", + type: "string" + }, + { + name: "state", + baseName: "state", + type: "string" + } +]; + +// model/oAuthTokenRefreshRequest.ts +var _OAuthTokenRefreshRequest = class { + constructor() { + this["grantType"] = "refresh_token"; + } + static getAttributeTypeMap() { + return _OAuthTokenRefreshRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "OAuthTokenRefreshRequest"); + } +}; +var OAuthTokenRefreshRequest = _OAuthTokenRefreshRequest; +OAuthTokenRefreshRequest.discriminator = void 0; +OAuthTokenRefreshRequest.attributeTypeMap = [ + { + name: "grantType", + baseName: "grant_type", + type: "string" + }, + { + name: "refreshToken", + baseName: "refresh_token", + type: "string" + } +]; + +// model/oAuthTokenResponse.ts +var _OAuthTokenResponse = class { + static getAttributeTypeMap() { + return _OAuthTokenResponse.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "OAuthTokenResponse"); + } +}; +var OAuthTokenResponse = _OAuthTokenResponse; +OAuthTokenResponse.discriminator = void 0; +OAuthTokenResponse.attributeTypeMap = [ + { + name: "accessToken", + baseName: "access_token", + type: "string" + }, + { + name: "tokenType", + baseName: "token_type", + type: "string" + }, + { + name: "refreshToken", + baseName: "refresh_token", + type: "string" + }, + { + name: "expiresIn", + baseName: "expires_in", + type: "number" + }, + { + name: "state", + baseName: "state", + type: "string" + } +]; + +// model/reportCreateRequest.ts +var _ReportCreateRequest = class { + static getAttributeTypeMap() { + return _ReportCreateRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "ReportCreateRequest"); + } +}; +var ReportCreateRequest = _ReportCreateRequest; +ReportCreateRequest.discriminator = void 0; +ReportCreateRequest.attributeTypeMap = [ + { + name: "endDate", + baseName: "end_date", + type: "string" + }, + { + name: "reportType", + baseName: "report_type", + type: "Array" + }, + { + name: "startDate", + baseName: "start_date", + type: "string" + } +]; +((ReportCreateRequest2) => { + let ReportTypeEnum; + ((ReportTypeEnum2) => { + ReportTypeEnum2["UserActivity"] = "user_activity"; + ReportTypeEnum2["DocumentStatus"] = "document_status"; + })(ReportTypeEnum = ReportCreateRequest2.ReportTypeEnum || (ReportCreateRequest2.ReportTypeEnum = {})); +})(ReportCreateRequest || (ReportCreateRequest = {})); + +// model/reportCreateResponse.ts +var _ReportCreateResponse = class { + static getAttributeTypeMap() { + return _ReportCreateResponse.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "ReportCreateResponse"); + } +}; +var ReportCreateResponse = _ReportCreateResponse; +ReportCreateResponse.discriminator = void 0; +ReportCreateResponse.attributeTypeMap = [ + { + name: "report", + baseName: "report", + type: "ReportResponse" + }, + { + name: "warnings", + baseName: "warnings", + type: "Array" + } +]; + +// model/reportResponse.ts +var _ReportResponse = class { + static getAttributeTypeMap() { + return _ReportResponse.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize(data, "ReportResponse"); + } +}; +var ReportResponse = _ReportResponse; +ReportResponse.discriminator = void 0; +ReportResponse.attributeTypeMap = [ + { + name: "success", + baseName: "success", + type: "string" + }, + { + name: "startDate", + baseName: "start_date", + type: "string" + }, + { + name: "endDate", + baseName: "end_date", + type: "string" + }, + { + name: "reportType", + baseName: "report_type", + type: "Array" + } +]; +((ReportResponse2) => { + let ReportTypeEnum; + ((ReportTypeEnum2) => { + ReportTypeEnum2["UserActivity"] = "user_activity"; + ReportTypeEnum2["DocumentStatus"] = "document_status"; + })(ReportTypeEnum = ReportResponse2.ReportTypeEnum || (ReportResponse2.ReportTypeEnum = {})); +})(ReportResponse || (ReportResponse = {})); + +// model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts +var _SignatureRequestBulkCreateEmbeddedWithTemplateRequest = class { + constructor() { + this["allowDecline"] = false; + this["testMode"] = false; + } + static getAttributeTypeMap() { + return _SignatureRequestBulkCreateEmbeddedWithTemplateRequest.attributeTypeMap; + } + static init(data) { + return ObjectSerializer.deserialize( + data, + "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" + ); + } +}; +var SignatureRequestBulkCreateEmbeddedWithTemplateRequest = _SignatureRequestBulkCreateEmbeddedWithTemplateRequest; +SignatureRequestBulkCreateEmbeddedWithTemplateRequest.discriminator = void 0; +SignatureRequestBulkCreateEmbeddedWithTemplateRequest.attributeTypeMap = [ + { + name: "templateIds", + baseName: "template_ids", + type: "Array" + }, + { + name: "clientId", + baseName: "client_id", + type: "string" + }, + { + name: "signerFile", + baseName: "signer_file", + type: "RequestFile" + }, + { + name: "signerList", + baseName: "signer_list", + type: "Array" + }, + { + name: "allowDecline", baseName: "allow_decline", type: "boolean" }, @@ -23162,245 +24405,39 @@ WarningResponse.attributeTypeMap = [ } ]; -// model/eventCallbackHelper.ts -var crypto = __toESM(require("crypto")); -var _EventCallbackHelper = class { -}; -var EventCallbackHelper = _EventCallbackHelper; -EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback"; -EventCallbackHelper.EVENT_TYPE_APP_CALLBACK = "app_callback"; -EventCallbackHelper.isValid = (apiKey, eventCallback) => { - const hmac = crypto.createHmac("sha256", apiKey); - hmac.update( - `${eventCallback.event.eventTime}${eventCallback.event.eventType}` - ); - return eventCallback.event.eventHash === hmac.digest("hex").toString(); -}; -EventCallbackHelper.getCallbackType = (eventCallback) => { - if (!eventCallback.event.eventMetadata || !eventCallback.event.eventMetadata.reportedForAppId) { - return _EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK; - } - return _EventCallbackHelper.EVENT_TYPE_APP_CALLBACK; -}; - -// model/models.ts -var primitives = [ - "string", - "boolean", - "double", - "integer", - "long", - "float", - "number", - "any" -]; -var ObjectSerializer = class { - static findCorrectType(data, expectedType) { - if (data == void 0) { - return expectedType; - } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) { - return expectedType; - } else if (expectedType === "Date") { - return expectedType; - } else { - if (enumsMap[expectedType]) { - return expectedType; - } - if (!typeMap[expectedType]) { - return expectedType; - } - let discriminatorProperty = typeMap[expectedType].discriminator; - let discriminatorValue = data[discriminatorProperty]; - if (typeMap[expectedType].hasOwnProperty("discriminatorClassName")) { - let discriminatorClass = typeMap[expectedType].discriminatorClassName(discriminatorValue); - if (discriminatorClass) { - return discriminatorClass; - } - } - if (discriminatorProperty == null) { - return expectedType; - } else { - if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; - if (typeMap[discriminatorType]) { - return discriminatorType; - } else { - return expectedType; - } - } else { - return expectedType; - } - } - } - } - static serialize(data, type) { - if (data == void 0) { - return data; - } else if (primitives.indexOf(type.toLowerCase()) !== -1) { - return data; - } else if (type.lastIndexOf("Array<", 0) === 0) { - let subType = type.replace("Array<", ""); - subType = subType.substring(0, subType.length - 1); - let transformedData = []; - for (let index = 0; index < data.length; index++) { - let datum = data[index]; - transformedData.push(ObjectSerializer.serialize(datum, subType)); - } - return transformedData; - } else if (type === "Date") { - return data.toISOString(); - } else { - if (enumsMap[type]) { - return data; - } - if (!typeMap[type]) { - return data; - } - type = this.findCorrectType(data, type); - let attributeTypes = typeMap[type].getAttributeTypeMap(); - let instance = {}; - for (let index = 0; index < attributeTypes.length; index++) { - let attributeType = attributeTypes[index]; - let value = ObjectSerializer.serialize( - data[attributeType.name], - attributeType.type - ); - if (value !== void 0) { - instance[attributeType.baseName] = value; - } - } - return instance; - } - } - static deserialize(data, type) { - type = ObjectSerializer.findCorrectType(data, type); - if (data == void 0) { - return data; - } else if (primitives.indexOf(type.toLowerCase()) !== -1) { - return data; - } else if (type.lastIndexOf("Array<", 0) === 0) { - let subType = type.replace("Array<", ""); - subType = subType.substring(0, subType.length - 1); - let transformedData = []; - for (let index = 0; index < data.length; index++) { - let datum = data[index]; - transformedData.push(ObjectSerializer.deserialize(datum, subType)); - } - return transformedData; - } else if (type === "Date") { - return new Date(data); - } else { - if (enumsMap[type]) { - return data; - } - if (!typeMap[type]) { - return data; - } - let instance = new typeMap[type](); - let attributeTypes = typeMap[type].getAttributeTypeMap(); - for (let index = 0; index < attributeTypes.length; index++) { - let attributeType = attributeTypes[index]; - const propertyKey = data[attributeType.baseName] !== void 0 ? attributeType.baseName : attributeType.name; - instance[attributeType.name] = ObjectSerializer.deserialize( - data[propertyKey], - attributeType.type - ); - } - return instance; - } - } -}; -var HttpBasicAuth = class { - constructor() { - this.username = ""; - this.password = ""; - } - applyToRequest(requestOptions) { - requestOptions.auth = { - username: this.username, - password: this.password - }; - } -}; -var HttpBearerAuth = class { - constructor() { - this.accessToken = ""; - } - applyToRequest(requestOptions) { - if (requestOptions && requestOptions.headers) { - const accessToken = typeof this.accessToken === "function" ? this.accessToken() : this.accessToken; - requestOptions.headers["Authorization"] = "Bearer " + accessToken; - } - } -}; -var ApiKeyAuth = class { - constructor(location, paramName) { - this.location = location; - this.paramName = paramName; - this.apiKey = ""; - } - applyToRequest(requestOptions) { - if (this.location == "query") { - requestOptions.params[this.paramName] = this.apiKey; - } else if (this.location == "header" && requestOptions && requestOptions.headers) { - requestOptions.headers[this.paramName] = this.apiKey; - } else if (this.location == "cookie" && requestOptions && requestOptions.headers) { - if (requestOptions.headers["Cookie"]) { - requestOptions.headers["Cookie"] += "; " + this.paramName + "=" + encodeURIComponent(this.apiKey); - } else { - requestOptions.headers["Cookie"] = this.paramName + "=" + encodeURIComponent(this.apiKey); - } - } - } -}; -var OAuth = class { - constructor() { - this.accessToken = ""; - } - applyToRequest(requestOptions) { - if (requestOptions && requestOptions.headers) { - requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; - } - } -}; -var VoidAuth = class { - constructor() { - this.username = ""; - this.password = ""; - } - applyToRequest(_) { - } -}; - -// model/index.ts -var enumsMap = { - "EventCallbackRequestEvent.EventTypeEnum": EventCallbackRequestEvent.EventTypeEnum, - "ReportCreateRequest.ReportTypeEnum": ReportCreateRequest.ReportTypeEnum, - "ReportResponse.ReportTypeEnum": ReportResponse.ReportTypeEnum, - SignatureRequestResponseCustomFieldTypeEnum, - SignatureRequestResponseDataTypeEnum, - "SubFieldOptions.DateFormatEnum": SubFieldOptions.DateFormatEnum, - "SubFormFieldRuleAction.TypeEnum": SubFormFieldRuleAction.TypeEnum, - "SubFormFieldRuleTrigger.OperatorEnum": SubFormFieldRuleTrigger.OperatorEnum, - "SubFormFieldsPerDocumentDateSigned.FontFamilyEnum": SubFormFieldsPerDocumentDateSigned.FontFamilyEnum, - "SubFormFieldsPerDocumentDropdown.FontFamilyEnum": SubFormFieldsPerDocumentDropdown.FontFamilyEnum, - SubFormFieldsPerDocumentFontEnum, - "SubFormFieldsPerDocumentHyperlink.FontFamilyEnum": SubFormFieldsPerDocumentHyperlink.FontFamilyEnum, - "SubFormFieldsPerDocumentText.ValidationTypeEnum": SubFormFieldsPerDocumentText.ValidationTypeEnum, - "SubFormFieldsPerDocumentText.FontFamilyEnum": SubFormFieldsPerDocumentText.FontFamilyEnum, - "SubFormFieldsPerDocumentTextMerge.FontFamilyEnum": SubFormFieldsPerDocumentTextMerge.FontFamilyEnum, - SubFormFieldsPerDocumentTypeEnum, - "SubMergeField.TypeEnum": SubMergeField.TypeEnum, - "SubOAuth.ScopesEnum": SubOAuth.ScopesEnum, - "SubSignatureRequestSigner.SmsPhoneNumberTypeEnum": SubSignatureRequestSigner.SmsPhoneNumberTypeEnum, - "SubSignatureRequestTemplateSigner.SmsPhoneNumberTypeEnum": SubSignatureRequestTemplateSigner.SmsPhoneNumberTypeEnum, - "SubSigningOptions.DefaultTypeEnum": SubSigningOptions.DefaultTypeEnum, - "SubWhiteLabelingOptions.LegalVersionEnum": SubWhiteLabelingOptions.LegalVersionEnum, - "TeamAddMemberRequest.RoleEnum": TeamAddMemberRequest.RoleEnum, - "TeamRemoveMemberRequest.NewRoleEnum": TeamRemoveMemberRequest.NewRoleEnum, - "TemplateResponseDocumentFormFieldText.ValidationTypeEnum": TemplateResponseDocumentFormFieldText.ValidationTypeEnum, - "UnclaimedDraftCreateEmbeddedRequest.TypeEnum": UnclaimedDraftCreateEmbeddedRequest.TypeEnum, - "UnclaimedDraftCreateRequest.TypeEnum": UnclaimedDraftCreateRequest.TypeEnum +// model/index.ts +var enumsMap = { + "EventCallbackRequestEvent.EventTypeEnum": EventCallbackRequestEvent.EventTypeEnum, + FaxLineAreaCodeGetCountryEnum, + FaxLineAreaCodeGetProvinceEnum, + FaxLineAreaCodeGetStateEnum, + "FaxLineCreateRequest.CountryEnum": FaxLineCreateRequest.CountryEnum, + "ReportCreateRequest.ReportTypeEnum": ReportCreateRequest.ReportTypeEnum, + "ReportResponse.ReportTypeEnum": ReportResponse.ReportTypeEnum, + SignatureRequestResponseCustomFieldTypeEnum, + SignatureRequestResponseDataTypeEnum, + "SubFieldOptions.DateFormatEnum": SubFieldOptions.DateFormatEnum, + "SubFormFieldRuleAction.TypeEnum": SubFormFieldRuleAction.TypeEnum, + "SubFormFieldRuleTrigger.OperatorEnum": SubFormFieldRuleTrigger.OperatorEnum, + "SubFormFieldsPerDocumentDateSigned.FontFamilyEnum": SubFormFieldsPerDocumentDateSigned.FontFamilyEnum, + "SubFormFieldsPerDocumentDropdown.FontFamilyEnum": SubFormFieldsPerDocumentDropdown.FontFamilyEnum, + SubFormFieldsPerDocumentFontEnum, + "SubFormFieldsPerDocumentHyperlink.FontFamilyEnum": SubFormFieldsPerDocumentHyperlink.FontFamilyEnum, + "SubFormFieldsPerDocumentText.ValidationTypeEnum": SubFormFieldsPerDocumentText.ValidationTypeEnum, + "SubFormFieldsPerDocumentText.FontFamilyEnum": SubFormFieldsPerDocumentText.FontFamilyEnum, + "SubFormFieldsPerDocumentTextMerge.FontFamilyEnum": SubFormFieldsPerDocumentTextMerge.FontFamilyEnum, + SubFormFieldsPerDocumentTypeEnum, + "SubMergeField.TypeEnum": SubMergeField.TypeEnum, + "SubOAuth.ScopesEnum": SubOAuth.ScopesEnum, + "SubSignatureRequestSigner.SmsPhoneNumberTypeEnum": SubSignatureRequestSigner.SmsPhoneNumberTypeEnum, + "SubSignatureRequestTemplateSigner.SmsPhoneNumberTypeEnum": SubSignatureRequestTemplateSigner.SmsPhoneNumberTypeEnum, + "SubSigningOptions.DefaultTypeEnum": SubSigningOptions.DefaultTypeEnum, + "SubWhiteLabelingOptions.LegalVersionEnum": SubWhiteLabelingOptions.LegalVersionEnum, + "TeamAddMemberRequest.RoleEnum": TeamAddMemberRequest.RoleEnum, + "TeamRemoveMemberRequest.NewRoleEnum": TeamRemoveMemberRequest.NewRoleEnum, + "TemplateResponseDocumentFormFieldText.ValidationTypeEnum": TemplateResponseDocumentFormFieldText.ValidationTypeEnum, + "UnclaimedDraftCreateEmbeddedRequest.TypeEnum": UnclaimedDraftCreateEmbeddedRequest.TypeEnum, + "UnclaimedDraftCreateRequest.TypeEnum": UnclaimedDraftCreateRequest.TypeEnum }; var typeMap = { AccountCreateRequest, @@ -23437,6 +24474,14 @@ var typeMap = { EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxLineAddUserRequest, + FaxLineAreaCodeGetResponse, + FaxLineCreateRequest, + FaxLineDeleteRequest, + FaxLineListResponse, + FaxLineRemoveUserRequest, + FaxLineResponse, + FaxLineResponseFaxLine, FileResponse, FileResponseDataUri, ListInfoResponse, @@ -23573,14 +24618,541 @@ var typeMap = { WarningResponse }; -// api/accountApi.ts -var defaultBasePath = "https://api.hellosign.com/v3"; -var AccountApi = class { +// api/accountApi.ts +var defaultBasePath = "https://api.hellosign.com/v3"; +var AccountApi = class { + constructor(basePath) { + this._basePath = defaultBasePath; + 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); + } + accountCreate(_0) { + return __async(this, arguments, function* (accountCreateRequest, options = { headers: {} }) { + accountCreateRequest = deserializeIfNeeded( + accountCreateRequest, + "AccountCreateRequest" + ); + const localVarPath = this.basePath + "/account/create"; + let localVarQueryParameters = {}; + let localVarHeaderParams = Object.assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams["content-type"] = "application/json"; + } else { + localVarHeaderParams["content-type"] = produces.join(","); + } + let localVarFormParams = {}; + let localVarBodyParams = void 0; + if (accountCreateRequest === null || accountCreateRequest === void 0) { + throw new Error( + "Required parameter accountCreateRequest was null or undefined when calling accountCreate." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + accountCreateRequest, + AccountCreateRequest.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( + accountCreateRequest, + "AccountCreateRequest" + ); + } + let localVarRequestOptions = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse( + resolve, + reject, + response, + "AccountCreateResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse( + reject, + error.response, + 200, + "AccountCreateResponse" + )) { + return; + } + if (handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + } + ); + }); + }); + } + accountGet(_0, _1) { + return __async(this, arguments, function* (accountId, emailAddress, options = { headers: {} }) { + const localVarPath = this.basePath + "/account"; + 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 (accountId !== void 0) { + localVarQueryParameters["account_id"] = ObjectSerializer.serialize( + accountId, + "string" + ); + } + if (emailAddress !== void 0) { + localVarQueryParameters["email_address"] = ObjectSerializer.serialize( + emailAddress, + "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) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse( + resolve, + reject, + response, + "AccountGetResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse( + reject, + error.response, + 200, + "AccountGetResponse" + )) { + return; + } + if (handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + accountUpdate(_0) { + return __async(this, arguments, function* (accountUpdateRequest, options = { headers: {} }) { + accountUpdateRequest = deserializeIfNeeded( + accountUpdateRequest, + "AccountUpdateRequest" + ); + const localVarPath = this.basePath + "/account"; + 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 (accountUpdateRequest === null || accountUpdateRequest === void 0) { + throw new Error( + "Required parameter accountUpdateRequest was null or undefined when calling accountUpdate." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + accountUpdateRequest, + AccountUpdateRequest.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( + accountUpdateRequest, + "AccountUpdateRequest" + ); + } + 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) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse( + resolve, + reject, + response, + "AccountGetResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse( + reject, + error.response, + 200, + "AccountGetResponse" + )) { + return; + } + if (handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + accountVerify(_0) { + return __async(this, arguments, function* (accountVerifyRequest, options = { headers: {} }) { + accountVerifyRequest = deserializeIfNeeded( + accountVerifyRequest, + "AccountVerifyRequest" + ); + const localVarPath = this.basePath + "/account/verify"; + 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 (accountVerifyRequest === null || accountVerifyRequest === void 0) { + throw new Error( + "Required parameter accountVerifyRequest was null or undefined when calling accountVerify." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + accountVerifyRequest, + AccountVerifyRequest.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( + accountVerifyRequest, + "AccountVerifyRequest" + ); + } + let localVarRequestOptions = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse( + resolve, + reject, + response, + "AccountVerifyResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse( + reject, + error.response, + 200, + "AccountVerifyResponse" + )) { + return; + } + if (handleErrorRangeResponse( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + } + ); + }); + }); + } +}; +function deserializeIfNeeded(obj, classname) { + if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { + return ObjectSerializer.deserialize(obj, classname); + } + return obj; +} +function handleSuccessfulResponse(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 handleErrorCodeResponse(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 handleErrorRangeResponse(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/apiAppApi.ts +var defaultBasePath2 = "https://api.hellosign.com/v3"; +var ApiAppApi = class { constructor(basePath) { - this._basePath = defaultBasePath; - this._defaultHeaders = { - "User-Agent": USER_AGENT - }; + this._basePath = defaultBasePath2; + this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { default: new VoidAuth(), @@ -23599,7 +25171,7 @@ var AccountApi = class { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); } get defaultHeaders() { return this._defaultHeaders; @@ -23625,15 +25197,207 @@ var AccountApi = class { addInterceptor(interceptor) { this.interceptors.push(interceptor); } - accountCreate(_0) { - return __async(this, arguments, function* (accountCreateRequest, options = { headers: {} }) { - if (accountCreateRequest !== null && accountCreateRequest !== void 0 && accountCreateRequest.constructor.name !== "AccountCreateRequest") { - accountCreateRequest = ObjectSerializer.deserialize( - accountCreateRequest, - "AccountCreateRequest" + apiAppCreate(_0) { + return __async(this, arguments, function* (apiAppCreateRequest, options = { headers: {} }) { + apiAppCreateRequest = deserializeIfNeeded2( + apiAppCreateRequest, + "ApiAppCreateRequest" + ); + const localVarPath = this.basePath + "/api_app"; + 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 (apiAppCreateRequest === null || apiAppCreateRequest === void 0) { + throw new Error( + "Required parameter apiAppCreateRequest was null or undefined when calling apiAppCreate." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + apiAppCreateRequest, + ApiAppCreateRequest.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( + apiAppCreateRequest, + "ApiAppCreateRequest" + ); + } + let localVarRequestOptions = { + method: "POST", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json", + data + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse2( + resolve, + reject, + response, + "ApiAppGetResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse2( + reject, + error.response, + 201, + "ApiAppGetResponse" + )) { + return; + } + if (handleErrorRangeResponse2( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + apiAppDelete(_0) { + return __async(this, arguments, function* (clientId, options = { headers: {} }) { + const localVarPath = this.basePath + "/api_app/{client_id}".replace( + "{client_id}", + encodeURIComponent(String(clientId)) + ); + 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 (clientId === null || clientId === void 0) { + throw new Error( + "Required parameter clientId was null or undefined when calling apiAppDelete." ); } - const localVarPath = this.basePath + "/account/create"; + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + let localVarRequestOptions = { + method: "DELETE", + params: localVarQueryParameters, + headers: localVarHeaderParams, + url: localVarPath, + paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, + maxContentLength: Infinity, + maxBodyLength: Infinity, + responseType: "json" + }; + let authenticationPromise = Promise.resolve(); + if (this.authentications.api_key.username) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.api_key.applyToRequest(localVarRequestOptions) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) + ); + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then( + () => interceptor(localVarRequestOptions) + ); + } + return interceptorPromise.then(() => { + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse2(resolve, reject, response); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorRangeResponse2( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + apiAppGet(_0) { + return __async(this, arguments, function* (clientId, options = { headers: {} }) { + const localVarPath = this.basePath + "/api_app/{client_id}".replace( + "{client_id}", + encodeURIComponent(String(clientId)) + ); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -23647,39 +25411,121 @@ var AccountApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (accountCreateRequest === null || accountCreateRequest === void 0) { + if (clientId === null || clientId === void 0) { throw new Error( - "Required parameter accountCreateRequest was null or undefined when calling accountCreate." + "Required parameter clientId was null or undefined when calling apiAppGet." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; - const result = generateFormData( - accountCreateRequest, - AccountCreateRequest.attributeTypeMap + 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) + ); + } + if (this.authentications.oauth2.accessToken) { + authenticationPromise = authenticationPromise.then( + () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then( + () => this.authentications.default.applyToRequest(localVarRequestOptions) ); - localVarUseFormData = result.localVarUseFormData; - let data = {}; - if (localVarUseFormData) { - const formData2 = toFormData3(result.data); - data = formData2; - localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); + 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) => { + handleSuccessfulResponse2( + resolve, + reject, + response, + "ApiAppGetResponse" + ); + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse2( + reject, + error.response, + 200, + "ApiAppGetResponse" + )) { + return; + } + if (handleErrorRangeResponse2( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + apiAppList(_0, _1) { + return __async(this, arguments, function* (page, pageSize, options = { headers: {} }) { + const localVarPath = this.basePath + "/api_app/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 { - data = ObjectSerializer.serialize( - accountCreateRequest, - "AccountCreateRequest" + 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: "POST", + method: "GET", 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) { @@ -23702,57 +25548,54 @@ var AccountApi = class { ); } return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "AccountCreateResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "AccountCreateResponse" - ); - reject(new HttpError(response, body, response.status)); - return; - } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); - return; - } + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse2( + resolve, + reject, + response, + "ApiAppListResponse" + ); + }, + (error) => { + if (error.response == null) { reject(error); + return; } - ); - } - ); + if (handleErrorCodeResponse2( + reject, + error.response, + 200, + "ApiAppListResponse" + )) { + return; + } + if (handleErrorRangeResponse2( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); }); }); } - accountGet(_0, _1) { - return __async(this, arguments, function* (accountId, emailAddress, options = { headers: {} }) { - const localVarPath = this.basePath + "/account"; + apiAppUpdate(_0, _1) { + return __async(this, arguments, function* (clientId, apiAppUpdateRequest, options = { headers: {} }) { + apiAppUpdateRequest = deserializeIfNeeded2( + apiAppUpdateRequest, + "ApiAppUpdateRequest" + ); + const localVarPath = this.basePath + "/api_app/{client_id}".replace( + "{client_id}", + encodeURIComponent(String(clientId)) + ); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -23766,29 +25609,44 @@ var AccountApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (accountId !== void 0) { - localVarQueryParameters["account_id"] = ObjectSerializer.serialize( - accountId, - "string" + if (clientId === null || clientId === void 0) { + throw new Error( + "Required parameter clientId was null or undefined when calling apiAppUpdate." ); } - if (emailAddress !== void 0) { - localVarQueryParameters["email_address"] = ObjectSerializer.serialize( - emailAddress, - "string" + if (apiAppUpdateRequest === null || apiAppUpdateRequest === void 0) { + throw new Error( + "Required parameter apiAppUpdateRequest was null or undefined when calling apiAppUpdate." + ); + } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; + const result = generateFormData( + apiAppUpdateRequest, + ApiAppUpdateRequest.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( + apiAppUpdateRequest, + "ApiAppUpdateRequest" ); } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; let localVarRequestOptions = { - method: "GET", + method: "PUT", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, maxContentLength: Infinity, maxBodyLength: Infinity, - responseType: "json" + responseType: "json", + data }; let authenticationPromise = Promise.resolve(); if (this.authentications.api_key.username) { @@ -23814,37 +25672,32 @@ var AccountApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "AccountGetResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse2( + resolve, + reject, + response, + "ApiAppGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "AccountGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse2( + reject, + error.response, + 200, + "ApiAppGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse2( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -23854,15 +25707,99 @@ var AccountApi = class { }); }); } - accountUpdate(_0) { - return __async(this, arguments, function* (accountUpdateRequest, options = { headers: {} }) { - if (accountUpdateRequest !== null && accountUpdateRequest !== void 0 && accountUpdateRequest.constructor.name !== "AccountUpdateRequest") { - accountUpdateRequest = ObjectSerializer.deserialize( - accountUpdateRequest, - "AccountUpdateRequest" - ); - } - const localVarPath = this.basePath + "/account"; +}; +function deserializeIfNeeded2(obj, classname) { + if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { + return ObjectSerializer.deserialize(obj, classname); + } + return obj; +} +function handleSuccessfulResponse2(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 handleErrorCodeResponse2(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 handleErrorRangeResponse2(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/bulkSendJobApi.ts +var defaultBasePath3 = "https://api.hellosign.com/v3"; +var BulkSendJobApi = class { + constructor(basePath) { + this._basePath = defaultBasePath3; + 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); + } + bulkSendJobGet(_0, _1, _2) { + return __async(this, arguments, function* (bulkSendJobId, page, pageSize, options = { headers: {} }) { + const localVarPath = this.basePath + "/bulk_send_job/{bulk_send_job_id}".replace( + "{bulk_send_job_id}", + encodeURIComponent(String(bulkSendJobId)) + ); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -23876,39 +25813,34 @@ var AccountApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (accountUpdateRequest === null || accountUpdateRequest === void 0) { + if (bulkSendJobId === null || bulkSendJobId === void 0) { throw new Error( - "Required parameter accountUpdateRequest was null or undefined when calling accountUpdate." + "Required parameter bulkSendJobId was null or undefined when calling bulkSendJobGet." ); } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - accountUpdateRequest, - AccountUpdateRequest.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( - accountUpdateRequest, - "AccountUpdateRequest" + 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: "PUT", + method: "GET", 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) { @@ -23931,58 +25863,49 @@ var AccountApi = class { ); } return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "AccountGetResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "AccountGetResponse" + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse3( + resolve, + reject, + response, + "BulkSendJobGetResponse" ); - reject(new HttpError(response, body, response.status)); - return; - } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse3( + reject, + error.response, + 200, + "BulkSendJobGetResponse" + )) { + return; + } + if (handleErrorRangeResponse3( + reject, + error.response, + "4XX", "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); - return; + )) { + return; + } + reject(error); } - reject(error); - } - ); - }); + ); + } + ); }); }); } - accountVerify(_0) { - return __async(this, arguments, function* (accountVerifyRequest, options = { headers: {} }) { - if (accountVerifyRequest !== null && accountVerifyRequest !== void 0 && accountVerifyRequest.constructor.name !== "AccountVerifyRequest") { - accountVerifyRequest = ObjectSerializer.deserialize( - accountVerifyRequest, - "AccountVerifyRequest" - ); - } - const localVarPath = this.basePath + "/account/verify"; + bulkSendJobList(_0, _1) { + return __async(this, arguments, function* (page, pageSize, options = { headers: {} }) { + const localVarPath = this.basePath + "/bulk_send_job/list"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -23996,39 +25919,29 @@ var AccountApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (accountVerifyRequest === null || accountVerifyRequest === void 0) { - throw new Error( - "Required parameter accountVerifyRequest was null or undefined when calling accountVerify." + if (page !== void 0) { + localVarQueryParameters["page"] = ObjectSerializer.serialize( + page, + "number" ); } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - accountVerifyRequest, - AccountVerifyRequest.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( - accountVerifyRequest, - "AccountVerifyRequest" + if (pageSize !== void 0) { + localVarQueryParameters["page_size"] = ObjectSerializer.serialize( + pageSize, + "number" ); } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; let localVarRequestOptions = { - method: "POST", + method: "GET", 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) { @@ -24055,40 +25968,32 @@ var AccountApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "AccountVerifyResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse3( + resolve, + reject, + response, + "BulkSendJobListResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "AccountVerifyResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse3( + reject, + error.response, + 200, + "BulkSendJobListResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse3( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -24100,15 +26005,42 @@ var AccountApi = class { }); } }; +function handleSuccessfulResponse3(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 handleErrorCodeResponse3(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 handleErrorRangeResponse3(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/apiAppApi.ts -var defaultBasePath2 = "https://api.hellosign.com/v3"; -var ApiAppApi = class { +// api/embeddedApi.ts +var defaultBasePath4 = "https://api.hellosign.com/v3"; +var EmbeddedApi = class { constructor(basePath) { - this._basePath = defaultBasePath2; - this._defaultHeaders = { - "User-Agent": USER_AGENT - }; + this._basePath = defaultBasePath4; + this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { default: new VoidAuth(), @@ -24127,7 +26059,7 @@ var ApiAppApi = class { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); } get defaultHeaders() { return this._defaultHeaders; @@ -24153,15 +26085,16 @@ var ApiAppApi = class { addInterceptor(interceptor) { this.interceptors.push(interceptor); } - apiAppCreate(_0) { - return __async(this, arguments, function* (apiAppCreateRequest, options = { headers: {} }) { - if (apiAppCreateRequest !== null && apiAppCreateRequest !== void 0 && apiAppCreateRequest.constructor.name !== "ApiAppCreateRequest") { - apiAppCreateRequest = ObjectSerializer.deserialize( - apiAppCreateRequest, - "ApiAppCreateRequest" - ); - } - const localVarPath = this.basePath + "/api_app"; + embeddedEditUrl(_0, _1) { + return __async(this, arguments, function* (templateId, embeddedEditUrlRequest, options = { headers: {} }) { + embeddedEditUrlRequest = deserializeIfNeeded3( + embeddedEditUrlRequest, + "EmbeddedEditUrlRequest" + ); + const localVarPath = this.basePath + "/embedded/edit_url/{template_id}".replace( + "{template_id}", + encodeURIComponent(String(templateId)) + ); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -24175,16 +26108,21 @@ var ApiAppApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (apiAppCreateRequest === null || apiAppCreateRequest === void 0) { + if (templateId === null || templateId === void 0) { throw new Error( - "Required parameter apiAppCreateRequest was null or undefined when calling apiAppCreate." + "Required parameter templateId was null or undefined when calling embeddedEditUrl." + ); + } + if (embeddedEditUrlRequest === null || embeddedEditUrlRequest === void 0) { + throw new Error( + "Required parameter embeddedEditUrlRequest was null or undefined when calling embeddedEditUrl." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; - const result = generateFormData( - apiAppCreateRequest, - ApiAppCreateRequest.attributeTypeMap + const result = generateFormData( + embeddedEditUrlRequest, + EmbeddedEditUrlRequest.attributeTypeMap ); localVarUseFormData = result.localVarUseFormData; let data = {}; @@ -24194,8 +26132,8 @@ var ApiAppApi = class { localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); } else { data = ObjectSerializer.serialize( - apiAppCreateRequest, - "ApiAppCreateRequest" + embeddedEditUrlRequest, + "EmbeddedEditUrlRequest" ); } let localVarRequestOptions = { @@ -24230,54 +26168,51 @@ var ApiAppApi = class { ); } return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "ApiAppGetResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - const response = error.response; - let body; - if (response.status === 201) { - body = ObjectSerializer.deserialize( - response.data, - "ApiAppGetResponse" + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse4( + resolve, + reject, + response, + "EmbeddedEditUrlResponse" ); - reject(new HttpError(response, body, response.status)); - return; - } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse4( + reject, + error.response, + 200, + "EmbeddedEditUrlResponse" + )) { + return; + } + if (handleErrorRangeResponse4( + reject, + error.response, + "4XX", "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); - return; + )) { + return; + } + reject(error); } - reject(error); - } - ); - }); + ); + } + ); }); }); } - apiAppDelete(_0) { - return __async(this, arguments, function* (clientId, options = { headers: {} }) { - const localVarPath = this.basePath + "/api_app/{client_id}".replace( - "{client_id}", - encodeURIComponent(String(clientId)) + embeddedSignUrl(_0) { + return __async(this, arguments, function* (signatureId, options = { headers: {} }) { + const localVarPath = this.basePath + "/embedded/sign_url/{signature_id}".replace( + "{signature_id}", + encodeURIComponent(String(signatureId)) ); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -24292,15 +26227,15 @@ var ApiAppApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (clientId === null || clientId === void 0) { + if (signatureId === null || signatureId === void 0) { throw new Error( - "Required parameter clientId was null or undefined when calling apiAppDelete." + "Required parameter signatureId was null or undefined when calling embeddedSignUrl." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { - method: "DELETE", + method: "GET", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, @@ -24330,46 +26265,140 @@ var ApiAppApi = class { ); } return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - const response = error.response; - let body; - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse4( + resolve, + reject, + response, + "EmbeddedSignUrlResponse" ); - reject(new HttpError(response, body, response.status)); - return; + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse4( + reject, + error.response, + 200, + "EmbeddedSignUrlResponse" + )) { + return; + } + if (handleErrorRangeResponse4( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); } - reject(error); - } - ); - }); + ); + } + ); }); }); } - apiAppGet(_0) { - return __async(this, arguments, function* (clientId, options = { headers: {} }) { - const localVarPath = this.basePath + "/api_app/{client_id}".replace( - "{client_id}", - encodeURIComponent(String(clientId)) +}; +function deserializeIfNeeded3(obj, classname) { + if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { + return ObjectSerializer.deserialize(obj, classname); + } + return obj; +} +function handleSuccessfulResponse4(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 handleErrorCodeResponse4(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 handleErrorRangeResponse4(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 defaultBasePath5 = "https://api.hellosign.com/v3"; +var FaxLineApi = class { + constructor(basePath) { + this._basePath = defaultBasePath5; + 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 = deserializeIfNeeded4( + faxLineAddUserRequest, + "FaxLineAddUserRequest" ); + const localVarPath = this.basePath + "/fax_line/add_user"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -24383,22 +26412,39 @@ var ApiAppApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (clientId === null || clientId === void 0) { + if (faxLineAddUserRequest === null || faxLineAddUserRequest === void 0) { throw new Error( - "Required parameter clientId was null or undefined when calling apiAppGet." + "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: "GET", + method: "PUT", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, maxContentLength: Infinity, maxBodyLength: Infinity, - responseType: "json" + responseType: "json", + data }; let authenticationPromise = Promise.resolve(); if (this.authentications.api_key.username) { @@ -24406,11 +26452,6 @@ var ApiAppApi = class { () => this.authentications.api_key.applyToRequest(localVarRequestOptions) ); } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } authenticationPromise = authenticationPromise.then( () => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -24424,37 +26465,32 @@ var ApiAppApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "ApiAppGetResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse5( + resolve, + reject, + response, + "FaxLineResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "ApiAppGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxLineResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -24464,9 +26500,9 @@ var ApiAppApi = class { }); }); } - apiAppList(_0, _1) { - return __async(this, arguments, function* (page, pageSize, options = { headers: {} }) { - const localVarPath = this.basePath + "/api_app/list"; + 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( {}, @@ -24480,16 +26516,33 @@ var ApiAppApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" + if (country === null || country === void 0) { + throw new Error( + "Required parameter country was null or undefined when calling faxLineAreaCodeGet." ); } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" + 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); @@ -24510,11 +26563,6 @@ var ApiAppApi = class { () => this.authentications.api_key.applyToRequest(localVarRequestOptions) ); } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } authenticationPromise = authenticationPromise.then( () => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -24525,61 +26573,53 @@ var ApiAppApi = class { ); } return interceptorPromise.then(() => { - return new Promise((resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "ApiAppListResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "ApiAppListResponse" + return new Promise( + (resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse5( + resolve, + reject, + response, + "FaxLineAreaCodeGetResponse" ); - reject(new HttpError(response, body, response.status)); - return; - } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, + }, + (error) => { + if (error.response == null) { + reject(error); + return; + } + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxLineAreaCodeGetResponse" + )) { + return; + } + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); - return; + )) { + return; + } + reject(error); } - reject(error); - } - ); - }); + ); + } + ); }); }); } - apiAppUpdate(_0, _1) { - return __async(this, arguments, function* (clientId, apiAppUpdateRequest, options = { headers: {} }) { - if (apiAppUpdateRequest !== null && apiAppUpdateRequest !== void 0 && apiAppUpdateRequest.constructor.name !== "ApiAppUpdateRequest") { - apiAppUpdateRequest = ObjectSerializer.deserialize( - apiAppUpdateRequest, - "ApiAppUpdateRequest" - ); - } - const localVarPath = this.basePath + "/api_app/{client_id}".replace( - "{client_id}", - encodeURIComponent(String(clientId)) + faxLineCreate(_0) { + return __async(this, arguments, function* (faxLineCreateRequest, options = { headers: {} }) { + faxLineCreateRequest = deserializeIfNeeded4( + faxLineCreateRequest, + "FaxLineCreateRequest" ); + const localVarPath = this.basePath + "/fax_line/create"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -24593,21 +26633,16 @@ var ApiAppApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (clientId === null || clientId === void 0) { - throw new Error( - "Required parameter clientId was null or undefined when calling apiAppUpdate." - ); - } - if (apiAppUpdateRequest === null || apiAppUpdateRequest === void 0) { + if (faxLineCreateRequest === null || faxLineCreateRequest === void 0) { throw new Error( - "Required parameter apiAppUpdateRequest was null or undefined when calling apiAppUpdate." + "Required parameter faxLineCreateRequest was null or undefined when calling faxLineCreate." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; const result = generateFormData( - apiAppUpdateRequest, - ApiAppUpdateRequest.attributeTypeMap + faxLineCreateRequest, + FaxLineCreateRequest.attributeTypeMap ); localVarUseFormData = result.localVarUseFormData; let data = {}; @@ -24617,12 +26652,12 @@ var ApiAppApi = class { localVarHeaderParams = __spreadValues(__spreadValues({}, localVarHeaderParams), formData2.getHeaders()); } else { data = ObjectSerializer.serialize( - apiAppUpdateRequest, - "ApiAppUpdateRequest" + faxLineCreateRequest, + "FaxLineCreateRequest" ); } let localVarRequestOptions = { - method: "PUT", + method: "POST", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, @@ -24638,11 +26673,6 @@ var ApiAppApi = class { () => this.authentications.api_key.applyToRequest(localVarRequestOptions) ); } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } authenticationPromise = authenticationPromise.then( () => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -24656,37 +26686,32 @@ var ApiAppApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "ApiAppGetResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse5( + resolve, + reject, + response, + "FaxLineResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "ApiAppGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxLineResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -24696,66 +26721,13 @@ var ApiAppApi = class { }); }); } -}; - -// api/bulkSendJobApi.ts -var defaultBasePath3 = "https://api.hellosign.com/v3"; -var BulkSendJobApi = class { - constructor(basePath) { - this._basePath = defaultBasePath3; - 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 = defaultHeaders; - } - 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); - } - bulkSendJobGet(_0, _1, _2) { - return __async(this, arguments, function* (bulkSendJobId, page, pageSize, options = { headers: {} }) { - const localVarPath = this.basePath + "/bulk_send_job/{bulk_send_job_id}".replace( - "{bulk_send_job_id}", - encodeURIComponent(String(bulkSendJobId)) + faxLineDelete(_0) { + return __async(this, arguments, function* (faxLineDeleteRequest, options = { headers: {} }) { + faxLineDeleteRequest = deserializeIfNeeded4( + faxLineDeleteRequest, + "FaxLineDeleteRequest" ); + const localVarPath = this.basePath + "/fax_line"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -24769,34 +26741,39 @@ var BulkSendJobApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (bulkSendJobId === null || bulkSendJobId === void 0) { + if (faxLineDeleteRequest === null || faxLineDeleteRequest === void 0) { throw new Error( - "Required parameter bulkSendJobId was null or undefined when calling bulkSendJobGet." - ); - } - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" - ); - } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" + "Required parameter faxLineDeleteRequest was null or undefined when calling faxLineDelete." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; + const result = generateFormData( + faxLineDeleteRequest, + FaxLineDeleteRequest.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( + faxLineDeleteRequest, + "FaxLineDeleteRequest" + ); + } let localVarRequestOptions = { - method: "GET", + method: "DELETE", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, maxContentLength: Infinity, maxBodyLength: Infinity, - responseType: "json" + responseType: "json", + data }; let authenticationPromise = Promise.resolve(); if (this.authentications.api_key.username) { @@ -24804,11 +26781,6 @@ var BulkSendJobApi = class { () => this.authentications.api_key.applyToRequest(localVarRequestOptions) ); } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } authenticationPromise = authenticationPromise.then( () => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -24819,57 +26791,34 @@ var BulkSendJobApi = class { ); } return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "BulkSendJobGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "BulkSendJobGetResponse" - ); - reject(new HttpError(response, body, response.status)); - return; - } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); - return; - } + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse5(resolve, reject, response); + }, + (error) => { + if (error.response == null) { reject(error); + return; } - ); - } - ); + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); }); }); } - bulkSendJobList(_0, _1) { - return __async(this, arguments, function* (page, pageSize, options = { headers: {} }) { - const localVarPath = this.basePath + "/bulk_send_job/list"; + faxLineGet(_0) { + return __async(this, arguments, function* (number, options = { headers: {} }) { + const localVarPath = this.basePath + "/fax_line"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -24883,16 +26832,15 @@ var BulkSendJobApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (page !== void 0) { - localVarQueryParameters["page"] = ObjectSerializer.serialize( - page, - "number" + if (number === null || number === void 0) { + throw new Error( + "Required parameter number was null or undefined when calling faxLineGet." ); } - if (pageSize !== void 0) { - localVarQueryParameters["page_size"] = ObjectSerializer.serialize( - pageSize, - "number" + if (number !== void 0) { + localVarQueryParameters["number"] = ObjectSerializer.serialize( + number, + "string" ); } Object.assign(localVarHeaderParams, options.headers); @@ -24913,11 +26861,6 @@ var BulkSendJobApi = class { () => this.authentications.api_key.applyToRequest(localVarRequestOptions) ); } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } authenticationPromise = authenticationPromise.then( () => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -24928,120 +26871,47 @@ var BulkSendJobApi = class { ); } return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "BulkSendJobListResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "BulkSendJobListResponse" - ); - reject(new HttpError(response, body, response.status)); - return; - } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); - return; - } + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse5( + resolve, + reject, + response, + "FaxLineResponse" + ); + }, + (error) => { + if (error.response == null) { reject(error); + return; } - ); - } - ); - }); - }); - } -}; - -// api/embeddedApi.ts -var defaultBasePath4 = "https://api.hellosign.com/v3"; -var EmbeddedApi = class { - constructor(basePath) { - this._basePath = defaultBasePath4; - 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 = defaultHeaders; - } - 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); - } - embeddedEditUrl(_0, _1) { - return __async(this, arguments, function* (templateId, embeddedEditUrlRequest, options = { headers: {} }) { - if (embeddedEditUrlRequest !== null && embeddedEditUrlRequest !== void 0 && embeddedEditUrlRequest.constructor.name !== "EmbeddedEditUrlRequest") { - embeddedEditUrlRequest = ObjectSerializer.deserialize( - embeddedEditUrlRequest, - "EmbeddedEditUrlRequest" - ); - } - const localVarPath = this.basePath + "/embedded/edit_url/{template_id}".replace( - "{template_id}", - encodeURIComponent(String(templateId)) - ); + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxLineResponse" + )) { + return; + } + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { + return; + } + reject(error); + } + ); + }); + }); + }); + } + faxLineList(_0, _1, _2, _3) { + return __async(this, arguments, function* (accountId, page, pageSize, showTeamLines, options = { headers: {} }) { + const localVarPath = this.basePath + "/fax_line/list"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -25055,44 +26925,41 @@ var EmbeddedApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (templateId === null || templateId === void 0) { - throw new Error( - "Required parameter templateId was null or undefined when calling embeddedEditUrl." + if (accountId !== void 0) { + localVarQueryParameters["account_id"] = ObjectSerializer.serialize( + accountId, + "string" ); } - if (embeddedEditUrlRequest === null || embeddedEditUrlRequest === void 0) { - throw new Error( - "Required parameter embeddedEditUrlRequest was null or undefined when calling embeddedEditUrl." + if (page !== void 0) { + localVarQueryParameters["page"] = ObjectSerializer.serialize( + page, + "number" ); } - Object.assign(localVarHeaderParams, options.headers); - let localVarUseFormData = false; - const result = generateFormData( - embeddedEditUrlRequest, - EmbeddedEditUrlRequest.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( - embeddedEditUrlRequest, - "EmbeddedEditUrlRequest" + if (pageSize !== void 0) { + localVarQueryParameters["page_size"] = ObjectSerializer.serialize( + pageSize, + "number" + ); + } + if (showTeamLines !== void 0) { + localVarQueryParameters["show_team_lines"] = ObjectSerializer.serialize( + showTeamLines, + "boolean" ); } + Object.assign(localVarHeaderParams, options.headers); + let localVarUseFormData = false; let localVarRequestOptions = { - method: "POST", + method: "GET", 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) { @@ -25100,11 +26967,6 @@ var EmbeddedApi = class { () => this.authentications.api_key.applyToRequest(localVarRequestOptions) ); } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } authenticationPromise = authenticationPromise.then( () => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -25119,40 +26981,32 @@ var EmbeddedApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "EmbeddedEditUrlResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse5( + resolve, + reject, + response, + "FaxLineListResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "EmbeddedEditUrlResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxLineListResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse5( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -25163,12 +27017,13 @@ var EmbeddedApi = class { }); }); } - embeddedSignUrl(_0) { - return __async(this, arguments, function* (signatureId, options = { headers: {} }) { - const localVarPath = this.basePath + "/embedded/sign_url/{signature_id}".replace( - "{signature_id}", - encodeURIComponent(String(signatureId)) + faxLineRemoveUser(_0) { + return __async(this, arguments, function* (faxLineRemoveUserRequest, options = { headers: {} }) { + faxLineRemoveUserRequest = deserializeIfNeeded4( + faxLineRemoveUserRequest, + "FaxLineRemoveUserRequest" ); + const localVarPath = this.basePath + "/fax_line/remove_user"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( {}, @@ -25182,22 +27037,39 @@ var EmbeddedApi = class { } let localVarFormParams = {}; let localVarBodyParams = void 0; - if (signatureId === null || signatureId === void 0) { + if (faxLineRemoveUserRequest === null || faxLineRemoveUserRequest === void 0) { throw new Error( - "Required parameter signatureId was null or undefined when calling embeddedSignUrl." + "Required parameter faxLineRemoveUserRequest was null or undefined when calling faxLineRemoveUser." ); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; + const result = generateFormData( + faxLineRemoveUserRequest, + FaxLineRemoveUserRequest.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( + faxLineRemoveUserRequest, + "FaxLineRemoveUserRequest" + ); + } let localVarRequestOptions = { - method: "GET", + method: "PUT", params: localVarQueryParameters, headers: localVarHeaderParams, url: localVarPath, paramsSerializer: this._useQuerystring ? queryParamsSerializer : void 0, maxContentLength: Infinity, maxBodyLength: Infinity, - responseType: "json" + responseType: "json", + data }; let authenticationPromise = Promise.resolve(); if (this.authentications.api_key.username) { @@ -25205,11 +27077,6 @@ var EmbeddedApi = class { () => this.authentications.api_key.applyToRequest(localVarRequestOptions) ); } - if (this.authentications.oauth2.accessToken) { - authenticationPromise = authenticationPromise.then( - () => this.authentications.oauth2.applyToRequest(localVarRequestOptions) - ); - } authenticationPromise = authenticationPromise.then( () => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -25220,64 +27087,87 @@ var EmbeddedApi = class { ); } return interceptorPromise.then(() => { - return new Promise( - (resolve, reject) => { - axios_default.request(localVarRequestOptions).then( - (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "EmbeddedSignUrlResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } - }, - (error) => { - if (error.response == null) { - reject(error); - return; - } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "EmbeddedSignUrlResponse" - ); - reject(new HttpError(response, body, response.status)); - return; - } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); - return; - } + return new Promise((resolve, reject) => { + axios_default.request(localVarRequestOptions).then( + (response) => { + handleSuccessfulResponse5( + resolve, + reject, + response, + "FaxLineResponse" + ); + }, + (error) => { + if (error.response == null) { reject(error); + return; } - ); - } - ); + if (handleErrorCodeResponse5( + reject, + error.response, + 200, + "FaxLineResponse" + )) { + 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/oAuthApi.ts -var defaultBasePath5 = "https://app.hellosign.com"; +var defaultBasePath6 = "https://app.hellosign.com"; var OAuthApi = class { constructor(basePath) { - this._basePath = defaultBasePath5; - this._defaultHeaders = { - "User-Agent": USER_AGENT - }; + this._basePath = defaultBasePath6; + this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { default: new VoidAuth(), @@ -25296,7 +27186,7 @@ var OAuthApi = class { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); } get defaultHeaders() { return this._defaultHeaders; @@ -25324,12 +27214,10 @@ var OAuthApi = class { } oauthTokenGenerate(_0) { return __async(this, arguments, function* (oAuthTokenGenerateRequest, options = { headers: {} }) { - if (oAuthTokenGenerateRequest !== null && oAuthTokenGenerateRequest !== void 0 && oAuthTokenGenerateRequest.constructor.name !== "OAuthTokenGenerateRequest") { - oAuthTokenGenerateRequest = ObjectSerializer.deserialize( - oAuthTokenGenerateRequest, - "OAuthTokenGenerateRequest" - ); - } + oAuthTokenGenerateRequest = deserializeIfNeeded5( + oAuthTokenGenerateRequest, + "OAuthTokenGenerateRequest" + ); const localVarPath = this.basePath + "/oauth/token"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -25392,27 +27280,24 @@ var OAuthApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "OAuthTokenResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse6( + resolve, + reject, + response, + "OAuthTokenResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "OAuthTokenResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse6( + reject, + error.response, + 200, + "OAuthTokenResponse" + )) { return; } reject(error); @@ -25424,12 +27309,10 @@ var OAuthApi = class { } oauthTokenRefresh(_0) { return __async(this, arguments, function* (oAuthTokenRefreshRequest, options = { headers: {} }) { - if (oAuthTokenRefreshRequest !== null && oAuthTokenRefreshRequest !== void 0 && oAuthTokenRefreshRequest.constructor.name !== "OAuthTokenRefreshRequest") { - oAuthTokenRefreshRequest = ObjectSerializer.deserialize( - oAuthTokenRefreshRequest, - "OAuthTokenRefreshRequest" - ); - } + oAuthTokenRefreshRequest = deserializeIfNeeded5( + oAuthTokenRefreshRequest, + "OAuthTokenRefreshRequest" + ); const localVarPath = this.basePath + "/oauth/token?refresh"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -25492,27 +27375,24 @@ var OAuthApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "OAuthTokenResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse6( + resolve, + reject, + response, + "OAuthTokenResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "OAuthTokenResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse6( + reject, + error.response, + 200, + "OAuthTokenResponse" + )) { return; } reject(error); @@ -25523,15 +27403,38 @@ var OAuthApi = class { }); } }; +function deserializeIfNeeded5(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) { + 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 handleErrorCodeResponse6(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; +} // api/reportApi.ts -var defaultBasePath6 = "https://api.hellosign.com/v3"; +var defaultBasePath7 = "https://api.hellosign.com/v3"; var ReportApi = class { constructor(basePath) { - this._basePath = defaultBasePath6; - this._defaultHeaders = { - "User-Agent": USER_AGENT - }; + this._basePath = defaultBasePath7; + this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { default: new VoidAuth(), @@ -25550,7 +27453,7 @@ var ReportApi = class { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); } get defaultHeaders() { return this._defaultHeaders; @@ -25578,12 +27481,10 @@ var ReportApi = class { } reportCreate(_0) { return __async(this, arguments, function* (reportCreateRequest, options = { headers: {} }) { - if (reportCreateRequest !== null && reportCreateRequest !== void 0 && reportCreateRequest.constructor.name !== "ReportCreateRequest") { - reportCreateRequest = ObjectSerializer.deserialize( - reportCreateRequest, - "ReportCreateRequest" - ); - } + reportCreateRequest = deserializeIfNeeded6( + reportCreateRequest, + "ReportCreateRequest" + ); const localVarPath = this.basePath + "/report/create"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -25652,40 +27553,32 @@ var ReportApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "ReportCreateResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse7( + resolve, + reject, + response, + "ReportCreateResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "ReportCreateResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse7( + reject, + error.response, + 200, + "ReportCreateResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse6( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -25697,15 +27590,48 @@ var ReportApi = class { }); } }; +function deserializeIfNeeded6(obj, classname) { + if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { + return ObjectSerializer.deserialize(obj, classname); + } + return obj; +} +function handleSuccessfulResponse7(resolve, reject, response, returnType) { + let body = response.data; + if (response.status && response.status >= 200 && response.status <= 299) { + if (returnType) { + body = ObjectSerializer.deserialize(body, returnType); + } + resolve({ response, body }); + } else { + reject(new HttpError(response, body, response.status)); + } +} +function handleErrorCodeResponse7(reject, response, code, returnType) { + if (response.status !== code) { + return false; + } + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; +} +function handleErrorRangeResponse6(reject, response, code, returnType) { + let rangeCodeLeft = Number(code[0] + "00"); + let rangeCodeRight = Number(code[0] + "99"); + if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; + } + return false; +} // api/signatureRequestApi.ts -var defaultBasePath7 = "https://api.hellosign.com/v3"; +var defaultBasePath8 = "https://api.hellosign.com/v3"; var SignatureRequestApi = class { constructor(basePath) { - this._basePath = defaultBasePath7; - this._defaultHeaders = { - "User-Agent": USER_AGENT - }; + this._basePath = defaultBasePath8; + this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { default: new VoidAuth(), @@ -25724,7 +27650,7 @@ var SignatureRequestApi = class { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); } get defaultHeaders() { return this._defaultHeaders; @@ -25752,12 +27678,10 @@ var SignatureRequestApi = class { } signatureRequestBulkCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestBulkCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - if (signatureRequestBulkCreateEmbeddedWithTemplateRequest !== null && signatureRequestBulkCreateEmbeddedWithTemplateRequest !== void 0 && signatureRequestBulkCreateEmbeddedWithTemplateRequest.constructor.name !== "SignatureRequestBulkCreateEmbeddedWithTemplateRequest") { - signatureRequestBulkCreateEmbeddedWithTemplateRequest = ObjectSerializer.deserialize( - signatureRequestBulkCreateEmbeddedWithTemplateRequest, - "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" - ); - } + signatureRequestBulkCreateEmbeddedWithTemplateRequest = deserializeIfNeeded7( + signatureRequestBulkCreateEmbeddedWithTemplateRequest, + "SignatureRequestBulkCreateEmbeddedWithTemplateRequest" + ); const localVarPath = this.basePath + "/signature_request/bulk_create_embedded_with_template"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -25826,40 +27750,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "BulkSendJobSendResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "BulkSendJobSendResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "BulkSendJobSendResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "BulkSendJobSendResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -25872,12 +27788,10 @@ var SignatureRequestApi = class { } signatureRequestBulkSendWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestBulkSendWithTemplateRequest, options = { headers: {} }) { - if (signatureRequestBulkSendWithTemplateRequest !== null && signatureRequestBulkSendWithTemplateRequest !== void 0 && signatureRequestBulkSendWithTemplateRequest.constructor.name !== "SignatureRequestBulkSendWithTemplateRequest") { - signatureRequestBulkSendWithTemplateRequest = ObjectSerializer.deserialize( - signatureRequestBulkSendWithTemplateRequest, - "SignatureRequestBulkSendWithTemplateRequest" - ); - } + signatureRequestBulkSendWithTemplateRequest = deserializeIfNeeded7( + signatureRequestBulkSendWithTemplateRequest, + "SignatureRequestBulkSendWithTemplateRequest" + ); const localVarPath = this.basePath + "/signature_request/bulk_send_with_template"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -25951,40 +27865,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "BulkSendJobSendResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "BulkSendJobSendResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "BulkSendJobSendResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "BulkSendJobSendResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -26055,28 +27961,19 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -26088,12 +27985,10 @@ var SignatureRequestApi = class { } signatureRequestCreateEmbedded(_0) { return __async(this, arguments, function* (signatureRequestCreateEmbeddedRequest, options = { headers: {} }) { - if (signatureRequestCreateEmbeddedRequest !== null && signatureRequestCreateEmbeddedRequest !== void 0 && signatureRequestCreateEmbeddedRequest.constructor.name !== "SignatureRequestCreateEmbeddedRequest") { - signatureRequestCreateEmbeddedRequest = ObjectSerializer.deserialize( - signatureRequestCreateEmbeddedRequest, - "SignatureRequestCreateEmbeddedRequest" - ); - } + signatureRequestCreateEmbeddedRequest = deserializeIfNeeded7( + signatureRequestCreateEmbeddedRequest, + "SignatureRequestCreateEmbeddedRequest" + ); const localVarPath = this.basePath + "/signature_request/create_embedded"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -26167,40 +28062,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "SignatureRequestGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -26213,12 +28100,10 @@ var SignatureRequestApi = class { } signatureRequestCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - if (signatureRequestCreateEmbeddedWithTemplateRequest !== null && signatureRequestCreateEmbeddedWithTemplateRequest !== void 0 && signatureRequestCreateEmbeddedWithTemplateRequest.constructor.name !== "SignatureRequestCreateEmbeddedWithTemplateRequest") { - signatureRequestCreateEmbeddedWithTemplateRequest = ObjectSerializer.deserialize( - signatureRequestCreateEmbeddedWithTemplateRequest, - "SignatureRequestCreateEmbeddedWithTemplateRequest" - ); - } + signatureRequestCreateEmbeddedWithTemplateRequest = deserializeIfNeeded7( + signatureRequestCreateEmbeddedWithTemplateRequest, + "SignatureRequestCreateEmbeddedWithTemplateRequest" + ); const localVarPath = this.basePath + "/signature_request/create_embedded_with_template"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -26292,40 +28177,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "SignatureRequestGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -26402,34 +28279,32 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "Buffer"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "Buffer" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize(response.data, "RequestFile"); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "RequestFile" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -26500,40 +28375,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "FileResponseDataUri" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "FileResponseDataUri" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "FileResponseDataUri" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "FileResponseDataUri" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -26610,37 +28477,32 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "FileResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "FileResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "FileResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "FileResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -26711,40 +28573,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "SignatureRequestGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -26832,40 +28686,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestListResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "SignatureRequestListResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "SignatureRequestListResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "SignatureRequestListResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -26937,40 +28783,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "SignatureRequestGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -26982,13 +28820,11 @@ var SignatureRequestApi = class { }); } signatureRequestRemind(_0, _1) { - return __async(this, arguments, function* (signatureRequestId, signatureRequestRemindRequest, options = { headers: {} }) { - if (signatureRequestRemindRequest !== null && signatureRequestRemindRequest !== void 0 && signatureRequestRemindRequest.constructor.name !== "SignatureRequestRemindRequest") { - signatureRequestRemindRequest = ObjectSerializer.deserialize( - signatureRequestRemindRequest, - "SignatureRequestRemindRequest" - ); - } + return __async(this, arguments, function* (signatureRequestId, signatureRequestRemindRequest, options = { headers: {} }) { + signatureRequestRemindRequest = deserializeIfNeeded7( + signatureRequestRemindRequest, + "SignatureRequestRemindRequest" + ); const localVarPath = this.basePath + "/signature_request/remind/{signature_request_id}".replace( "{signature_request_id}", encodeURIComponent(String(signatureRequestId)) @@ -27070,40 +28906,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "SignatureRequestGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -27169,28 +28997,19 @@ var SignatureRequestApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -27202,12 +29021,10 @@ var SignatureRequestApi = class { } signatureRequestSend(_0) { return __async(this, arguments, function* (signatureRequestSendRequest, options = { headers: {} }) { - if (signatureRequestSendRequest !== null && signatureRequestSendRequest !== void 0 && signatureRequestSendRequest.constructor.name !== "SignatureRequestSendRequest") { - signatureRequestSendRequest = ObjectSerializer.deserialize( - signatureRequestSendRequest, - "SignatureRequestSendRequest" - ); - } + signatureRequestSendRequest = deserializeIfNeeded7( + signatureRequestSendRequest, + "SignatureRequestSendRequest" + ); const localVarPath = this.basePath + "/signature_request/send"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -27281,40 +29098,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "SignatureRequestGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -27327,12 +29136,10 @@ var SignatureRequestApi = class { } signatureRequestSendWithTemplate(_0) { return __async(this, arguments, function* (signatureRequestSendWithTemplateRequest, options = { headers: {} }) { - if (signatureRequestSendWithTemplateRequest !== null && signatureRequestSendWithTemplateRequest !== void 0 && signatureRequestSendWithTemplateRequest.constructor.name !== "SignatureRequestSendWithTemplateRequest") { - signatureRequestSendWithTemplateRequest = ObjectSerializer.deserialize( - signatureRequestSendWithTemplateRequest, - "SignatureRequestSendWithTemplateRequest" - ); - } + signatureRequestSendWithTemplateRequest = deserializeIfNeeded7( + signatureRequestSendWithTemplateRequest, + "SignatureRequestSendWithTemplateRequest" + ); const localVarPath = this.basePath + "/signature_request/send_with_template"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -27406,40 +29213,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "SignatureRequestGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -27452,12 +29251,10 @@ var SignatureRequestApi = class { } signatureRequestUpdate(_0, _1) { return __async(this, arguments, function* (signatureRequestId, signatureRequestUpdateRequest, options = { headers: {} }) { - if (signatureRequestUpdateRequest !== null && signatureRequestUpdateRequest !== void 0 && signatureRequestUpdateRequest.constructor.name !== "SignatureRequestUpdateRequest") { - signatureRequestUpdateRequest = ObjectSerializer.deserialize( - signatureRequestUpdateRequest, - "SignatureRequestUpdateRequest" - ); - } + signatureRequestUpdateRequest = deserializeIfNeeded7( + signatureRequestUpdateRequest, + "SignatureRequestUpdateRequest" + ); const localVarPath = this.basePath + "/signature_request/update/{signature_request_id}".replace( "{signature_request_id}", encodeURIComponent(String(signatureRequestId)) @@ -27539,40 +29336,32 @@ var SignatureRequestApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "SignatureRequestGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse8( + resolve, + reject, + response, + "SignatureRequestGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "SignatureRequestGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse8( + reject, + error.response, + 200, + "SignatureRequestGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse7( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -27584,15 +29373,48 @@ var SignatureRequestApi = class { }); } }; +function deserializeIfNeeded7(obj, classname) { + if (obj !== null && obj !== void 0 && obj.constructor.name !== classname) { + return ObjectSerializer.deserialize(obj, classname); + } + return obj; +} +function handleSuccessfulResponse8(resolve, reject, response, returnType) { + let body = response.data; + if (response.status && response.status >= 200 && response.status <= 299) { + if (returnType) { + body = ObjectSerializer.deserialize(body, returnType); + } + resolve({ response, body }); + } else { + reject(new HttpError(response, body, response.status)); + } +} +function handleErrorCodeResponse8(reject, response, code, returnType) { + if (response.status !== code) { + return false; + } + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; +} +function handleErrorRangeResponse7(reject, response, code, returnType) { + let rangeCodeLeft = Number(code[0] + "00"); + let rangeCodeRight = Number(code[0] + "99"); + if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; + } + return false; +} // api/teamApi.ts -var defaultBasePath8 = "https://api.hellosign.com/v3"; +var defaultBasePath9 = "https://api.hellosign.com/v3"; var TeamApi = class { constructor(basePath) { - this._basePath = defaultBasePath8; - this._defaultHeaders = { - "User-Agent": USER_AGENT - }; + this._basePath = defaultBasePath9; + this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { default: new VoidAuth(), @@ -27611,7 +29433,7 @@ var TeamApi = class { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); } get defaultHeaders() { return this._defaultHeaders; @@ -27639,12 +29461,10 @@ var TeamApi = class { } teamAddMember(_0, _1) { return __async(this, arguments, function* (teamAddMemberRequest, teamId, options = { headers: {} }) { - if (teamAddMemberRequest !== null && teamAddMemberRequest !== void 0 && teamAddMemberRequest.constructor.name !== "TeamAddMemberRequest") { - teamAddMemberRequest = ObjectSerializer.deserialize( - teamAddMemberRequest, - "TeamAddMemberRequest" - ); - } + teamAddMemberRequest = deserializeIfNeeded8( + teamAddMemberRequest, + "TeamAddMemberRequest" + ); const localVarPath = this.basePath + "/team/add_member"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -27723,37 +29543,32 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "TeamGetResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse9( + resolve, + reject, + response, + "TeamGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TeamGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "TeamGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -27765,12 +29580,10 @@ var TeamApi = class { } teamCreate(_0) { return __async(this, arguments, function* (teamCreateRequest, options = { headers: {} }) { - if (teamCreateRequest !== null && teamCreateRequest !== void 0 && teamCreateRequest.constructor.name !== "TeamCreateRequest") { - teamCreateRequest = ObjectSerializer.deserialize( - teamCreateRequest, - "TeamCreateRequest" - ); - } + teamCreateRequest = deserializeIfNeeded8( + teamCreateRequest, + "TeamCreateRequest" + ); const localVarPath = this.basePath + "/team/create"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -27840,37 +29653,32 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "TeamGetResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse9( + resolve, + reject, + response, + "TeamGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TeamGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "TeamGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -27932,28 +29740,19 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse9(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -28015,37 +29814,32 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "TeamGetResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse9( + resolve, + reject, + response, + "TeamGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TeamGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "TeamGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -28114,40 +29908,32 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TeamGetInfoResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse9( + resolve, + reject, + response, + "TeamGetInfoResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TeamGetInfoResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "TeamGetInfoResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -28217,40 +30003,32 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TeamInvitesResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse9( + resolve, + reject, + response, + "TeamInvitesResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TeamInvitesResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "TeamInvitesResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -28334,40 +30112,32 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TeamMembersResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse9( + resolve, + reject, + response, + "TeamMembersResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TeamMembersResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "TeamMembersResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -28380,12 +30150,10 @@ var TeamApi = class { } teamRemoveMember(_0) { return __async(this, arguments, function* (teamRemoveMemberRequest, options = { headers: {} }) { - if (teamRemoveMemberRequest !== null && teamRemoveMemberRequest !== void 0 && teamRemoveMemberRequest.constructor.name !== "TeamRemoveMemberRequest") { - teamRemoveMemberRequest = ObjectSerializer.deserialize( - teamRemoveMemberRequest, - "TeamRemoveMemberRequest" - ); - } + teamRemoveMemberRequest = deserializeIfNeeded8( + teamRemoveMemberRequest, + "TeamRemoveMemberRequest" + ); const localVarPath = this.basePath + "/team/remove_member"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -28458,37 +30226,32 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "TeamGetResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse9( + resolve, + reject, + response, + "TeamGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 201) { - body = ObjectSerializer.deserialize( - response.data, - "TeamGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse9( + reject, + error.response, + 201, + "TeamGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -28571,40 +30334,32 @@ var TeamApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TeamSubTeamsResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse9( + resolve, + reject, + response, + "TeamSubTeamsResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TeamSubTeamsResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "TeamSubTeamsResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -28617,12 +30372,10 @@ var TeamApi = class { } teamUpdate(_0) { return __async(this, arguments, function* (teamUpdateRequest, options = { headers: {} }) { - if (teamUpdateRequest !== null && teamUpdateRequest !== void 0 && teamUpdateRequest.constructor.name !== "TeamUpdateRequest") { - teamUpdateRequest = ObjectSerializer.deserialize( - teamUpdateRequest, - "TeamUpdateRequest" - ); - } + teamUpdateRequest = deserializeIfNeeded8( + teamUpdateRequest, + "TeamUpdateRequest" + ); const localVarPath = this.basePath + "/team"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -28692,37 +30445,32 @@ var TeamApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "TeamGetResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse9( + resolve, + reject, + response, + "TeamGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TeamGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse9( + reject, + error.response, + 200, + "TeamGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse8( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -28733,15 +30481,48 @@ var TeamApi = class { }); } }; +function deserializeIfNeeded8(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) { + 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 handleErrorCodeResponse9(reject, response, code, returnType) { + if (response.status !== code) { + return false; + } + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; +} +function handleErrorRangeResponse8(reject, response, code, returnType) { + let rangeCodeLeft = Number(code[0] + "00"); + let rangeCodeRight = Number(code[0] + "99"); + if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { + const body = ObjectSerializer.deserialize(response.data, returnType); + reject(new HttpError(response, body, response.status)); + return true; + } + return false; +} // api/templateApi.ts -var defaultBasePath9 = "https://api.hellosign.com/v3"; +var defaultBasePath10 = "https://api.hellosign.com/v3"; var TemplateApi = class { constructor(basePath) { - this._basePath = defaultBasePath9; - this._defaultHeaders = { - "User-Agent": USER_AGENT - }; + this._basePath = defaultBasePath10; + this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { default: new VoidAuth(), @@ -28760,7 +30541,7 @@ var TemplateApi = class { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); } get defaultHeaders() { return this._defaultHeaders; @@ -28788,12 +30569,10 @@ var TemplateApi = class { } templateAddUser(_0, _1) { return __async(this, arguments, function* (templateId, templateAddUserRequest, options = { headers: {} }) { - if (templateAddUserRequest !== null && templateAddUserRequest !== void 0 && templateAddUserRequest.constructor.name !== "TemplateAddUserRequest") { - templateAddUserRequest = ObjectSerializer.deserialize( - templateAddUserRequest, - "TemplateAddUserRequest" - ); - } + templateAddUserRequest = deserializeIfNeeded9( + templateAddUserRequest, + "TemplateAddUserRequest" + ); const localVarPath = this.basePath + "/template/add_user/{template_id}".replace( "{template_id}", encodeURIComponent(String(templateId)) @@ -28875,40 +30654,32 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TemplateGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10( + resolve, + reject, + response, + "TemplateGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TemplateGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse10( + reject, + error.response, + 200, + "TemplateGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -28921,12 +30692,10 @@ var TemplateApi = class { } templateCreate(_0) { return __async(this, arguments, function* (templateCreateRequest, options = { headers: {} }) { - if (templateCreateRequest !== null && templateCreateRequest !== void 0 && templateCreateRequest.constructor.name !== "TemplateCreateRequest") { - templateCreateRequest = ObjectSerializer.deserialize( - templateCreateRequest, - "TemplateCreateRequest" - ); - } + templateCreateRequest = deserializeIfNeeded9( + templateCreateRequest, + "TemplateCreateRequest" + ); const localVarPath = this.basePath + "/template/create"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -29000,40 +30769,32 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TemplateCreateResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10( + resolve, + reject, + response, + "TemplateCreateResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TemplateCreateResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse10( + reject, + error.response, + 200, + "TemplateCreateResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -29046,12 +30807,10 @@ var TemplateApi = class { } templateCreateEmbeddedDraft(_0) { return __async(this, arguments, function* (templateCreateEmbeddedDraftRequest, options = { headers: {} }) { - if (templateCreateEmbeddedDraftRequest !== null && templateCreateEmbeddedDraftRequest !== void 0 && templateCreateEmbeddedDraftRequest.constructor.name !== "TemplateCreateEmbeddedDraftRequest") { - templateCreateEmbeddedDraftRequest = ObjectSerializer.deserialize( - templateCreateEmbeddedDraftRequest, - "TemplateCreateEmbeddedDraftRequest" - ); - } + templateCreateEmbeddedDraftRequest = deserializeIfNeeded9( + templateCreateEmbeddedDraftRequest, + "TemplateCreateEmbeddedDraftRequest" + ); const localVarPath = this.basePath + "/template/create_embedded_draft"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -29125,40 +30884,32 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TemplateCreateEmbeddedDraftResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10( + resolve, + reject, + response, + "TemplateCreateEmbeddedDraftResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TemplateCreateEmbeddedDraftResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse10( + reject, + error.response, + 200, + "TemplateCreateEmbeddedDraftResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -29229,28 +30980,19 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10(resolve, reject, response); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -29326,34 +31068,32 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "Buffer"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10( + resolve, + reject, + response, + "Buffer" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize(response.data, "RequestFile"); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse10( + reject, + error.response, + 200, + "RequestFile" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -29424,40 +31164,32 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "FileResponseDataUri" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10( + resolve, + reject, + response, + "FileResponseDataUri" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "FileResponseDataUri" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse10( + reject, + error.response, + 200, + "FileResponseDataUri" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -29534,37 +31266,32 @@ var TemplateApi = class { return new Promise((resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize(body, "FileResponse"); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10( + resolve, + reject, + response, + "FileResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "FileResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse10( + reject, + error.response, + 200, + "FileResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -29635,40 +31362,32 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TemplateGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10( + resolve, + reject, + response, + "TemplateGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TemplateGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse10( + reject, + error.response, + 200, + "TemplateGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -29756,40 +31475,32 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TemplateListResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10( + resolve, + reject, + response, + "TemplateListResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TemplateListResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse10( + reject, + error.response, + 200, + "TemplateListResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -29802,12 +31513,10 @@ var TemplateApi = class { } templateRemoveUser(_0, _1) { return __async(this, arguments, function* (templateId, templateRemoveUserRequest, options = { headers: {} }) { - if (templateRemoveUserRequest !== null && templateRemoveUserRequest !== void 0 && templateRemoveUserRequest.constructor.name !== "TemplateRemoveUserRequest") { - templateRemoveUserRequest = ObjectSerializer.deserialize( - templateRemoveUserRequest, - "TemplateRemoveUserRequest" - ); - } + templateRemoveUserRequest = deserializeIfNeeded9( + templateRemoveUserRequest, + "TemplateRemoveUserRequest" + ); const localVarPath = this.basePath + "/template/remove_user/{template_id}".replace( "{template_id}", encodeURIComponent(String(templateId)) @@ -29889,40 +31598,32 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TemplateGetResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10( + resolve, + reject, + response, + "TemplateGetResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TemplateGetResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse10( + reject, + error.response, + 200, + "TemplateGetResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -29935,12 +31636,10 @@ var TemplateApi = class { } templateUpdateFiles(_0, _1) { return __async(this, arguments, function* (templateId, templateUpdateFilesRequest, options = { headers: {} }) { - if (templateUpdateFilesRequest !== null && templateUpdateFilesRequest !== void 0 && templateUpdateFilesRequest.constructor.name !== "TemplateUpdateFilesRequest") { - templateUpdateFilesRequest = ObjectSerializer.deserialize( - templateUpdateFilesRequest, - "TemplateUpdateFilesRequest" - ); - } + templateUpdateFilesRequest = deserializeIfNeeded9( + templateUpdateFilesRequest, + "TemplateUpdateFilesRequest" + ); const localVarPath = this.basePath + "/template/update_files/{template_id}".replace( "{template_id}", encodeURIComponent(String(templateId)) @@ -30022,40 +31721,32 @@ var TemplateApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "TemplateUpdateFilesResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse10( + resolve, + reject, + response, + "TemplateUpdateFilesResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "TemplateUpdateFilesResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse10( + reject, + error.response, + 200, + "TemplateUpdateFilesResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse9( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -30067,15 +31758,48 @@ var TemplateApi = class { }); } }; +function deserializeIfNeeded9(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) { + 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 handleErrorCodeResponse10(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 handleErrorRangeResponse9(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/unclaimedDraftApi.ts -var defaultBasePath10 = "https://api.hellosign.com/v3"; +var defaultBasePath11 = "https://api.hellosign.com/v3"; var UnclaimedDraftApi = class { constructor(basePath) { - this._basePath = defaultBasePath10; - this._defaultHeaders = { - "User-Agent": USER_AGENT - }; + this._basePath = defaultBasePath11; + this._defaultHeaders = { "User-Agent": USER_AGENT }; this._useQuerystring = false; this.authentications = { default: new VoidAuth(), @@ -30094,7 +31818,7 @@ var UnclaimedDraftApi = class { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { - this._defaultHeaders = defaultHeaders; + this._defaultHeaders = __spreadProps(__spreadValues({}, defaultHeaders), { "User-Agent": USER_AGENT }); } get defaultHeaders() { return this._defaultHeaders; @@ -30122,12 +31846,10 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreate(_0) { return __async(this, arguments, function* (unclaimedDraftCreateRequest, options = { headers: {} }) { - if (unclaimedDraftCreateRequest !== null && unclaimedDraftCreateRequest !== void 0 && unclaimedDraftCreateRequest.constructor.name !== "UnclaimedDraftCreateRequest") { - unclaimedDraftCreateRequest = ObjectSerializer.deserialize( - unclaimedDraftCreateRequest, - "UnclaimedDraftCreateRequest" - ); - } + unclaimedDraftCreateRequest = deserializeIfNeeded10( + unclaimedDraftCreateRequest, + "UnclaimedDraftCreateRequest" + ); const localVarPath = this.basePath + "/unclaimed_draft/create"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -30201,40 +31923,32 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "UnclaimedDraftCreateResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse11( + resolve, + reject, + response, + "UnclaimedDraftCreateResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "UnclaimedDraftCreateResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse11( + reject, + error.response, + 200, + "UnclaimedDraftCreateResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse10( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -30247,12 +31961,10 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreateEmbedded(_0) { return __async(this, arguments, function* (unclaimedDraftCreateEmbeddedRequest, options = { headers: {} }) { - if (unclaimedDraftCreateEmbeddedRequest !== null && unclaimedDraftCreateEmbeddedRequest !== void 0 && unclaimedDraftCreateEmbeddedRequest.constructor.name !== "UnclaimedDraftCreateEmbeddedRequest") { - unclaimedDraftCreateEmbeddedRequest = ObjectSerializer.deserialize( - unclaimedDraftCreateEmbeddedRequest, - "UnclaimedDraftCreateEmbeddedRequest" - ); - } + unclaimedDraftCreateEmbeddedRequest = deserializeIfNeeded10( + unclaimedDraftCreateEmbeddedRequest, + "UnclaimedDraftCreateEmbeddedRequest" + ); const localVarPath = this.basePath + "/unclaimed_draft/create_embedded"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -30326,40 +32038,32 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "UnclaimedDraftCreateResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse11( + resolve, + reject, + response, + "UnclaimedDraftCreateResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "UnclaimedDraftCreateResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse11( + reject, + error.response, + 200, + "UnclaimedDraftCreateResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse10( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -30372,12 +32076,10 @@ var UnclaimedDraftApi = class { } unclaimedDraftCreateEmbeddedWithTemplate(_0) { return __async(this, arguments, function* (unclaimedDraftCreateEmbeddedWithTemplateRequest, options = { headers: {} }) { - if (unclaimedDraftCreateEmbeddedWithTemplateRequest !== null && unclaimedDraftCreateEmbeddedWithTemplateRequest !== void 0 && unclaimedDraftCreateEmbeddedWithTemplateRequest.constructor.name !== "UnclaimedDraftCreateEmbeddedWithTemplateRequest") { - unclaimedDraftCreateEmbeddedWithTemplateRequest = ObjectSerializer.deserialize( - unclaimedDraftCreateEmbeddedWithTemplateRequest, - "UnclaimedDraftCreateEmbeddedWithTemplateRequest" - ); - } + unclaimedDraftCreateEmbeddedWithTemplateRequest = deserializeIfNeeded10( + unclaimedDraftCreateEmbeddedWithTemplateRequest, + "UnclaimedDraftCreateEmbeddedWithTemplateRequest" + ); const localVarPath = this.basePath + "/unclaimed_draft/create_embedded_with_template"; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign( @@ -30451,40 +32153,32 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "UnclaimedDraftCreateResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse11( + resolve, + reject, + response, + "UnclaimedDraftCreateResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "UnclaimedDraftCreateResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse11( + reject, + error.response, + 200, + "UnclaimedDraftCreateResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse10( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -30497,12 +32191,10 @@ var UnclaimedDraftApi = class { } unclaimedDraftEditAndResend(_0, _1) { return __async(this, arguments, function* (signatureRequestId, unclaimedDraftEditAndResendRequest, options = { headers: {} }) { - if (unclaimedDraftEditAndResendRequest !== null && unclaimedDraftEditAndResendRequest !== void 0 && unclaimedDraftEditAndResendRequest.constructor.name !== "UnclaimedDraftEditAndResendRequest") { - unclaimedDraftEditAndResendRequest = ObjectSerializer.deserialize( - unclaimedDraftEditAndResendRequest, - "UnclaimedDraftEditAndResendRequest" - ); - } + unclaimedDraftEditAndResendRequest = deserializeIfNeeded10( + unclaimedDraftEditAndResendRequest, + "UnclaimedDraftEditAndResendRequest" + ); const localVarPath = this.basePath + "/unclaimed_draft/edit_and_resend/{signature_request_id}".replace( "{signature_request_id}", encodeURIComponent(String(signatureRequestId)) @@ -30584,40 +32276,32 @@ var UnclaimedDraftApi = class { (resolve, reject) => { axios_default.request(localVarRequestOptions).then( (response) => { - let body = response.data; - if (response.status && response.status >= 200 && response.status <= 299) { - body = ObjectSerializer.deserialize( - body, - "UnclaimedDraftCreateResponse" - ); - resolve({ response, body }); - } else { - reject(new HttpError(response, body, response.status)); - } + handleSuccessfulResponse11( + resolve, + reject, + response, + "UnclaimedDraftCreateResponse" + ); }, (error) => { if (error.response == null) { reject(error); return; } - const response = error.response; - let body; - if (response.status === 200) { - body = ObjectSerializer.deserialize( - response.data, - "UnclaimedDraftCreateResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorCodeResponse11( + reject, + error.response, + 200, + "UnclaimedDraftCreateResponse" + )) { return; } - let rangeCodeLeft = Number("4XX"[0] + "00"); - let rangeCodeRight = Number("4XX"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "ErrorResponse" - ); - reject(new HttpError(response, body, response.status)); + if (handleErrorRangeResponse10( + reject, + error.response, + "4XX", + "ErrorResponse" + )) { return; } reject(error); @@ -30629,6 +32313,41 @@ var UnclaimedDraftApi = class { }); } }; +function deserializeIfNeeded10(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) { + 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 handleErrorCodeResponse11(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 handleErrorRangeResponse10(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/apis.ts var import_form_data2 = __toESM(require_form_data()); @@ -30645,7 +32364,7 @@ var HttpError = class extends Error { var queryParamsSerializer = (params) => { return import_qs.default.stringify(params, { arrayFormat: "brackets" }); }; -var USER_AGENT = "OpenAPI-Generator/1.5-dev/node"; +var USER_AGENT = "OpenAPI-Generator/1.6-dev/node"; var generateFormData = (obj, typemap) => { const data = {}; let localVarUseFormData = false; @@ -30709,6 +32428,7 @@ var APIS = [ ApiAppApi, BulkSendJobApi, EmbeddedApi, + FaxLineApi, OAuthApi, ReportApi, SignatureRequestApi, @@ -30759,6 +32479,18 @@ var APIS = [ EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, + FaxLineAddUserRequest, + FaxLineApi, + FaxLineAreaCodeGetCountryEnum, + FaxLineAreaCodeGetProvinceEnum, + FaxLineAreaCodeGetResponse, + FaxLineAreaCodeGetStateEnum, + FaxLineCreateRequest, + FaxLineDeleteRequest, + FaxLineListResponse, + FaxLineRemoveUserRequest, + FaxLineResponse, + FaxLineResponseFaxLine, FileResponse, FileResponseDataUri, HttpBasicAuth, @@ -30919,6 +32651,7 @@ var APIS = [ /*! * mime-db * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson * MIT Licensed */ /*! diff --git a/sdks/node/docs/api/FaxLineApi.md b/sdks/node/docs/api/FaxLineApi.md new file mode 100644 index 000000000..4d9f6208b --- /dev/null +++ b/sdks/node/docs/api/FaxLineApi.md @@ -0,0 +1,567 @@ +# FaxLineApi + +All URIs are relative to https://api.hellosign.com/v3. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**faxLineAddUser()**](FaxLineApi.md#faxLineAddUser) | **PUT** /fax_line/add_user | Add Fax Line User | +| [**faxLineAreaCodeGet()**](FaxLineApi.md#faxLineAreaCodeGet) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes | +| [**faxLineCreate()**](FaxLineApi.md#faxLineCreate) | **POST** /fax_line/create | Purchase Fax Line | +| [**faxLineDelete()**](FaxLineApi.md#faxLineDelete) | **DELETE** /fax_line | Delete Fax Line | +| [**faxLineGet()**](FaxLineApi.md#faxLineGet) | **GET** /fax_line | Get Fax Line | +| [**faxLineList()**](FaxLineApi.md#faxLineList) | **GET** /fax_line/list | List Fax Lines | +| [**faxLineRemoveUser()**](FaxLineApi.md#faxLineRemoveUser) | **PUT** /fax_line/remove_user | Remove Fax Line Access | + + +## `faxLineAddUser()` + +```typescript +faxLineAddUser(faxLineAddUserRequest: FaxLineAddUserRequest): FaxLineResponse +``` + +Add Fax Line User + +Grants a user access to the specified Fax Line. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data: DropboxSign.FaxLineAddUserRequest = { + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com", +}; + +const result = faxLineApi.faxLineAddUser(data); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data = { + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com", +}; + +const result = faxLineApi.faxLineAddUser(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 | +| ------------- | ------------- | ------------- | ------------- | +| **faxLineAddUserRequest** | [**FaxLineAddUserRequest**](../model/FaxLineAddUserRequest.md)| | | + +### Return type + +[**FaxLineResponse**](../model/FaxLineResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `faxLineAreaCodeGet()` + +```typescript +faxLineAreaCodeGet(country: 'CA' | 'US' | 'UK', 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', province: 'AB' | 'BC' | 'MB' | 'NB' | 'NL' | 'NT' | 'NS' | 'NU' | 'ON' | 'PE' | 'QC' | 'SK' | 'YT', city: string): FaxLineAreaCodeGetResponse +``` + +Get Available Fax Line Area Codes + +Returns a response with the area codes available for a given state/provice and city. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineAreaCodeGet("US", "CA"); +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 faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineAreaCodeGet("US", "CA"); +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 | +| ------------- | ------------- | ------------- | ------------- | +| **country** | **'CA' | 'US' | 'UK'**| Filter area codes by country. | | +| **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'**| Filter area codes by state. | [optional] | +| **province** | **'AB' | 'BC' | 'MB' | 'NB' | 'NL' | 'NT' | 'NS' | 'NU' | 'ON' | 'PE' | 'QC' | 'SK' | 'YT'**| Filter area codes by province. | [optional] | +| **city** | **string**| Filter area codes by city. | [optional] | + +### Return type + +[**FaxLineAreaCodeGetResponse**](../model/FaxLineAreaCodeGetResponse.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) + +## `faxLineCreate()` + +```typescript +faxLineCreate(faxLineCreateRequest: FaxLineCreateRequest): FaxLineResponse +``` + +Purchase Fax Line + +Purchases a new Fax Line. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data: DropboxSign.FaxLineCreateRequest = { + areaCode: 209, + country: "US", +}; + +const result = faxLineApi.faxLineCreate(data); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data = { + areaCode: 209, + country: "US", +}; + +const result = faxLineApi.faxLineCreate(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 | +| ------------- | ------------- | ------------- | ------------- | +| **faxLineCreateRequest** | [**FaxLineCreateRequest**](../model/FaxLineCreateRequest.md)| | | + +### Return type + +[**FaxLineResponse**](../model/FaxLineResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `faxLineDelete()` + +```typescript +faxLineDelete(faxLineDeleteRequest: FaxLineDeleteRequest) +``` + +Delete Fax Line + +Deletes the specified Fax Line from the subscription. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data: DropboxSign.FaxLineDeleteRequest = { + number: "[FAX_NUMBER]", +}; + +const result = faxLineApi.faxLineDelete(data); + +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 faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data = { + number: "[FAX_NUMBER]", +}; + +const result = faxLineApi.faxLineDelete(data); + +result.catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### Parameters + +|Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **faxLineDeleteRequest** | [**FaxLineDeleteRequest**](../model/FaxLineDeleteRequest.md)| | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `faxLineGet()` + +```typescript +faxLineGet(number: string): FaxLineResponse +``` + +Get Fax Line + +Returns the properties and settings of a Fax Line. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineGet("[FAX_NUMBER]"); +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 faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineGet("[FAX_NUMBER]"); +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 | +| ------------- | ------------- | ------------- | ------------- | +| **number** | **string**| The Fax Line number. | | + +### Return type + +[**FaxLineResponse**](../model/FaxLineResponse.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) + +## `faxLineList()` + +```typescript +faxLineList(accountId: string, page: number, pageSize: number, showTeamLines: boolean): FaxLineListResponse +``` + +List Fax Lines + +Returns the properties and settings of multiple Fax Lines. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineList(); +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 faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const result = faxLineApi.faxLineList(); +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 | +| ------------- | ------------- | ------------- | ------------- | +| **accountId** | **string**| Account ID | [optional] | +| **page** | **number**| Page | [optional] [default to 1] | +| **pageSize** | **number**| Page size | [optional] [default to 20] | +| **showTeamLines** | **boolean**| Show team lines | [optional] | + +### Return type + +[**FaxLineListResponse**](../model/FaxLineListResponse.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) + +## `faxLineRemoveUser()` + +```typescript +faxLineRemoveUser(faxLineRemoveUserRequest: FaxLineRemoveUserRequest): FaxLineResponse +``` + +Remove Fax Line Access + +Removes a user\'s access to the specified Fax Line. + +### TypeScript Example + +```typescript +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data: DropboxSign.FaxLineRemoveUserRequest = { + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com", +}; + +const result = faxLineApi.faxLineRemoveUser(data); +result.then(response => { + console.log(response.body); +}).catch(error => { + console.log("Exception when calling Dropbox Sign API:"); + console.log(error.body); +}); + +``` + +### JavaScript Example + +```javascript +import * as DropboxSign from "@dropbox/sign"; + +const faxLineApi = new DropboxSign.FaxLineApi(); + +// Configure HTTP basic authorization: api_key +faxLineApi.username = "YOUR_API_KEY"; + +const data = { + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com", +}; + +const result = faxLineApi.faxLineRemoveUser(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 | +| ------------- | ------------- | ------------- | ------------- | +| **faxLineRemoveUserRequest** | [**FaxLineRemoveUserRequest**](../model/FaxLineRemoveUserRequest.md)| | | + +### Return type + +[**FaxLineResponse**](../model/FaxLineResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/AccountCreateResponse.md b/sdks/node/docs/model/AccountCreateResponse.md index 87147eb64..203a7e73d 100644 --- a/sdks/node/docs/model/AccountCreateResponse.md +++ b/sdks/node/docs/model/AccountCreateResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `account` | [```AccountResponse```](AccountResponse.md) | | | +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `oauthData` | [```OAuthTokenResponse```](OAuthTokenResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/node/docs/model/AccountGetResponse.md b/sdks/node/docs/model/AccountGetResponse.md index ae90fa359..38a4eeefe 100644 --- a/sdks/node/docs/model/AccountGetResponse.md +++ b/sdks/node/docs/model/AccountGetResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `account` | [```AccountResponse```](AccountResponse.md) | | | +| `account`*_required_ | [```AccountResponse```](AccountResponse.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/ApiAppGetResponse.md b/sdks/node/docs/model/ApiAppGetResponse.md index fe5b2c7b6..a3f95b71c 100644 --- a/sdks/node/docs/model/ApiAppGetResponse.md +++ b/sdks/node/docs/model/ApiAppGetResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `apiApp` | [```ApiAppResponse```](ApiAppResponse.md) | | | +| `apiApp`*_required_ | [```ApiAppResponse```](ApiAppResponse.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/ApiAppListResponse.md b/sdks/node/docs/model/ApiAppListResponse.md index 4deeadfba..24dd3d3d2 100644 --- a/sdks/node/docs/model/ApiAppListResponse.md +++ b/sdks/node/docs/model/ApiAppListResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `apiApps` | [```Array```](ApiAppResponse.md) | Contains information about API Apps. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `apiApps`*_required_ | [```Array```](ApiAppResponse.md) | Contains information about API Apps. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.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/BulkSendJobGetResponse.md b/sdks/node/docs/model/BulkSendJobGetResponse.md index 2a3194f21..b0c299fce 100644 --- a/sdks/node/docs/model/BulkSendJobGetResponse.md +++ b/sdks/node/docs/model/BulkSendJobGetResponse.md @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `bulkSendJob` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `signatureRequests` | [```Array```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | +| `bulkSendJob`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `signatureRequests`*_required_ | [```Array```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | | `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/BulkSendJobListResponse.md b/sdks/node/docs/model/BulkSendJobListResponse.md index 9a7d572de..e9be32a88 100644 --- a/sdks/node/docs/model/BulkSendJobListResponse.md +++ b/sdks/node/docs/model/BulkSendJobListResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `bulkSendJobs` | [```Array```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `bulkSendJobs`*_required_ | [```Array```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.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/BulkSendJobSendResponse.md b/sdks/node/docs/model/BulkSendJobSendResponse.md index 4193f0944..3619bdf29 100644 --- a/sdks/node/docs/model/BulkSendJobSendResponse.md +++ b/sdks/node/docs/model/BulkSendJobSendResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `bulkSendJob` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `bulkSendJob`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.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/EmbeddedEditUrlResponse.md b/sdks/node/docs/model/EmbeddedEditUrlResponse.md index 6f19a0f84..ed7cccca8 100644 --- a/sdks/node/docs/model/EmbeddedEditUrlResponse.md +++ b/sdks/node/docs/model/EmbeddedEditUrlResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `embedded` | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | +| `embedded`*_required_ | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.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/EmbeddedSignUrlResponse.md b/sdks/node/docs/model/EmbeddedSignUrlResponse.md index 646fb4824..fdcb5e5d8 100644 --- a/sdks/node/docs/model/EmbeddedSignUrlResponse.md +++ b/sdks/node/docs/model/EmbeddedSignUrlResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `embedded` | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | +| `embedded`*_required_ | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.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/FaxLineAddUserRequest.md b/sdks/node/docs/model/FaxLineAddUserRequest.md new file mode 100644 index 000000000..df23c2cdb --- /dev/null +++ b/sdks/node/docs/model/FaxLineAddUserRequest.md @@ -0,0 +1,13 @@ +# # FaxLineAddUserRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```string``` | The Fax Line number. | | +| `accountId` | ```string``` | Account ID | | +| `emailAddress` | ```string``` | Email address | | + +[[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/FaxLineAreaCodeGetCountryEnum.md b/sdks/node/docs/model/FaxLineAreaCodeGetCountryEnum.md new file mode 100644 index 000000000..91b758d8f --- /dev/null +++ b/sdks/node/docs/model/FaxLineAreaCodeGetCountryEnum.md @@ -0,0 +1,10 @@ +# # FaxLineAreaCodeGetCountryEnum + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/FaxLineAreaCodeGetProvinceEnum.md b/sdks/node/docs/model/FaxLineAreaCodeGetProvinceEnum.md new file mode 100644 index 000000000..369a34359 --- /dev/null +++ b/sdks/node/docs/model/FaxLineAreaCodeGetProvinceEnum.md @@ -0,0 +1,10 @@ +# # FaxLineAreaCodeGetProvinceEnum + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/FaxLineAreaCodeGetResponse.md b/sdks/node/docs/model/FaxLineAreaCodeGetResponse.md new file mode 100644 index 000000000..dabe3d811 --- /dev/null +++ b/sdks/node/docs/model/FaxLineAreaCodeGetResponse.md @@ -0,0 +1,11 @@ +# # FaxLineAreaCodeGetResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `areaCodes`*_required_ | ```Array``` | | | + +[[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/FaxLineAreaCodeGetStateEnum.md b/sdks/node/docs/model/FaxLineAreaCodeGetStateEnum.md new file mode 100644 index 000000000..f978b75a2 --- /dev/null +++ b/sdks/node/docs/model/FaxLineAreaCodeGetStateEnum.md @@ -0,0 +1,10 @@ +# # FaxLineAreaCodeGetStateEnum + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/FaxLineCreateRequest.md b/sdks/node/docs/model/FaxLineCreateRequest.md new file mode 100644 index 000000000..ae70b5cb9 --- /dev/null +++ b/sdks/node/docs/model/FaxLineCreateRequest.md @@ -0,0 +1,14 @@ +# # FaxLineCreateRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `areaCode`*_required_ | ```number``` | Area code | | +| `country`*_required_ | ```string``` | Country | | +| `city` | ```string``` | City | | +| `accountId` | ```string``` | Account ID | | + +[[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/FaxLineDeleteRequest.md b/sdks/node/docs/model/FaxLineDeleteRequest.md new file mode 100644 index 000000000..a2112ed33 --- /dev/null +++ b/sdks/node/docs/model/FaxLineDeleteRequest.md @@ -0,0 +1,11 @@ +# # FaxLineDeleteRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```string``` | The Fax Line number. | | + +[[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/FaxLineListResponse.md b/sdks/node/docs/model/FaxLineListResponse.md new file mode 100644 index 000000000..cb5723c8f --- /dev/null +++ b/sdks/node/docs/model/FaxLineListResponse.md @@ -0,0 +1,13 @@ +# # FaxLineListResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `faxLines`*_required_ | [```Array```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/FaxLineRemoveUserRequest.md b/sdks/node/docs/model/FaxLineRemoveUserRequest.md new file mode 100644 index 000000000..e161ecf38 --- /dev/null +++ b/sdks/node/docs/model/FaxLineRemoveUserRequest.md @@ -0,0 +1,13 @@ +# # FaxLineRemoveUserRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```string``` | The Fax Line number. | | +| `accountId` | ```string``` | Account ID | | +| `emailAddress` | ```string``` | Email address | | + +[[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/FaxLineResponse.md b/sdks/node/docs/model/FaxLineResponse.md new file mode 100644 index 000000000..9982027a5 --- /dev/null +++ b/sdks/node/docs/model/FaxLineResponse.md @@ -0,0 +1,12 @@ +# # FaxLineResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `faxLine`*_required_ | [```FaxLineResponseFaxLine```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/FaxLineResponseFaxLine.md b/sdks/node/docs/model/FaxLineResponseFaxLine.md new file mode 100644 index 000000000..aaf5b0f21 --- /dev/null +++ b/sdks/node/docs/model/FaxLineResponseFaxLine.md @@ -0,0 +1,14 @@ +# # FaxLineResponseFaxLine + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number` | ```string``` | Number | | +| `createdAt` | ```number``` | Created at | | +| `updatedAt` | ```number``` | Updated at | | +| `accounts` | [```Array```](AccountResponse.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/FileResponse.md b/sdks/node/docs/model/FileResponse.md index f3c87df69..0a81629ed 100644 --- a/sdks/node/docs/model/FileResponse.md +++ b/sdks/node/docs/model/FileResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `fileUrl` | ```string``` | URL to the file. | | -| `expiresAt` | ```number``` | When the link expires. | | +| `fileUrl`*_required_ | ```string``` | URL to the file. | | +| `expiresAt`*_required_ | ```number``` | When the link expires. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/FileResponseDataUri.md b/sdks/node/docs/model/FileResponseDataUri.md index ebc241421..c9742c251 100644 --- a/sdks/node/docs/model/FileResponseDataUri.md +++ b/sdks/node/docs/model/FileResponseDataUri.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `dataUri` | ```string``` | File as base64 encoded string. | | +| `dataUri`*_required_ | ```string``` | File as base64 encoded string. | | [[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/ReportCreateResponse.md b/sdks/node/docs/model/ReportCreateResponse.md index 6d85982b3..81c15fe1e 100644 --- a/sdks/node/docs/model/ReportCreateResponse.md +++ b/sdks/node/docs/model/ReportCreateResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `report` | [```ReportResponse```](ReportResponse.md) | | | +| `report`*_required_ | [```ReportResponse```](ReportResponse.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/SignatureRequestGetResponse.md b/sdks/node/docs/model/SignatureRequestGetResponse.md index 03d08211e..ccddbf51d 100644 --- a/sdks/node/docs/model/SignatureRequestGetResponse.md +++ b/sdks/node/docs/model/SignatureRequestGetResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `signatureRequest` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | +| `signatureRequest`*_required_ | [```SignatureRequestResponse```](SignatureRequestResponse.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/SignatureRequestListResponse.md b/sdks/node/docs/model/SignatureRequestListResponse.md index 2cc7765ba..aebe68507 100644 --- a/sdks/node/docs/model/SignatureRequestListResponse.md +++ b/sdks/node/docs/model/SignatureRequestListResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `signatureRequests` | [```Array```](SignatureRequestResponse.md) | Contains information about signature requests. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `signatureRequests`*_required_ | [```Array```](SignatureRequestResponse.md) | Contains information about signature requests. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.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/SubWhiteLabelingOptions.md b/sdks/node/docs/model/SubWhiteLabelingOptions.md index 413d28d2d..6306db07d 100644 --- a/sdks/node/docs/model/SubWhiteLabelingOptions.md +++ b/sdks/node/docs/model/SubWhiteLabelingOptions.md @@ -9,7 +9,7 @@ Take a look at our [white labeling guide](https://developers.hellosign.com/api/r Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- | `headerBackgroundColor` | ```string``` | | [default to '#1A1A1A'] | -| `legalVersion` | ```string``` | | [default to LegalVersionEnum_Terms1] | +| `legalVersion` | ```string``` | | [default to LegalVersionEnum.Terms1] | | `linkColor` | ```string``` | | [default to '#00B3E6'] | | `pageBackgroundColor` | ```string``` | | [default to '#F7F8F9'] | | `primaryButtonColor` | ```string``` | | [default to '#00B3E6'] | diff --git a/sdks/node/docs/model/TeamGetInfoResponse.md b/sdks/node/docs/model/TeamGetInfoResponse.md index a5b04e4dd..1390eff5a 100644 --- a/sdks/node/docs/model/TeamGetInfoResponse.md +++ b/sdks/node/docs/model/TeamGetInfoResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `team` | [```TeamInfoResponse```](TeamInfoResponse.md) | | | +| `team`*_required_ | [```TeamInfoResponse```](TeamInfoResponse.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/TeamGetResponse.md b/sdks/node/docs/model/TeamGetResponse.md index fee970d3d..ffc3d96c0 100644 --- a/sdks/node/docs/model/TeamGetResponse.md +++ b/sdks/node/docs/model/TeamGetResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `team` | [```TeamResponse```](TeamResponse.md) | | | +| `team`*_required_ | [```TeamResponse```](TeamResponse.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/TeamInvitesResponse.md b/sdks/node/docs/model/TeamInvitesResponse.md index 3408f71e0..5638e756b 100644 --- a/sdks/node/docs/model/TeamInvitesResponse.md +++ b/sdks/node/docs/model/TeamInvitesResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `teamInvites` | [```Array```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | +| `teamInvites`*_required_ | [```Array```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | | `warnings` | [```Array```](WarningResponse.md) | | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/TeamMembersResponse.md b/sdks/node/docs/model/TeamMembersResponse.md index 8e5800aba..4a1e754cf 100644 --- a/sdks/node/docs/model/TeamMembersResponse.md +++ b/sdks/node/docs/model/TeamMembersResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `teamMembers` | [```Array```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `teamMembers`*_required_ | [```Array```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/TeamSubTeamsResponse.md b/sdks/node/docs/model/TeamSubTeamsResponse.md index cb61e32af..be29d5e39 100644 --- a/sdks/node/docs/model/TeamSubTeamsResponse.md +++ b/sdks/node/docs/model/TeamSubTeamsResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `subTeams` | [```Array```](SubTeamResponse.md) | Contains a list with sub teams. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `subTeams`*_required_ | [```Array```](SubTeamResponse.md) | Contains a list with sub teams. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/node/docs/model/TemplateCreateEmbeddedDraftResponse.md b/sdks/node/docs/model/TemplateCreateEmbeddedDraftResponse.md index b8a266ea8..cbe628ace 100644 --- a/sdks/node/docs/model/TemplateCreateEmbeddedDraftResponse.md +++ b/sdks/node/docs/model/TemplateCreateEmbeddedDraftResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template` | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | +| `template`*_required_ | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.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/TemplateCreateResponse.md b/sdks/node/docs/model/TemplateCreateResponse.md index 481d81852..f47cfb546 100644 --- a/sdks/node/docs/model/TemplateCreateResponse.md +++ b/sdks/node/docs/model/TemplateCreateResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template` | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | +| `template`*_required_ | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.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/TemplateEditResponse.md b/sdks/node/docs/model/TemplateEditResponse.md index e28421e8e..2f40ccbad 100644 --- a/sdks/node/docs/model/TemplateEditResponse.md +++ b/sdks/node/docs/model/TemplateEditResponse.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `templateId` | ```string``` | The id of the Template. | | +| `templateId`*_required_ | ```string``` | The id of the Template. | | [[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/TemplateGetResponse.md b/sdks/node/docs/model/TemplateGetResponse.md index c4f59d5b8..2724b34c0 100644 --- a/sdks/node/docs/model/TemplateGetResponse.md +++ b/sdks/node/docs/model/TemplateGetResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template` | [```TemplateResponse```](TemplateResponse.md) | | | +| `template`*_required_ | [```TemplateResponse```](TemplateResponse.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/TemplateListResponse.md b/sdks/node/docs/model/TemplateListResponse.md index e546b474a..4929e7844 100644 --- a/sdks/node/docs/model/TemplateListResponse.md +++ b/sdks/node/docs/model/TemplateListResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `templates` | [```Array```](TemplateResponse.md) | List of templates that the API caller has access to. | | -| `listInfo` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `templates`*_required_ | [```Array```](TemplateResponse.md) | List of templates that the API caller has access to. | | +| `listInfo`*_required_ | [```ListInfoResponse```](ListInfoResponse.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/TemplateUpdateFilesResponse.md b/sdks/node/docs/model/TemplateUpdateFilesResponse.md index f97e2ed5d..8dd0dedf6 100644 --- a/sdks/node/docs/model/TemplateUpdateFilesResponse.md +++ b/sdks/node/docs/model/TemplateUpdateFilesResponse.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template` | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | +| `template`*_required_ | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.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/UnclaimedDraftCreateEmbeddedRequest.md b/sdks/node/docs/model/UnclaimedDraftCreateEmbeddedRequest.md index 11526b5ce..444d8d77c 100644 --- a/sdks/node/docs/model/UnclaimedDraftCreateEmbeddedRequest.md +++ b/sdks/node/docs/model/UnclaimedDraftCreateEmbeddedRequest.md @@ -37,7 +37,7 @@ Name | Type | Description | Notes | `skipMeNow` | ```boolean``` | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [default to false] | | `subject` | ```string``` | The subject in the email that will be sent to the signers. | | | `testMode` | ```boolean``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to false] | -| `type` | ```string``` | The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. | [default to TypeEnum_RequestSignature] | +| `type` | ```string``` | The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. | [default to TypeEnum.RequestSignature] | | `usePreexistingFields` | ```boolean``` | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [default to false] | | `useTextTags` | ```boolean``` | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [default to false] | | `populateAutoFillFields` | ```boolean``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to false] | diff --git a/sdks/node/docs/model/UnclaimedDraftCreateResponse.md b/sdks/node/docs/model/UnclaimedDraftCreateResponse.md index 00e5a8215..439d6b272 100644 --- a/sdks/node/docs/model/UnclaimedDraftCreateResponse.md +++ b/sdks/node/docs/model/UnclaimedDraftCreateResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `unclaimedDraft` | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | +| `unclaimedDraft`*_required_ | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.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/model/accountCreateRequest.ts b/sdks/node/model/accountCreateRequest.ts index b43a81c39..08c7d1b99 100644 --- a/sdks/node/model/accountCreateRequest.ts +++ b/sdks/node/model/accountCreateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class AccountCreateRequest { /** diff --git a/sdks/node/model/accountCreateResponse.ts b/sdks/node/model/accountCreateResponse.ts index a572908c9..cdc2e0479 100644 --- a/sdks/node/model/accountCreateResponse.ts +++ b/sdks/node/model/accountCreateResponse.ts @@ -22,13 +22,13 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { AccountResponse } from "./accountResponse"; import { OAuthTokenResponse } from "./oAuthTokenResponse"; import { WarningResponse } from "./warningResponse"; export class AccountCreateResponse { - "account"?: AccountResponse; + "account": AccountResponse; "oauthData"?: OAuthTokenResponse; /** * A list of warnings. diff --git a/sdks/node/model/accountGetResponse.ts b/sdks/node/model/accountGetResponse.ts index bbf8f9215..1ce7e6d37 100644 --- a/sdks/node/model/accountGetResponse.ts +++ b/sdks/node/model/accountGetResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { AccountResponse } from "./accountResponse"; import { WarningResponse } from "./warningResponse"; export class AccountGetResponse { - "account"?: AccountResponse; + "account": AccountResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/accountResponse.ts b/sdks/node/model/accountResponse.ts index 5173bbcac..73394d615 100644 --- a/sdks/node/model/accountResponse.ts +++ b/sdks/node/model/accountResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { AccountResponseQuotas } from "./accountResponseQuotas"; import { AccountResponseUsage } from "./accountResponseUsage"; diff --git a/sdks/node/model/accountResponseQuotas.ts b/sdks/node/model/accountResponseQuotas.ts index d831c6101..3553070d7 100644 --- a/sdks/node/model/accountResponseQuotas.ts +++ b/sdks/node/model/accountResponseQuotas.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Details concerning remaining monthly quotas. diff --git a/sdks/node/model/accountResponseUsage.ts b/sdks/node/model/accountResponseUsage.ts index 8c19a17f5..95f6f9f88 100644 --- a/sdks/node/model/accountResponseUsage.ts +++ b/sdks/node/model/accountResponseUsage.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Details concerning monthly usage diff --git a/sdks/node/model/accountUpdateRequest.ts b/sdks/node/model/accountUpdateRequest.ts index a2cc5fc29..65aedf88a 100644 --- a/sdks/node/model/accountUpdateRequest.ts +++ b/sdks/node/model/accountUpdateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class AccountUpdateRequest { /** diff --git a/sdks/node/model/accountVerifyRequest.ts b/sdks/node/model/accountVerifyRequest.ts index 2f929417c..b1d05e997 100644 --- a/sdks/node/model/accountVerifyRequest.ts +++ b/sdks/node/model/accountVerifyRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class AccountVerifyRequest { /** diff --git a/sdks/node/model/accountVerifyResponse.ts b/sdks/node/model/accountVerifyResponse.ts index 2ee9b1335..ef067ad84 100644 --- a/sdks/node/model/accountVerifyResponse.ts +++ b/sdks/node/model/accountVerifyResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { AccountVerifyResponseAccount } from "./accountVerifyResponseAccount"; import { WarningResponse } from "./warningResponse"; diff --git a/sdks/node/model/accountVerifyResponseAccount.ts b/sdks/node/model/accountVerifyResponseAccount.ts index 788cb3841..0db1f1770 100644 --- a/sdks/node/model/accountVerifyResponseAccount.ts +++ b/sdks/node/model/accountVerifyResponseAccount.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class AccountVerifyResponseAccount { /** diff --git a/sdks/node/model/apiAppCreateRequest.ts b/sdks/node/model/apiAppCreateRequest.ts index a9cc3bd55..aed0d3d6c 100644 --- a/sdks/node/model/apiAppCreateRequest.ts +++ b/sdks/node/model/apiAppCreateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubOAuth } from "./subOAuth"; import { SubOptions } from "./subOptions"; import { SubWhiteLabelingOptions } from "./subWhiteLabelingOptions"; diff --git a/sdks/node/model/apiAppGetResponse.ts b/sdks/node/model/apiAppGetResponse.ts index 5be8ba812..de4f9211a 100644 --- a/sdks/node/model/apiAppGetResponse.ts +++ b/sdks/node/model/apiAppGetResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { ApiAppResponse } from "./apiAppResponse"; import { WarningResponse } from "./warningResponse"; export class ApiAppGetResponse { - "apiApp"?: ApiAppResponse; + "apiApp": ApiAppResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/apiAppListResponse.ts b/sdks/node/model/apiAppListResponse.ts index d1fe6efef..d5b3379a9 100644 --- a/sdks/node/model/apiAppListResponse.ts +++ b/sdks/node/model/apiAppListResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { ApiAppResponse } from "./apiAppResponse"; import { ListInfoResponse } from "./listInfoResponse"; import { WarningResponse } from "./warningResponse"; @@ -31,8 +31,8 @@ export class ApiAppListResponse { /** * Contains information about API Apps. */ - "apiApps"?: Array; - "listInfo"?: ListInfoResponse; + "apiApps": Array; + "listInfo": ListInfoResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/apiAppResponse.ts b/sdks/node/model/apiAppResponse.ts index dc5ac3c09..167b3eb15 100644 --- a/sdks/node/model/apiAppResponse.ts +++ b/sdks/node/model/apiAppResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { ApiAppResponseOAuth } from "./apiAppResponseOAuth"; import { ApiAppResponseOptions } from "./apiAppResponseOptions"; import { ApiAppResponseOwnerAccount } from "./apiAppResponseOwnerAccount"; diff --git a/sdks/node/model/apiAppResponseOAuth.ts b/sdks/node/model/apiAppResponseOAuth.ts index 23629f7d4..bd8d8fd29 100644 --- a/sdks/node/model/apiAppResponseOAuth.ts +++ b/sdks/node/model/apiAppResponseOAuth.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * An object describing the app\'s OAuth properties, or null if OAuth is not configured for the app. diff --git a/sdks/node/model/apiAppResponseOptions.ts b/sdks/node/model/apiAppResponseOptions.ts index 851a8a1c4..3d36cd672 100644 --- a/sdks/node/model/apiAppResponseOptions.ts +++ b/sdks/node/model/apiAppResponseOptions.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * An object with options that override account settings. diff --git a/sdks/node/model/apiAppResponseOwnerAccount.ts b/sdks/node/model/apiAppResponseOwnerAccount.ts index a7f69795c..8abfae818 100644 --- a/sdks/node/model/apiAppResponseOwnerAccount.ts +++ b/sdks/node/model/apiAppResponseOwnerAccount.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * An object describing the app\'s owner diff --git a/sdks/node/model/apiAppResponseWhiteLabelingOptions.ts b/sdks/node/model/apiAppResponseWhiteLabelingOptions.ts index 150aafcc4..6c4beeebe 100644 --- a/sdks/node/model/apiAppResponseWhiteLabelingOptions.ts +++ b/sdks/node/model/apiAppResponseWhiteLabelingOptions.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * An object with options to customize the app\'s signer page diff --git a/sdks/node/model/apiAppUpdateRequest.ts b/sdks/node/model/apiAppUpdateRequest.ts index a3ce93427..5097625fd 100644 --- a/sdks/node/model/apiAppUpdateRequest.ts +++ b/sdks/node/model/apiAppUpdateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubOAuth } from "./subOAuth"; import { SubOptions } from "./subOptions"; import { SubWhiteLabelingOptions } from "./subWhiteLabelingOptions"; diff --git a/sdks/node/model/bulkSendJobGetResponse.ts b/sdks/node/model/bulkSendJobGetResponse.ts index 851a0e862..ed3ed1c3a 100644 --- a/sdks/node/model/bulkSendJobGetResponse.ts +++ b/sdks/node/model/bulkSendJobGetResponse.ts @@ -22,19 +22,19 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { BulkSendJobGetResponseSignatureRequests } from "./bulkSendJobGetResponseSignatureRequests"; import { BulkSendJobResponse } from "./bulkSendJobResponse"; import { ListInfoResponse } from "./listInfoResponse"; import { WarningResponse } from "./warningResponse"; export class BulkSendJobGetResponse { - "bulkSendJob"?: BulkSendJobResponse; - "listInfo"?: ListInfoResponse; + "bulkSendJob": BulkSendJobResponse; + "listInfo": ListInfoResponse; /** * Contains information about the Signature Requests sent in bulk. */ - "signatureRequests"?: Array; + "signatureRequests": Array; /** * A list of warnings. */ diff --git a/sdks/node/model/bulkSendJobGetResponseSignatureRequests.ts b/sdks/node/model/bulkSendJobGetResponseSignatureRequests.ts index 7bd1b1cf4..e271790d1 100644 --- a/sdks/node/model/bulkSendJobGetResponseSignatureRequests.ts +++ b/sdks/node/model/bulkSendJobGetResponseSignatureRequests.ts @@ -22,8 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; -import { SignatureRequestResponse } from "./signatureRequestResponse"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseAttachment } from "./signatureRequestResponseAttachment"; import { SignatureRequestResponseCustomFieldBase } from "./signatureRequestResponseCustomFieldBase"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; diff --git a/sdks/node/model/bulkSendJobListResponse.ts b/sdks/node/model/bulkSendJobListResponse.ts index a2ea9aea9..142a37d20 100644 --- a/sdks/node/model/bulkSendJobListResponse.ts +++ b/sdks/node/model/bulkSendJobListResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { BulkSendJobResponse } from "./bulkSendJobResponse"; import { ListInfoResponse } from "./listInfoResponse"; import { WarningResponse } from "./warningResponse"; @@ -31,8 +31,8 @@ export class BulkSendJobListResponse { /** * Contains a list of BulkSendJobs that the API caller has access to. */ - "bulkSendJobs"?: Array; - "listInfo"?: ListInfoResponse; + "bulkSendJobs": Array; + "listInfo": ListInfoResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/bulkSendJobResponse.ts b/sdks/node/model/bulkSendJobResponse.ts index 699126685..115d7fb01 100644 --- a/sdks/node/model/bulkSendJobResponse.ts +++ b/sdks/node/model/bulkSendJobResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. diff --git a/sdks/node/model/bulkSendJobSendResponse.ts b/sdks/node/model/bulkSendJobSendResponse.ts index bcd4c45d8..0d9efa12d 100644 --- a/sdks/node/model/bulkSendJobSendResponse.ts +++ b/sdks/node/model/bulkSendJobSendResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { BulkSendJobResponse } from "./bulkSendJobResponse"; import { WarningResponse } from "./warningResponse"; export class BulkSendJobSendResponse { - "bulkSendJob"?: BulkSendJobResponse; + "bulkSendJob": BulkSendJobResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/embeddedEditUrlRequest.ts b/sdks/node/model/embeddedEditUrlRequest.ts index b5627d806..865da4415 100644 --- a/sdks/node/model/embeddedEditUrlRequest.ts +++ b/sdks/node/model/embeddedEditUrlRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubEditorOptions } from "./subEditorOptions"; import { SubMergeField } from "./subMergeField"; diff --git a/sdks/node/model/embeddedEditUrlResponse.ts b/sdks/node/model/embeddedEditUrlResponse.ts index 0c5c668fc..d299e6a0a 100644 --- a/sdks/node/model/embeddedEditUrlResponse.ts +++ b/sdks/node/model/embeddedEditUrlResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { EmbeddedEditUrlResponseEmbedded } from "./embeddedEditUrlResponseEmbedded"; import { WarningResponse } from "./warningResponse"; export class EmbeddedEditUrlResponse { - "embedded"?: EmbeddedEditUrlResponseEmbedded; + "embedded": EmbeddedEditUrlResponseEmbedded; /** * A list of warnings. */ diff --git a/sdks/node/model/embeddedEditUrlResponseEmbedded.ts b/sdks/node/model/embeddedEditUrlResponseEmbedded.ts index 1cd2f25e5..ad3a99e08 100644 --- a/sdks/node/model/embeddedEditUrlResponseEmbedded.ts +++ b/sdks/node/model/embeddedEditUrlResponseEmbedded.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * An embedded template object. diff --git a/sdks/node/model/embeddedSignUrlResponse.ts b/sdks/node/model/embeddedSignUrlResponse.ts index 8a348cb26..8e34234d0 100644 --- a/sdks/node/model/embeddedSignUrlResponse.ts +++ b/sdks/node/model/embeddedSignUrlResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { EmbeddedSignUrlResponseEmbedded } from "./embeddedSignUrlResponseEmbedded"; import { WarningResponse } from "./warningResponse"; export class EmbeddedSignUrlResponse { - "embedded"?: EmbeddedSignUrlResponseEmbedded; + "embedded": EmbeddedSignUrlResponseEmbedded; /** * A list of warnings. */ diff --git a/sdks/node/model/embeddedSignUrlResponseEmbedded.ts b/sdks/node/model/embeddedSignUrlResponseEmbedded.ts index 9903ee181..2cc11e748 100644 --- a/sdks/node/model/embeddedSignUrlResponseEmbedded.ts +++ b/sdks/node/model/embeddedSignUrlResponseEmbedded.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * An object that contains necessary information to set up embedded signing. diff --git a/sdks/node/model/errorResponse.ts b/sdks/node/model/errorResponse.ts index 8bbf7da22..ddcccd872 100644 --- a/sdks/node/model/errorResponse.ts +++ b/sdks/node/model/errorResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { ErrorResponseError } from "./errorResponseError"; export class ErrorResponse { diff --git a/sdks/node/model/errorResponseError.ts b/sdks/node/model/errorResponseError.ts index 41429b7ac..577bb5dd5 100644 --- a/sdks/node/model/errorResponseError.ts +++ b/sdks/node/model/errorResponseError.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Contains information about an error that occurred. diff --git a/sdks/node/model/eventCallbackHelper.ts b/sdks/node/model/eventCallbackHelper.ts index 451ca3ed7..36678c2e3 100644 --- a/sdks/node/model/eventCallbackHelper.ts +++ b/sdks/node/model/eventCallbackHelper.ts @@ -1,5 +1,5 @@ -import { EventCallbackRequest } from "./"; import * as crypto from "crypto"; +import { EventCallbackRequest } from "./"; export class EventCallbackHelper { static readonly EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback"; diff --git a/sdks/node/model/eventCallbackRequest.ts b/sdks/node/model/eventCallbackRequest.ts index 5f21476d3..a7e6485e6 100644 --- a/sdks/node/model/eventCallbackRequest.ts +++ b/sdks/node/model/eventCallbackRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { AccountResponse } from "./accountResponse"; import { EventCallbackRequestEvent } from "./eventCallbackRequestEvent"; import { SignatureRequestResponse } from "./signatureRequestResponse"; diff --git a/sdks/node/model/eventCallbackRequestEvent.ts b/sdks/node/model/eventCallbackRequestEvent.ts index 433724010..423380752 100644 --- a/sdks/node/model/eventCallbackRequestEvent.ts +++ b/sdks/node/model/eventCallbackRequestEvent.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { EventCallbackRequestEventMetadata } from "./eventCallbackRequestEventMetadata"; /** diff --git a/sdks/node/model/eventCallbackRequestEventMetadata.ts b/sdks/node/model/eventCallbackRequestEventMetadata.ts index e40a673a7..22894d2d8 100644 --- a/sdks/node/model/eventCallbackRequestEventMetadata.ts +++ b/sdks/node/model/eventCallbackRequestEventMetadata.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Specific metadata about the event. diff --git a/sdks/node/model/faxLineAddUserRequest.ts b/sdks/node/model/faxLineAddUserRequest.ts new file mode 100644 index 000000000..95b75de1b --- /dev/null +++ b/sdks/node/model/faxLineAddUserRequest.ts @@ -0,0 +1,69 @@ +/** + * 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 FaxLineAddUserRequest { + /** + * The Fax Line number. + */ + "number": string; + /** + * Account ID + */ + "accountId"?: string; + /** + * Email address + */ + "emailAddress"?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "number", + baseName: "number", + type: "string", + }, + { + name: "accountId", + baseName: "account_id", + type: "string", + }, + { + name: "emailAddress", + baseName: "email_address", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxLineAddUserRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxLineAddUserRequest { + return ObjectSerializer.deserialize(data, "FaxLineAddUserRequest"); + } +} diff --git a/sdks/node/model/faxLineAreaCodeGetCountryEnum.ts b/sdks/node/model/faxLineAreaCodeGetCountryEnum.ts new file mode 100644 index 000000000..bb10727c8 --- /dev/null +++ b/sdks/node/model/faxLineAreaCodeGetCountryEnum.ts @@ -0,0 +1,29 @@ +/** + * 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. + */ + +export enum FaxLineAreaCodeGetCountryEnum { + Ca = "CA", + Us = "US", + Uk = "UK", +} diff --git a/sdks/node/model/faxLineAreaCodeGetProvinceEnum.ts b/sdks/node/model/faxLineAreaCodeGetProvinceEnum.ts new file mode 100644 index 000000000..5b9c14988 --- /dev/null +++ b/sdks/node/model/faxLineAreaCodeGetProvinceEnum.ts @@ -0,0 +1,39 @@ +/** + * 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. + */ + +export enum FaxLineAreaCodeGetProvinceEnum { + Ab = "AB", + Bc = "BC", + Mb = "MB", + Nb = "NB", + Nl = "NL", + Nt = "NT", + Ns = "NS", + Nu = "NU", + On = "ON", + Pe = "PE", + Qc = "QC", + Sk = "SK", + Yt = "YT", +} diff --git a/sdks/node/model/faxLineAreaCodeGetResponse.ts b/sdks/node/model/faxLineAreaCodeGetResponse.ts new file mode 100644 index 000000000..b3c9a110f --- /dev/null +++ b/sdks/node/model/faxLineAreaCodeGetResponse.ts @@ -0,0 +1,48 @@ +/** + * 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 FaxLineAreaCodeGetResponse { + "areaCodes": Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "areaCodes", + baseName: "area_codes", + type: "Array", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxLineAreaCodeGetResponse.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxLineAreaCodeGetResponse { + return ObjectSerializer.deserialize(data, "FaxLineAreaCodeGetResponse"); + } +} diff --git a/sdks/node/model/faxLineAreaCodeGetStateEnum.ts b/sdks/node/model/faxLineAreaCodeGetStateEnum.ts new file mode 100644 index 000000000..810b46b2e --- /dev/null +++ b/sdks/node/model/faxLineAreaCodeGetStateEnum.ts @@ -0,0 +1,77 @@ +/** + * 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. + */ + +export enum FaxLineAreaCodeGetStateEnum { + Ak = "AK", + Al = "AL", + Ar = "AR", + Az = "AZ", + Ca = "CA", + Co = "CO", + Ct = "CT", + Dc = "DC", + De = "DE", + Fl = "FL", + Ga = "GA", + Hi = "HI", + Ia = "IA", + Id = "ID", + Il = "IL", + In = "IN", + Ks = "KS", + Ky = "KY", + La = "LA", + Ma = "MA", + Md = "MD", + Me = "ME", + Mi = "MI", + Mn = "MN", + Mo = "MO", + Ms = "MS", + Mt = "MT", + Nc = "NC", + Nd = "ND", + Ne = "NE", + Nh = "NH", + Nj = "NJ", + Nm = "NM", + Nv = "NV", + Ny = "NY", + Oh = "OH", + Ok = "OK", + Or = "OR", + Pa = "PA", + Ri = "RI", + Sc = "SC", + Sd = "SD", + Tn = "TN", + Tx = "TX", + Ut = "UT", + Va = "VA", + Vt = "VT", + Wa = "WA", + Wi = "WI", + Wv = "WV", + Wy = "WY", +} diff --git a/sdks/node/model/faxLineCreateRequest.ts b/sdks/node/model/faxLineCreateRequest.ts new file mode 100644 index 000000000..3a67d60e4 --- /dev/null +++ b/sdks/node/model/faxLineCreateRequest.ts @@ -0,0 +1,86 @@ +/** + * 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 FaxLineCreateRequest { + /** + * Area code + */ + "areaCode": number; + /** + * Country + */ + "country": FaxLineCreateRequest.CountryEnum; + /** + * City + */ + "city"?: string; + /** + * Account ID + */ + "accountId"?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "areaCode", + baseName: "area_code", + type: "number", + }, + { + name: "country", + baseName: "country", + type: "FaxLineCreateRequest.CountryEnum", + }, + { + name: "city", + baseName: "city", + type: "string", + }, + { + name: "accountId", + baseName: "account_id", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxLineCreateRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxLineCreateRequest { + return ObjectSerializer.deserialize(data, "FaxLineCreateRequest"); + } +} + +export namespace FaxLineCreateRequest { + export enum CountryEnum { + Ca = "CA", + Us = "US", + Uk = "UK", + } +} diff --git a/sdks/node/model/faxLineDeleteRequest.ts b/sdks/node/model/faxLineDeleteRequest.ts new file mode 100644 index 000000000..26d8798c4 --- /dev/null +++ b/sdks/node/model/faxLineDeleteRequest.ts @@ -0,0 +1,51 @@ +/** + * 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 FaxLineDeleteRequest { + /** + * The Fax Line number. + */ + "number": string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "number", + baseName: "number", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxLineDeleteRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxLineDeleteRequest { + return ObjectSerializer.deserialize(data, "FaxLineDeleteRequest"); + } +} diff --git a/sdks/node/model/faxLineListResponse.ts b/sdks/node/model/faxLineListResponse.ts new file mode 100644 index 000000000..8a5aa67d0 --- /dev/null +++ b/sdks/node/model/faxLineListResponse.ts @@ -0,0 +1,63 @@ +/** + * 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 { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; +import { ListInfoResponse } from "./listInfoResponse"; +import { WarningResponse } from "./warningResponse"; + +export class FaxLineListResponse { + "listInfo": ListInfoResponse; + "faxLines": Array; + "warnings"?: WarningResponse; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "listInfo", + baseName: "list_info", + type: "ListInfoResponse", + }, + { + name: "faxLines", + baseName: "fax_lines", + type: "Array", + }, + { + name: "warnings", + baseName: "warnings", + type: "WarningResponse", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxLineListResponse.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxLineListResponse { + return ObjectSerializer.deserialize(data, "FaxLineListResponse"); + } +} diff --git a/sdks/node/model/faxLineRemoveUserRequest.ts b/sdks/node/model/faxLineRemoveUserRequest.ts new file mode 100644 index 000000000..02f921c6a --- /dev/null +++ b/sdks/node/model/faxLineRemoveUserRequest.ts @@ -0,0 +1,69 @@ +/** + * 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 FaxLineRemoveUserRequest { + /** + * The Fax Line number. + */ + "number": string; + /** + * Account ID + */ + "accountId"?: string; + /** + * Email address + */ + "emailAddress"?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "number", + baseName: "number", + type: "string", + }, + { + name: "accountId", + baseName: "account_id", + type: "string", + }, + { + name: "emailAddress", + baseName: "email_address", + type: "string", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxLineRemoveUserRequest.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxLineRemoveUserRequest { + return ObjectSerializer.deserialize(data, "FaxLineRemoveUserRequest"); + } +} diff --git a/sdks/node/model/faxLineResponse.ts b/sdks/node/model/faxLineResponse.ts new file mode 100644 index 000000000..e9aa66010 --- /dev/null +++ b/sdks/node/model/faxLineResponse.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 { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; +import { WarningResponse } from "./warningResponse"; + +export class FaxLineResponse { + "faxLine": FaxLineResponseFaxLine; + "warnings"?: WarningResponse; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "faxLine", + baseName: "fax_line", + type: "FaxLineResponseFaxLine", + }, + { + name: "warnings", + baseName: "warnings", + type: "WarningResponse", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxLineResponse.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxLineResponse { + return ObjectSerializer.deserialize(data, "FaxLineResponse"); + } +} diff --git a/sdks/node/model/faxLineResponseFaxLine.ts b/sdks/node/model/faxLineResponseFaxLine.ts new file mode 100644 index 000000000..aeefe37e2 --- /dev/null +++ b/sdks/node/model/faxLineResponseFaxLine.ts @@ -0,0 +1,76 @@ +/** + * 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 { AccountResponse } from "./accountResponse"; + +export class FaxLineResponseFaxLine { + /** + * Number + */ + "number"?: string; + /** + * Created at + */ + "createdAt"?: number; + /** + * Updated at + */ + "updatedAt"?: number; + "accounts"?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: AttributeTypeMap = [ + { + name: "number", + baseName: "number", + type: "string", + }, + { + name: "createdAt", + baseName: "created_at", + type: "number", + }, + { + name: "updatedAt", + baseName: "updated_at", + type: "number", + }, + { + name: "accounts", + baseName: "accounts", + type: "Array", + }, + ]; + + static getAttributeTypeMap(): AttributeTypeMap { + return FaxLineResponseFaxLine.attributeTypeMap; + } + + /** Attempt to instantiate and hydrate a new instance of this class */ + static init(data: any): FaxLineResponseFaxLine { + return ObjectSerializer.deserialize(data, "FaxLineResponseFaxLine"); + } +} diff --git a/sdks/node/model/fileResponse.ts b/sdks/node/model/fileResponse.ts index 23804e51f..068b9e7a5 100644 --- a/sdks/node/model/fileResponse.ts +++ b/sdks/node/model/fileResponse.ts @@ -22,17 +22,17 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class FileResponse { /** * URL to the file. */ - "fileUrl"?: string; + "fileUrl": string; /** * When the link expires. */ - "expiresAt"?: number; + "expiresAt": number; static discriminator: string | undefined = undefined; diff --git a/sdks/node/model/fileResponseDataUri.ts b/sdks/node/model/fileResponseDataUri.ts index 5fa922ea4..44ec2dbab 100644 --- a/sdks/node/model/fileResponseDataUri.ts +++ b/sdks/node/model/fileResponseDataUri.ts @@ -22,13 +22,13 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class FileResponseDataUri { /** * File as base64 encoded string. */ - "dataUri"?: string; + "dataUri": string; static discriminator: string | undefined = undefined; diff --git a/sdks/node/model/index.ts b/sdks/node/model/index.ts index 60062191f..c59b28024 100644 --- a/sdks/node/model/index.ts +++ b/sdks/node/model/index.ts @@ -29,12 +29,37 @@ import { EmbeddedSignUrlResponse } from "./embeddedSignUrlResponse"; import { EmbeddedSignUrlResponseEmbedded } from "./embeddedSignUrlResponseEmbedded"; import { ErrorResponse } from "./errorResponse"; import { ErrorResponseError } from "./errorResponseError"; +import { EventCallbackHelper } from "./eventCallbackHelper"; import { EventCallbackRequest } from "./eventCallbackRequest"; import { EventCallbackRequestEvent } from "./eventCallbackRequestEvent"; import { EventCallbackRequestEventMetadata } from "./eventCallbackRequestEventMetadata"; +import { FaxLineAddUserRequest } from "./faxLineAddUserRequest"; +import { FaxLineAreaCodeGetCountryEnum } from "./faxLineAreaCodeGetCountryEnum"; +import { FaxLineAreaCodeGetProvinceEnum } from "./faxLineAreaCodeGetProvinceEnum"; +import { FaxLineAreaCodeGetResponse } from "./faxLineAreaCodeGetResponse"; +import { FaxLineAreaCodeGetStateEnum } from "./faxLineAreaCodeGetStateEnum"; +import { FaxLineCreateRequest } from "./faxLineCreateRequest"; +import { FaxLineDeleteRequest } from "./faxLineDeleteRequest"; +import { FaxLineListResponse } from "./faxLineListResponse"; +import { FaxLineRemoveUserRequest } from "./faxLineRemoveUserRequest"; +import { FaxLineResponse } from "./faxLineResponse"; +import { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; import { FileResponse } from "./fileResponse"; import { FileResponseDataUri } from "./fileResponseDataUri"; import { ListInfoResponse } from "./listInfoResponse"; +import { + ApiKeyAuth, + AttributeTypeMap, + Authentication, + HttpBasicAuth, + HttpBearerAuth, + Interceptor, + OAuth, + ObjectSerializer, + RequestDetailedFile, + RequestFile, + VoidAuth, +} from "./models"; import { OAuthTokenGenerateRequest } from "./oAuthTokenGenerateRequest"; import { OAuthTokenRefreshRequest } from "./oAuthTokenRefreshRequest"; import { OAuthTokenResponse } from "./oAuthTokenResponse"; @@ -170,24 +195,14 @@ import { UnclaimedDraftCreateResponse } from "./unclaimedDraftCreateResponse"; import { UnclaimedDraftEditAndResendRequest } from "./unclaimedDraftEditAndResendRequest"; import { UnclaimedDraftResponse } from "./unclaimedDraftResponse"; import { WarningResponse } from "./warningResponse"; -import { EventCallbackHelper } from "./eventCallbackHelper"; -import { - RequestDetailedFile, - RequestFile, - AttributeTypeMap, - ObjectSerializer, - Authentication, - HttpBasicAuth, - HttpBearerAuth, - ApiKeyAuth, - OAuth, - VoidAuth, - Interceptor, -} from "./models"; export let enumsMap: { [index: string]: any } = { "EventCallbackRequestEvent.EventTypeEnum": EventCallbackRequestEvent.EventTypeEnum, + FaxLineAreaCodeGetCountryEnum: FaxLineAreaCodeGetCountryEnum, + FaxLineAreaCodeGetProvinceEnum: FaxLineAreaCodeGetProvinceEnum, + FaxLineAreaCodeGetStateEnum: FaxLineAreaCodeGetStateEnum, + "FaxLineCreateRequest.CountryEnum": FaxLineCreateRequest.CountryEnum, "ReportCreateRequest.ReportTypeEnum": ReportCreateRequest.ReportTypeEnum, "ReportResponse.ReportTypeEnum": ReportResponse.ReportTypeEnum, SignatureRequestResponseCustomFieldTypeEnum: @@ -264,6 +279,14 @@ export let typeMap: { [index: string]: any } = { EventCallbackRequest: EventCallbackRequest, EventCallbackRequestEvent: EventCallbackRequestEvent, EventCallbackRequestEventMetadata: EventCallbackRequestEventMetadata, + FaxLineAddUserRequest: FaxLineAddUserRequest, + FaxLineAreaCodeGetResponse: FaxLineAreaCodeGetResponse, + FaxLineCreateRequest: FaxLineCreateRequest, + FaxLineDeleteRequest: FaxLineDeleteRequest, + FaxLineListResponse: FaxLineListResponse, + FaxLineRemoveUserRequest: FaxLineRemoveUserRequest, + FaxLineResponse: FaxLineResponse, + FaxLineResponseFaxLine: FaxLineResponseFaxLine, FileResponse: FileResponse, FileResponseDataUri: FileResponseDataUri, ListInfoResponse: ListInfoResponse, @@ -457,6 +480,9 @@ export { ApiAppResponseOwnerAccount, ApiAppResponseWhiteLabelingOptions, ApiAppUpdateRequest, + ApiKeyAuth, + AttributeTypeMap, + Authentication, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, @@ -469,18 +495,37 @@ export { 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, @@ -609,17 +654,6 @@ export { UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest, UnclaimedDraftResponse, - WarningResponse, - EventCallbackHelper, - RequestDetailedFile, - RequestFile, - AttributeTypeMap, - ObjectSerializer, - Authentication, - HttpBasicAuth, - HttpBearerAuth, - ApiKeyAuth, - OAuth, VoidAuth, - Interceptor, + WarningResponse, }; diff --git a/sdks/node/model/listInfoResponse.ts b/sdks/node/model/listInfoResponse.ts index 1834e09d6..b689f42e7 100644 --- a/sdks/node/model/listInfoResponse.ts +++ b/sdks/node/model/listInfoResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Contains pagination information about the data returned. diff --git a/sdks/node/model/models.ts b/sdks/node/model/models.ts index 6fc948f33..3f6c346c4 100644 --- a/sdks/node/model/models.ts +++ b/sdks/node/model/models.ts @@ -1,8 +1,7 @@ import { AxiosRequestConfig } from "axios"; +import { Headers } from "form-data"; import * as fs from "fs"; - import { enumsMap, typeMap } from "./"; -import { Headers } from "form-data"; export interface RequestDetailedFile { value: Buffer; @@ -15,8 +14,6 @@ export interface RequestDetailedFile { }; } -export type RequestFile = fs.ReadStream | RequestDetailedFile; - interface AttributeType { name: string; baseName: string; @@ -25,6 +22,8 @@ interface AttributeType { export interface AttributeTypeMap extends Array {} +export type RequestFile = fs.ReadStream | RequestDetailedFile; + /* tslint:disable:no-unused-variable */ let primitives = [ "string", @@ -165,7 +164,6 @@ export class ObjectSerializer { let attributeTypes = typeMap[type].getAttributeTypeMap(); for (let index = 0; index < attributeTypes.length; index++) { let attributeType = attributeTypes[index]; - const propertyKey = data[attributeType.baseName] !== undefined ? attributeType.baseName diff --git a/sdks/node/model/oAuthTokenGenerateRequest.ts b/sdks/node/model/oAuthTokenGenerateRequest.ts index caa10846f..ef86cc664 100644 --- a/sdks/node/model/oAuthTokenGenerateRequest.ts +++ b/sdks/node/model/oAuthTokenGenerateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class OAuthTokenGenerateRequest { /** diff --git a/sdks/node/model/oAuthTokenRefreshRequest.ts b/sdks/node/model/oAuthTokenRefreshRequest.ts index 87c34b914..e6c6848b6 100644 --- a/sdks/node/model/oAuthTokenRefreshRequest.ts +++ b/sdks/node/model/oAuthTokenRefreshRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class OAuthTokenRefreshRequest { /** diff --git a/sdks/node/model/oAuthTokenResponse.ts b/sdks/node/model/oAuthTokenResponse.ts index 25b5d392a..e1c6d4c0c 100644 --- a/sdks/node/model/oAuthTokenResponse.ts +++ b/sdks/node/model/oAuthTokenResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class OAuthTokenResponse { "accessToken"?: string; diff --git a/sdks/node/model/reportCreateRequest.ts b/sdks/node/model/reportCreateRequest.ts index 96f9203fa..48960ccc4 100644 --- a/sdks/node/model/reportCreateRequest.ts +++ b/sdks/node/model/reportCreateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class ReportCreateRequest { /** diff --git a/sdks/node/model/reportCreateResponse.ts b/sdks/node/model/reportCreateResponse.ts index 37a29099f..1c651699f 100644 --- a/sdks/node/model/reportCreateResponse.ts +++ b/sdks/node/model/reportCreateResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { ReportResponse } from "./reportResponse"; import { WarningResponse } from "./warningResponse"; export class ReportCreateResponse { - "report"?: ReportResponse; + "report": ReportResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/reportResponse.ts b/sdks/node/model/reportResponse.ts index 6a0028fa9..589ded1ce 100644 --- a/sdks/node/model/reportResponse.ts +++ b/sdks/node/model/reportResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Contains information about the report request. diff --git a/sdks/node/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts b/sdks/node/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts index 860f307ee..8901d5b16 100644 --- a/sdks/node/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts +++ b/sdks/node/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubBulkSignerList } from "./subBulkSignerList"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; diff --git a/sdks/node/model/signatureRequestBulkSendWithTemplateRequest.ts b/sdks/node/model/signatureRequestBulkSendWithTemplateRequest.ts index cd808eea5..c8c07dc36 100644 --- a/sdks/node/model/signatureRequestBulkSendWithTemplateRequest.ts +++ b/sdks/node/model/signatureRequestBulkSendWithTemplateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubBulkSignerList } from "./subBulkSignerList"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; diff --git a/sdks/node/model/signatureRequestCreateEmbeddedRequest.ts b/sdks/node/model/signatureRequestCreateEmbeddedRequest.ts index 8c9575c1f..774cbec6c 100644 --- a/sdks/node/model/signatureRequestCreateEmbeddedRequest.ts +++ b/sdks/node/model/signatureRequestCreateEmbeddedRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubCustomField } from "./subCustomField"; import { SubFieldOptions } from "./subFieldOptions"; diff --git a/sdks/node/model/signatureRequestCreateEmbeddedWithTemplateRequest.ts b/sdks/node/model/signatureRequestCreateEmbeddedWithTemplateRequest.ts index 840255db0..08b7b6e58 100644 --- a/sdks/node/model/signatureRequestCreateEmbeddedWithTemplateRequest.ts +++ b/sdks/node/model/signatureRequestCreateEmbeddedWithTemplateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; diff --git a/sdks/node/model/signatureRequestGetResponse.ts b/sdks/node/model/signatureRequestGetResponse.ts index 50cbb0c1a..31023c28f 100644 --- a/sdks/node/model/signatureRequestGetResponse.ts +++ b/sdks/node/model/signatureRequestGetResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponse } from "./signatureRequestResponse"; import { WarningResponse } from "./warningResponse"; export class SignatureRequestGetResponse { - "signatureRequest"?: SignatureRequestResponse; + "signatureRequest": SignatureRequestResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/signatureRequestListResponse.ts b/sdks/node/model/signatureRequestListResponse.ts index 7ae81fd03..acb50fe40 100644 --- a/sdks/node/model/signatureRequestListResponse.ts +++ b/sdks/node/model/signatureRequestListResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { ListInfoResponse } from "./listInfoResponse"; import { SignatureRequestResponse } from "./signatureRequestResponse"; import { WarningResponse } from "./warningResponse"; @@ -31,8 +31,8 @@ export class SignatureRequestListResponse { /** * Contains information about signature requests. */ - "signatureRequests"?: Array; - "listInfo"?: ListInfoResponse; + "signatureRequests": Array; + "listInfo": ListInfoResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/signatureRequestRemindRequest.ts b/sdks/node/model/signatureRequestRemindRequest.ts index 50d8c8bb1..b89334eb4 100644 --- a/sdks/node/model/signatureRequestRemindRequest.ts +++ b/sdks/node/model/signatureRequestRemindRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SignatureRequestRemindRequest { /** diff --git a/sdks/node/model/signatureRequestResponse.ts b/sdks/node/model/signatureRequestResponse.ts index 66adc3ab8..65ce7f128 100644 --- a/sdks/node/model/signatureRequestResponse.ts +++ b/sdks/node/model/signatureRequestResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseAttachment } from "./signatureRequestResponseAttachment"; import { SignatureRequestResponseCustomFieldBase } from "./signatureRequestResponseCustomFieldBase"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; diff --git a/sdks/node/model/signatureRequestResponseAttachment.ts b/sdks/node/model/signatureRequestResponseAttachment.ts index bf81dcb5d..8a59e65d2 100644 --- a/sdks/node/model/signatureRequestResponseAttachment.ts +++ b/sdks/node/model/signatureRequestResponseAttachment.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Signer attachments. @@ -35,7 +35,7 @@ export class SignatureRequestResponseAttachment { /** * The Signer this attachment is assigned to. */ - "signer": string; + "signer": number | string; /** * The name of this attachment. */ diff --git a/sdks/node/model/signatureRequestResponseCustomFieldBase.ts b/sdks/node/model/signatureRequestResponseCustomFieldBase.ts index d82edeb17..ffd75d1c4 100644 --- a/sdks/node/model/signatureRequestResponseCustomFieldBase.ts +++ b/sdks/node/model/signatureRequestResponseCustomFieldBase.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap } from "./"; /** * An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` diff --git a/sdks/node/model/signatureRequestResponseCustomFieldCheckbox.ts b/sdks/node/model/signatureRequestResponseCustomFieldCheckbox.ts index 31b10d2c6..02ab8dcfd 100644 --- a/sdks/node/model/signatureRequestResponseCustomFieldCheckbox.ts +++ b/sdks/node/model/signatureRequestResponseCustomFieldCheckbox.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseCustomFieldBase } from "./signatureRequestResponseCustomFieldBase"; /** diff --git a/sdks/node/model/signatureRequestResponseCustomFieldText.ts b/sdks/node/model/signatureRequestResponseCustomFieldText.ts index e43a85a5d..c6b1bc73a 100644 --- a/sdks/node/model/signatureRequestResponseCustomFieldText.ts +++ b/sdks/node/model/signatureRequestResponseCustomFieldText.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseCustomFieldBase } from "./signatureRequestResponseCustomFieldBase"; /** diff --git a/sdks/node/model/signatureRequestResponseCustomFieldTypeEnum.ts b/sdks/node/model/signatureRequestResponseCustomFieldTypeEnum.ts index 3328269f3..67bc72c84 100644 --- a/sdks/node/model/signatureRequestResponseCustomFieldTypeEnum.ts +++ b/sdks/node/model/signatureRequestResponseCustomFieldTypeEnum.ts @@ -22,8 +22,6 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; - export enum SignatureRequestResponseCustomFieldTypeEnum { Text = "text", Checkbox = "checkbox", diff --git a/sdks/node/model/signatureRequestResponseDataBase.ts b/sdks/node/model/signatureRequestResponseDataBase.ts index a7a516658..42c150334 100644 --- a/sdks/node/model/signatureRequestResponseDataBase.ts +++ b/sdks/node/model/signatureRequestResponseDataBase.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap } from "./"; /** * An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. diff --git a/sdks/node/model/signatureRequestResponseDataTypeEnum.ts b/sdks/node/model/signatureRequestResponseDataTypeEnum.ts index 8884433ab..c0a92799c 100644 --- a/sdks/node/model/signatureRequestResponseDataTypeEnum.ts +++ b/sdks/node/model/signatureRequestResponseDataTypeEnum.ts @@ -22,8 +22,6 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; - export enum SignatureRequestResponseDataTypeEnum { Text = "text", Checkbox = "checkbox", diff --git a/sdks/node/model/signatureRequestResponseDataValueCheckbox.ts b/sdks/node/model/signatureRequestResponseDataValueCheckbox.ts index 1f46399a6..c64f356c9 100644 --- a/sdks/node/model/signatureRequestResponseDataValueCheckbox.ts +++ b/sdks/node/model/signatureRequestResponseDataValueCheckbox.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; export class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase { diff --git a/sdks/node/model/signatureRequestResponseDataValueCheckboxMerge.ts b/sdks/node/model/signatureRequestResponseDataValueCheckboxMerge.ts index db8771952..2c5edeb49 100644 --- a/sdks/node/model/signatureRequestResponseDataValueCheckboxMerge.ts +++ b/sdks/node/model/signatureRequestResponseDataValueCheckboxMerge.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; export class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase { diff --git a/sdks/node/model/signatureRequestResponseDataValueDateSigned.ts b/sdks/node/model/signatureRequestResponseDataValueDateSigned.ts index 917a16c29..097e81008 100644 --- a/sdks/node/model/signatureRequestResponseDataValueDateSigned.ts +++ b/sdks/node/model/signatureRequestResponseDataValueDateSigned.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; export class SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase { diff --git a/sdks/node/model/signatureRequestResponseDataValueDropdown.ts b/sdks/node/model/signatureRequestResponseDataValueDropdown.ts index 3b757a871..b9660803d 100644 --- a/sdks/node/model/signatureRequestResponseDataValueDropdown.ts +++ b/sdks/node/model/signatureRequestResponseDataValueDropdown.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; export class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase { diff --git a/sdks/node/model/signatureRequestResponseDataValueInitials.ts b/sdks/node/model/signatureRequestResponseDataValueInitials.ts index 935812bf2..59e854f77 100644 --- a/sdks/node/model/signatureRequestResponseDataValueInitials.ts +++ b/sdks/node/model/signatureRequestResponseDataValueInitials.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; export class SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase { diff --git a/sdks/node/model/signatureRequestResponseDataValueRadio.ts b/sdks/node/model/signatureRequestResponseDataValueRadio.ts index eb0e3f35d..8f570485a 100644 --- a/sdks/node/model/signatureRequestResponseDataValueRadio.ts +++ b/sdks/node/model/signatureRequestResponseDataValueRadio.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; export class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase { diff --git a/sdks/node/model/signatureRequestResponseDataValueSignature.ts b/sdks/node/model/signatureRequestResponseDataValueSignature.ts index 6ee068fa5..99da64fac 100644 --- a/sdks/node/model/signatureRequestResponseDataValueSignature.ts +++ b/sdks/node/model/signatureRequestResponseDataValueSignature.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; export class SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase { diff --git a/sdks/node/model/signatureRequestResponseDataValueText.ts b/sdks/node/model/signatureRequestResponseDataValueText.ts index 89091c609..9d5f4ad8d 100644 --- a/sdks/node/model/signatureRequestResponseDataValueText.ts +++ b/sdks/node/model/signatureRequestResponseDataValueText.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; export class SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase { diff --git a/sdks/node/model/signatureRequestResponseDataValueTextMerge.ts b/sdks/node/model/signatureRequestResponseDataValueTextMerge.ts index 8f9c0ee31..45ac660c6 100644 --- a/sdks/node/model/signatureRequestResponseDataValueTextMerge.ts +++ b/sdks/node/model/signatureRequestResponseDataValueTextMerge.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SignatureRequestResponseDataBase } from "./signatureRequestResponseDataBase"; export class SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase { diff --git a/sdks/node/model/signatureRequestResponseSignatures.ts b/sdks/node/model/signatureRequestResponseSignatures.ts index 6efe96093..1311ebea1 100644 --- a/sdks/node/model/signatureRequestResponseSignatures.ts +++ b/sdks/node/model/signatureRequestResponseSignatures.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * An array of signature objects, 1 for each signer. diff --git a/sdks/node/model/signatureRequestSendRequest.ts b/sdks/node/model/signatureRequestSendRequest.ts index bd0063257..63ec9cc6d 100644 --- a/sdks/node/model/signatureRequestSendRequest.ts +++ b/sdks/node/model/signatureRequestSendRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubCustomField } from "./subCustomField"; import { SubFieldOptions } from "./subFieldOptions"; diff --git a/sdks/node/model/signatureRequestSendWithTemplateRequest.ts b/sdks/node/model/signatureRequestSendWithTemplateRequest.ts index f02a08167..2a3dbb8ea 100644 --- a/sdks/node/model/signatureRequestSendWithTemplateRequest.ts +++ b/sdks/node/model/signatureRequestSendWithTemplateRequest.ts @@ -22,12 +22,15 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; import { SubSigningOptions } from "./subSigningOptions"; +/** + * + */ export class SignatureRequestSendWithTemplateRequest { /** * Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. diff --git a/sdks/node/model/signatureRequestUpdateRequest.ts b/sdks/node/model/signatureRequestUpdateRequest.ts index ad005798d..e9e187752 100644 --- a/sdks/node/model/signatureRequestUpdateRequest.ts +++ b/sdks/node/model/signatureRequestUpdateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SignatureRequestUpdateRequest { /** diff --git a/sdks/node/model/subAttachment.ts b/sdks/node/model/subAttachment.ts index f629e3295..a166738bd 100644 --- a/sdks/node/model/subAttachment.ts +++ b/sdks/node/model/subAttachment.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubAttachment { /** diff --git a/sdks/node/model/subBulkSignerList.ts b/sdks/node/model/subBulkSignerList.ts index c360c94e3..46a11d1e5 100644 --- a/sdks/node/model/subBulkSignerList.ts +++ b/sdks/node/model/subBulkSignerList.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubBulkSignerListCustomField } from "./subBulkSignerListCustomField"; import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; diff --git a/sdks/node/model/subBulkSignerListCustomField.ts b/sdks/node/model/subBulkSignerListCustomField.ts index 994831248..c76bb8e74 100644 --- a/sdks/node/model/subBulkSignerListCustomField.ts +++ b/sdks/node/model/subBulkSignerListCustomField.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubBulkSignerListCustomField { /** diff --git a/sdks/node/model/subCC.ts b/sdks/node/model/subCC.ts index d129aa024..bd26cad14 100644 --- a/sdks/node/model/subCC.ts +++ b/sdks/node/model/subCC.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubCC { /** diff --git a/sdks/node/model/subCustomField.ts b/sdks/node/model/subCustomField.ts index fcb03a408..998efa58b 100644 --- a/sdks/node/model/subCustomField.ts +++ b/sdks/node/model/subCustomField.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. diff --git a/sdks/node/model/subEditorOptions.ts b/sdks/node/model/subEditorOptions.ts index f43b6cf27..c91cf2306 100644 --- a/sdks/node/model/subEditorOptions.ts +++ b/sdks/node/model/subEditorOptions.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * This allows the requester to specify editor options when a preparing a document diff --git a/sdks/node/model/subFieldOptions.ts b/sdks/node/model/subFieldOptions.ts index 7c69ffd58..19932ca10 100644 --- a/sdks/node/model/subFieldOptions.ts +++ b/sdks/node/model/subFieldOptions.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * This allows the requester to specify field options for a signature request. diff --git a/sdks/node/model/subFormFieldGroup.ts b/sdks/node/model/subFormFieldGroup.ts index 54925e4d3..3ad157040 100644 --- a/sdks/node/model/subFormFieldGroup.ts +++ b/sdks/node/model/subFormFieldGroup.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubFormFieldGroup { /** diff --git a/sdks/node/model/subFormFieldRule.ts b/sdks/node/model/subFormFieldRule.ts index de013327b..6d1e131fb 100644 --- a/sdks/node/model/subFormFieldRule.ts +++ b/sdks/node/model/subFormFieldRule.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldRuleAction } from "./subFormFieldRuleAction"; import { SubFormFieldRuleTrigger } from "./subFormFieldRuleTrigger"; diff --git a/sdks/node/model/subFormFieldRuleAction.ts b/sdks/node/model/subFormFieldRuleAction.ts index d2ecf98d4..43ec2545f 100644 --- a/sdks/node/model/subFormFieldRuleAction.ts +++ b/sdks/node/model/subFormFieldRuleAction.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubFormFieldRuleAction { /** diff --git a/sdks/node/model/subFormFieldRuleTrigger.ts b/sdks/node/model/subFormFieldRuleTrigger.ts index 2465231b2..84609a51d 100644 --- a/sdks/node/model/subFormFieldRuleTrigger.ts +++ b/sdks/node/model/subFormFieldRuleTrigger.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubFormFieldRuleTrigger { /** diff --git a/sdks/node/model/subFormFieldsPerDocumentBase.ts b/sdks/node/model/subFormFieldsPerDocumentBase.ts index a5a756bc3..098c5730f 100644 --- a/sdks/node/model/subFormFieldsPerDocumentBase.ts +++ b/sdks/node/model/subFormFieldsPerDocumentBase.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap } from "./"; /** * The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` diff --git a/sdks/node/model/subFormFieldsPerDocumentCheckbox.ts b/sdks/node/model/subFormFieldsPerDocumentCheckbox.ts index 391c1d2fc..f1a55dba4 100644 --- a/sdks/node/model/subFormFieldsPerDocumentCheckbox.ts +++ b/sdks/node/model/subFormFieldsPerDocumentCheckbox.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; /** diff --git a/sdks/node/model/subFormFieldsPerDocumentCheckboxMerge.ts b/sdks/node/model/subFormFieldsPerDocumentCheckboxMerge.ts index 8727211a8..54a374279 100644 --- a/sdks/node/model/subFormFieldsPerDocumentCheckboxMerge.ts +++ b/sdks/node/model/subFormFieldsPerDocumentCheckboxMerge.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; /** diff --git a/sdks/node/model/subFormFieldsPerDocumentDateSigned.ts b/sdks/node/model/subFormFieldsPerDocumentDateSigned.ts index f09642a5b..658fa5279 100644 --- a/sdks/node/model/subFormFieldsPerDocumentDateSigned.ts +++ b/sdks/node/model/subFormFieldsPerDocumentDateSigned.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; /** diff --git a/sdks/node/model/subFormFieldsPerDocumentDropdown.ts b/sdks/node/model/subFormFieldsPerDocumentDropdown.ts index e027b33e5..74076a0cb 100644 --- a/sdks/node/model/subFormFieldsPerDocumentDropdown.ts +++ b/sdks/node/model/subFormFieldsPerDocumentDropdown.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; /** diff --git a/sdks/node/model/subFormFieldsPerDocumentFontEnum.ts b/sdks/node/model/subFormFieldsPerDocumentFontEnum.ts index 210f4564b..e38061eac 100644 --- a/sdks/node/model/subFormFieldsPerDocumentFontEnum.ts +++ b/sdks/node/model/subFormFieldsPerDocumentFontEnum.ts @@ -22,8 +22,6 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; - export enum SubFormFieldsPerDocumentFontEnum { Helvetica = "helvetica", Arial = "arial", diff --git a/sdks/node/model/subFormFieldsPerDocumentHyperlink.ts b/sdks/node/model/subFormFieldsPerDocumentHyperlink.ts index ee01c4846..d5cf15b3e 100644 --- a/sdks/node/model/subFormFieldsPerDocumentHyperlink.ts +++ b/sdks/node/model/subFormFieldsPerDocumentHyperlink.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; /** diff --git a/sdks/node/model/subFormFieldsPerDocumentInitials.ts b/sdks/node/model/subFormFieldsPerDocumentInitials.ts index 8b901c29f..6d05c5cab 100644 --- a/sdks/node/model/subFormFieldsPerDocumentInitials.ts +++ b/sdks/node/model/subFormFieldsPerDocumentInitials.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; /** diff --git a/sdks/node/model/subFormFieldsPerDocumentRadio.ts b/sdks/node/model/subFormFieldsPerDocumentRadio.ts index 42805cb96..4af01d903 100644 --- a/sdks/node/model/subFormFieldsPerDocumentRadio.ts +++ b/sdks/node/model/subFormFieldsPerDocumentRadio.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; /** diff --git a/sdks/node/model/subFormFieldsPerDocumentSignature.ts b/sdks/node/model/subFormFieldsPerDocumentSignature.ts index 1b5d3afb0..adc4be238 100644 --- a/sdks/node/model/subFormFieldsPerDocumentSignature.ts +++ b/sdks/node/model/subFormFieldsPerDocumentSignature.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; /** diff --git a/sdks/node/model/subFormFieldsPerDocumentText.ts b/sdks/node/model/subFormFieldsPerDocumentText.ts index 3a095a041..6f05f4ceb 100644 --- a/sdks/node/model/subFormFieldsPerDocumentText.ts +++ b/sdks/node/model/subFormFieldsPerDocumentText.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; /** diff --git a/sdks/node/model/subFormFieldsPerDocumentTextMerge.ts b/sdks/node/model/subFormFieldsPerDocumentTextMerge.ts index c6143f1ec..f8b658a0a 100644 --- a/sdks/node/model/subFormFieldsPerDocumentTextMerge.ts +++ b/sdks/node/model/subFormFieldsPerDocumentTextMerge.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; /** diff --git a/sdks/node/model/subFormFieldsPerDocumentTypeEnum.ts b/sdks/node/model/subFormFieldsPerDocumentTypeEnum.ts index 4fb12ed8d..5b239ea12 100644 --- a/sdks/node/model/subFormFieldsPerDocumentTypeEnum.ts +++ b/sdks/node/model/subFormFieldsPerDocumentTypeEnum.ts @@ -22,8 +22,6 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; - export enum SubFormFieldsPerDocumentTypeEnum { Checkbox = "checkbox", CheckboxMerge = "checkbox-merge", diff --git a/sdks/node/model/subMergeField.ts b/sdks/node/model/subMergeField.ts index c651f9542..f728475c2 100644 --- a/sdks/node/model/subMergeField.ts +++ b/sdks/node/model/subMergeField.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubMergeField { /** diff --git a/sdks/node/model/subOAuth.ts b/sdks/node/model/subOAuth.ts index c5113236c..ab3979846 100644 --- a/sdks/node/model/subOAuth.ts +++ b/sdks/node/model/subOAuth.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * OAuth related parameters. diff --git a/sdks/node/model/subOptions.ts b/sdks/node/model/subOptions.ts index 6624d8720..844e4ff23 100644 --- a/sdks/node/model/subOptions.ts +++ b/sdks/node/model/subOptions.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Additional options supported by API App. diff --git a/sdks/node/model/subSignatureRequestGroupedSigners.ts b/sdks/node/model/subSignatureRequestGroupedSigners.ts index 8055b50d1..9417509e4 100644 --- a/sdks/node/model/subSignatureRequestGroupedSigners.ts +++ b/sdks/node/model/subSignatureRequestGroupedSigners.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubSignatureRequestSigner } from "./subSignatureRequestSigner"; export class SubSignatureRequestGroupedSigners { diff --git a/sdks/node/model/subSignatureRequestSigner.ts b/sdks/node/model/subSignatureRequestSigner.ts index c7b1fabb9..6eb403434 100644 --- a/sdks/node/model/subSignatureRequestSigner.ts +++ b/sdks/node/model/subSignatureRequestSigner.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubSignatureRequestSigner { /** diff --git a/sdks/node/model/subSignatureRequestTemplateSigner.ts b/sdks/node/model/subSignatureRequestTemplateSigner.ts index 98be7ce9e..7722e724e 100644 --- a/sdks/node/model/subSignatureRequestTemplateSigner.ts +++ b/sdks/node/model/subSignatureRequestTemplateSigner.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubSignatureRequestTemplateSigner { /** diff --git a/sdks/node/model/subSigningOptions.ts b/sdks/node/model/subSigningOptions.ts index a37e76dda..886d611c7 100644 --- a/sdks/node/model/subSigningOptions.ts +++ b/sdks/node/model/subSigningOptions.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings. diff --git a/sdks/node/model/subTeamResponse.ts b/sdks/node/model/subTeamResponse.ts index fc30d706c..22111b62e 100644 --- a/sdks/node/model/subTeamResponse.ts +++ b/sdks/node/model/subTeamResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubTeamResponse { /** diff --git a/sdks/node/model/subTemplateRole.ts b/sdks/node/model/subTemplateRole.ts index 8d1c05fbb..249f3628d 100644 --- a/sdks/node/model/subTemplateRole.ts +++ b/sdks/node/model/subTemplateRole.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubTemplateRole { /** diff --git a/sdks/node/model/subUnclaimedDraftSigner.ts b/sdks/node/model/subUnclaimedDraftSigner.ts index 48dc51f25..6207006bf 100644 --- a/sdks/node/model/subUnclaimedDraftSigner.ts +++ b/sdks/node/model/subUnclaimedDraftSigner.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubUnclaimedDraftSigner { /** diff --git a/sdks/node/model/subUnclaimedDraftTemplateSigner.ts b/sdks/node/model/subUnclaimedDraftTemplateSigner.ts index f26630da5..dd341e84a 100644 --- a/sdks/node/model/subUnclaimedDraftTemplateSigner.ts +++ b/sdks/node/model/subUnclaimedDraftTemplateSigner.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class SubUnclaimedDraftTemplateSigner { /** diff --git a/sdks/node/model/subWhiteLabelingOptions.ts b/sdks/node/model/subWhiteLabelingOptions.ts index 54f1ef2cc..17a64f32e 100644 --- a/sdks/node/model/subWhiteLabelingOptions.ts +++ b/sdks/node/model/subWhiteLabelingOptions.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * An array of elements and values serialized to a string, to be used to customize the app\'s signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. diff --git a/sdks/node/model/teamAddMemberRequest.ts b/sdks/node/model/teamAddMemberRequest.ts index 8f6b723ee..c5f49a26e 100644 --- a/sdks/node/model/teamAddMemberRequest.ts +++ b/sdks/node/model/teamAddMemberRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TeamAddMemberRequest { /** diff --git a/sdks/node/model/teamCreateRequest.ts b/sdks/node/model/teamCreateRequest.ts index 115270ca0..7439b337d 100644 --- a/sdks/node/model/teamCreateRequest.ts +++ b/sdks/node/model/teamCreateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TeamCreateRequest { /** diff --git a/sdks/node/model/teamGetInfoResponse.ts b/sdks/node/model/teamGetInfoResponse.ts index c42a564f7..48159ef24 100644 --- a/sdks/node/model/teamGetInfoResponse.ts +++ b/sdks/node/model/teamGetInfoResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TeamInfoResponse } from "./teamInfoResponse"; import { WarningResponse } from "./warningResponse"; export class TeamGetInfoResponse { - "team"?: TeamInfoResponse; + "team": TeamInfoResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/teamGetResponse.ts b/sdks/node/model/teamGetResponse.ts index 8ebb307d6..01aaca14b 100644 --- a/sdks/node/model/teamGetResponse.ts +++ b/sdks/node/model/teamGetResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TeamResponse } from "./teamResponse"; import { WarningResponse } from "./warningResponse"; export class TeamGetResponse { - "team"?: TeamResponse; + "team": TeamResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/teamInfoResponse.ts b/sdks/node/model/teamInfoResponse.ts index 1654388ad..40ae3cd2c 100644 --- a/sdks/node/model/teamInfoResponse.ts +++ b/sdks/node/model/teamInfoResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TeamParentResponse } from "./teamParentResponse"; export class TeamInfoResponse { diff --git a/sdks/node/model/teamInviteResponse.ts b/sdks/node/model/teamInviteResponse.ts index 1e0268622..a227d7cd7 100644 --- a/sdks/node/model/teamInviteResponse.ts +++ b/sdks/node/model/teamInviteResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TeamInviteResponse { /** diff --git a/sdks/node/model/teamInvitesResponse.ts b/sdks/node/model/teamInvitesResponse.ts index 08f01c069..484de3cce 100644 --- a/sdks/node/model/teamInvitesResponse.ts +++ b/sdks/node/model/teamInvitesResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TeamInviteResponse } from "./teamInviteResponse"; import { WarningResponse } from "./warningResponse"; @@ -30,7 +30,7 @@ export class TeamInvitesResponse { /** * Contains a list of team invites and their roles. */ - "teamInvites"?: Array; + "teamInvites": Array; "warnings"?: Array; static discriminator: string | undefined = undefined; diff --git a/sdks/node/model/teamMemberResponse.ts b/sdks/node/model/teamMemberResponse.ts index a4515f3ae..76e2d689e 100644 --- a/sdks/node/model/teamMemberResponse.ts +++ b/sdks/node/model/teamMemberResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TeamMemberResponse { /** diff --git a/sdks/node/model/teamMembersResponse.ts b/sdks/node/model/teamMembersResponse.ts index 5194c7405..82d68941c 100644 --- a/sdks/node/model/teamMembersResponse.ts +++ b/sdks/node/model/teamMembersResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { ListInfoResponse } from "./listInfoResponse"; import { TeamMemberResponse } from "./teamMemberResponse"; import { WarningResponse } from "./warningResponse"; @@ -31,8 +31,8 @@ export class TeamMembersResponse { /** * Contains a list of team members and their roles for a specific team. */ - "teamMembers"?: Array; - "listInfo"?: ListInfoResponse; + "teamMembers": Array; + "listInfo": ListInfoResponse; "warnings"?: Array; static discriminator: string | undefined = undefined; diff --git a/sdks/node/model/teamParentResponse.ts b/sdks/node/model/teamParentResponse.ts index c0d48af54..b5b67f4e7 100644 --- a/sdks/node/model/teamParentResponse.ts +++ b/sdks/node/model/teamParentResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Information about the parent team if a team has one, set to `null` otherwise. diff --git a/sdks/node/model/teamRemoveMemberRequest.ts b/sdks/node/model/teamRemoveMemberRequest.ts index 98676f517..19757b71e 100644 --- a/sdks/node/model/teamRemoveMemberRequest.ts +++ b/sdks/node/model/teamRemoveMemberRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TeamRemoveMemberRequest { /** diff --git a/sdks/node/model/teamResponse.ts b/sdks/node/model/teamResponse.ts index 54cf03713..4d0a233d0 100644 --- a/sdks/node/model/teamResponse.ts +++ b/sdks/node/model/teamResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { AccountResponse } from "./accountResponse"; /** diff --git a/sdks/node/model/teamSubTeamsResponse.ts b/sdks/node/model/teamSubTeamsResponse.ts index 656e22333..f2d6cb379 100644 --- a/sdks/node/model/teamSubTeamsResponse.ts +++ b/sdks/node/model/teamSubTeamsResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { ListInfoResponse } from "./listInfoResponse"; import { SubTeamResponse } from "./subTeamResponse"; import { WarningResponse } from "./warningResponse"; @@ -31,8 +31,8 @@ export class TeamSubTeamsResponse { /** * Contains a list with sub teams. */ - "subTeams"?: Array; - "listInfo"?: ListInfoResponse; + "subTeams": Array; + "listInfo": ListInfoResponse; "warnings"?: Array; static discriminator: string | undefined = undefined; diff --git a/sdks/node/model/teamUpdateRequest.ts b/sdks/node/model/teamUpdateRequest.ts index 88d1aac55..c0ad1fab4 100644 --- a/sdks/node/model/teamUpdateRequest.ts +++ b/sdks/node/model/teamUpdateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TeamUpdateRequest { /** diff --git a/sdks/node/model/templateAddUserRequest.ts b/sdks/node/model/templateAddUserRequest.ts index 1c2691157..8edfd37b6 100644 --- a/sdks/node/model/templateAddUserRequest.ts +++ b/sdks/node/model/templateAddUserRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TemplateAddUserRequest { /** diff --git a/sdks/node/model/templateCreateEmbeddedDraftRequest.ts b/sdks/node/model/templateCreateEmbeddedDraftRequest.ts index 61f59da10..657fa7c86 100644 --- a/sdks/node/model/templateCreateEmbeddedDraftRequest.ts +++ b/sdks/node/model/templateCreateEmbeddedDraftRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubEditorOptions } from "./subEditorOptions"; import { SubFieldOptions } from "./subFieldOptions"; diff --git a/sdks/node/model/templateCreateEmbeddedDraftResponse.ts b/sdks/node/model/templateCreateEmbeddedDraftResponse.ts index 63ec550b0..7d2a40559 100644 --- a/sdks/node/model/templateCreateEmbeddedDraftResponse.ts +++ b/sdks/node/model/templateCreateEmbeddedDraftResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateCreateEmbeddedDraftResponseTemplate } from "./templateCreateEmbeddedDraftResponseTemplate"; import { WarningResponse } from "./warningResponse"; export class TemplateCreateEmbeddedDraftResponse { - "template"?: TemplateCreateEmbeddedDraftResponseTemplate; + "template": TemplateCreateEmbeddedDraftResponseTemplate; /** * A list of warnings. */ diff --git a/sdks/node/model/templateCreateEmbeddedDraftResponseTemplate.ts b/sdks/node/model/templateCreateEmbeddedDraftResponseTemplate.ts index 788d6b72d..af7f9a71b 100644 --- a/sdks/node/model/templateCreateEmbeddedDraftResponseTemplate.ts +++ b/sdks/node/model/templateCreateEmbeddedDraftResponseTemplate.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { WarningResponse } from "./warningResponse"; /** diff --git a/sdks/node/model/templateCreateRequest.ts b/sdks/node/model/templateCreateRequest.ts index 82c501124..66701c09e 100644 --- a/sdks/node/model/templateCreateRequest.ts +++ b/sdks/node/model/templateCreateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubFieldOptions } from "./subFieldOptions"; import { SubFormFieldGroup } from "./subFormFieldGroup"; diff --git a/sdks/node/model/templateCreateResponse.ts b/sdks/node/model/templateCreateResponse.ts index 11d0dbc78..fdf2e1e40 100644 --- a/sdks/node/model/templateCreateResponse.ts +++ b/sdks/node/model/templateCreateResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateCreateResponseTemplate } from "./templateCreateResponseTemplate"; import { WarningResponse } from "./warningResponse"; export class TemplateCreateResponse { - "template"?: TemplateCreateResponseTemplate; + "template": TemplateCreateResponseTemplate; /** * A list of warnings. */ diff --git a/sdks/node/model/templateCreateResponseTemplate.ts b/sdks/node/model/templateCreateResponseTemplate.ts index f6de5fc50..cdcd61167 100644 --- a/sdks/node/model/templateCreateResponseTemplate.ts +++ b/sdks/node/model/templateCreateResponseTemplate.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Template object with parameters: `template_id`. diff --git a/sdks/node/model/templateEditResponse.ts b/sdks/node/model/templateEditResponse.ts index c0bbca667..aa51f43d0 100644 --- a/sdks/node/model/templateEditResponse.ts +++ b/sdks/node/model/templateEditResponse.ts @@ -22,13 +22,13 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TemplateEditResponse { /** * The id of the Template. */ - "templateId"?: string; + "templateId": string; static discriminator: string | undefined = undefined; diff --git a/sdks/node/model/templateGetResponse.ts b/sdks/node/model/templateGetResponse.ts index 96a2ca85a..a00f271e3 100644 --- a/sdks/node/model/templateGetResponse.ts +++ b/sdks/node/model/templateGetResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponse } from "./templateResponse"; import { WarningResponse } from "./warningResponse"; export class TemplateGetResponse { - "template"?: TemplateResponse; + "template": TemplateResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/templateListResponse.ts b/sdks/node/model/templateListResponse.ts index 65d5ff5ec..0a797e6c1 100644 --- a/sdks/node/model/templateListResponse.ts +++ b/sdks/node/model/templateListResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { ListInfoResponse } from "./listInfoResponse"; import { TemplateResponse } from "./templateResponse"; import { WarningResponse } from "./warningResponse"; @@ -31,8 +31,8 @@ export class TemplateListResponse { /** * List of templates that the API caller has access to. */ - "templates"?: Array; - "listInfo"?: ListInfoResponse; + "templates": Array; + "listInfo": ListInfoResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/templateRemoveUserRequest.ts b/sdks/node/model/templateRemoveUserRequest.ts index e103a5478..4379f10a8 100644 --- a/sdks/node/model/templateRemoveUserRequest.ts +++ b/sdks/node/model/templateRemoveUserRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TemplateRemoveUserRequest { /** diff --git a/sdks/node/model/templateResponse.ts b/sdks/node/model/templateResponse.ts index 4fc489e7e..88df4c09b 100644 --- a/sdks/node/model/templateResponse.ts +++ b/sdks/node/model/templateResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseAccount } from "./templateResponseAccount"; import { TemplateResponseCCRole } from "./templateResponseCCRole"; import { TemplateResponseDocument } from "./templateResponseDocument"; diff --git a/sdks/node/model/templateResponseAccount.ts b/sdks/node/model/templateResponseAccount.ts index 703c72e13..3b43d9351 100644 --- a/sdks/node/model/templateResponseAccount.ts +++ b/sdks/node/model/templateResponseAccount.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseAccountQuota } from "./templateResponseAccountQuota"; export class TemplateResponseAccount { diff --git a/sdks/node/model/templateResponseAccountQuota.ts b/sdks/node/model/templateResponseAccountQuota.ts index e6d3c1bea..e2d6669b6 100644 --- a/sdks/node/model/templateResponseAccountQuota.ts +++ b/sdks/node/model/templateResponseAccountQuota.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. diff --git a/sdks/node/model/templateResponseCCRole.ts b/sdks/node/model/templateResponseCCRole.ts index c20a545d6..b3b7a2fd7 100644 --- a/sdks/node/model/templateResponseCCRole.ts +++ b/sdks/node/model/templateResponseCCRole.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TemplateResponseCCRole { /** diff --git a/sdks/node/model/templateResponseDocument.ts b/sdks/node/model/templateResponseDocument.ts index 71c39fdb9..0c7a19e02 100644 --- a/sdks/node/model/templateResponseDocument.ts +++ b/sdks/node/model/templateResponseDocument.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentCustomFieldBase } from "./templateResponseDocumentCustomFieldBase"; import { TemplateResponseDocumentFieldGroup } from "./templateResponseDocumentFieldGroup"; import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; diff --git a/sdks/node/model/templateResponseDocumentCustomFieldBase.ts b/sdks/node/model/templateResponseDocumentCustomFieldBase.ts index ea5cd75b1..a0ed43965 100644 --- a/sdks/node/model/templateResponseDocumentCustomFieldBase.ts +++ b/sdks/node/model/templateResponseDocumentCustomFieldBase.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap } from "./"; /** * An array of Form Field objects containing the name and type of each named field. @@ -40,7 +40,7 @@ export abstract class TemplateResponseDocumentCustomFieldBase { /** * The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). */ - "signer"?: string | null; + "signer"?: number | string | null; /** * The horizontal offset in pixels for this form field. */ diff --git a/sdks/node/model/templateResponseDocumentCustomFieldCheckbox.ts b/sdks/node/model/templateResponseDocumentCustomFieldCheckbox.ts index 9e8c5062f..f499b69fc 100644 --- a/sdks/node/model/templateResponseDocumentCustomFieldCheckbox.ts +++ b/sdks/node/model/templateResponseDocumentCustomFieldCheckbox.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentCustomFieldBase } from "./templateResponseDocumentCustomFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentCustomFieldText.ts b/sdks/node/model/templateResponseDocumentCustomFieldText.ts index 500a37c13..3f59efc19 100644 --- a/sdks/node/model/templateResponseDocumentCustomFieldText.ts +++ b/sdks/node/model/templateResponseDocumentCustomFieldText.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentCustomFieldBase } from "./templateResponseDocumentCustomFieldBase"; import { TemplateResponseFieldAvgTextLength } from "./templateResponseFieldAvgTextLength"; diff --git a/sdks/node/model/templateResponseDocumentFieldGroup.ts b/sdks/node/model/templateResponseDocumentFieldGroup.ts index 3fc6d9aaf..4d2f9c695 100644 --- a/sdks/node/model/templateResponseDocumentFieldGroup.ts +++ b/sdks/node/model/templateResponseDocumentFieldGroup.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentFieldGroupRule } from "./templateResponseDocumentFieldGroupRule"; export class TemplateResponseDocumentFieldGroup { diff --git a/sdks/node/model/templateResponseDocumentFieldGroupRule.ts b/sdks/node/model/templateResponseDocumentFieldGroupRule.ts index 582becc48..f5ad93cf4 100644 --- a/sdks/node/model/templateResponseDocumentFieldGroupRule.ts +++ b/sdks/node/model/templateResponseDocumentFieldGroupRule.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping). diff --git a/sdks/node/model/templateResponseDocumentFormFieldBase.ts b/sdks/node/model/templateResponseDocumentFormFieldBase.ts index b1b380187..94242a4a9 100644 --- a/sdks/node/model/templateResponseDocumentFormFieldBase.ts +++ b/sdks/node/model/templateResponseDocumentFormFieldBase.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap } from "./"; /** * An array of Form Field objects containing the name and type of each named field. @@ -40,7 +40,7 @@ export abstract class TemplateResponseDocumentFormFieldBase { /** * The signer of the Form Field. */ - "signer"?: string; + "signer"?: number | string; /** * The horizontal offset in pixels for this form field. */ diff --git a/sdks/node/model/templateResponseDocumentFormFieldCheckbox.ts b/sdks/node/model/templateResponseDocumentFormFieldCheckbox.ts index f144b3aa1..5e0b6d88b 100644 --- a/sdks/node/model/templateResponseDocumentFormFieldCheckbox.ts +++ b/sdks/node/model/templateResponseDocumentFormFieldCheckbox.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentFormFieldDateSigned.ts b/sdks/node/model/templateResponseDocumentFormFieldDateSigned.ts index 7483b8c08..b510aa57f 100644 --- a/sdks/node/model/templateResponseDocumentFormFieldDateSigned.ts +++ b/sdks/node/model/templateResponseDocumentFormFieldDateSigned.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentFormFieldDropdown.ts b/sdks/node/model/templateResponseDocumentFormFieldDropdown.ts index cd3d19fa8..e2878febc 100644 --- a/sdks/node/model/templateResponseDocumentFormFieldDropdown.ts +++ b/sdks/node/model/templateResponseDocumentFormFieldDropdown.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentFormFieldHyperlink.ts b/sdks/node/model/templateResponseDocumentFormFieldHyperlink.ts index a9d35836a..4a5998959 100644 --- a/sdks/node/model/templateResponseDocumentFormFieldHyperlink.ts +++ b/sdks/node/model/templateResponseDocumentFormFieldHyperlink.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; import { TemplateResponseFieldAvgTextLength } from "./templateResponseFieldAvgTextLength"; diff --git a/sdks/node/model/templateResponseDocumentFormFieldInitials.ts b/sdks/node/model/templateResponseDocumentFormFieldInitials.ts index d158e2150..1b14087a4 100644 --- a/sdks/node/model/templateResponseDocumentFormFieldInitials.ts +++ b/sdks/node/model/templateResponseDocumentFormFieldInitials.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentFormFieldRadio.ts b/sdks/node/model/templateResponseDocumentFormFieldRadio.ts index 518bfa583..3a20f95a0 100644 --- a/sdks/node/model/templateResponseDocumentFormFieldRadio.ts +++ b/sdks/node/model/templateResponseDocumentFormFieldRadio.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentFormFieldSignature.ts b/sdks/node/model/templateResponseDocumentFormFieldSignature.ts index a7005ffa4..c069e00aa 100644 --- a/sdks/node/model/templateResponseDocumentFormFieldSignature.ts +++ b/sdks/node/model/templateResponseDocumentFormFieldSignature.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentFormFieldText.ts b/sdks/node/model/templateResponseDocumentFormFieldText.ts index b6646b67b..2c320d342 100644 --- a/sdks/node/model/templateResponseDocumentFormFieldText.ts +++ b/sdks/node/model/templateResponseDocumentFormFieldText.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentFormFieldBase } from "./templateResponseDocumentFormFieldBase"; import { TemplateResponseFieldAvgTextLength } from "./templateResponseFieldAvgTextLength"; diff --git a/sdks/node/model/templateResponseDocumentStaticFieldBase.ts b/sdks/node/model/templateResponseDocumentStaticFieldBase.ts index 1fd71dce5..04d3275ef 100644 --- a/sdks/node/model/templateResponseDocumentStaticFieldBase.ts +++ b/sdks/node/model/templateResponseDocumentStaticFieldBase.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap } from "./"; /** * An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. diff --git a/sdks/node/model/templateResponseDocumentStaticFieldCheckbox.ts b/sdks/node/model/templateResponseDocumentStaticFieldCheckbox.ts index 2ed104c5f..2a6d05dcb 100644 --- a/sdks/node/model/templateResponseDocumentStaticFieldCheckbox.ts +++ b/sdks/node/model/templateResponseDocumentStaticFieldCheckbox.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentStaticFieldDateSigned.ts b/sdks/node/model/templateResponseDocumentStaticFieldDateSigned.ts index 80d202e2e..4e9a7d785 100644 --- a/sdks/node/model/templateResponseDocumentStaticFieldDateSigned.ts +++ b/sdks/node/model/templateResponseDocumentStaticFieldDateSigned.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentStaticFieldDropdown.ts b/sdks/node/model/templateResponseDocumentStaticFieldDropdown.ts index df43b6d92..228547758 100644 --- a/sdks/node/model/templateResponseDocumentStaticFieldDropdown.ts +++ b/sdks/node/model/templateResponseDocumentStaticFieldDropdown.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentStaticFieldHyperlink.ts b/sdks/node/model/templateResponseDocumentStaticFieldHyperlink.ts index ed8c207fc..e930e6037 100644 --- a/sdks/node/model/templateResponseDocumentStaticFieldHyperlink.ts +++ b/sdks/node/model/templateResponseDocumentStaticFieldHyperlink.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentStaticFieldInitials.ts b/sdks/node/model/templateResponseDocumentStaticFieldInitials.ts index f9a4fd293..bd478bdd7 100644 --- a/sdks/node/model/templateResponseDocumentStaticFieldInitials.ts +++ b/sdks/node/model/templateResponseDocumentStaticFieldInitials.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentStaticFieldRadio.ts b/sdks/node/model/templateResponseDocumentStaticFieldRadio.ts index 7272ec6ee..b6cfa1af8 100644 --- a/sdks/node/model/templateResponseDocumentStaticFieldRadio.ts +++ b/sdks/node/model/templateResponseDocumentStaticFieldRadio.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentStaticFieldSignature.ts b/sdks/node/model/templateResponseDocumentStaticFieldSignature.ts index 879adee61..bdf167863 100644 --- a/sdks/node/model/templateResponseDocumentStaticFieldSignature.ts +++ b/sdks/node/model/templateResponseDocumentStaticFieldSignature.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; /** diff --git a/sdks/node/model/templateResponseDocumentStaticFieldText.ts b/sdks/node/model/templateResponseDocumentStaticFieldText.ts index 197aeaab8..7a768c4ae 100644 --- a/sdks/node/model/templateResponseDocumentStaticFieldText.ts +++ b/sdks/node/model/templateResponseDocumentStaticFieldText.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateResponseDocumentStaticFieldBase } from "./templateResponseDocumentStaticFieldBase"; /** diff --git a/sdks/node/model/templateResponseFieldAvgTextLength.ts b/sdks/node/model/templateResponseFieldAvgTextLength.ts index 17b04fc38..d0a4fc396 100644 --- a/sdks/node/model/templateResponseFieldAvgTextLength.ts +++ b/sdks/node/model/templateResponseFieldAvgTextLength.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * Average text length in this field. diff --git a/sdks/node/model/templateResponseSignerRole.ts b/sdks/node/model/templateResponseSignerRole.ts index 0b3d5b67e..9bebd958f 100644 --- a/sdks/node/model/templateResponseSignerRole.ts +++ b/sdks/node/model/templateResponseSignerRole.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; export class TemplateResponseSignerRole { /** diff --git a/sdks/node/model/templateUpdateFilesRequest.ts b/sdks/node/model/templateUpdateFilesRequest.ts index 9f75a47d4..56f8016ca 100644 --- a/sdks/node/model/templateUpdateFilesRequest.ts +++ b/sdks/node/model/templateUpdateFilesRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; export class TemplateUpdateFilesRequest { /** diff --git a/sdks/node/model/templateUpdateFilesResponse.ts b/sdks/node/model/templateUpdateFilesResponse.ts index 4c46ef688..d81f63895 100644 --- a/sdks/node/model/templateUpdateFilesResponse.ts +++ b/sdks/node/model/templateUpdateFilesResponse.ts @@ -22,11 +22,11 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { TemplateUpdateFilesResponseTemplate } from "./templateUpdateFilesResponseTemplate"; export class TemplateUpdateFilesResponse { - "template"?: TemplateUpdateFilesResponseTemplate; + "template": TemplateUpdateFilesResponseTemplate; static discriminator: string | undefined = undefined; diff --git a/sdks/node/model/templateUpdateFilesResponseTemplate.ts b/sdks/node/model/templateUpdateFilesResponseTemplate.ts index 58e6ce711..98e18dabc 100644 --- a/sdks/node/model/templateUpdateFilesResponseTemplate.ts +++ b/sdks/node/model/templateUpdateFilesResponseTemplate.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { WarningResponse } from "./warningResponse"; /** diff --git a/sdks/node/model/unclaimedDraftCreateEmbeddedRequest.ts b/sdks/node/model/unclaimedDraftCreateEmbeddedRequest.ts index cde1c5277..950f3c5c1 100644 --- a/sdks/node/model/unclaimedDraftCreateEmbeddedRequest.ts +++ b/sdks/node/model/unclaimedDraftCreateEmbeddedRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubCustomField } from "./subCustomField"; import { SubEditorOptions } from "./subEditorOptions"; @@ -33,6 +33,9 @@ import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; import { SubSigningOptions } from "./subSigningOptions"; import { SubUnclaimedDraftSigner } from "./subUnclaimedDraftSigner"; +/** + * + */ export class UnclaimedDraftCreateEmbeddedRequest { /** * Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. diff --git a/sdks/node/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.ts b/sdks/node/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.ts index ff7169c74..d9d70068e 100644 --- a/sdks/node/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.ts +++ b/sdks/node/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; import { SubEditorOptions } from "./subEditorOptions"; diff --git a/sdks/node/model/unclaimedDraftCreateRequest.ts b/sdks/node/model/unclaimedDraftCreateRequest.ts index 873736e21..cac96a626 100644 --- a/sdks/node/model/unclaimedDraftCreateRequest.ts +++ b/sdks/node/model/unclaimedDraftCreateRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubCustomField } from "./subCustomField"; import { SubFieldOptions } from "./subFieldOptions"; @@ -32,6 +32,9 @@ import { SubFormFieldsPerDocumentBase } from "./subFormFieldsPerDocumentBase"; import { SubSigningOptions } from "./subSigningOptions"; import { SubUnclaimedDraftSigner } from "./subUnclaimedDraftSigner"; +/** + * + */ export class UnclaimedDraftCreateRequest { /** * The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. diff --git a/sdks/node/model/unclaimedDraftCreateResponse.ts b/sdks/node/model/unclaimedDraftCreateResponse.ts index 823737127..101aca017 100644 --- a/sdks/node/model/unclaimedDraftCreateResponse.ts +++ b/sdks/node/model/unclaimedDraftCreateResponse.ts @@ -22,12 +22,12 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { UnclaimedDraftResponse } from "./unclaimedDraftResponse"; import { WarningResponse } from "./warningResponse"; export class UnclaimedDraftCreateResponse { - "unclaimedDraft"?: UnclaimedDraftResponse; + "unclaimedDraft": UnclaimedDraftResponse; /** * A list of warnings. */ diff --git a/sdks/node/model/unclaimedDraftEditAndResendRequest.ts b/sdks/node/model/unclaimedDraftEditAndResendRequest.ts index f3e090e5d..9aa72f4b2 100644 --- a/sdks/node/model/unclaimedDraftEditAndResendRequest.ts +++ b/sdks/node/model/unclaimedDraftEditAndResendRequest.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; import { SubEditorOptions } from "./subEditorOptions"; export class UnclaimedDraftEditAndResendRequest { diff --git a/sdks/node/model/unclaimedDraftResponse.ts b/sdks/node/model/unclaimedDraftResponse.ts index 8b1546494..9a635ffc6 100644 --- a/sdks/node/model/unclaimedDraftResponse.ts +++ b/sdks/node/model/unclaimedDraftResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * A group of documents that a user can take ownership of via the claim URL. diff --git a/sdks/node/model/warningResponse.ts b/sdks/node/model/warningResponse.ts index 9bcad08a3..579a4cbd8 100644 --- a/sdks/node/model/warningResponse.ts +++ b/sdks/node/model/warningResponse.ts @@ -22,7 +22,7 @@ * SOFTWARE. */ -import { RequestFile, AttributeTypeMap, ObjectSerializer } from "./"; +import { AttributeTypeMap, ObjectSerializer } from "./"; /** * A list of warnings. diff --git a/sdks/node/openapi-config.yaml b/sdks/node/openapi-config.yaml index 63b2675d6..2f8202ddf 100644 --- a/sdks/node/openapi-config.yaml +++ b/sdks/node/openapi-config.yaml @@ -2,11 +2,12 @@ generatorName: typescript-node typeMappings: {} additionalProperties: npmName: "@dropbox/sign" - npmVersion: 1.5-dev + npmVersion: 1.6-dev supportsES6: true apiDocPath: ./docs/api modelDocPath: ./docs/model sortModelPropertiesByRequiredFlag: true + useCustomTemplateCode: true files: npmignore: templateType: SupportingFiles @@ -32,6 +33,9 @@ files: model-index.mustache: templateType: SupportingFiles destinationFilename: model/index.ts + prettierrc.cjs: + templateType: SupportingFiles + destinationFilename: .prettierrc.cjs globalProperties: apiTests: false modelTests: false diff --git a/sdks/node/package-lock.json b/sdks/node/package-lock.json index 42bbb09ee..6596183a2 100644 --- a/sdks/node/package-lock.json +++ b/sdks/node/package-lock.json @@ -1,158 +1,91 @@ { "name": "@dropbox/sign", - "version": "1.5-dev", + "version": "1.6-dev", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dropbox/sign", - "version": "1.5-dev", + "version": "1.6-dev", "dependencies": { - "axios": "^1.6.0", - "bluebird": "^3.5.0", + "axios": "^1.7.0", + "bluebird": "^3.7.2", "form-data": "^4.0.0", "qs": "^6.10.3" }, "devDependencies": { - "@types/bluebird": "3.5.33", + "@types/bluebird": "^3.5.33", "@types/jest": "^29.5.7", + "@types/json-diff": "^1.0.3", "@types/node": "^20.8.10", + "@types/qs": "^6.9.15", "axios-mock-adapter": "^1.20.0", "esbuild": "^0.14.54", "jest": "^29.7.0", "json-diff": "^0.7.1", "prettier": "2.5.1", + "prettier-plugin-organize-imports": "^4.0.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^4.3.0" + "typescript": "^4.0 || ^5.0" } }, "node_modules/@ampproject/remapping": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.1.1.tgz", - "integrity": "sha512-Aolwjd7HSC2PyY0fDj/wA/EimQT4HfEnFYNp5s9CQlrdhyvWTtvZ5YzrUPu6R6/1jKiUlxu8bUhkdSnKHNAHMA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.0" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/compat-data": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.0.tgz", - "integrity": "sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.4.tgz", + "integrity": "sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.17.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.2.tgz", - "integrity": "sha512-R3VH5G42VSDolRHyUO4V2cfag8WHcZyxdq5Z/m8Xyb92lW/Erm/6kM+XtRFGf3Mulre3mveni2NHfEUws8wSvw==", - "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.0.0", - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.0", - "@babel/helper-compilation-targets": "^7.16.7", - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helpers": "^7.17.2", - "@babel/parser": "^7.17.0", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.0", - "@babel/types": "^7.17.0", - "convert-source-map": "^1.7.0", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz", + "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.0", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-module-transforms": "^7.25.2", + "@babel/helpers": "^7.25.0", + "@babel/parser": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.2", + "@babel/types": "^7.25.2", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", - "semver": "^6.3.0" + "json5": "^2.2.3", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -163,14 +96,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "version": "7.25.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.5.tgz", + "integrity": "sha512-abd43wyLfbWoxC6ahM8xTkqLpGB2iWBVyuKC9/srhFunCd1SDNrV1s72bBpK4hLj8KLzHBBcOblvLQZBNw9r3w==", "dev": true, "dependencies": { - "@babel/types": "^7.23.0", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", + "@babel/types": "^7.25.4", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" }, "engines": { @@ -178,171 +111,124 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", - "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.16.4", - "@babel/helper-validator-option": "^7.16.7", - "browserslist": "^4.17.5", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", - "dev": true, - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", + "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/compat-data": "^7.25.2", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", - "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", + "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", - "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", + "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-simple-access": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/helper-validator-identifier": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.2" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", + "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", - "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", + "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", - "dev": true, - "dependencies": { - "@babel/types": "^7.22.5" + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", - "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", + "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.17.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.2.tgz", - "integrity": "sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz", + "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==", "dev": true, "dependencies": { - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.0", - "@babel/types": "^7.17.0" + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.7", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -420,10 +306,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.4.tgz", + "integrity": "sha512-nq+eWrOgdtu3jG5Os4TQP3x3cLA8hR8TvJNjD8vnPa20WGycimcparWnLK4jJhElTK6SDyuJo1weMKO/5LpmLA==", "dev": true, + "dependencies": { + "@babel/types": "^7.25.4" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -467,6 +356,36 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.7.tgz", + "integrity": "sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-import-meta": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", @@ -492,12 +411,12 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", - "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz", + "integrity": "sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.7" }, "engines": { "node": ">=6.9.0" @@ -578,6 +497,21 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-top-level-await": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", @@ -594,12 +528,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", - "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.4.tgz", + "integrity": "sha512-uMOCoHVU52BsSWxPOMVv5qKRdeSlPuImUCB2dlPuBSU+W2/ROE7/Zg8F2Kepbk+8yBa68LlRKxO+xgEVWorsDg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -609,34 +543,31 @@ } }, "node_modules/@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", - "debug": "^4.1.0", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.4.tgz", + "integrity": "sha512-VJ4XsrD+nOvlXyLzmLzUs/0qjFS4sK30te5yEFlvbbUNEgKaVb2BHZUpAL+ttLPQAHNrsI3zZisbfha5Cvr8vg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.4", + "@babel/parser": "^7.25.4", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.4", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -644,13 +575,13 @@ } }, "node_modules/@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.4.tgz", + "integrity": "sha512-zQ1ijeeCXVEh+aNL0RlmkPkG8HUiDcU2pzQQFjtbntgAczRASFzj4H+6+bV+dy1ntKR14I/DypeuRG1uma98iQ==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -774,115 +705,6 @@ } } }, - "node_modules/@jest/core/node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/core/node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "node_modules/@jest/core/node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/@jest/core/node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/core/node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/core/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/@jest/core/node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/@jest/environment": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", @@ -998,150 +820,10 @@ } } }, - "node_modules/@jest/reporters/node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/reporters/node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "node_modules/@jest/reporters/node_modules/istanbul-lib-instrument": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz", - "integrity": "sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==", - "dev": true, - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@jest/reporters/node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/@jest/reporters/node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/reporters/node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/reporters/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@jest/reporters/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/@jest/reporters/node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "dependencies": { "@sinclair/typebox": "^0.27.8" @@ -1194,70 +876,32 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/test-sequencer/node_modules/jest-haste-map": { + "node_modules/@jest/transform": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "dependencies": { + "@babel/core": "^7.11.6", "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", "jest-regex-util": "^29.6.3", "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", "micromatch": "^4.0.4", - "walker": "^1.0.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/@jest/test-sequencer/node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/test-sequencer/node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/test-sequencer/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, "node_modules/@jest/types": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", @@ -1276,47 +920,47 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", - "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -1330,9 +974,9 @@ "dev": true }, "node_modules/@sinonjs/commons": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", - "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "dependencies": { "type-detect": "4.0.8" @@ -1348,55 +992,55 @@ } }, "node_modules/@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", "dev": true }, "node_modules/@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true }, "node_modules/@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true }, "node_modules/@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, "node_modules/@types/babel__core": { - "version": "7.1.18", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.18.tgz", - "integrity": "sha512-S7unDjm/C7z2A2R9NzfKCK1I+BAALDtxEmsJBwlB3EzNfb929ykjL++1CK9LO++EIp2fQrC8O+BwjKvz6UeDyQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "node_modules/@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -1404,97 +1048,109 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.14.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", - "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", "dev": true, "dependencies": { - "@babel/types": "^7.3.0" + "@babel/types": "^7.20.7" } }, "node_modules/@types/bluebird": { - "version": "3.5.33", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.33.tgz", - "integrity": "sha512-ndEo1xvnYeHxm7I/5sF6tBvnsA4Tdi3zj1keRKRs12SP+2ye2A27NDJ1B6PqkfMbGAcT+mqQVqbZRIrhfOp5PQ==", + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.42.tgz", + "integrity": "sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==", "dev": true }, "node_modules/@types/graceful-fs": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", - "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true }, "node_modules/@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "node_modules/@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, "dependencies": { "@types/istanbul-lib-report": "*" } }, "node_modules/@types/jest": { - "version": "29.5.7", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.7.tgz", - "integrity": "sha512-HLyetab6KVPSiF+7pFcUyMeLsx25LDNDemw9mGsJBkai/oouwrjTycocSDYopMEwFhN2Y4s9oPyOCZNofgSt2g==", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, "dependencies": { "expect": "^29.0.0", "pretty-format": "^29.0.0" } }, + "node_modules/@types/json-diff": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/json-diff/-/json-diff-1.0.3.tgz", + "integrity": "sha512-Qvxm8fpRMv/1zZR3sQWImeRK2mBYJji20xF51Fq9Gt//Ed18u0x6/FNLogLS1xhfUWTEmDyqveJqn95ltB6Kvw==", + "dev": true + }, "node_modules/@types/node": { - "version": "20.8.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz", - "integrity": "sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==", + "version": "20.16.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.1.tgz", + "integrity": "sha512-zJDo7wEadFtSyNz5QITDfRcrhqDvQI1xQNQ0VoizPjM/dVAODqqIUWbJPkvsxmTI0MYRGRikcdjMPhOssnPejQ==", "dev": true, "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true + }, "node_modules/@types/stack-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.2.tgz", - "integrity": "sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, "node_modules/@types/yargs": { - "version": "17.0.30", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.30.tgz", - "integrity": "sha512-3SJLzYk3yz3EgI9I8OLoH06B3PdXIoU2imrBZzaGqUtUXf5iUNDtmAfCGuQrny1bnmyjh/GM/YNts6WK5jR5Rw==", + "version": "17.0.33", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", + "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { - "version": "21.0.2", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.2.tgz", - "integrity": "sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw==", + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1503,6 +1159,18 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", + "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", + "dev": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -1543,9 +1211,9 @@ } }, "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", @@ -1570,17 +1238,23 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", - "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.5.tgz", + "integrity": "sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -1598,6 +1272,27 @@ "axios": ">= 0.17.0" } }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", @@ -1614,31 +1309,81 @@ "node": ">=8" } }, - "node_modules/babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "dependencies": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "engines": { + "node": ">=8" } }, - "node_modules/balanced-match": { - "version": "1.0.2", + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", + "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true @@ -1659,38 +1404,47 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" } }, "node_modules/browserslist": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", - "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "caniuse-lite": "^1.0.30001286", - "electron-to-chromium": "^1.4.17", - "escalade": "^3.1.1", - "node-releases": "^2.0.1", - "picocolors": "^1.0.0" + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" }, "bin": { "browserslist": "cli.js" }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" } }, "node_modules/bs-logger": { @@ -1721,12 +1475,18 @@ "dev": true }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1751,14 +1511,24 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001311", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001311.tgz", - "integrity": "sha512-mleTFtFKfykEeW34EyfhGIFjGCqzhh38Y0LhdQ9aWF+HorZTtdgKV/1hEE0NlFkG2ubvisPV6l400tlbPys98A==", + "version": "1.0.30001653", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001653.tgz", + "integrity": "sha512-XGWQVB8wFQ2+9NZwZ10GxTYC5hk0Fa+q8cSkr0tgvMhYhMHP/QC+WTgrePMDBWiWc/pV+1ik82Al20XOK25Gcw==", "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - } + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] }, "node_modules/chalk": { "version": "4.1.2", @@ -1786,25 +1556,34 @@ } }, "node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==", - "dev": true + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } }, "node_modules/cjs-module-lexer": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", - "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.0.tgz", + "integrity": "sha512-N1NGmowPlGBLsOZLPvm48StN04V4YvQRL0i6b7ctrVY3epjP/ct7hFLOItz6pDIvRjwpfPxi52a2UWV2ziir8g==", "dev": true }, "node_modules/cli-color": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.1.tgz", - "integrity": "sha512-eBbxZF6fqPUNnf7CLAFOersUnyYzv83tHFLSlts+OAHsNendaqv2tHCq+/MO+b3Y+9JeoUlIvobyxG/Z8GNeOg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.4.tgz", + "integrity": "sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA==", "dev": true, "dependencies": { "d": "^1.0.1", - "es5-ext": "^0.10.53", + "es5-ext": "^0.10.64", "es6-iterator": "^2.0.3", "memoizee": "^0.4.15", "timers-ext": "^0.1.7" @@ -1875,17 +1654,14 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "node_modules/convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true }, "node_modules/create-jest": { "version": "29.7.0", @@ -1929,19 +1705,22 @@ } }, "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", + "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", "dev": true, "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" + "es5-ext": "^0.10.64", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.12" } }, "node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -1956,9 +1735,9 @@ } }, "node_modules/dedent": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", - "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", + "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", "dev": true, "peerDependencies": { "babel-plugin-macros": "^3.1.0" @@ -1978,10 +1757,26 @@ "node": ">=0.10.0" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "engines": { "node": ">=0.4.0" } @@ -2016,7 +1811,7 @@ "node_modules/difflib": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz", - "integrity": "sha1-teMDYabbAjF21WKJLbhZQKcY9H4=", + "integrity": "sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==", "dev": true, "dependencies": { "heap": ">= 0.2.0" @@ -2028,7 +1823,7 @@ "node_modules/dreamopt": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/dreamopt/-/dreamopt-0.8.0.tgz", - "integrity": "sha1-W8yAvnCX5F/EicNCQFq2gUCowdk=", + "integrity": "sha512-vyJTp8+mC+G+5dfgsY+r3ckxlz+QMX40VjPQsZc5gxVAxLmi64TBoVkP54A/pRAXMXsbu2GMMBrZPxNv23waMg==", "dev": true, "dependencies": { "wordwrap": ">=0.0.2" @@ -2037,10 +1832,25 @@ "node": ">=0.4.0" } }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dev": true, + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/electron-to-chromium": { - "version": "1.4.68", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.68.tgz", - "integrity": "sha512-cId+QwWrV8R1UawO6b9BR1hnkJ4EJPCPAr4h315vliHUtVUJDk39Sg1PMNnaWKfj5x+93ssjeJ9LKL6r8LaMiA==", + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz", + "integrity": "sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==", "dev": true }, "node_modules/emittery": { @@ -2070,21 +1880,45 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", "dev": true, + "hasInstallScript": true, "dependencies": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.10" } }, "node_modules/es6-iterator": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", "dev": true, "dependencies": { "d": "1", @@ -2093,13 +1927,16 @@ } }, "node_modules/es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz", + "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==", "dev": true, "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" + "d": "^1.0.2", + "ext": "^1.7.0" + }, + "engines": { + "node": ">=0.12" } }, "node_modules/es6-weak-map": { @@ -2183,9 +2020,9 @@ } }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, "engines": { "node": ">=6" @@ -2200,6 +2037,21 @@ "node": ">=8" } }, + "node_modules/esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "dev": true, + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -2216,7 +2068,7 @@ "node_modules/event-emitter": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", "dev": true, "dependencies": { "d": "1", @@ -2272,20 +2124,14 @@ } }, "node_modules/ext": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", - "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", + "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", "dev": true, "dependencies": { - "type": "^2.5.0" + "type": "^2.7.2" } }, - "node_modules/ext/node_modules/type": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz", - "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==", - "dev": true - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2299,18 +2145,48 @@ "dev": true }, "node_modules/fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "dependencies": { "bser": "2.1.1" } }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -2333,9 +2209,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", @@ -2367,13 +2243,13 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -2411,13 +2287,18 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2445,15 +2326,16 @@ } }, "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -2473,23 +2355,23 @@ "node": ">=4" } }, - "node_modules/graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", - "dev": true - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dependencies": { - "function-bind": "^1.1.1" + "get-intrinsic": "^1.1.3" }, - "engines": { - "node": ">= 0.4.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2499,6 +2381,28 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -2511,10 +2415,9 @@ } }, "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dev": true, + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dependencies": { "function-bind": "^1.1.2" }, @@ -2544,9 +2447,9 @@ } }, "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", "dev": true, "dependencies": { "pkg-dir": "^4.2.0", @@ -2565,7 +2468,7 @@ "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { "node": ">=0.8.19" @@ -2574,7 +2477,8 @@ "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "dependencies": { "once": "^1.3.0", @@ -2617,12 +2521,15 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dev": true, "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2680,28 +2587,40 @@ "dev": true }, "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-instrument": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz", - "integrity": "sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" + "semver": "^7.5.4" }, "engines": { - "node": ">=8" + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/istanbul-lib-report": { @@ -2733,9 +2652,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", @@ -2745,6 +2664,24 @@ "node": ">=8" } }, + "node_modules/jake": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", + "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", + "dev": true, + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", @@ -2785,25 +2722,10 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-changed-files/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/jest-circus": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", - "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "dependencies": { "@jest/environment": "^29.7.0", @@ -2831,21 +2753,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-circus/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/jest-cli": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", @@ -2924,167 +2831,6 @@ } } }, - "node_modules/jest-config/node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-config/node_modules/babel-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", - "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", - "dev": true, - "dependencies": { - "@jest/transform": "^29.7.0", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.6.3", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.8.0" - } - }, - "node_modules/jest-config/node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", - "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", - "dev": true, - "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-config/node_modules/babel-preset-jest": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", - "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", - "dev": true, - "dependencies": { - "babel-plugin-jest-hoist": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/jest-config/node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "node_modules/jest-config/node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/jest-config/node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-config/node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-config/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/jest-config/node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/jest-diff": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", @@ -3154,6 +2900,31 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, "node_modules/jest-leak-detector": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", @@ -3233,6 +3004,15 @@ } } }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/jest-resolve": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", @@ -3266,103 +3046,30 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-resolve-dependencies/node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve/node_modules/jest-haste-map": { + "node_modules/jest-runner": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", + "chalk": "^4.0.0", + "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/jest-resolve/node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve/node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/jest-runner": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", - "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", - "dev": true, - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/environment": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-leak-detector": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-resolve": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-util": "^29.7.0", - "jest-watcher": "^29.7.0", + "jest-watcher": "^29.7.0", "jest-worker": "^29.7.0", "p-limit": "^3.1.0", "source-map-support": "0.5.13" @@ -3371,392 +3078,75 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-runner/node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runner/node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "node_modules/jest-runner/node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/jest-runner/node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runner/node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runner/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/jest-runner/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/jest-runner/node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/jest-runtime": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", - "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/globals": "^29.7.0", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0", - "strip-bom": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime/node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime/node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "node_modules/jest-runtime/node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/jest-runtime/node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime/node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/jest-runtime/node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/jest-snapshot": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", - "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "natural-compare": "^1.4.0", - "pretty-format": "^29.7.0", - "semver": "^7.5.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "node_modules/jest-snapshot/node_modules/jest-haste-map": { + "node_modules/jest-runtime": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", "dev": true, "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "slash": "^3.0.0", + "strip-bom": "^4.0.0" }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/jest-snapshot/node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-snapshot/node_modules/jest-worker": { + "node_modules/jest-snapshot": { "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "dependencies": { - "@types/node": "*", + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -3764,34 +3154,6 @@ "node": ">=10" } }, - "node_modules/jest-snapshot/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/jest-snapshot/node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/jest-util": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", @@ -3857,6 +3219,36 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3889,9 +3281,9 @@ } }, "node_modules/json-diff": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/json-diff/-/json-diff-0.7.1.tgz", - "integrity": "sha512-/LxjcgeDIZwFB1HHTShKAYs2NaxAgwUQjXKvrFLDvw3KqvbffFmy5ZeeamxoSLgQG89tRs9+CFKiR3lJAPPhDw==", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/json-diff/-/json-diff-0.7.4.tgz", + "integrity": "sha512-FJ2P+ShDbzu9epF+kCKgoSUhPIUW7Ta7A4XlIT0L5LzgaR/z1TBF1mm0XhRGj8RlA3Xm0j+c/FsWOHDtuoYejA==", "dev": true, "dependencies": { "cli-color": "^2.0.0", @@ -3962,25 +3354,22 @@ "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", "dev": true }, "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" + "yallist": "^3.0.2" } }, "node_modules/lru-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", - "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==", "dev": true, "dependencies": { "es5-ext": "~0.10.2" @@ -4002,13 +3391,10 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -4032,27 +3418,24 @@ } }, "node_modules/memoizee": { - "version": "0.4.15", - "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", - "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", + "version": "0.4.17", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.17.tgz", + "integrity": "sha512-DGqD7Hjpi/1or4F/aYAspXKNm5Yili0QDAFAY4QYvpqpgiY6+1jOfqpmByzjxbWd/T9mChbCArXAbDAsTm5oXA==", "dev": true, "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.53", + "d": "^1.0.2", + "es5-ext": "^0.10.64", "es6-weak-map": "^2.0.3", "event-emitter": "^0.3.5", "is-promise": "^2.2.2", "lru-queue": "^0.1.0", "next-tick": "^1.1.0", "timers-ext": "^0.1.7" + }, + "engines": { + "node": ">=0.12" } }, - "node_modules/memoizee/node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", - "dev": true - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -4060,32 +3443,32 @@ "dev": true }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" } }, "node_modules/mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dependencies": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" @@ -4101,9 +3484,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -4125,21 +3508,21 @@ "dev": true }, "node_modules/next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "dev": true }, "node_modules/node-releases": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", - "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==", + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", "dev": true }, "node_modules/normalize-path": { @@ -4164,9 +3547,12 @@ } }, "node_modules/object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4174,7 +3560,7 @@ "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "dependencies": { "wrappy": "1" @@ -4196,15 +3582,15 @@ } }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4222,6 +3608,21 @@ "node": ">=8" } }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -4261,7 +3662,7 @@ "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4283,9 +3684,9 @@ "dev": true }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", "dev": true }, "node_modules/picomatch": { @@ -4301,9 +3702,9 @@ } }, "node_modules/pirates": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", - "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, "engines": { "node": ">= 6" @@ -4333,6 +3734,26 @@ "node": ">=10.13.0" } }, + "node_modules/prettier-plugin-organize-imports": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.0.0.tgz", + "integrity": "sha512-vnKSdgv9aOlqKeEFGhf9SCBsTyzDSyScy1k7E0R1Uo4L0cTcOV7c1XQaT7jfXIOc/p08WLBfN2QUQA9zDSZMxA==", + "dev": true, + "peerDependencies": { + "@vue/language-plugin-pug": "^2.0.24", + "prettier": ">=2.0", + "typescript": ">=2.9", + "vue-tsc": "^2.0.24" + }, + "peerDependenciesMeta": { + "@vue/language-plugin-pug": { + "optional": true + }, + "vue-tsc": { + "optional": true + } + } + }, "node_modules/pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", @@ -4378,9 +3799,9 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/pure-rand": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", - "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", "dev": true, "funding": [ { @@ -4394,11 +3815,11 @@ ] }, "node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -4408,9 +3829,9 @@ } }, "node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, "node_modules/require-directory": { @@ -4469,12 +3890,6 @@ "node": ">=10" } }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -4484,6 +3899,22 @@ "semver": "bin/semver.js" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -4506,13 +3937,17 @@ } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4561,7 +3996,7 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, "node_modules/stack-utils": { @@ -4684,13 +4119,16 @@ } }, "node_modules/timers-ext": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", - "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.8.tgz", + "integrity": "sha512-wFH7+SEAcKfJpfLPkrgMPvvwnEtj8W4IurvEyrKsDleXnKLCDw71w8jltvfLa8Rm4qQxxT4jmDBYbJG/z7qoww==", "dev": true, "dependencies": { - "es5-ext": "~0.10.46", - "next-tick": "1" + "es5-ext": "^0.10.64", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.12" } }, "node_modules/tmpl": { @@ -4702,7 +4140,7 @@ "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, "engines": { "node": ">=4" @@ -4721,28 +4159,30 @@ } }, "node_modules/ts-jest": { - "version": "29.1.1", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", - "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", + "version": "29.2.5", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", + "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", "dev": true, "dependencies": { - "bs-logger": "0.x", - "fast-json-stable-stringify": "2.x", + "bs-logger": "^0.2.6", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "^2.1.0", "jest-util": "^29.0.0", "json5": "^2.2.3", - "lodash.memoize": "4.x", - "make-error": "1.x", - "semver": "^7.5.3", - "yargs-parser": "^21.0.1" + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.6.3", + "yargs-parser": "^21.1.1" }, "bin": { "ts-jest": "cli.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", "@jest/types": "^29.0.0", "babel-jest": "^29.0.0", "jest": "^29.0.0", @@ -4752,6 +4192,9 @@ "@babel/core": { "optional": true }, + "@jest/transform": { + "optional": true + }, "@jest/types": { "optional": true }, @@ -4764,13 +4207,10 @@ } }, "node_modules/ts-jest/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -4779,9 +4219,9 @@ } }, "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", @@ -4821,19 +4261,10 @@ } } }, - "node_modules/ts-node/node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", "dev": true }, "node_modules/type-detect": { @@ -4858,24 +4289,54 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "dev": true }, + "node_modules/update-browserslist-db": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -4883,9 +4344,9 @@ "dev": true }, "node_modules/v8-to-istanbul": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", - "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", @@ -4896,12 +4357,6 @@ "node": ">=10.12.0" } }, - "node_modules/v8-to-istanbul/node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -4929,7 +4384,7 @@ "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", "dev": true }, "node_modules/wrap-ansi": { @@ -4952,9 +4407,22 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -4965,9 +4433,9 @@ } }, "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, "node_modules/yargs": { diff --git a/sdks/node/package.json b/sdks/node/package.json index b27f4f763..2468838c0 100644 --- a/sdks/node/package.json +++ b/sdks/node/package.json @@ -1,6 +1,6 @@ { "name": "@dropbox/sign", - "version": "1.5-dev", + "version": "1.6-dev", "description": "Official Node client for Dropbox Sign", "repository": { "type": "git", @@ -18,22 +18,25 @@ }, "author": "Dropbox Sign", "dependencies": { - "axios": "^1.6.0", - "bluebird": "^3.5.0", + "axios": "^1.7.0", + "bluebird": "^3.7.2", "form-data": "^4.0.0", "qs": "^6.10.3" }, "devDependencies": { - "@types/bluebird": "3.5.33", + "@types/bluebird": "^3.5.33", "@types/jest": "^29.5.7", + "@types/json-diff": "^1.0.3", "@types/node": "^20.8.10", + "@types/qs": "^6.9.15", "axios-mock-adapter": "^1.20.0", "esbuild": "^0.14.54", "jest": "^29.7.0", "json-diff": "^0.7.1", "prettier": "2.5.1", + "prettier-plugin-organize-imports": "^4.0.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^4.3.0" + "typescript": "^4.0 || ^5.0" } } diff --git a/sdks/node/run-build b/sdks/node/run-build index d9f8594fd..9bf210d4a 100755 --- a/sdks/node/run-build +++ b/sdks/node/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/1314e229f58cf056850dc912bbf55e49bcda2db8/modules/openapi-generator/src/main/resources/typescript-node +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/typescript-node set -e @@ -11,7 +11,7 @@ WORKING_DIR="/app/javascript" docker run --rm \ -v "${DIR}/:/local" \ --user "$(id -u):$(id -g)" \ - openapitools/openapi-generator-cli:v5.3.0 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ @@ -28,7 +28,7 @@ mkdir -p "${DIR}/tmp_docs" docker run --rm \ -v "${DIR}/:/local" \ --user "$(id -u):$(id -g)" \ - openapitools/openapi-generator-cli:v5.3.0 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ @@ -49,7 +49,7 @@ mkdir -p "${DIR}/tmp_docs" docker run --rm \ -v "${DIR}/:/local" \ --user "$(id -u):$(id -g)" \ - openapitools/openapi-generator-cli:v5.3.0 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ diff --git a/sdks/node/templates/api-all.mustache b/sdks/node/templates/api-all.mustache index c986da7d7..bdf5c7c1d 100644 --- a/sdks/node/templates/api-all.mustache +++ b/sdks/node/templates/api-all.mustache @@ -1,38 +1,58 @@ {{#apiInfo}} -import { AttributeTypeMap, ObjectSerializer, RequestDetailedFile } from "../model"; +{{^useCustomTemplateCode}} +{{#apis}} +{{#operations}} +export * from './{{ classFilename }}'; +import { {{ classname }} } from './{{ classFilename }}'; +{{/operations}} +{{#withInterfaces}} +export * from './{{ classFilename }}Interface' +{{/withInterfaces}} +{{/apis}} +{{/useCustomTemplateCode}} import * as http from 'http'; -import { AxiosResponse } from "axios"; -import formData from "form-data"; -import Qs from "qs"; +{{#useCustomTemplateCode}} +import { ErrorResponse } from "../model"; +{{/useCustomTemplateCode}} export class HttpError extends Error { - constructor (public response: AxiosResponse, public body: any, public statusCode?: number) { +{{^useCustomTemplateCode}} + constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + constructor (public response: AxiosResponse, public body: ErrorResponse, public statusCode?: number) { +{{/useCustomTemplateCode}} super('HTTP request failed'); this.name = 'HttpError'; } } -export interface optionsI { - headers: { [name: string]: string } -} +{{^useCustomTemplateCode}} +export { RequestFile } from '../model/models'; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +export { RequestFile } from '../model'; +{{/useCustomTemplateCode}} -export interface returnTypeT { - response: AxiosResponse, - body: T, -} +{{^useCustomTemplateCode}} +export const APIS = [{{#apis}}{{#operations}}{{ classname }}{{/operations}}{{^-last}}, {{/-last}}{{/apis}}]; +{{/useCustomTemplateCode}} +{{/apiInfo}} -export interface returnTypeI { - response: AxiosResponse, - body?: any, -} +{{#useCustomTemplateCode}} +import { AxiosResponse } from "axios"; +import { AttributeTypeMap, ObjectSerializer, RequestDetailedFile } from "../model"; +import formData from "form-data"; +import Qs from "qs"; + +export interface optionsI { headers: { [name: string]: string } } +export interface returnTypeT { response: AxiosResponse, body: T } +export interface returnTypeI { response: AxiosResponse, body?: any } export const queryParamsSerializer = (params) => { return Qs.stringify(params, { arrayFormat: 'brackets' }) } -export { RequestFile } from '../model'; -{{/apiInfo}} - export const USER_AGENT = "OpenAPI-Generator/{{{npmVersion}}}/node"; /** @@ -153,3 +173,4 @@ function isBufferDetailedFile(obj: any): obj is RequestDetailedFile { } const shouldJsonify = (val: any): boolean => val === Object(val); +{{/useCustomTemplateCode}} diff --git a/sdks/node/templates/api-single.mustache b/sdks/node/templates/api-single.mustache index cf81db291..cd57b314c 100644 --- a/sdks/node/templates/api-single.mustache +++ b/sdks/node/templates/api-single.mustache @@ -1,19 +1,41 @@ {{>licenseInfo}} - -import axios, { AxiosError, AxiosRequestConfig } from 'axios'; +{{^useCustomTemplateCode}} +import localVarRequest from 'request'; +import http from 'http'; /* tslint:disable:no-unused-locals */ +{{#imports}} +import { {{classname}} } from '{{filename}}'; +{{/imports}} + +import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; +{{#hasAuthMethods}} +import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; +{{/hasAuthMethods}} + +import { HttpError, RequestFile } from './apis'; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; +import http from 'http'; + import { ObjectSerializer, Authentication, VoidAuth, Interceptor, -{{#hasAuthMethods}} HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, -{{/hasAuthMethods}} -{{#imports}} - {{classname}}, -{{/imports}} + {{#imports}}{{classname}},{{/imports}} } from '../model'; -import { HttpError, optionsI, returnTypeT, returnTypeI, generateFormData, toFormData, queryParamsSerializer, USER_AGENT } from './'; +import { + HttpError, + optionsI, + returnTypeT, + returnTypeI, + generateFormData, + toFormData, + queryParamsSerializer, + USER_AGENT, +} from './'; +{{/useCustomTemplateCode}} let defaultBasePath = '{{{basePath}}}'; @@ -37,9 +59,12 @@ export enum {{classname}}ApiKeys { export class {{classname}} { protected _basePath = defaultBasePath; - protected _defaultHeaders: any = { - 'User-Agent': USER_AGENT, - }; +{{^useCustomTemplateCode}} + protected _defaultHeaders : any = {}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + protected _defaultHeaders : any = { 'User-Agent': USER_AGENT }; +{{/useCustomTemplateCode}} protected _useQuerystring : boolean = false; protected authentications = { @@ -64,11 +89,38 @@ export class {{classname}} { protected interceptors: Interceptor[] = []; +{{^useCustomTemplateCode}} + constructor(basePath?: string); +{{#authMethods}} +{{#isBasicBasic}} + constructor(username: string, password: string, basePath?: string); +{{/isBasicBasic}} +{{/authMethods}} + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { +{{#authMethods}} +{{#isBasicBasic}} + this.username = basePathOrUsername; + this.password = password +{{/isBasicBasic}} +{{/authMethods}} + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} constructor(basePath?: string) { if (basePath) { this.basePath = basePath; } } +{{/useCustomTemplateCode}} set useQuerystring(value: boolean) { this._useQuerystring = value; @@ -79,7 +131,12 @@ export class {{classname}} { } set defaultHeaders(defaultHeaders: any) { +{{^useCustomTemplateCode}} this._defaultHeaders = defaultHeaders; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT }; +{{/useCustomTemplateCode}} } get defaultHeaders() { @@ -94,9 +151,16 @@ export class {{classname}} { this.authentications.default = auth; } +{{^useCustomTemplateCode}} + public setApiKey(key: {{classname}}ApiKeys, value: string) { + (this.authentications as any)[{{classname}}ApiKeys[key]].apiKey = value; + } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public setApiKey(key: string) { this.authentications.api_key.username = key; } +{{/useCustomTemplateCode}} {{#hasAuthMethods}} {{#authMethods}} {{#isBasicBasic}} @@ -137,15 +201,19 @@ export class {{classname}} { {{#allParams}} * @param {{paramName}} {{description}} {{/allParams}} +{{#useCustomTemplateCode}} * @param options +{{/useCustomTemplateCode}} */ +{{^useCustomTemplateCode}} + public async {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; {{#returnType}}body: {{{.}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public async {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: optionsI = {headers: {}}) : Promise<{{#returnType}}returnTypeT<{{{.}}}>{{/returnType}}{{^returnType}}returnTypeI{{/returnType}}> { - {{#bodyParam}} - if (({{paramName}} !== null && {{paramName}} !== undefined) && {{{paramName}}}.constructor.name !== "{{{dataType}}}") { - {{{paramName}}} = ObjectSerializer.deserialize({{{paramName}}}, "{{{dataType}}}"); - } - {{/bodyParam}} - +{{#bodyParam}} + {{{paramName}}} = deserializeIfNeeded({{paramName}}, "{{{dataType}}}"); +{{/bodyParam}} +{{/useCustomTemplateCode}} const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}} .replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; let localVarQueryParameters: any = {}; @@ -153,14 +221,25 @@ export class {{classname}} { {{#hasProduces}} const produces = [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}]; // give precedence to 'application/json' +{{^useCustomTemplateCode}} + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if (produces.indexOf('application/json') >= 0) { localVarHeaderParams['content-type'] = 'application/json'; } else { - localVarHeaderParams['content-type'] = produces.join(","); + localVarHeaderParams['content-type'] = produces.join(','); } +{{/useCustomTemplateCode}} {{/hasProduces}} let localVarFormParams: any = {}; +{{#useCustomTemplateCode}} let localVarBodyParams: any = undefined; +{{/useCustomTemplateCode}} {{#allParams}} {{#required}} @@ -198,7 +277,24 @@ export class {{classname}} { {{/isFile}} {{/formParams}} - +{{^useCustomTemplateCode}} + let localVarRequestOptions: localVarRequest.Options = { + method: '{{httpMethod}}', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, +{{^isResponseFile}} + json: true, +{{/isResponseFile}} +{{#isResponseFile}} + encoding: null, +{{/isResponseFile}} +{{#bodyParam}} + body: ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}") +{{/bodyParam}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#bodyParam}} const result = generateFormData({{{paramName}}}, {{{dataType}}}.attributeTypeMap); localVarUseFormData = result.localVarUseFormData; @@ -236,6 +332,7 @@ export class {{classname}} { {{#bodyParam}} data, {{/bodyParam}} +{{/useCustomTemplateCode}} }; let authenticationPromise = Promise.resolve(); @@ -246,7 +343,12 @@ export class {{classname}} { } {{/isApiKey}} {{#isBasicBasic}} +{{^useCustomTemplateCode}} + if (this.authentications.{{name}}.username && this.authentications.{{name}}.password) { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if (this.authentications.{{name}}.username) { +{{/useCustomTemplateCode}} authenticationPromise = authenticationPromise.then(() => this.authentications.{{name}}.applyToRequest(localVarRequestOptions)); } {{/isBasicBasic}} @@ -269,41 +371,58 @@ export class {{classname}} { } return interceptorPromise.then(() => { - return new Promise<{{#returnType}}returnTypeT<{{{.}}}>{{/returnType}}{{^returnType}}returnTypeI{{/returnType}}>((resolve, reject) => { - axios.request(localVarRequestOptions) - .then((response) => { - let body = response.data; - - if (response.status && response.status >= 200 && response.status <= 299) { +{{^useCustomTemplateCode}} + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; {{#returnType}}body: {{{.}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { {{#returnType}} body = ObjectSerializer.deserialize(body, "{{{.}}}"); {{/returnType}} resolve({ response: response, body: body }); } else { - reject(new HttpError(response, body, response.status)); + reject(new HttpError(response, body, response.statusCode)); } + } + }); + }); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + return new Promise<{{#returnType}}returnTypeT<{{{.}}}>{{/returnType}}{{^returnType}}returnTypeI{{/returnType}}>((resolve, reject) => { + axios.request(localVarRequestOptions) + .then((response) => { + handleSuccessfulResponse{{#returnType}}<{{{.}}}>{{/returnType}}( + resolve, + reject, + response, + {{#returnType}}"{{{.}}}",{{/returnType}} + ); }, (error: AxiosError) => { if (error.response == null) { reject(error); return; } - const response = error.response; - - let body; - {{#responses}} {{#dataType}} {{^isWildcard}} {{^isRange}} - if (response.status === {{code}}) { - body = ObjectSerializer.deserialize( - response.data, - "{{{dataType}}}" - ); - - reject(new HttpError(response, body, response.status)); - return; + if (handleErrorCodeResponse( + reject, + error.response, + {{code}}, + "{{{dataType}}}", + )) { + return; } {{/isRange}} {{/isWildcard}} @@ -313,40 +432,106 @@ export class {{classname}} { {{#responses}} {{#dataType}} {{#isRange}} - let rangeCodeLeft = Number("{{code}}"[0] + "00"); - let rangeCodeRight = Number("{{code}}"[0] + "99"); - if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) { - body = ObjectSerializer.deserialize( - response.data, - "{{{dataType}}}" - ); - - reject(new HttpError(response, body, response.status)); - return; + if (handleErrorRangeResponse( + reject, + error.response, + "{{code}}", + "{{{dataType}}}", + )) { + return; } {{/isRange}} {{/dataType}} {{/responses}} - {{#responses}} - {{#dataType}} - {{#isWildcard}} - body = ObjectSerializer.deserialize( - response.data.error, - "{{{dataType}}}" - ); - - reject(new HttpError(response, response.data, response.status)); - return; - {{/isWildcard}} - {{/dataType}} - {{/responses}} - reject(error); }); }); +{{/useCustomTemplateCode}} }); } {{/operation}} } +{{#useCustomTemplateCode}} + +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; +} +{{/useCustomTemplateCode}} {{/operations}} diff --git a/sdks/node/templates/api.mustache b/sdks/node/templates/api.mustache index 1b3c2c525..cb7a86d30 100644 --- a/sdks/node/templates/api.mustache +++ b/sdks/node/templates/api.mustache @@ -1,3 +1,13 @@ // This is the entrypoint for the package +{{^useCustomTemplateCode}} +export * from './api/apis'; +{{#models.0}} +export * from './model/models'; +{{/models.0}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} export * from './api/index'; +{{#models.0}} export * from './model/index'; +{{/models.0}} +{{/useCustomTemplateCode}} diff --git a/sdks/node/templates/gitignore b/sdks/node/templates/gitignore index 78cc8efe1..9954e5824 100644 --- a/sdks/node/templates/gitignore +++ b/sdks/node/templates/gitignore @@ -1,10 +1,12 @@ wwwroot/*.js node_modules typings +dist +# CUSTOM - BEGIN test.* *.tgz .openapi-generator - .composer tmp_docs vendor +# CUSTOM - END diff --git a/sdks/node/templates/licenseInfo.mustache b/sdks/node/templates/licenseInfo.mustache index c68eee184..c02a394af 100644 --- a/sdks/node/templates/licenseInfo.mustache +++ b/sdks/node/templates/licenseInfo.mustache @@ -1,3 +1,17 @@ +{{^useCustomTemplateCode}} +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} /** * The MIT License (MIT) * @@ -21,3 +35,4 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +{{/useCustomTemplateCode}} diff --git a/sdks/node/templates/model.mustache b/sdks/node/templates/model.mustache index e337b5863..a55b8f195 100644 --- a/sdks/node/templates/model.mustache +++ b/sdks/node/templates/model.mustache @@ -1,7 +1,12 @@ {{>licenseInfo}} {{#models}} {{#model}} +{{^useCustomTemplateCode}} +import { RequestFile } from './models'; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} import { RequestFile, AttributeTypeMap, ObjectSerializer } from './'; +{{/useCustomTemplateCode}} {{#tsImports}} import { {{classname}} } from '{{filename}}'; {{/tsImports}} @@ -12,14 +17,24 @@ import { {{classname}} } from '{{filename}}'; */ {{/description}} {{^isEnum}} +{{^useCustomTemplateCode}} +export class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{ +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} export {{#vendorExtensions.x-base-class}}abstract {{/vendorExtensions.x-base-class}}class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{ +{{/useCustomTemplateCode}} {{#vars}} {{#description}} /** * {{{.}}} */ {{/description}} +{{^useCustomTemplateCode}} + '{{name}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}{{#defaultValue}} = {{#isEnum}}{{classname}}.{{/isEnum}}{{{.}}}{{/defaultValue}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} '{{name}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{#vendorExtensions.x-int-or-string}}number | string{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; +{{/useCustomTemplateCode}} {{/vars}} {{#discriminator}} @@ -30,7 +45,12 @@ export {{#vendorExtensions.x-base-class}}abstract {{/vendorExtensions.x-base-cla {{/discriminator}} {{^isArray}} +{{^useCustomTemplateCode}} + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} static attributeTypeMap: AttributeTypeMap = [ +{{/useCustomTemplateCode}} {{#vars}} { "name": "{{name}}", @@ -41,7 +61,12 @@ export {{#vendorExtensions.x-base-class}}abstract {{/vendorExtensions.x-base-cla {{/vars}} ]; +{{^useCustomTemplateCode}} + static getAttributeTypeMap() { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} static getAttributeTypeMap(): AttributeTypeMap { +{{/useCustomTemplateCode}} {{#parent}} return super.getAttributeTypeMap().concat({{classname}}.attributeTypeMap); {{/parent}} @@ -49,6 +74,7 @@ export {{#vendorExtensions.x-base-class}}abstract {{/vendorExtensions.x-base-cla return {{classname}}.attributeTypeMap; {{/parent}} } +{{#useCustomTemplateCode}} {{#discriminator}} static discriminatorClassName(value: any): string | null { @@ -71,6 +97,7 @@ export {{#vendorExtensions.x-base-class}}abstract {{/vendorExtensions.x-base-cla return ObjectSerializer.deserialize(data, '{{classname}}'); } {{/discriminator}} +{{/useCustomTemplateCode}} {{/isArray}} } @@ -81,7 +108,12 @@ export namespace {{classname}} { export enum {{enumName}} { {{#allowableValues}} {{#enumVars}} +{{^useCustomTemplateCode}} + {{name}} = {{{value}}}{{^-last}},{{/-last}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{name}} = {{{value}}}{{^-last}},{{/-last}} +{{/useCustomTemplateCode}} {{/enumVars}} {{/allowableValues}} } @@ -94,7 +126,12 @@ export namespace {{classname}} { export enum {{classname}} { {{#allowableValues}} {{#enumVars}} +{{^useCustomTemplateCode}} + {{name}} = {{{value}}}{{^-last}},{{/-last}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{name}} = {{{value}}}{{^-last}},{{/-last}} +{{/useCustomTemplateCode}} {{/enumVars}} {{/allowableValues}} } diff --git a/sdks/node/templates/models.mustache b/sdks/node/templates/models.mustache index dc7cdbfbb..8443f9341 100644 --- a/sdks/node/templates/models.mustache +++ b/sdks/node/templates/models.mustache @@ -1,8 +1,29 @@ +{{^useCustomTemplateCode}} {{#generateApis}} -import { AxiosRequestConfig } from 'axios'; +import localVarRequest from 'request'; {{/generateApis}} + +{{#models}} +{{#model}} +export * from '{{{ classFilename }}}'; +{{/model}} +{{/models}} + import * as fs from 'fs'; +export interface RequestDetailedFile { + value: Buffer; + options?: { + filename?: string; + contentType?: string; + } +} + +export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +import { AxiosRequestConfig } from 'axios'; +import * as fs from 'fs'; import { enumsMap, typeMap } from "./"; import { Headers } from "form-data"; @@ -17,8 +38,6 @@ export interface RequestDetailedFile { }; } -export type RequestFile = fs.ReadStream | RequestDetailedFile; - interface AttributeType { name: string; baseName: string; @@ -27,9 +46,20 @@ interface AttributeType { export interface AttributeTypeMap extends Array{} +export type RequestFile = fs.ReadStream | RequestDetailedFile; +{{/useCustomTemplateCode}} + {{! Object serialization only relevant if generating APIs, too }} {{#generateApis}} +{{^useCustomTemplateCode}} +{{#models}} +{{#model}} +import { {{classname}} } from '{{{ classFilename }}}'; +{{/model}} +{{/models}} + +{{/useCustomTemplateCode}} /* tslint:disable:no-unused-variable */ let primitives = [ "string", @@ -42,6 +72,34 @@ let primitives = [ "any" ]; +{{^useCustomTemplateCode}} +let enumsMap: {[index: string]: any} = { + {{#models}} + {{#model}} + {{#hasEnums}} + {{#vars}} + {{#isEnum}} + {{#isContainer}}"{{classname}}.{{enumName}}": {{classname}}.{{enumName}}{{/isContainer}}{{^isContainer}}"{{datatypeWithEnum}}": {{datatypeWithEnum}}{{/isContainer}}, + {{/isEnum}} + {{/vars}} + {{/hasEnums}} + {{#isEnum}} + "{{classname}}": {{classname}}, + {{/isEnum}} + {{/model}} + {{/models}} +} + +let typeMap: {[index: string]: any} = { + {{#models}} + {{#model}} + {{^isEnum}} + "{{classname}}": {{classname}}, + {{/isEnum}} + {{/model}} + {{/models}} +} +{{/useCustomTemplateCode}} export class ObjectSerializer { public static findCorrectType(data: any, expectedType: string) { if (data == undefined) { @@ -61,6 +119,7 @@ export class ObjectSerializer { // Check the discriminator let discriminatorProperty = typeMap[expectedType].discriminator; +{{#useCustomTemplateCode}} let discriminatorValue = data[discriminatorProperty]; if (typeMap[expectedType].hasOwnProperty('discriminatorClassName')) { @@ -73,6 +132,7 @@ export class ObjectSerializer { } } +{{/useCustomTemplateCode}} if (discriminatorProperty == null) { return expectedType; // the type does not have a discriminator. use it. } else { @@ -122,12 +182,17 @@ export class ObjectSerializer { let instance: {[index: string]: any} = {}; for (let index = 0; index < attributeTypes.length; index++) { let attributeType = attributeTypes[index]; +{{^useCustomTemplateCode}} + instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} let value = ObjectSerializer.serialize(data[attributeType.name], attributeType.type); // Only add property if not null if (value !== undefined) { instance[attributeType.baseName] = value; } +{{/useCustomTemplateCode}} } return instance; } @@ -163,12 +228,16 @@ export class ObjectSerializer { let attributeTypes = typeMap[type].getAttributeTypeMap(); for (let index = 0; index < attributeTypes.length; index++) { let attributeType = attributeTypes[index]; - +{{^useCustomTemplateCode}} + instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} const propertyKey = data[attributeType.baseName] !== undefined ? attributeType.baseName : attributeType.name; instance[attributeType.name] = ObjectSerializer.deserialize(data[propertyKey], attributeType.type); +{{/useCustomTemplateCode}} } return instance; } @@ -179,14 +248,24 @@ export interface Authentication { /** * Apply authentication settings to header and query params. */ +{{^useCustomTemplateCode}} + applyToRequest(requestOptions: localVarRequest.Options): Promise | void; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} applyToRequest(requestOptions: AxiosRequestConfig): Promise | void; +{{/useCustomTemplateCode}} } export class HttpBasicAuth implements Authentication { public username: string = ''; public password: string = ''; +{{^useCustomTemplateCode}} + applyToRequest(requestOptions: localVarRequest.Options): void { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} applyToRequest(requestOptions: AxiosRequestConfig): void { +{{/useCustomTemplateCode}} requestOptions.auth = { username: this.username, password: this.password } @@ -196,7 +275,12 @@ export class HttpBasicAuth implements Authentication { export class HttpBearerAuth implements Authentication { public accessToken: string | (() => string) = ''; +{{^useCustomTemplateCode}} + applyToRequest(requestOptions: localVarRequest.Options): void { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} applyToRequest(requestOptions: AxiosRequestConfig): void { +{{/useCustomTemplateCode}} if (requestOptions && requestOptions.headers) { const accessToken = typeof this.accessToken === 'function' ? this.accessToken() @@ -212,9 +296,19 @@ export class ApiKeyAuth implements Authentication { constructor(private location: string, private paramName: string) { } +{{^useCustomTemplateCode}} + applyToRequest(requestOptions: localVarRequest.Options): void { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} applyToRequest(requestOptions: AxiosRequestConfig): void { +{{/useCustomTemplateCode}} if (this.location == "query") { +{{^useCustomTemplateCode}} + (requestOptions.qs)[this.paramName] = this.apiKey; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} (requestOptions.params)[this.paramName] = this.apiKey; +{{/useCustomTemplateCode}} } else if (this.location == "header" && requestOptions && requestOptions.headers) { requestOptions.headers[this.paramName] = this.apiKey; } else if (this.location == 'cookie' && requestOptions && requestOptions.headers) { @@ -231,7 +325,12 @@ export class ApiKeyAuth implements Authentication { export class OAuth implements Authentication { public accessToken: string = ''; +{{^useCustomTemplateCode}} + applyToRequest(requestOptions: localVarRequest.Options): void { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} applyToRequest(requestOptions: AxiosRequestConfig): void { +{{/useCustomTemplateCode}} if (requestOptions && requestOptions.headers) { requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; } @@ -242,10 +341,20 @@ export class VoidAuth implements Authentication { public username: string = ''; public password: string = ''; +{{^useCustomTemplateCode}} + applyToRequest(_: localVarRequest.Options): void { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} applyToRequest(_: AxiosRequestConfig): void { +{{/useCustomTemplateCode}} // Do nothing } } +{{^useCustomTemplateCode}} +export type Interceptor = (requestOptions: localVarRequest.Options) => (Promise | void); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} export type Interceptor = (requestOptions: AxiosRequestConfig) => (Promise | void); +{{/useCustomTemplateCode}} {{/generateApis}} diff --git a/sdks/node/templates/package.mustache b/sdks/node/templates/package.mustache index 14ae39057..ea815e46f 100644 --- a/sdks/node/templates/package.mustache +++ b/sdks/node/templates/package.mustache @@ -18,23 +18,26 @@ }, "author": "Dropbox Sign", "dependencies": { - "axios": "^1.6.0", - "bluebird": "^3.5.0", + "axios": "^1.7.0", + "bluebird": "^3.7.2", "form-data": "^4.0.0", "qs": "^6.10.3" }, "devDependencies": { - "@types/bluebird": "3.5.33", + "@types/bluebird": "^3.5.33", "@types/jest": "^29.5.7", + "@types/json-diff": "^1.0.3", "@types/node": "^20.8.10", + "@types/qs": "^6.9.15", "axios-mock-adapter": "^1.20.0", "esbuild": "^0.14.54", "jest": "^29.7.0", "json-diff": "^0.7.1", "prettier": "2.5.1", + "prettier-plugin-organize-imports": "^4.0.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^4.3.0" + "typescript": "^4.0 || ^5.0" }{{#npmRepository}}, "publishConfig": { "registry": "{{npmRepository}}" diff --git a/sdks/node/templates/prettierrc.cjs b/sdks/node/templates/prettierrc.cjs new file mode 100644 index 000000000..405eedf4d --- /dev/null +++ b/sdks/node/templates/prettierrc.cjs @@ -0,0 +1,3 @@ +module.exports = { + plugins: [require.resolve('prettier-plugin-organize-imports')] +}; diff --git a/sdks/node/templates/tsconfig.mustache b/sdks/node/templates/tsconfig.mustache index 78f502082..cbdcae0ce 100644 --- a/sdks/node/templates/tsconfig.mustache +++ b/sdks/node/templates/tsconfig.mustache @@ -2,7 +2,6 @@ "compilerOptions": { "module": "commonjs", "noImplicitAny": false, - "suppressImplicitAnyIndexErrors": true, "target": "{{#supportsES6}}ES6{{/supportsES6}}{{^supportsES6}}ES5{{/supportsES6}}", "allowSyntheticDefaultImports": true, "esModuleInterop": true, diff --git a/sdks/node/tests/test_utils.ts b/sdks/node/tests/test_utils.ts index 40db3239a..d3650ef97 100644 --- a/sdks/node/tests/test_utils.ts +++ b/sdks/node/tests/test_utils.ts @@ -1,5 +1,5 @@ -import jsonDiff from 'json-diff'; -import MockAdapter from 'axios-mock-adapter'; +import * as jsonDiff from 'json-diff'; +import MockAdapter = require("axios-mock-adapter"); import { ObjectSerializer } from '../model'; export const getFixtureData = (file: string): Object => { diff --git a/sdks/node/tsconfig.json b/sdks/node/tsconfig.json index 80b3276f3..b5314dbc3 100644 --- a/sdks/node/tsconfig.json +++ b/sdks/node/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "module": "commonjs", "noImplicitAny": false, - "suppressImplicitAnyIndexErrors": true, "target": "ES6", "allowSyntheticDefaultImports": true, "esModuleInterop": true, diff --git a/sdks/node/types/api/accountApi.d.ts b/sdks/node/types/api/accountApi.d.ts index 49738c7b9..21a0bc1c4 100644 --- a/sdks/node/types/api/accountApi.d.ts +++ b/sdks/node/types/api/accountApi.d.ts @@ -1,4 +1,4 @@ -import { Authentication, Interceptor, HttpBasicAuth, HttpBearerAuth, AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse } from "../model"; +import { AccountCreateRequest, AccountCreateResponse, AccountGetResponse, AccountUpdateRequest, AccountVerifyRequest, AccountVerifyResponse, Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; import { optionsI, returnTypeT } from "./"; export declare enum AccountApiApiKeys { } diff --git a/sdks/node/types/api/apiAppApi.d.ts b/sdks/node/types/api/apiAppApi.d.ts index 92d5a1c8c..c07f8bea3 100644 --- a/sdks/node/types/api/apiAppApi.d.ts +++ b/sdks/node/types/api/apiAppApi.d.ts @@ -1,5 +1,5 @@ -import { Authentication, Interceptor, HttpBasicAuth, HttpBearerAuth, ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppUpdateRequest } from "../model"; -import { optionsI, returnTypeT, returnTypeI } from "./"; +import { ApiAppCreateRequest, ApiAppGetResponse, ApiAppListResponse, ApiAppUpdateRequest, Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; +import { optionsI, returnTypeI, returnTypeT } from "./"; export declare enum ApiAppApiApiKeys { } export declare class ApiAppApi { diff --git a/sdks/node/types/api/apis.d.ts b/sdks/node/types/api/apis.d.ts index 1d1ccb66b..8530ae249 100644 --- a/sdks/node/types/api/apis.d.ts +++ b/sdks/node/types/api/apis.d.ts @@ -1,12 +1,14 @@ -import { AttributeTypeMap } from "../model"; -import { AxiosResponse } from "axios"; -import formData from "form-data"; +import { ErrorResponse } from "../model"; export declare class HttpError extends Error { response: AxiosResponse; - body: any; + body: ErrorResponse; statusCode?: number | undefined; - constructor(response: AxiosResponse, body: any, statusCode?: number | undefined); + constructor(response: AxiosResponse, body: ErrorResponse, statusCode?: number | undefined); } +export { RequestFile } from "../model"; +import { AxiosResponse } from "axios"; +import formData from "form-data"; +import { AttributeTypeMap } from "../model"; export interface optionsI { headers: { [name: string]: string; @@ -20,9 +22,8 @@ export interface returnTypeI { response: AxiosResponse; body?: any; } -export declare const queryParamsSerializer: (params: any) => any; -export { RequestFile } from "../model"; -export declare const USER_AGENT = "OpenAPI-Generator/1.5-dev/node"; +export declare const queryParamsSerializer: (params: any) => string; +export declare const USER_AGENT = "OpenAPI-Generator/1.6-dev/node"; export declare const generateFormData: (obj: any, typemap: AttributeTypeMap) => { localVarUseFormData: boolean; data: object; diff --git a/sdks/node/types/api/bulkSendJobApi.d.ts b/sdks/node/types/api/bulkSendJobApi.d.ts index 69549cda2..6d64cb54a 100644 --- a/sdks/node/types/api/bulkSendJobApi.d.ts +++ b/sdks/node/types/api/bulkSendJobApi.d.ts @@ -1,4 +1,4 @@ -import { Authentication, Interceptor, HttpBasicAuth, HttpBearerAuth, BulkSendJobGetResponse, BulkSendJobListResponse } from "../model"; +import { Authentication, BulkSendJobGetResponse, BulkSendJobListResponse, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; import { optionsI, returnTypeT } from "./"; export declare enum BulkSendJobApiApiKeys { } diff --git a/sdks/node/types/api/embeddedApi.d.ts b/sdks/node/types/api/embeddedApi.d.ts index 3360eaffb..f66b6d702 100644 --- a/sdks/node/types/api/embeddedApi.d.ts +++ b/sdks/node/types/api/embeddedApi.d.ts @@ -1,4 +1,4 @@ -import { Authentication, Interceptor, HttpBasicAuth, HttpBearerAuth, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedSignUrlResponse } from "../model"; +import { Authentication, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedSignUrlResponse, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; import { optionsI, returnTypeT } from "./"; export declare enum EmbeddedApiApiKeys { } diff --git a/sdks/node/types/api/faxLineApi.d.ts b/sdks/node/types/api/faxLineApi.d.ts new file mode 100644 index 000000000..64b2a45a0 --- /dev/null +++ b/sdks/node/types/api/faxLineApi.d.ts @@ -0,0 +1,34 @@ +import { Authentication, FaxLineAddUserRequest, FaxLineAreaCodeGetResponse, FaxLineCreateRequest, FaxLineDeleteRequest, FaxLineListResponse, FaxLineRemoveUserRequest, FaxLineResponse, HttpBasicAuth, HttpBearerAuth, Interceptor } from "../model"; +import { optionsI, returnTypeI, returnTypeT } from "./"; +export declare enum FaxLineApiApiKeys { +} +export declare class FaxLineApi { + 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; + faxLineAddUser(faxLineAddUserRequest: FaxLineAddUserRequest, options?: optionsI): Promise>; + faxLineAreaCodeGet(country: "CA" | "US" | "UK", 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", province?: "AB" | "BC" | "MB" | "NB" | "NL" | "NT" | "NS" | "NU" | "ON" | "PE" | "QC" | "SK" | "YT", city?: string, options?: optionsI): Promise>; + faxLineCreate(faxLineCreateRequest: FaxLineCreateRequest, options?: optionsI): Promise>; + faxLineDelete(faxLineDeleteRequest: FaxLineDeleteRequest, options?: optionsI): Promise; + faxLineGet(number: string, options?: optionsI): Promise>; + faxLineList(accountId?: string, page?: number, pageSize?: number, showTeamLines?: boolean, options?: optionsI): Promise>; + faxLineRemoveUser(faxLineRemoveUserRequest: FaxLineRemoveUserRequest, options?: optionsI): Promise>; +} diff --git a/sdks/node/types/api/index.d.ts b/sdks/node/types/api/index.d.ts index 42c100179..567248c08 100644 --- a/sdks/node/types/api/index.d.ts +++ b/sdks/node/types/api/index.d.ts @@ -2,12 +2,13 @@ import { AccountApi } from "./accountApi"; import { ApiAppApi } from "./apiAppApi"; import { BulkSendJobApi } from "./bulkSendJobApi"; import { EmbeddedApi } from "./embeddedApi"; +import { FaxLineApi } from "./faxLineApi"; import { OAuthApi } from "./oAuthApi"; import { ReportApi } from "./reportApi"; import { SignatureRequestApi } from "./signatureRequestApi"; import { TeamApi } from "./teamApi"; import { TemplateApi } from "./templateApi"; import { UnclaimedDraftApi } from "./unclaimedDraftApi"; -export { AccountApi, ApiAppApi, BulkSendJobApi, EmbeddedApi, OAuthApi, ReportApi, SignatureRequestApi, TeamApi, TemplateApi, UnclaimedDraftApi, }; -export { HttpError, optionsI, returnTypeT, returnTypeI, generateFormData, toFormData, queryParamsSerializer, USER_AGENT, } from "./apis"; -export declare const APIS: (typeof AccountApi | typeof ApiAppApi | typeof BulkSendJobApi | typeof EmbeddedApi | typeof OAuthApi | typeof ReportApi | typeof SignatureRequestApi | typeof TeamApi | typeof TemplateApi | typeof UnclaimedDraftApi)[]; +export { AccountApi, ApiAppApi, BulkSendJobApi, EmbeddedApi, 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)[]; diff --git a/sdks/node/types/api/oAuthApi.d.ts b/sdks/node/types/api/oAuthApi.d.ts index deac9db9d..28b40664c 100644 --- a/sdks/node/types/api/oAuthApi.d.ts +++ b/sdks/node/types/api/oAuthApi.d.ts @@ -1,4 +1,4 @@ -import { Authentication, Interceptor, HttpBasicAuth, HttpBearerAuth, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse } from "../model"; +import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse } from "../model"; import { optionsI, returnTypeT } from "./"; export declare enum OAuthApiApiKeys { } diff --git a/sdks/node/types/api/reportApi.d.ts b/sdks/node/types/api/reportApi.d.ts index abd9f9ff8..c32ef2358 100644 --- a/sdks/node/types/api/reportApi.d.ts +++ b/sdks/node/types/api/reportApi.d.ts @@ -1,4 +1,4 @@ -import { Authentication, Interceptor, HttpBasicAuth, HttpBearerAuth, ReportCreateRequest, ReportCreateResponse } from "../model"; +import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, ReportCreateRequest, ReportCreateResponse } from "../model"; import { optionsI, returnTypeT } from "./"; export declare enum ReportApiApiKeys { } diff --git a/sdks/node/types/api/signatureRequestApi.d.ts b/sdks/node/types/api/signatureRequestApi.d.ts index 8f2506264..58a02bdcd 100644 --- a/sdks/node/types/api/signatureRequestApi.d.ts +++ b/sdks/node/types/api/signatureRequestApi.d.ts @@ -1,6 +1,5 @@ -/// -import { Authentication, Interceptor, HttpBasicAuth, HttpBearerAuth, BulkSendJobSendResponse, FileResponse, FileResponseDataUri, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest } from "../model"; -import { optionsI, returnTypeT, returnTypeI } from "./"; +import { Authentication, BulkSendJobSendResponse, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, SignatureRequestBulkCreateEmbeddedWithTemplateRequest, SignatureRequestBulkSendWithTemplateRequest, SignatureRequestCreateEmbeddedRequest, SignatureRequestCreateEmbeddedWithTemplateRequest, SignatureRequestGetResponse, SignatureRequestListResponse, SignatureRequestRemindRequest, SignatureRequestSendRequest, SignatureRequestSendWithTemplateRequest, SignatureRequestUpdateRequest } from "../model"; +import { optionsI, returnTypeI, returnTypeT } from "./"; export declare enum SignatureRequestApiApiKeys { } export declare class SignatureRequestApi { diff --git a/sdks/node/types/api/teamApi.d.ts b/sdks/node/types/api/teamApi.d.ts index 8e7045e04..31b05a503 100644 --- a/sdks/node/types/api/teamApi.d.ts +++ b/sdks/node/types/api/teamApi.d.ts @@ -1,5 +1,5 @@ -import { Authentication, Interceptor, HttpBasicAuth, HttpBearerAuth, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInvitesResponse, TeamMembersResponse, TeamRemoveMemberRequest, TeamSubTeamsResponse, TeamUpdateRequest } from "../model"; -import { optionsI, returnTypeT, returnTypeI } from "./"; +import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, TeamAddMemberRequest, TeamCreateRequest, TeamGetInfoResponse, TeamGetResponse, TeamInvitesResponse, TeamMembersResponse, TeamRemoveMemberRequest, TeamSubTeamsResponse, TeamUpdateRequest } from "../model"; +import { optionsI, returnTypeI, returnTypeT } from "./"; export declare enum TeamApiApiKeys { } export declare class TeamApi { diff --git a/sdks/node/types/api/templateApi.d.ts b/sdks/node/types/api/templateApi.d.ts index 51a5cecff..aeaa69a46 100644 --- a/sdks/node/types/api/templateApi.d.ts +++ b/sdks/node/types/api/templateApi.d.ts @@ -1,6 +1,5 @@ -/// -import { Authentication, Interceptor, HttpBasicAuth, HttpBearerAuth, FileResponse, FileResponseDataUri, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateRequest, TemplateCreateResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse } from "../model"; -import { optionsI, returnTypeT, returnTypeI } from "./"; +import { Authentication, FileResponse, FileResponseDataUri, HttpBasicAuth, HttpBearerAuth, Interceptor, TemplateAddUserRequest, TemplateCreateEmbeddedDraftRequest, TemplateCreateEmbeddedDraftResponse, TemplateCreateRequest, TemplateCreateResponse, TemplateGetResponse, TemplateListResponse, TemplateRemoveUserRequest, TemplateUpdateFilesRequest, TemplateUpdateFilesResponse } from "../model"; +import { optionsI, returnTypeI, returnTypeT } from "./"; export declare enum TemplateApiApiKeys { } export declare class TemplateApi { diff --git a/sdks/node/types/api/unclaimedDraftApi.d.ts b/sdks/node/types/api/unclaimedDraftApi.d.ts index 783fcff37..df8e1699c 100644 --- a/sdks/node/types/api/unclaimedDraftApi.d.ts +++ b/sdks/node/types/api/unclaimedDraftApi.d.ts @@ -1,4 +1,4 @@ -import { Authentication, Interceptor, HttpBasicAuth, HttpBearerAuth, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest } from "../model"; +import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, UnclaimedDraftCreateEmbeddedRequest, UnclaimedDraftCreateEmbeddedWithTemplateRequest, UnclaimedDraftCreateRequest, UnclaimedDraftCreateResponse, UnclaimedDraftEditAndResendRequest } from "../model"; import { optionsI, returnTypeT } from "./"; export declare enum UnclaimedDraftApiApiKeys { } diff --git a/sdks/node/types/model/accountCreateResponse.d.ts b/sdks/node/types/model/accountCreateResponse.d.ts index d7d1379b8..b0739f3d6 100644 --- a/sdks/node/types/model/accountCreateResponse.d.ts +++ b/sdks/node/types/model/accountCreateResponse.d.ts @@ -3,7 +3,7 @@ import { AccountResponse } from "./accountResponse"; import { OAuthTokenResponse } from "./oAuthTokenResponse"; import { WarningResponse } from "./warningResponse"; export declare class AccountCreateResponse { - "account"?: AccountResponse; + "account": AccountResponse; "oauthData"?: OAuthTokenResponse; "warnings"?: Array; static discriminator: string | undefined; diff --git a/sdks/node/types/model/accountGetResponse.d.ts b/sdks/node/types/model/accountGetResponse.d.ts index c6c35cbfd..d46206b49 100644 --- a/sdks/node/types/model/accountGetResponse.d.ts +++ b/sdks/node/types/model/accountGetResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { AccountResponse } from "./accountResponse"; import { WarningResponse } from "./warningResponse"; export declare class AccountGetResponse { - "account"?: AccountResponse; + "account": AccountResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/apiAppCreateRequest.d.ts b/sdks/node/types/model/apiAppCreateRequest.d.ts index f6b90a17c..03553d98e 100644 --- a/sdks/node/types/model/apiAppCreateRequest.d.ts +++ b/sdks/node/types/model/apiAppCreateRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubOAuth } from "./subOAuth"; import { SubOptions } from "./subOptions"; import { SubWhiteLabelingOptions } from "./subWhiteLabelingOptions"; diff --git a/sdks/node/types/model/apiAppGetResponse.d.ts b/sdks/node/types/model/apiAppGetResponse.d.ts index 96ef128b8..9d7c45639 100644 --- a/sdks/node/types/model/apiAppGetResponse.d.ts +++ b/sdks/node/types/model/apiAppGetResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { ApiAppResponse } from "./apiAppResponse"; import { WarningResponse } from "./warningResponse"; export declare class ApiAppGetResponse { - "apiApp"?: ApiAppResponse; + "apiApp": ApiAppResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/apiAppListResponse.d.ts b/sdks/node/types/model/apiAppListResponse.d.ts index 6a80f6a23..214dac34b 100644 --- a/sdks/node/types/model/apiAppListResponse.d.ts +++ b/sdks/node/types/model/apiAppListResponse.d.ts @@ -3,8 +3,8 @@ import { ApiAppResponse } from "./apiAppResponse"; import { ListInfoResponse } from "./listInfoResponse"; import { WarningResponse } from "./warningResponse"; export declare class ApiAppListResponse { - "apiApps"?: Array; - "listInfo"?: ListInfoResponse; + "apiApps": Array; + "listInfo": ListInfoResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/apiAppUpdateRequest.d.ts b/sdks/node/types/model/apiAppUpdateRequest.d.ts index 36485fc19..9debf019a 100644 --- a/sdks/node/types/model/apiAppUpdateRequest.d.ts +++ b/sdks/node/types/model/apiAppUpdateRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubOAuth } from "./subOAuth"; import { SubOptions } from "./subOptions"; import { SubWhiteLabelingOptions } from "./subWhiteLabelingOptions"; diff --git a/sdks/node/types/model/bulkSendJobGetResponse.d.ts b/sdks/node/types/model/bulkSendJobGetResponse.d.ts index a79e6d972..b4d39ed9d 100644 --- a/sdks/node/types/model/bulkSendJobGetResponse.d.ts +++ b/sdks/node/types/model/bulkSendJobGetResponse.d.ts @@ -4,9 +4,9 @@ import { BulkSendJobResponse } from "./bulkSendJobResponse"; import { ListInfoResponse } from "./listInfoResponse"; import { WarningResponse } from "./warningResponse"; export declare class BulkSendJobGetResponse { - "bulkSendJob"?: BulkSendJobResponse; - "listInfo"?: ListInfoResponse; - "signatureRequests"?: Array; + "bulkSendJob": BulkSendJobResponse; + "listInfo": ListInfoResponse; + "signatureRequests": Array; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/bulkSendJobListResponse.d.ts b/sdks/node/types/model/bulkSendJobListResponse.d.ts index bac973afe..11b6be2e5 100644 --- a/sdks/node/types/model/bulkSendJobListResponse.d.ts +++ b/sdks/node/types/model/bulkSendJobListResponse.d.ts @@ -3,8 +3,8 @@ import { BulkSendJobResponse } from "./bulkSendJobResponse"; import { ListInfoResponse } from "./listInfoResponse"; import { WarningResponse } from "./warningResponse"; export declare class BulkSendJobListResponse { - "bulkSendJobs"?: Array; - "listInfo"?: ListInfoResponse; + "bulkSendJobs": Array; + "listInfo": ListInfoResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/bulkSendJobSendResponse.d.ts b/sdks/node/types/model/bulkSendJobSendResponse.d.ts index 88b025c6d..7a82bf1e5 100644 --- a/sdks/node/types/model/bulkSendJobSendResponse.d.ts +++ b/sdks/node/types/model/bulkSendJobSendResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { BulkSendJobResponse } from "./bulkSendJobResponse"; import { WarningResponse } from "./warningResponse"; export declare class BulkSendJobSendResponse { - "bulkSendJob"?: BulkSendJobResponse; + "bulkSendJob": BulkSendJobResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/embeddedEditUrlResponse.d.ts b/sdks/node/types/model/embeddedEditUrlResponse.d.ts index 1be6d07ca..bb01ab223 100644 --- a/sdks/node/types/model/embeddedEditUrlResponse.d.ts +++ b/sdks/node/types/model/embeddedEditUrlResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { EmbeddedEditUrlResponseEmbedded } from "./embeddedEditUrlResponseEmbedded"; import { WarningResponse } from "./warningResponse"; export declare class EmbeddedEditUrlResponse { - "embedded"?: EmbeddedEditUrlResponseEmbedded; + "embedded": EmbeddedEditUrlResponseEmbedded; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/embeddedSignUrlResponse.d.ts b/sdks/node/types/model/embeddedSignUrlResponse.d.ts index c1a2f2436..8a739647e 100644 --- a/sdks/node/types/model/embeddedSignUrlResponse.d.ts +++ b/sdks/node/types/model/embeddedSignUrlResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { EmbeddedSignUrlResponseEmbedded } from "./embeddedSignUrlResponseEmbedded"; import { WarningResponse } from "./warningResponse"; export declare class EmbeddedSignUrlResponse { - "embedded"?: EmbeddedSignUrlResponseEmbedded; + "embedded": EmbeddedSignUrlResponseEmbedded; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/faxLineAddUserRequest.d.ts b/sdks/node/types/model/faxLineAddUserRequest.d.ts new file mode 100644 index 000000000..56fefd2f3 --- /dev/null +++ b/sdks/node/types/model/faxLineAddUserRequest.d.ts @@ -0,0 +1,10 @@ +import { AttributeTypeMap } from "./"; +export declare class FaxLineAddUserRequest { + "number": string; + "accountId"?: string; + "emailAddress"?: string; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxLineAddUserRequest; +} diff --git a/sdks/node/types/model/faxLineAreaCodeGetCountryEnum.d.ts b/sdks/node/types/model/faxLineAreaCodeGetCountryEnum.d.ts new file mode 100644 index 000000000..8352fd878 --- /dev/null +++ b/sdks/node/types/model/faxLineAreaCodeGetCountryEnum.d.ts @@ -0,0 +1,5 @@ +export declare enum FaxLineAreaCodeGetCountryEnum { + Ca = "CA", + Us = "US", + Uk = "UK" +} diff --git a/sdks/node/types/model/faxLineAreaCodeGetProvinceEnum.d.ts b/sdks/node/types/model/faxLineAreaCodeGetProvinceEnum.d.ts new file mode 100644 index 000000000..e43edf5df --- /dev/null +++ b/sdks/node/types/model/faxLineAreaCodeGetProvinceEnum.d.ts @@ -0,0 +1,15 @@ +export declare enum FaxLineAreaCodeGetProvinceEnum { + Ab = "AB", + Bc = "BC", + Mb = "MB", + Nb = "NB", + Nl = "NL", + Nt = "NT", + Ns = "NS", + Nu = "NU", + On = "ON", + Pe = "PE", + Qc = "QC", + Sk = "SK", + Yt = "YT" +} diff --git a/sdks/node/types/model/faxLineAreaCodeGetResponse.d.ts b/sdks/node/types/model/faxLineAreaCodeGetResponse.d.ts new file mode 100644 index 000000000..5a55319d2 --- /dev/null +++ b/sdks/node/types/model/faxLineAreaCodeGetResponse.d.ts @@ -0,0 +1,8 @@ +import { AttributeTypeMap } from "./"; +export declare class FaxLineAreaCodeGetResponse { + "areaCodes": Array; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxLineAreaCodeGetResponse; +} diff --git a/sdks/node/types/model/faxLineAreaCodeGetStateEnum.d.ts b/sdks/node/types/model/faxLineAreaCodeGetStateEnum.d.ts new file mode 100644 index 000000000..4193d07bd --- /dev/null +++ b/sdks/node/types/model/faxLineAreaCodeGetStateEnum.d.ts @@ -0,0 +1,53 @@ +export declare enum FaxLineAreaCodeGetStateEnum { + Ak = "AK", + Al = "AL", + Ar = "AR", + Az = "AZ", + Ca = "CA", + Co = "CO", + Ct = "CT", + Dc = "DC", + De = "DE", + Fl = "FL", + Ga = "GA", + Hi = "HI", + Ia = "IA", + Id = "ID", + Il = "IL", + In = "IN", + Ks = "KS", + Ky = "KY", + La = "LA", + Ma = "MA", + Md = "MD", + Me = "ME", + Mi = "MI", + Mn = "MN", + Mo = "MO", + Ms = "MS", + Mt = "MT", + Nc = "NC", + Nd = "ND", + Ne = "NE", + Nh = "NH", + Nj = "NJ", + Nm = "NM", + Nv = "NV", + Ny = "NY", + Oh = "OH", + Ok = "OK", + Or = "OR", + Pa = "PA", + Ri = "RI", + Sc = "SC", + Sd = "SD", + Tn = "TN", + Tx = "TX", + Ut = "UT", + Va = "VA", + Vt = "VT", + Wa = "WA", + Wi = "WI", + Wv = "WV", + Wy = "WY" +} diff --git a/sdks/node/types/model/faxLineCreateRequest.d.ts b/sdks/node/types/model/faxLineCreateRequest.d.ts new file mode 100644 index 000000000..a91bcda4d --- /dev/null +++ b/sdks/node/types/model/faxLineCreateRequest.d.ts @@ -0,0 +1,18 @@ +import { AttributeTypeMap } from "./"; +export declare class FaxLineCreateRequest { + "areaCode": number; + "country": FaxLineCreateRequest.CountryEnum; + "city"?: string; + "accountId"?: string; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxLineCreateRequest; +} +export declare namespace FaxLineCreateRequest { + enum CountryEnum { + Ca = "CA", + Us = "US", + Uk = "UK" + } +} diff --git a/sdks/node/types/model/faxLineDeleteRequest.d.ts b/sdks/node/types/model/faxLineDeleteRequest.d.ts new file mode 100644 index 000000000..3dd720983 --- /dev/null +++ b/sdks/node/types/model/faxLineDeleteRequest.d.ts @@ -0,0 +1,8 @@ +import { AttributeTypeMap } from "./"; +export declare class FaxLineDeleteRequest { + "number": string; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxLineDeleteRequest; +} diff --git a/sdks/node/types/model/faxLineListResponse.d.ts b/sdks/node/types/model/faxLineListResponse.d.ts new file mode 100644 index 000000000..b426f1eab --- /dev/null +++ b/sdks/node/types/model/faxLineListResponse.d.ts @@ -0,0 +1,13 @@ +import { AttributeTypeMap } from "./"; +import { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; +import { ListInfoResponse } from "./listInfoResponse"; +import { WarningResponse } from "./warningResponse"; +export declare class FaxLineListResponse { + "listInfo": ListInfoResponse; + "faxLines": Array; + "warnings"?: WarningResponse; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxLineListResponse; +} diff --git a/sdks/node/types/model/faxLineRemoveUserRequest.d.ts b/sdks/node/types/model/faxLineRemoveUserRequest.d.ts new file mode 100644 index 000000000..a57a09421 --- /dev/null +++ b/sdks/node/types/model/faxLineRemoveUserRequest.d.ts @@ -0,0 +1,10 @@ +import { AttributeTypeMap } from "./"; +export declare class FaxLineRemoveUserRequest { + "number": string; + "accountId"?: string; + "emailAddress"?: string; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxLineRemoveUserRequest; +} diff --git a/sdks/node/types/model/faxLineResponse.d.ts b/sdks/node/types/model/faxLineResponse.d.ts new file mode 100644 index 000000000..41d8248b1 --- /dev/null +++ b/sdks/node/types/model/faxLineResponse.d.ts @@ -0,0 +1,11 @@ +import { AttributeTypeMap } from "./"; +import { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; +import { WarningResponse } from "./warningResponse"; +export declare class FaxLineResponse { + "faxLine": FaxLineResponseFaxLine; + "warnings"?: WarningResponse; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxLineResponse; +} diff --git a/sdks/node/types/model/faxLineResponseFaxLine.d.ts b/sdks/node/types/model/faxLineResponseFaxLine.d.ts new file mode 100644 index 000000000..d5f8c4aa7 --- /dev/null +++ b/sdks/node/types/model/faxLineResponseFaxLine.d.ts @@ -0,0 +1,12 @@ +import { AttributeTypeMap } from "./"; +import { AccountResponse } from "./accountResponse"; +export declare class FaxLineResponseFaxLine { + "number"?: string; + "createdAt"?: number; + "updatedAt"?: number; + "accounts"?: Array; + static discriminator: string | undefined; + static attributeTypeMap: AttributeTypeMap; + static getAttributeTypeMap(): AttributeTypeMap; + static init(data: any): FaxLineResponseFaxLine; +} diff --git a/sdks/node/types/model/fileResponse.d.ts b/sdks/node/types/model/fileResponse.d.ts index c0971591f..aaeac2159 100644 --- a/sdks/node/types/model/fileResponse.d.ts +++ b/sdks/node/types/model/fileResponse.d.ts @@ -1,7 +1,7 @@ import { AttributeTypeMap } from "./"; export declare class FileResponse { - "fileUrl"?: string; - "expiresAt"?: number; + "fileUrl": string; + "expiresAt": number; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; diff --git a/sdks/node/types/model/fileResponseDataUri.d.ts b/sdks/node/types/model/fileResponseDataUri.d.ts index c0b98d5ef..9b04c5631 100644 --- a/sdks/node/types/model/fileResponseDataUri.d.ts +++ b/sdks/node/types/model/fileResponseDataUri.d.ts @@ -1,6 +1,6 @@ import { AttributeTypeMap } from "./"; export declare class FileResponseDataUri { - "dataUri"?: string; + "dataUri": string; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; diff --git a/sdks/node/types/model/index.d.ts b/sdks/node/types/model/index.d.ts index f748121c4..ad7859941 100644 --- a/sdks/node/types/model/index.d.ts +++ b/sdks/node/types/model/index.d.ts @@ -29,12 +29,25 @@ import { EmbeddedSignUrlResponse } from "./embeddedSignUrlResponse"; import { EmbeddedSignUrlResponseEmbedded } from "./embeddedSignUrlResponseEmbedded"; import { ErrorResponse } from "./errorResponse"; import { ErrorResponseError } from "./errorResponseError"; +import { EventCallbackHelper } from "./eventCallbackHelper"; import { EventCallbackRequest } from "./eventCallbackRequest"; import { EventCallbackRequestEvent } from "./eventCallbackRequestEvent"; import { EventCallbackRequestEventMetadata } from "./eventCallbackRequestEventMetadata"; +import { FaxLineAddUserRequest } from "./faxLineAddUserRequest"; +import { FaxLineAreaCodeGetCountryEnum } from "./faxLineAreaCodeGetCountryEnum"; +import { FaxLineAreaCodeGetProvinceEnum } from "./faxLineAreaCodeGetProvinceEnum"; +import { FaxLineAreaCodeGetResponse } from "./faxLineAreaCodeGetResponse"; +import { FaxLineAreaCodeGetStateEnum } from "./faxLineAreaCodeGetStateEnum"; +import { FaxLineCreateRequest } from "./faxLineCreateRequest"; +import { FaxLineDeleteRequest } from "./faxLineDeleteRequest"; +import { FaxLineListResponse } from "./faxLineListResponse"; +import { FaxLineRemoveUserRequest } from "./faxLineRemoveUserRequest"; +import { FaxLineResponse } from "./faxLineResponse"; +import { FaxLineResponseFaxLine } from "./faxLineResponseFaxLine"; import { FileResponse } from "./fileResponse"; import { FileResponseDataUri } from "./fileResponseDataUri"; import { ListInfoResponse } from "./listInfoResponse"; +import { ApiKeyAuth, AttributeTypeMap, Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, OAuth, ObjectSerializer, RequestDetailedFile, RequestFile, VoidAuth } from "./models"; import { OAuthTokenGenerateRequest } from "./oAuthTokenGenerateRequest"; import { OAuthTokenRefreshRequest } from "./oAuthTokenRefreshRequest"; import { OAuthTokenResponse } from "./oAuthTokenResponse"; @@ -170,12 +183,10 @@ import { UnclaimedDraftCreateResponse } from "./unclaimedDraftCreateResponse"; import { UnclaimedDraftEditAndResendRequest } from "./unclaimedDraftEditAndResendRequest"; import { UnclaimedDraftResponse } from "./unclaimedDraftResponse"; import { WarningResponse } from "./warningResponse"; -import { EventCallbackHelper } from "./eventCallbackHelper"; -import { RequestDetailedFile, RequestFile, AttributeTypeMap, ObjectSerializer, Authentication, HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, VoidAuth, Interceptor } from "./models"; export declare let enumsMap: { [index: string]: any; }; 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, BulkSendJobGetResponse, BulkSendJobGetResponseSignatureRequests, BulkSendJobListResponse, BulkSendJobResponse, BulkSendJobSendResponse, EmbeddedEditUrlRequest, EmbeddedEditUrlResponse, EmbeddedEditUrlResponseEmbedded, EmbeddedSignUrlResponse, EmbeddedSignUrlResponseEmbedded, ErrorResponse, ErrorResponseError, EventCallbackRequest, EventCallbackRequestEvent, EventCallbackRequestEventMetadata, FileResponse, FileResponseDataUri, ListInfoResponse, OAuthTokenGenerateRequest, OAuthTokenRefreshRequest, OAuthTokenResponse, ReportCreateRequest, ReportCreateResponse, ReportResponse, 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, WarningResponse, EventCallbackHelper, RequestDetailedFile, RequestFile, AttributeTypeMap, ObjectSerializer, Authentication, HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, VoidAuth, Interceptor, }; +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, }; diff --git a/sdks/node/types/model/models.d.ts b/sdks/node/types/model/models.d.ts index 75a30330e..de0de4629 100644 --- a/sdks/node/types/model/models.d.ts +++ b/sdks/node/types/model/models.d.ts @@ -1,8 +1,6 @@ -/// -/// import { AxiosRequestConfig } from "axios"; -import * as fs from "fs"; import { Headers } from "form-data"; +import * as fs from "fs"; export interface RequestDetailedFile { value: Buffer; options: { @@ -13,7 +11,6 @@ export interface RequestDetailedFile { filepath?: string; }; } -export type RequestFile = fs.ReadStream | RequestDetailedFile; interface AttributeType { name: string; baseName: string; @@ -21,6 +18,7 @@ interface AttributeType { } export interface AttributeTypeMap extends Array { } +export type RequestFile = fs.ReadStream | RequestDetailedFile; export declare class ObjectSerializer { static findCorrectType(data: any, expectedType: string): any; static serialize(data: any, type: string): any; diff --git a/sdks/node/types/model/reportCreateResponse.d.ts b/sdks/node/types/model/reportCreateResponse.d.ts index 1eedadf5a..07d6e0005 100644 --- a/sdks/node/types/model/reportCreateResponse.d.ts +++ b/sdks/node/types/model/reportCreateResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { ReportResponse } from "./reportResponse"; import { WarningResponse } from "./warningResponse"; export declare class ReportCreateResponse { - "report"?: ReportResponse; + "report": ReportResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts index 60d16d985..0846addef 100644 --- a/sdks/node/types/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts +++ b/sdks/node/types/model/signatureRequestBulkCreateEmbeddedWithTemplateRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubBulkSignerList } from "./subBulkSignerList"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; diff --git a/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts index f37ca1a80..e021f5165 100644 --- a/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts +++ b/sdks/node/types/model/signatureRequestBulkSendWithTemplateRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubBulkSignerList } from "./subBulkSignerList"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; diff --git a/sdks/node/types/model/signatureRequestCreateEmbeddedRequest.d.ts b/sdks/node/types/model/signatureRequestCreateEmbeddedRequest.d.ts index c5e667f78..a26931cca 100644 --- a/sdks/node/types/model/signatureRequestCreateEmbeddedRequest.d.ts +++ b/sdks/node/types/model/signatureRequestCreateEmbeddedRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubCustomField } from "./subCustomField"; import { SubFieldOptions } from "./subFieldOptions"; diff --git a/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts index 05f1e70d5..a707ac1a9 100644 --- a/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts +++ b/sdks/node/types/model/signatureRequestCreateEmbeddedWithTemplateRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; diff --git a/sdks/node/types/model/signatureRequestGetResponse.d.ts b/sdks/node/types/model/signatureRequestGetResponse.d.ts index 837db07ad..c7b3d4473 100644 --- a/sdks/node/types/model/signatureRequestGetResponse.d.ts +++ b/sdks/node/types/model/signatureRequestGetResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { SignatureRequestResponse } from "./signatureRequestResponse"; import { WarningResponse } from "./warningResponse"; export declare class SignatureRequestGetResponse { - "signatureRequest"?: SignatureRequestResponse; + "signatureRequest": SignatureRequestResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/signatureRequestListResponse.d.ts b/sdks/node/types/model/signatureRequestListResponse.d.ts index a138f5680..b1f229cb9 100644 --- a/sdks/node/types/model/signatureRequestListResponse.d.ts +++ b/sdks/node/types/model/signatureRequestListResponse.d.ts @@ -3,8 +3,8 @@ import { ListInfoResponse } from "./listInfoResponse"; import { SignatureRequestResponse } from "./signatureRequestResponse"; import { WarningResponse } from "./warningResponse"; export declare class SignatureRequestListResponse { - "signatureRequests"?: Array; - "listInfo"?: ListInfoResponse; + "signatureRequests": Array; + "listInfo": ListInfoResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/signatureRequestResponseAttachment.d.ts b/sdks/node/types/model/signatureRequestResponseAttachment.d.ts index 787b7a1fb..aa6a3b3cf 100644 --- a/sdks/node/types/model/signatureRequestResponseAttachment.d.ts +++ b/sdks/node/types/model/signatureRequestResponseAttachment.d.ts @@ -1,7 +1,7 @@ import { AttributeTypeMap } from "./"; export declare class SignatureRequestResponseAttachment { "id": string; - "signer": string; + "signer": number | string; "name": string; "required": boolean; "instructions"?: string | null; diff --git a/sdks/node/types/model/signatureRequestSendRequest.d.ts b/sdks/node/types/model/signatureRequestSendRequest.d.ts index 4465f5ca7..cd862694b 100644 --- a/sdks/node/types/model/signatureRequestSendRequest.d.ts +++ b/sdks/node/types/model/signatureRequestSendRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubCustomField } from "./subCustomField"; import { SubFieldOptions } from "./subFieldOptions"; diff --git a/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts b/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts index abd2727a2..3bacfad01 100644 --- a/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts +++ b/sdks/node/types/model/signatureRequestSendWithTemplateRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; import { SubSignatureRequestTemplateSigner } from "./subSignatureRequestTemplateSigner"; diff --git a/sdks/node/types/model/teamGetInfoResponse.d.ts b/sdks/node/types/model/teamGetInfoResponse.d.ts index 7943c3ee2..b52a84c46 100644 --- a/sdks/node/types/model/teamGetInfoResponse.d.ts +++ b/sdks/node/types/model/teamGetInfoResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { TeamInfoResponse } from "./teamInfoResponse"; import { WarningResponse } from "./warningResponse"; export declare class TeamGetInfoResponse { - "team"?: TeamInfoResponse; + "team": TeamInfoResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/teamGetResponse.d.ts b/sdks/node/types/model/teamGetResponse.d.ts index 7e1f9a3a0..5ebf91dd7 100644 --- a/sdks/node/types/model/teamGetResponse.d.ts +++ b/sdks/node/types/model/teamGetResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { TeamResponse } from "./teamResponse"; import { WarningResponse } from "./warningResponse"; export declare class TeamGetResponse { - "team"?: TeamResponse; + "team": TeamResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/teamInvitesResponse.d.ts b/sdks/node/types/model/teamInvitesResponse.d.ts index 5633a3aa3..bbbd11b10 100644 --- a/sdks/node/types/model/teamInvitesResponse.d.ts +++ b/sdks/node/types/model/teamInvitesResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { TeamInviteResponse } from "./teamInviteResponse"; import { WarningResponse } from "./warningResponse"; export declare class TeamInvitesResponse { - "teamInvites"?: Array; + "teamInvites": Array; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/teamMembersResponse.d.ts b/sdks/node/types/model/teamMembersResponse.d.ts index 4de7c2996..d5b56b4dc 100644 --- a/sdks/node/types/model/teamMembersResponse.d.ts +++ b/sdks/node/types/model/teamMembersResponse.d.ts @@ -3,8 +3,8 @@ import { ListInfoResponse } from "./listInfoResponse"; import { TeamMemberResponse } from "./teamMemberResponse"; import { WarningResponse } from "./warningResponse"; export declare class TeamMembersResponse { - "teamMembers"?: Array; - "listInfo"?: ListInfoResponse; + "teamMembers": Array; + "listInfo": ListInfoResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/teamSubTeamsResponse.d.ts b/sdks/node/types/model/teamSubTeamsResponse.d.ts index c597fdf58..ed1b32bf0 100644 --- a/sdks/node/types/model/teamSubTeamsResponse.d.ts +++ b/sdks/node/types/model/teamSubTeamsResponse.d.ts @@ -3,8 +3,8 @@ import { ListInfoResponse } from "./listInfoResponse"; import { SubTeamResponse } from "./subTeamResponse"; import { WarningResponse } from "./warningResponse"; export declare class TeamSubTeamsResponse { - "subTeams"?: Array; - "listInfo"?: ListInfoResponse; + "subTeams": Array; + "listInfo": ListInfoResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/templateCreateEmbeddedDraftRequest.d.ts b/sdks/node/types/model/templateCreateEmbeddedDraftRequest.d.ts index dd3959c35..a527c0e84 100644 --- a/sdks/node/types/model/templateCreateEmbeddedDraftRequest.d.ts +++ b/sdks/node/types/model/templateCreateEmbeddedDraftRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubEditorOptions } from "./subEditorOptions"; import { SubFieldOptions } from "./subFieldOptions"; diff --git a/sdks/node/types/model/templateCreateEmbeddedDraftResponse.d.ts b/sdks/node/types/model/templateCreateEmbeddedDraftResponse.d.ts index 20f5213ba..a3897e556 100644 --- a/sdks/node/types/model/templateCreateEmbeddedDraftResponse.d.ts +++ b/sdks/node/types/model/templateCreateEmbeddedDraftResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { TemplateCreateEmbeddedDraftResponseTemplate } from "./templateCreateEmbeddedDraftResponseTemplate"; import { WarningResponse } from "./warningResponse"; export declare class TemplateCreateEmbeddedDraftResponse { - "template"?: TemplateCreateEmbeddedDraftResponseTemplate; + "template": TemplateCreateEmbeddedDraftResponseTemplate; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/templateCreateRequest.d.ts b/sdks/node/types/model/templateCreateRequest.d.ts index 2271dc63a..b81d319ea 100644 --- a/sdks/node/types/model/templateCreateRequest.d.ts +++ b/sdks/node/types/model/templateCreateRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubFieldOptions } from "./subFieldOptions"; import { SubFormFieldGroup } from "./subFormFieldGroup"; diff --git a/sdks/node/types/model/templateCreateResponse.d.ts b/sdks/node/types/model/templateCreateResponse.d.ts index d55ee5bb2..6dfd9c343 100644 --- a/sdks/node/types/model/templateCreateResponse.d.ts +++ b/sdks/node/types/model/templateCreateResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { TemplateCreateResponseTemplate } from "./templateCreateResponseTemplate"; import { WarningResponse } from "./warningResponse"; export declare class TemplateCreateResponse { - "template"?: TemplateCreateResponseTemplate; + "template": TemplateCreateResponseTemplate; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/templateEditResponse.d.ts b/sdks/node/types/model/templateEditResponse.d.ts index b746ec11d..dba3ddce6 100644 --- a/sdks/node/types/model/templateEditResponse.d.ts +++ b/sdks/node/types/model/templateEditResponse.d.ts @@ -1,6 +1,6 @@ import { AttributeTypeMap } from "./"; export declare class TemplateEditResponse { - "templateId"?: string; + "templateId": string; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; diff --git a/sdks/node/types/model/templateGetResponse.d.ts b/sdks/node/types/model/templateGetResponse.d.ts index 12889f04b..2a2278de7 100644 --- a/sdks/node/types/model/templateGetResponse.d.ts +++ b/sdks/node/types/model/templateGetResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { TemplateResponse } from "./templateResponse"; import { WarningResponse } from "./warningResponse"; export declare class TemplateGetResponse { - "template"?: TemplateResponse; + "template": TemplateResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/templateListResponse.d.ts b/sdks/node/types/model/templateListResponse.d.ts index 65451285f..1f1456d14 100644 --- a/sdks/node/types/model/templateListResponse.d.ts +++ b/sdks/node/types/model/templateListResponse.d.ts @@ -3,8 +3,8 @@ import { ListInfoResponse } from "./listInfoResponse"; import { TemplateResponse } from "./templateResponse"; import { WarningResponse } from "./warningResponse"; export declare class TemplateListResponse { - "templates"?: Array; - "listInfo"?: ListInfoResponse; + "templates": Array; + "listInfo": ListInfoResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/node/types/model/templateResponseDocumentCustomFieldBase.d.ts b/sdks/node/types/model/templateResponseDocumentCustomFieldBase.d.ts index fa72abb4a..fa313114d 100644 --- a/sdks/node/types/model/templateResponseDocumentCustomFieldBase.d.ts +++ b/sdks/node/types/model/templateResponseDocumentCustomFieldBase.d.ts @@ -3,7 +3,7 @@ export declare abstract class TemplateResponseDocumentCustomFieldBase { "type": string; "apiId"?: string; "name"?: string; - "signer"?: string | null; + "signer"?: number | string | null; "x"?: number; "y"?: number; "width"?: number; diff --git a/sdks/node/types/model/templateResponseDocumentFormFieldBase.d.ts b/sdks/node/types/model/templateResponseDocumentFormFieldBase.d.ts index 760bc482b..6df5fc173 100644 --- a/sdks/node/types/model/templateResponseDocumentFormFieldBase.d.ts +++ b/sdks/node/types/model/templateResponseDocumentFormFieldBase.d.ts @@ -3,7 +3,7 @@ export declare abstract class TemplateResponseDocumentFormFieldBase { "type": string; "apiId"?: string; "name"?: string; - "signer"?: string; + "signer"?: number | string; "x"?: number; "y"?: number; "width"?: number; diff --git a/sdks/node/types/model/templateUpdateFilesRequest.d.ts b/sdks/node/types/model/templateUpdateFilesRequest.d.ts index 7f9e0e090..690367e63 100644 --- a/sdks/node/types/model/templateUpdateFilesRequest.d.ts +++ b/sdks/node/types/model/templateUpdateFilesRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; export declare class TemplateUpdateFilesRequest { "clientId"?: string; "files"?: Array; diff --git a/sdks/node/types/model/templateUpdateFilesResponse.d.ts b/sdks/node/types/model/templateUpdateFilesResponse.d.ts index 65c63d522..fef82c231 100644 --- a/sdks/node/types/model/templateUpdateFilesResponse.d.ts +++ b/sdks/node/types/model/templateUpdateFilesResponse.d.ts @@ -1,7 +1,7 @@ import { AttributeTypeMap } from "./"; import { TemplateUpdateFilesResponseTemplate } from "./templateUpdateFilesResponseTemplate"; export declare class TemplateUpdateFilesResponse { - "template"?: TemplateUpdateFilesResponseTemplate; + "template": TemplateUpdateFilesResponseTemplate; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; static getAttributeTypeMap(): AttributeTypeMap; diff --git a/sdks/node/types/model/unclaimedDraftCreateEmbeddedRequest.d.ts b/sdks/node/types/model/unclaimedDraftCreateEmbeddedRequest.d.ts index b8e87165f..1b48b08e1 100644 --- a/sdks/node/types/model/unclaimedDraftCreateEmbeddedRequest.d.ts +++ b/sdks/node/types/model/unclaimedDraftCreateEmbeddedRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubCustomField } from "./subCustomField"; import { SubEditorOptions } from "./subEditorOptions"; diff --git a/sdks/node/types/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.d.ts b/sdks/node/types/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.d.ts index 709ba7358..488d294dd 100644 --- a/sdks/node/types/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.d.ts +++ b/sdks/node/types/model/unclaimedDraftCreateEmbeddedWithTemplateRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubCC } from "./subCC"; import { SubCustomField } from "./subCustomField"; import { SubEditorOptions } from "./subEditorOptions"; diff --git a/sdks/node/types/model/unclaimedDraftCreateRequest.d.ts b/sdks/node/types/model/unclaimedDraftCreateRequest.d.ts index cd08607bf..fd54bdc79 100644 --- a/sdks/node/types/model/unclaimedDraftCreateRequest.d.ts +++ b/sdks/node/types/model/unclaimedDraftCreateRequest.d.ts @@ -1,4 +1,4 @@ -import { RequestFile, AttributeTypeMap } from "./"; +import { AttributeTypeMap, RequestFile } from "./"; import { SubAttachment } from "./subAttachment"; import { SubCustomField } from "./subCustomField"; import { SubFieldOptions } from "./subFieldOptions"; diff --git a/sdks/node/types/model/unclaimedDraftCreateResponse.d.ts b/sdks/node/types/model/unclaimedDraftCreateResponse.d.ts index 7280c749f..188a52c03 100644 --- a/sdks/node/types/model/unclaimedDraftCreateResponse.d.ts +++ b/sdks/node/types/model/unclaimedDraftCreateResponse.d.ts @@ -2,7 +2,7 @@ import { AttributeTypeMap } from "./"; import { UnclaimedDraftResponse } from "./unclaimedDraftResponse"; import { WarningResponse } from "./warningResponse"; export declare class UnclaimedDraftCreateResponse { - "unclaimedDraft"?: UnclaimedDraftResponse; + "unclaimedDraft": UnclaimedDraftResponse; "warnings"?: Array; static discriminator: string | undefined; static attributeTypeMap: AttributeTypeMap; diff --git a/sdks/php/.gitignore b/sdks/php/.gitignore index 3f10c0389..12f85db8f 100644 --- a/sdks/php/.gitignore +++ b/sdks/php/.gitignore @@ -14,7 +14,9 @@ composer.phar # PHPUnit cache .phpunit.result.cache +# CUSTOM - BEGIN .composer .openapi-generator git_push.sh composer.lock +# CUSTOM - END diff --git a/sdks/php/.php-cs-fixer.dist.php b/sdks/php/.php-cs-fixer.dist.php new file mode 100644 index 000000000..a8ff32efd --- /dev/null +++ b/sdks/php/.php-cs-fixer.dist.php @@ -0,0 +1,105 @@ +in(__DIR__) + ->exclude('vendor') + ->exclude('test') + ->exclude('tests') + ->exclude('bin') + ->exclude('docs') + ->exclude('examples') + ->exclude('templates') + ->exclude('test_fixtures') +; + +$config = new PhpCsFixer\Config(); +$config->setParallelConfig( + PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect() +); +return $config->setRules([ + '@PhpCsFixer' => true, + '@Symfony' => true, + '@DoctrineAnnotation' => true, + 'binary_operator_spaces' => [ + 'operators' => [ + '=>' => null, + ], + ], + 'blank_line_before_statement' => [ + 'statements' => [], + ], + 'blank_line_after_opening_tag' => false, + 'cast_spaces' => [ + 'space' => 'none', + ], + 'class_definition' => [ + 'inline_constructor_arguments' => false, + 'space_before_parenthesis' => true, + ], + 'concat_space' => [ + 'spacing' => 'one', + ], + 'nullable_type_declaration_for_default_null_value' => false, + 'declare_parentheses' => true, + 'echo_tag_syntax' => [ + 'format' => 'short', + 'shorten_simple_statements_only' => true, + ], + 'fully_qualified_strict_types' => true, + 'global_namespace_import' => true, + 'general_phpdoc_annotation_remove' => [ + 'annotations' => [ + 'author', 'package', 'subpackage', 'version', + ], + ], + 'increment_style' => false, + 'multiline_whitespace_before_semicolons' => [ + 'strategy' => 'no_multi_line', + ], + 'ordered_imports' => [ + 'imports_order' => [ + 'class', 'function', 'const', + ], + 'sort_algorithm' => 'alpha', + ], + 'no_superfluous_phpdoc_tags' => [ + 'allow_mixed' => true, + 'allow_unused_params' => true, + 'remove_inheritdoc' => true, + ], + 'phpdoc_align' => [ + 'tags' => [ + 'method', 'param', 'property', 'return', 'type', 'var', + ], + ], + 'phpdoc_line_span' => [ + 'property' => 'single', + ], + 'phpdoc_separation' => false, + 'phpdoc_summary' => false, + 'phpdoc_to_comment' => false, + 'phpdoc_to_param_type' => [ + 'scalar_types' => true, + 'union_types' => false, + ], + 'php_unit_internal_class' => false, + 'php_unit_test_class_requires_covers' => false, + 'single_line_throw' => false, + 'statement_indentation' => [ + 'stick_comment_to_next_continuous_control_statement' => false, + ], + 'visibility_required' => [ + 'elements' => ['method', 'property'], + ], + 'yoda_style' => false, + 'trailing_comma_in_multiline' => [ + 'after_heredoc' => true, + ], +]) + ->setFinder($finder) + ->setRiskyAllowed(true) +; diff --git a/sdks/php/.php-cs-fixer.php b/sdks/php/.php-cs-fixer.php deleted file mode 100644 index 4f602dac6..000000000 --- a/sdks/php/.php-cs-fixer.php +++ /dev/null @@ -1,22 +0,0 @@ -in(__DIR__) - ->exclude(['bin', 'docs', 'examples', 'templates', 'legacy']); - -$config = new PhpCsFixer\Config(); -return $config->setRules([ - '@Symfony' => true, - 'concat_space' => ['spacing' => 'one'], - 'global_namespace_import' => true, - 'fully_qualified_strict_types' => true, - 'increment_style' => false, - 'phpdoc_align' => ['align' => 'left'], - 'phpdoc_separation' => false, - 'phpdoc_summary' => false, - 'phpdoc_to_param_type' => true, - 'single_line_throw' => false, - 'yoda_style' => false, -]) - ->setFinder($finder) - ->setRiskyAllowed(true); diff --git a/sdks/php/README.md b/sdks/php/README.md index 6dc14707d..b68ace90a 100644 --- a/sdks/php/README.md +++ b/sdks/php/README.md @@ -59,7 +59,7 @@ To install the bindings via [Composer](https://getcomposer.org/), add the follow } ``` -Then run `composer install`. +Then run `composer install` Alternatively, install directly with @@ -160,6 +160,13 @@ 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 | +| *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 | +| *FaxLineApi* | [**faxLineDelete**](docs/Api/FaxLineApi.md#faxlinedelete) | **DELETE** /fax_line | Delete Fax Line | +| *FaxLineApi* | [**faxLineGet**](docs/Api/FaxLineApi.md#faxlineget) | **GET** /fax_line | Get Fax Line | +| *FaxLineApi* | [**faxLineList**](docs/Api/FaxLineApi.md#faxlinelist) | **GET** /fax_line/list | List Fax Lines | +| *FaxLineApi* | [**faxLineRemoveUser**](docs/Api/FaxLineApi.md#faxlineremoveuser) | **PUT** /fax_line/remove_user | Remove Fax Line Access | | *OAuthApi* | [**oauthTokenGenerate**](docs/Api/OAuthApi.md#oauthtokengenerate) | **POST** /oauth/token | OAuth Token Generate | | *OAuthApi* | [**oauthTokenRefresh**](docs/Api/OAuthApi.md#oauthtokenrefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh | | *ReportApi* | [**reportCreate**](docs/Api/ReportApi.md#reportcreate) | **POST** /report/create | Create Report | @@ -205,6 +212,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | *UnclaimedDraftApi* | [**unclaimedDraftCreateEmbeddedWithTemplate**](docs/Api/UnclaimedDraftApi.md#unclaimeddraftcreateembeddedwithtemplate) | **POST** /unclaimed_draft/create_embedded_with_template | Create Embedded Unclaimed Draft with Template | | *UnclaimedDraftApi* | [**unclaimedDraftEditAndResend**](docs/Api/UnclaimedDraftApi.md#unclaimeddrafteditandresend) | **POST** /unclaimed_draft/edit_and_resend/{signature_request_id} | Edit and Resend Unclaimed Draft | + ## Models - [AccountCreateRequest](docs/Model/AccountCreateRequest.md) @@ -241,6 +249,17 @@ 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) +- [FaxLineAddUserRequest](docs/Model/FaxLineAddUserRequest.md) +- [FaxLineAreaCodeGetCountryEnum](docs/Model/FaxLineAreaCodeGetCountryEnum.md) +- [FaxLineAreaCodeGetProvinceEnum](docs/Model/FaxLineAreaCodeGetProvinceEnum.md) +- [FaxLineAreaCodeGetResponse](docs/Model/FaxLineAreaCodeGetResponse.md) +- [FaxLineAreaCodeGetStateEnum](docs/Model/FaxLineAreaCodeGetStateEnum.md) +- [FaxLineCreateRequest](docs/Model/FaxLineCreateRequest.md) +- [FaxLineDeleteRequest](docs/Model/FaxLineDeleteRequest.md) +- [FaxLineListResponse](docs/Model/FaxLineListResponse.md) +- [FaxLineRemoveUserRequest](docs/Model/FaxLineRemoveUserRequest.md) +- [FaxLineResponse](docs/Model/FaxLineResponse.md) +- [FaxLineResponseFaxLine](docs/Model/FaxLineResponseFaxLine.md) - [FileResponse](docs/Model/FileResponse.md) - [FileResponseDataUri](docs/Model/FileResponseDataUri.md) - [ListInfoResponse](docs/Model/ListInfoResponse.md) @@ -382,6 +401,7 @@ All URIs are relative to *https://api.hellosign.com/v3* ## Authorization + ### api_key - **Type**: HTTP basic authentication @@ -409,5 +429,6 @@ apisupport@hellosign.com This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: `3.0.0` - - Package version: `1.5-dev` + - Package version: `1.6-dev` + - Generator version: `7.8.0` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/sdks/php/VERSION b/sdks/php/VERSION index 6f3dd2f48..78ca9a102 100644 --- a/sdks/php/VERSION +++ b/sdks/php/VERSION @@ -1 +1 @@ -1.5-dev +1.6-dev diff --git a/sdks/php/bin/php-8 b/sdks/php/bin/php-8 new file mode 100755 index 000000000..78acc6d73 --- /dev/null +++ b/sdks/php/bin/php-8 @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Warning: You should run this from rootless Docker (or Podman, or other) + +set -e + +DIR=$(cd `dirname $0` && pwd) +ROOT_DIR="${DIR}/.." +WORKING_DIR="/app/php" + +docker run --rm \ + -v "${ROOT_DIR}:${WORKING_DIR}" \ + -v "dropbox-sign-sdk-composer-cache:/.composer" \ + -w "${WORKING_DIR}" \ + -u root:root \ + jtreminio/php:8.1 "$@" + + exit 0 diff --git a/sdks/php/bin/replace b/sdks/php/bin/replace index ddf95444e..232cc7b3b 100755 --- a/sdks/php/bin/replace +++ b/sdks/php/bin/replace @@ -16,4 +16,8 @@ perl -pi -e 's#@return Model\\(.*)\|\\Dropbox\\Sign\\Model\\ErrorResponse#@retur "${ROOT_DIR}/src/Api/"*.php perl -pi -e 's#@return SplFileObject\|\\Dropbox\\Sign\\Model\\ErrorResponse#@return SplFileObject#g' \ "${ROOT_DIR}/src/Api/"*.php +perl -pi -e 's#@return Model\\(.*)\|Model\\ErrorResponse#@return Model\\$1#g' \ + "${ROOT_DIR}/src/Api/"*.php +perl -pi -e 's#@return SplFileObject\|Model\\ErrorResponse#@return SplFileObject#g' \ + "${ROOT_DIR}/src/Api/"*.php printf "\n" diff --git a/sdks/php/composer.json b/sdks/php/composer.json index 8d7844d8f..347c72797 100644 --- a/sdks/php/composer.json +++ b/sdks/php/composer.json @@ -1,6 +1,6 @@ { "name": "dropbox/sign", - "description": "Official Dropbox Sign APIv3 PHP SDK", + "description": "Dropbox Sign v3 API", "keywords": [ "openapitools", "openapi-generator", @@ -13,18 +13,12 @@ "dropboxsign" ], "homepage": "https://hellosign.com", - "license": [ - "MIT" - ], + "license": "MIT", "authors": [ { "name": "Dropbox Sign", "homepage": "https://hellosign.com", "email": "apisupport@hellosign.com" - }, - { - "name": "OpenAPI-Generator contributors", - "homepage": "https://openapi-generator.tech" } ], "require": { @@ -37,13 +31,11 @@ }, "require-dev": { "phpunit/phpunit": "^8.0 || ^9.0", - "friendsofphp/php-cs-fixer": "3.4.*", + "friendsofphp/php-cs-fixer": "^3.5", "symfony/yaml": "^5.4" }, "autoload": { - "psr-4": { - "Dropbox\\Sign\\": "src/" - } + "psr-4": { "Dropbox\\Sign\\" : "src/" } }, "autoload-dev": { "psr-4": { "Dropbox\\Sign\\Test\\" : "test/" } diff --git a/sdks/php/docs/Api/AccountApi.md b/sdks/php/docs/Api/AccountApi.md index 7e850df59..9c8e8c9f0 100644 --- a/sdks/php/docs/Api/AccountApi.md +++ b/sdks/php/docs/Api/AccountApi.md @@ -15,7 +15,6 @@ All URIs are relative to https://api.hellosign.com/v3. ```php accountCreate($account_create_request): \Dropbox\Sign\Model\AccountCreateResponse ``` - Create Account Creates a new Dropbox Sign Account that is associated with the specified `email_address`. @@ -79,7 +78,6 @@ try { ```php accountGet($account_id, $email_address): \Dropbox\Sign\Model\AccountGetResponse ``` - Get Account Returns the properties and settings of your Account. @@ -141,7 +139,6 @@ try { ```php accountUpdate($account_update_request): \Dropbox\Sign\Model\AccountGetResponse ``` - Update Account Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. @@ -205,7 +202,6 @@ try { ```php accountVerify($account_verify_request): \Dropbox\Sign\Model\AccountVerifyResponse ``` - Verify Account Verifies whether an Dropbox Sign Account exists for the given email address. diff --git a/sdks/php/docs/Api/ApiAppApi.md b/sdks/php/docs/Api/ApiAppApi.md index e330f9946..a591601b2 100644 --- a/sdks/php/docs/Api/ApiAppApi.md +++ b/sdks/php/docs/Api/ApiAppApi.md @@ -16,7 +16,6 @@ All URIs are relative to https://api.hellosign.com/v3. ```php apiAppCreate($api_app_create_request): \Dropbox\Sign\Model\ApiAppGetResponse ``` - Create API App Creates a new API App. @@ -97,7 +96,6 @@ try { ```php apiAppDelete($client_id) ``` - Delete API App Deletes an API App. Can only be invoked for apps you own. @@ -159,7 +157,6 @@ void (empty response body) ```php apiAppGet($client_id): \Dropbox\Sign\Model\ApiAppGetResponse ``` - Get API App Returns an object with information about an API App. @@ -222,7 +219,6 @@ try { ```php apiAppList($page, $page_size): \Dropbox\Sign\Model\ApiAppListResponse ``` - List API Apps Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. @@ -287,7 +283,6 @@ try { ```php apiAppUpdate($client_id, $api_app_update_request): \Dropbox\Sign\Model\ApiAppGetResponse ``` - Update API App Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. diff --git a/sdks/php/docs/Api/BulkSendJobApi.md b/sdks/php/docs/Api/BulkSendJobApi.md index b53d3074c..ede4f3415 100644 --- a/sdks/php/docs/Api/BulkSendJobApi.md +++ b/sdks/php/docs/Api/BulkSendJobApi.md @@ -13,7 +13,6 @@ All URIs are relative to https://api.hellosign.com/v3. ```php bulkSendJobGet($bulk_send_job_id, $page, $page_size): \Dropbox\Sign\Model\BulkSendJobGetResponse ``` - Get Bulk Send Job Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. @@ -78,7 +77,6 @@ try { ```php bulkSendJobList($page, $page_size): \Dropbox\Sign\Model\BulkSendJobListResponse ``` - List Bulk Send Jobs Returns a list of BulkSendJob that you can access. diff --git a/sdks/php/docs/Api/EmbeddedApi.md b/sdks/php/docs/Api/EmbeddedApi.md index 111eefb3b..8b1acfbc4 100644 --- a/sdks/php/docs/Api/EmbeddedApi.md +++ b/sdks/php/docs/Api/EmbeddedApi.md @@ -13,7 +13,6 @@ All URIs are relative to https://api.hellosign.com/v3. ```php embeddedEditUrl($template_id, $embedded_edit_url_request): \Dropbox\Sign\Model\EmbeddedEditUrlResponse ``` - Get Embedded Template Edit URL Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. @@ -81,7 +80,6 @@ try { ```php embeddedSignUrl($signature_id): \Dropbox\Sign\Model\EmbeddedSignUrlResponse ``` - Get Embedded Sign URL 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. diff --git a/sdks/php/docs/Api/FaxLineApi.md b/sdks/php/docs/Api/FaxLineApi.md new file mode 100644 index 000000000..1bb340d36 --- /dev/null +++ b/sdks/php/docs/Api/FaxLineApi.md @@ -0,0 +1,433 @@ +# Dropbox\Sign\FaxLineApi + +All URIs are relative to https://api.hellosign.com/v3. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**faxLineAddUser()**](FaxLineApi.md#faxLineAddUser) | **PUT** /fax_line/add_user | Add Fax Line User | +| [**faxLineAreaCodeGet()**](FaxLineApi.md#faxLineAreaCodeGet) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes | +| [**faxLineCreate()**](FaxLineApi.md#faxLineCreate) | **POST** /fax_line/create | Purchase Fax Line | +| [**faxLineDelete()**](FaxLineApi.md#faxLineDelete) | **DELETE** /fax_line | Delete Fax Line | +| [**faxLineGet()**](FaxLineApi.md#faxLineGet) | **GET** /fax_line | Get Fax Line | +| [**faxLineList()**](FaxLineApi.md#faxLineList) | **GET** /fax_line/list | List Fax Lines | +| [**faxLineRemoveUser()**](FaxLineApi.md#faxLineRemoveUser) | **PUT** /fax_line/remove_user | Remove Fax Line Access | + + +## `faxLineAddUser()` + +```php +faxLineAddUser($fax_line_add_user_request): \Dropbox\Sign\Model\FaxLineResponse +``` +Add Fax Line User + +Grants a user access to the specified Fax Line. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +$data = new Dropbox\Sign\Model\FaxLineAddUserRequest(); +$data->setNumber("[FAX_NUMBER]") + ->setEmailAddress("member@dropboxsign.com"); + +try { + $result = $faxLineApi->faxLineAddUser($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_line_add_user_request** | [**\Dropbox\Sign\Model\FaxLineAddUserRequest**](../Model/FaxLineAddUserRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\FaxLineResponse**](../Model/FaxLineResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `faxLineAreaCodeGet()` + +```php +faxLineAreaCodeGet($country, $state, $province, $city): \Dropbox\Sign\Model\FaxLineAreaCodeGetResponse +``` +Get Available Fax Line Area Codes + +Returns a response with the area codes available for a given state/provice and city. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +try { + $result = $faxLineApi->faxLineAreaCodeGet("US", "CA"); + 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 | +| ------------- | ------------- | ------------- | ------------- | +| **country** | **string**| Filter area codes by country. | | +| **state** | **string**| Filter area codes by state. | [optional] | +| **province** | **string**| Filter area codes by province. | [optional] | +| **city** | **string**| Filter area codes by city. | [optional] | + +### Return type + +[**\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse**](../Model/FaxLineAreaCodeGetResponse.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) + +## `faxLineCreate()` + +```php +faxLineCreate($fax_line_create_request): \Dropbox\Sign\Model\FaxLineResponse +``` +Purchase Fax Line + +Purchases a new Fax Line. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +$data = new Dropbox\Sign\Model\FaxLineCreateRequest(); +$data->setAreaCode(209) + ->setCountry("US"); + +try { + $result = $faxLineApi->faxLineCreate($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_line_create_request** | [**\Dropbox\Sign\Model\FaxLineCreateRequest**](../Model/FaxLineCreateRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\FaxLineResponse**](../Model/FaxLineResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `faxLineDelete()` + +```php +faxLineDelete($fax_line_delete_request) +``` +Delete Fax Line + +Deletes the specified Fax Line from the subscription. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +$data = new Dropbox\Sign\Model\FaxLineDeleteRequest(); +$data->setNumber("[FAX_NUMBER]"); + +try { + $faxLineApi->faxLineDelete($data); +} 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_line_delete_request** | [**\Dropbox\Sign\Model\FaxLineDeleteRequest**](../Model/FaxLineDeleteRequest.md)| | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `faxLineGet()` + +```php +faxLineGet($number): \Dropbox\Sign\Model\FaxLineResponse +``` +Get Fax Line + +Returns the properties and settings of a Fax Line. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +try { + $result = $faxLineApi->faxLineGet("[FAX_NUMBER]"); + 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 | +| ------------- | ------------- | ------------- | ------------- | +| **number** | **string**| The Fax Line number. | | + +### Return type + +[**\Dropbox\Sign\Model\FaxLineResponse**](../Model/FaxLineResponse.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) + +## `faxLineList()` + +```php +faxLineList($account_id, $page, $page_size, $show_team_lines): \Dropbox\Sign\Model\FaxLineListResponse +``` +List Fax Lines + +Returns the properties and settings of multiple Fax Lines. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +try { + $result = $faxLineApi->faxLineList(); + 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 | +| ------------- | ------------- | ------------- | ------------- | +| **account_id** | **string**| Account ID | [optional] | +| **page** | **int**| Page | [optional] [default to 1] | +| **page_size** | **int**| Page size | [optional] [default to 20] | +| **show_team_lines** | **bool**| Show team lines | [optional] | + +### Return type + +[**\Dropbox\Sign\Model\FaxLineListResponse**](../Model/FaxLineListResponse.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) + +## `faxLineRemoveUser()` + +```php +faxLineRemoveUser($fax_line_remove_user_request): \Dropbox\Sign\Model\FaxLineResponse +``` +Remove Fax Line Access + +Removes a user's access to the specified Fax Line. + +### Example + +```php +setUsername("YOUR_API_KEY"); + +$faxLineApi = new Dropbox\Sign\Api\FaxLineApi($config); + +$data = new Dropbox\Sign\Model\FaxLineRemoveUserRequest(); +$data->setNumber("[FAX_NUMBER]") + ->setEmailAddress("member@dropboxsign.com"); + +try { + $result = $faxLineApi->faxLineRemoveUser($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_line_remove_user_request** | [**\Dropbox\Sign\Model\FaxLineRemoveUserRequest**](../Model/FaxLineRemoveUserRequest.md)| | | + +### Return type + +[**\Dropbox\Sign\Model\FaxLineResponse**](../Model/FaxLineResponse.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/sdks/php/docs/Api/OAuthApi.md b/sdks/php/docs/Api/OAuthApi.md index 9b63ca7fd..854b4b7a0 100644 --- a/sdks/php/docs/Api/OAuthApi.md +++ b/sdks/php/docs/Api/OAuthApi.md @@ -13,7 +13,6 @@ All URIs are relative to https://api.hellosign.com/v3. ```php oauthTokenGenerate($o_auth_token_generate_request): \Dropbox\Sign\Model\OAuthTokenResponse ``` - OAuth Token Generate Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. @@ -74,7 +73,6 @@ No authorization required ```php oauthTokenRefresh($o_auth_token_refresh_request): \Dropbox\Sign\Model\OAuthTokenResponse ``` - OAuth Token Refresh Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. diff --git a/sdks/php/docs/Api/ReportApi.md b/sdks/php/docs/Api/ReportApi.md index 95afd1fd0..285a20e83 100644 --- a/sdks/php/docs/Api/ReportApi.md +++ b/sdks/php/docs/Api/ReportApi.md @@ -12,7 +12,6 @@ All URIs are relative to https://api.hellosign.com/v3. ```php reportCreate($report_create_request): \Dropbox\Sign\Model\ReportCreateResponse ``` - Create Report Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. diff --git a/sdks/php/docs/Api/SignatureRequestApi.md b/sdks/php/docs/Api/SignatureRequestApi.md index 078cc8769..373d1215c 100644 --- a/sdks/php/docs/Api/SignatureRequestApi.md +++ b/sdks/php/docs/Api/SignatureRequestApi.md @@ -27,7 +27,6 @@ All URIs are relative to https://api.hellosign.com/v3. ```php signatureRequestBulkCreateEmbeddedWithTemplate($signature_request_bulk_create_embedded_with_template_request): \Dropbox\Sign\Model\BulkSendJobSendResponse ``` - Embedded Bulk Send with Template Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. @@ -126,7 +125,6 @@ try { ```php signatureRequestBulkSendWithTemplate($signature_request_bulk_send_with_template_request): \Dropbox\Sign\Model\BulkSendJobSendResponse ``` - Bulk Send with Template Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. @@ -227,7 +225,6 @@ try { ```php signatureRequestCancel($signature_request_id) ``` - Cancel Incomplete Signature Request Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. @@ -289,7 +286,6 @@ void (empty response body) ```php signatureRequestCreateEmbedded($signature_request_create_embedded_request): \Dropbox\Sign\Model\SignatureRequestGetResponse ``` - Create Embedded Signature Request Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. @@ -381,7 +377,6 @@ try { ```php signatureRequestCreateEmbeddedWithTemplate($signature_request_create_embedded_with_template_request): \Dropbox\Sign\Model\SignatureRequestGetResponse ``` - Create Embedded Signature Request with Template Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. @@ -463,7 +458,6 @@ try { ```php signatureRequestFiles($signature_request_id, $file_type): \SplFileObject ``` - Download Files Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. @@ -528,7 +522,6 @@ try { ```php signatureRequestFilesAsDataUri($signature_request_id): \Dropbox\Sign\Model\FileResponseDataUri ``` - Download Files as Data Uri Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. @@ -591,7 +584,6 @@ try { ```php signatureRequestFilesAsFileUrl($signature_request_id, $force_download): \Dropbox\Sign\Model\FileResponse ``` - Download Files as File Url Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. @@ -655,7 +647,6 @@ try { ```php signatureRequestGet($signature_request_id): \Dropbox\Sign\Model\SignatureRequestGetResponse ``` - Get Signature Request Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. @@ -718,7 +709,6 @@ try { ```php signatureRequestList($account_id, $page, $page_size, $query): \Dropbox\Sign\Model\SignatureRequestListResponse ``` - List Signature Requests Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. @@ -785,7 +775,6 @@ try { ```php signatureRequestReleaseHold($signature_request_id): \Dropbox\Sign\Model\SignatureRequestGetResponse ``` - Release On-Hold Signature Request Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. @@ -848,7 +837,6 @@ try { ```php signatureRequestRemind($signature_request_id, $signature_request_remind_request): \Dropbox\Sign\Model\SignatureRequestGetResponse ``` - Send Request Reminder Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. @@ -915,7 +903,6 @@ try { ```php signatureRequestRemove($signature_request_id) ``` - Remove Signature Request Access Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. @@ -974,7 +961,6 @@ void (empty response body) ```php signatureRequestSend($signature_request_send_request): \Dropbox\Sign\Model\SignatureRequestGetResponse ``` - Send Signature Request Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. @@ -1073,7 +1059,6 @@ try { ```php signatureRequestSendWithTemplate($signature_request_send_with_template_request): \Dropbox\Sign\Model\SignatureRequestGetResponse ``` - Send with Template Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. @@ -1166,7 +1151,6 @@ try { ```php signatureRequestUpdate($signature_request_id, $signature_request_update_request): \Dropbox\Sign\Model\SignatureRequestGetResponse ``` - Update Signature Request Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. diff --git a/sdks/php/docs/Api/TeamApi.md b/sdks/php/docs/Api/TeamApi.md index 7705304ad..1f46c6b3f 100644 --- a/sdks/php/docs/Api/TeamApi.md +++ b/sdks/php/docs/Api/TeamApi.md @@ -21,7 +21,6 @@ All URIs are relative to https://api.hellosign.com/v3. ```php teamAddMember($team_add_member_request, $team_id): \Dropbox\Sign\Model\TeamGetResponse ``` - Add User to Team Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. @@ -86,7 +85,6 @@ try { ```php teamCreate($team_create_request): \Dropbox\Sign\Model\TeamGetResponse ``` - Create Team Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. @@ -150,7 +148,6 @@ try { ```php teamDelete() ``` - Delete Team Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). @@ -208,7 +205,6 @@ void (empty response body) ```php teamGet(): \Dropbox\Sign\Model\TeamGetResponse ``` - Get Team Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. @@ -267,7 +263,6 @@ try { ```php teamInfo($team_id): \Dropbox\Sign\Model\TeamGetInfoResponse ``` - Get Team Info Provides information about a team. @@ -328,7 +323,6 @@ try { ```php teamInvites($email_address): \Dropbox\Sign\Model\TeamInvitesResponse ``` - List Team Invites Provides a list of team invites (and their roles). @@ -391,7 +385,6 @@ try { ```php teamMembers($team_id, $page, $page_size): \Dropbox\Sign\Model\TeamMembersResponse ``` - List Team Members Provides a paginated list of members (and their roles) that belong to a given team. @@ -456,7 +449,6 @@ try { ```php teamRemoveMember($team_remove_member_request): \Dropbox\Sign\Model\TeamGetResponse ``` - Remove User from Team Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. @@ -521,7 +513,6 @@ try { ```php teamSubTeams($team_id, $page, $page_size): \Dropbox\Sign\Model\TeamSubTeamsResponse ``` - List Sub Teams Provides a paginated list of sub teams that belong to a given team. @@ -586,7 +577,6 @@ try { ```php teamUpdate($team_update_request): \Dropbox\Sign\Model\TeamGetResponse ``` - Update Team Updates the name of your Team. diff --git a/sdks/php/docs/Api/TemplateApi.md b/sdks/php/docs/Api/TemplateApi.md index c81bc7b74..3331db8dd 100644 --- a/sdks/php/docs/Api/TemplateApi.md +++ b/sdks/php/docs/Api/TemplateApi.md @@ -22,7 +22,6 @@ All URIs are relative to https://api.hellosign.com/v3. ```php templateAddUser($template_id, $template_add_user_request): \Dropbox\Sign\Model\TemplateGetResponse ``` - Add User to Template Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. @@ -89,7 +88,6 @@ try { ```php templateCreate($template_create_request): \Dropbox\Sign\Model\TemplateCreateResponse ``` - Create Template Creates a template that can then be used. @@ -181,7 +179,6 @@ try { ```php templateCreateEmbeddedDraft($template_create_embedded_draft_request): \Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse ``` - Create Embedded Template Draft The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. @@ -273,7 +270,6 @@ try { ```php templateDelete($template_id) ``` - Delete Template Completely deletes the template specified from the account. @@ -335,7 +331,6 @@ void (empty response body) ```php templateFiles($template_id, $file_type): \SplFileObject ``` - Get Template Files Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. @@ -400,7 +395,6 @@ try { ```php templateFilesAsDataUri($template_id): \Dropbox\Sign\Model\FileResponseDataUri ``` - Get Template Files as Data Uri Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. @@ -463,7 +457,6 @@ try { ```php templateFilesAsFileUrl($template_id, $force_download): \Dropbox\Sign\Model\FileResponse ``` - Get Template Files as File Url Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. @@ -527,7 +520,6 @@ try { ```php templateGet($template_id): \Dropbox\Sign\Model\TemplateGetResponse ``` - Get Template Returns the Template specified by the `template_id` parameter. @@ -590,7 +582,6 @@ try { ```php templateList($account_id, $page, $page_size, $query): \Dropbox\Sign\Model\TemplateListResponse ``` - List Templates Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. @@ -656,7 +647,6 @@ try { ```php templateRemoveUser($template_id, $template_remove_user_request): \Dropbox\Sign\Model\TemplateGetResponse ``` - Remove User from Template Removes the specified Account's access to the specified Template. @@ -723,7 +713,6 @@ try { ```php templateUpdateFiles($template_id, $template_update_files_request): \Dropbox\Sign\Model\TemplateUpdateFilesResponse ``` - Update Template Files Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). diff --git a/sdks/php/docs/Api/UnclaimedDraftApi.md b/sdks/php/docs/Api/UnclaimedDraftApi.md index c0dd2c438..a2b2f4236 100644 --- a/sdks/php/docs/Api/UnclaimedDraftApi.md +++ b/sdks/php/docs/Api/UnclaimedDraftApi.md @@ -15,7 +15,6 @@ All URIs are relative to https://api.hellosign.com/v3. ```php unclaimedDraftCreate($unclaimed_draft_create_request): \Dropbox\Sign\Model\UnclaimedDraftCreateResponse ``` - Create Unclaimed Draft Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. @@ -114,7 +113,6 @@ try { ```php unclaimedDraftCreateEmbedded($unclaimed_draft_create_embedded_request): \Dropbox\Sign\Model\UnclaimedDraftCreateResponse ``` - Create Embedded Unclaimed Draft Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. @@ -181,7 +179,6 @@ try { ```php unclaimedDraftCreateEmbeddedWithTemplate($unclaimed_draft_create_embedded_with_template_request): \Dropbox\Sign\Model\UnclaimedDraftCreateResponse ``` - Create Embedded Unclaimed Draft with Template Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. @@ -259,7 +256,6 @@ try { ```php unclaimedDraftEditAndResend($signature_request_id, $unclaimed_draft_edit_and_resend_request): \Dropbox\Sign\Model\UnclaimedDraftCreateResponse ``` - Edit and Resend Unclaimed Draft Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. diff --git a/sdks/php/docs/Model/AccountCreateResponse.md b/sdks/php/docs/Model/AccountCreateResponse.md index 8fe2b43b0..bf38de482 100644 --- a/sdks/php/docs/Model/AccountCreateResponse.md +++ b/sdks/php/docs/Model/AccountCreateResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `account` | [```\Dropbox\Sign\Model\AccountResponse```](AccountResponse.md) | | | +| `account`*_required_ | [```\Dropbox\Sign\Model\AccountResponse```](AccountResponse.md) | | | | `oauth_data` | [```\Dropbox\Sign\Model\OAuthTokenResponse```](OAuthTokenResponse.md) | | | | `warnings` | [```\Dropbox\Sign\Model\WarningResponse[]```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/php/docs/Model/AccountGetResponse.md b/sdks/php/docs/Model/AccountGetResponse.md index 2fcbaea24..e7cecaf5d 100644 --- a/sdks/php/docs/Model/AccountGetResponse.md +++ b/sdks/php/docs/Model/AccountGetResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `account` | [```\Dropbox\Sign\Model\AccountResponse```](AccountResponse.md) | | | +| `account`*_required_ | [```\Dropbox\Sign\Model\AccountResponse```](AccountResponse.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/ApiAppGetResponse.md b/sdks/php/docs/Model/ApiAppGetResponse.md index 7713af6a7..b47e35c20 100644 --- a/sdks/php/docs/Model/ApiAppGetResponse.md +++ b/sdks/php/docs/Model/ApiAppGetResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `api_app` | [```\Dropbox\Sign\Model\ApiAppResponse```](ApiAppResponse.md) | | | +| `api_app`*_required_ | [```\Dropbox\Sign\Model\ApiAppResponse```](ApiAppResponse.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/ApiAppListResponse.md b/sdks/php/docs/Model/ApiAppListResponse.md index 5b5eb1ace..2eb8ae3c9 100644 --- a/sdks/php/docs/Model/ApiAppListResponse.md +++ b/sdks/php/docs/Model/ApiAppListResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `api_apps` | [```\Dropbox\Sign\Model\ApiAppResponse[]```](ApiAppResponse.md) | Contains information about API Apps. | | -| `list_info` | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | +| `api_apps`*_required_ | [```\Dropbox\Sign\Model\ApiAppResponse[]```](ApiAppResponse.md) | Contains information about API Apps. | | +| `list_info`*_required_ | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.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/BulkSendJobGetResponse.md b/sdks/php/docs/Model/BulkSendJobGetResponse.md index 2d5dec769..ec44f5b9a 100644 --- a/sdks/php/docs/Model/BulkSendJobGetResponse.md +++ b/sdks/php/docs/Model/BulkSendJobGetResponse.md @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `bulk_send_job` | [```\Dropbox\Sign\Model\BulkSendJobResponse```](BulkSendJobResponse.md) | | | -| `list_info` | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | -| `signature_requests` | [```\Dropbox\Sign\Model\BulkSendJobGetResponseSignatureRequests[]```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | +| `bulk_send_job`*_required_ | [```\Dropbox\Sign\Model\BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `list_info`*_required_ | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | +| `signature_requests`*_required_ | [```\Dropbox\Sign\Model\BulkSendJobGetResponseSignatureRequests[]```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | | `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/BulkSendJobListResponse.md b/sdks/php/docs/Model/BulkSendJobListResponse.md index aa4742fe9..470448cd9 100644 --- a/sdks/php/docs/Model/BulkSendJobListResponse.md +++ b/sdks/php/docs/Model/BulkSendJobListResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `bulk_send_jobs` | [```\Dropbox\Sign\Model\BulkSendJobResponse[]```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | -| `list_info` | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | +| `bulk_send_jobs`*_required_ | [```\Dropbox\Sign\Model\BulkSendJobResponse[]```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | +| `list_info`*_required_ | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.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/BulkSendJobSendResponse.md b/sdks/php/docs/Model/BulkSendJobSendResponse.md index 8f933ecee..83f1c7f8b 100644 --- a/sdks/php/docs/Model/BulkSendJobSendResponse.md +++ b/sdks/php/docs/Model/BulkSendJobSendResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `bulk_send_job` | [```\Dropbox\Sign\Model\BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `bulk_send_job`*_required_ | [```\Dropbox\Sign\Model\BulkSendJobResponse```](BulkSendJobResponse.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/EmbeddedEditUrlResponse.md b/sdks/php/docs/Model/EmbeddedEditUrlResponse.md index a2b930f99..75b539197 100644 --- a/sdks/php/docs/Model/EmbeddedEditUrlResponse.md +++ b/sdks/php/docs/Model/EmbeddedEditUrlResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `embedded` | [```\Dropbox\Sign\Model\EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | +| `embedded`*_required_ | [```\Dropbox\Sign\Model\EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.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/EmbeddedSignUrlResponse.md b/sdks/php/docs/Model/EmbeddedSignUrlResponse.md index d4ac6ea33..bbf44ed90 100644 --- a/sdks/php/docs/Model/EmbeddedSignUrlResponse.md +++ b/sdks/php/docs/Model/EmbeddedSignUrlResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `embedded` | [```\Dropbox\Sign\Model\EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | +| `embedded`*_required_ | [```\Dropbox\Sign\Model\EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.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/FaxLineAddUserRequest.md b/sdks/php/docs/Model/FaxLineAddUserRequest.md new file mode 100644 index 000000000..aef875b22 --- /dev/null +++ b/sdks/php/docs/Model/FaxLineAddUserRequest.md @@ -0,0 +1,13 @@ +# # FaxLineAddUserRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```string``` | The Fax Line number. | | +| `account_id` | ```string``` | Account ID | | +| `email_address` | ```string``` | Email address | | + +[[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/FaxLineAreaCodeGetCountryEnum.md b/sdks/php/docs/Model/FaxLineAreaCodeGetCountryEnum.md new file mode 100644 index 000000000..91b758d8f --- /dev/null +++ b/sdks/php/docs/Model/FaxLineAreaCodeGetCountryEnum.md @@ -0,0 +1,10 @@ +# # FaxLineAreaCodeGetCountryEnum + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/FaxLineAreaCodeGetProvinceEnum.md b/sdks/php/docs/Model/FaxLineAreaCodeGetProvinceEnum.md new file mode 100644 index 000000000..369a34359 --- /dev/null +++ b/sdks/php/docs/Model/FaxLineAreaCodeGetProvinceEnum.md @@ -0,0 +1,10 @@ +# # FaxLineAreaCodeGetProvinceEnum + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/FaxLineAreaCodeGetResponse.md b/sdks/php/docs/Model/FaxLineAreaCodeGetResponse.md new file mode 100644 index 000000000..3f1d9039a --- /dev/null +++ b/sdks/php/docs/Model/FaxLineAreaCodeGetResponse.md @@ -0,0 +1,11 @@ +# # FaxLineAreaCodeGetResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `area_codes`*_required_ | ```int[]``` | | | + +[[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/FaxLineAreaCodeGetStateEnum.md b/sdks/php/docs/Model/FaxLineAreaCodeGetStateEnum.md new file mode 100644 index 000000000..f978b75a2 --- /dev/null +++ b/sdks/php/docs/Model/FaxLineAreaCodeGetStateEnum.md @@ -0,0 +1,10 @@ +# # FaxLineAreaCodeGetStateEnum + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/FaxLineCreateRequest.md b/sdks/php/docs/Model/FaxLineCreateRequest.md new file mode 100644 index 000000000..6b599a339 --- /dev/null +++ b/sdks/php/docs/Model/FaxLineCreateRequest.md @@ -0,0 +1,14 @@ +# # FaxLineCreateRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `area_code`*_required_ | ```int``` | Area code | | +| `country`*_required_ | ```string``` | Country | | +| `city` | ```string``` | City | | +| `account_id` | ```string``` | Account ID | | + +[[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/FaxLineDeleteRequest.md b/sdks/php/docs/Model/FaxLineDeleteRequest.md new file mode 100644 index 000000000..a2112ed33 --- /dev/null +++ b/sdks/php/docs/Model/FaxLineDeleteRequest.md @@ -0,0 +1,11 @@ +# # FaxLineDeleteRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```string``` | The Fax Line number. | | + +[[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/FaxLineListResponse.md b/sdks/php/docs/Model/FaxLineListResponse.md new file mode 100644 index 000000000..3b6398939 --- /dev/null +++ b/sdks/php/docs/Model/FaxLineListResponse.md @@ -0,0 +1,13 @@ +# # FaxLineListResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `list_info`*_required_ | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | +| `fax_lines`*_required_ | [```\Dropbox\Sign\Model\FaxLineResponseFaxLine[]```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```\Dropbox\Sign\Model\WarningResponse```](WarningResponse.md) | | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/FaxLineRemoveUserRequest.md b/sdks/php/docs/Model/FaxLineRemoveUserRequest.md new file mode 100644 index 000000000..6def01071 --- /dev/null +++ b/sdks/php/docs/Model/FaxLineRemoveUserRequest.md @@ -0,0 +1,13 @@ +# # FaxLineRemoveUserRequest + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```string``` | The Fax Line number. | | +| `account_id` | ```string``` | Account ID | | +| `email_address` | ```string``` | Email address | | + +[[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/FaxLineResponse.md b/sdks/php/docs/Model/FaxLineResponse.md new file mode 100644 index 000000000..372b1d043 --- /dev/null +++ b/sdks/php/docs/Model/FaxLineResponse.md @@ -0,0 +1,12 @@ +# # FaxLineResponse + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_line`*_required_ | [```\Dropbox\Sign\Model\FaxLineResponseFaxLine```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```\Dropbox\Sign\Model\WarningResponse```](WarningResponse.md) | | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/FaxLineResponseFaxLine.md b/sdks/php/docs/Model/FaxLineResponseFaxLine.md new file mode 100644 index 000000000..51f479adc --- /dev/null +++ b/sdks/php/docs/Model/FaxLineResponseFaxLine.md @@ -0,0 +1,14 @@ +# # FaxLineResponseFaxLine + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number` | ```string``` | Number | | +| `created_at` | ```int``` | Created at | | +| `updated_at` | ```int``` | Updated at | | +| `accounts` | [```\Dropbox\Sign\Model\AccountResponse[]```](AccountResponse.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/FileResponse.md b/sdks/php/docs/Model/FileResponse.md index 29c92acc1..5803b6565 100644 --- a/sdks/php/docs/Model/FileResponse.md +++ b/sdks/php/docs/Model/FileResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `file_url` | ```string``` | URL to the file. | | -| `expires_at` | ```int``` | When the link expires. | | +| `file_url`*_required_ | ```string``` | URL to the file. | | +| `expires_at`*_required_ | ```int``` | When the link expires. | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/FileResponseDataUri.md b/sdks/php/docs/Model/FileResponseDataUri.md index 48d1f047b..dbead09b0 100644 --- a/sdks/php/docs/Model/FileResponseDataUri.md +++ b/sdks/php/docs/Model/FileResponseDataUri.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `data_uri` | ```string``` | File as base64 encoded string. | | +| `data_uri`*_required_ | ```string``` | File as base64 encoded string. | | [[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/ReportCreateResponse.md b/sdks/php/docs/Model/ReportCreateResponse.md index ed9d6a43c..335d94a47 100644 --- a/sdks/php/docs/Model/ReportCreateResponse.md +++ b/sdks/php/docs/Model/ReportCreateResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `report` | [```\Dropbox\Sign\Model\ReportResponse```](ReportResponse.md) | | | +| `report`*_required_ | [```\Dropbox\Sign\Model\ReportResponse```](ReportResponse.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/SignatureRequestGetResponse.md b/sdks/php/docs/Model/SignatureRequestGetResponse.md index d276a5e13..c2f3c97b7 100644 --- a/sdks/php/docs/Model/SignatureRequestGetResponse.md +++ b/sdks/php/docs/Model/SignatureRequestGetResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `signature_request` | [```\Dropbox\Sign\Model\SignatureRequestResponse```](SignatureRequestResponse.md) | | | +| `signature_request`*_required_ | [```\Dropbox\Sign\Model\SignatureRequestResponse```](SignatureRequestResponse.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/SignatureRequestListResponse.md b/sdks/php/docs/Model/SignatureRequestListResponse.md index c4a8ac0e1..c0aae36cd 100644 --- a/sdks/php/docs/Model/SignatureRequestListResponse.md +++ b/sdks/php/docs/Model/SignatureRequestListResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `signature_requests` | [```\Dropbox\Sign\Model\SignatureRequestResponse[]```](SignatureRequestResponse.md) | Contains information about signature requests. | | -| `list_info` | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | +| `signature_requests`*_required_ | [```\Dropbox\Sign\Model\SignatureRequestResponse[]```](SignatureRequestResponse.md) | Contains information about signature requests. | | +| `list_info`*_required_ | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.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/TeamGetInfoResponse.md b/sdks/php/docs/Model/TeamGetInfoResponse.md index c2d45f633..6250ae721 100644 --- a/sdks/php/docs/Model/TeamGetInfoResponse.md +++ b/sdks/php/docs/Model/TeamGetInfoResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `team` | [```\Dropbox\Sign\Model\TeamInfoResponse```](TeamInfoResponse.md) | | | +| `team`*_required_ | [```\Dropbox\Sign\Model\TeamInfoResponse```](TeamInfoResponse.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/TeamGetResponse.md b/sdks/php/docs/Model/TeamGetResponse.md index 2a6e4cffd..0d65f9000 100644 --- a/sdks/php/docs/Model/TeamGetResponse.md +++ b/sdks/php/docs/Model/TeamGetResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `team` | [```\Dropbox\Sign\Model\TeamResponse```](TeamResponse.md) | | | +| `team`*_required_ | [```\Dropbox\Sign\Model\TeamResponse```](TeamResponse.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/TeamInvitesResponse.md b/sdks/php/docs/Model/TeamInvitesResponse.md index de58a4720..64d96b25b 100644 --- a/sdks/php/docs/Model/TeamInvitesResponse.md +++ b/sdks/php/docs/Model/TeamInvitesResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `team_invites` | [```\Dropbox\Sign\Model\TeamInviteResponse[]```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | +| `team_invites`*_required_ | [```\Dropbox\Sign\Model\TeamInviteResponse[]```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | | `warnings` | [```\Dropbox\Sign\Model\WarningResponse[]```](WarningResponse.md) | | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/TeamMembersResponse.md b/sdks/php/docs/Model/TeamMembersResponse.md index 1efec1b0a..0474722c4 100644 --- a/sdks/php/docs/Model/TeamMembersResponse.md +++ b/sdks/php/docs/Model/TeamMembersResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `team_members` | [```\Dropbox\Sign\Model\TeamMemberResponse[]```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | -| `list_info` | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | +| `team_members`*_required_ | [```\Dropbox\Sign\Model\TeamMemberResponse[]```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | +| `list_info`*_required_ | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```\Dropbox\Sign\Model\WarningResponse[]```](WarningResponse.md) | | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/TeamSubTeamsResponse.md b/sdks/php/docs/Model/TeamSubTeamsResponse.md index a8fc485ba..9a37ce150 100644 --- a/sdks/php/docs/Model/TeamSubTeamsResponse.md +++ b/sdks/php/docs/Model/TeamSubTeamsResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `sub_teams` | [```\Dropbox\Sign\Model\SubTeamResponse[]```](SubTeamResponse.md) | Contains a list with sub teams. | | -| `list_info` | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | +| `sub_teams`*_required_ | [```\Dropbox\Sign\Model\SubTeamResponse[]```](SubTeamResponse.md) | Contains a list with sub teams. | | +| `list_info`*_required_ | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```\Dropbox\Sign\Model\WarningResponse[]```](WarningResponse.md) | | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/sdks/php/docs/Model/TemplateCreateEmbeddedDraftResponse.md b/sdks/php/docs/Model/TemplateCreateEmbeddedDraftResponse.md index ff88f1507..439aa708e 100644 --- a/sdks/php/docs/Model/TemplateCreateEmbeddedDraftResponse.md +++ b/sdks/php/docs/Model/TemplateCreateEmbeddedDraftResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template` | [```\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | +| `template`*_required_ | [```\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.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/TemplateCreateResponse.md b/sdks/php/docs/Model/TemplateCreateResponse.md index 480c24ef2..676d2acca 100644 --- a/sdks/php/docs/Model/TemplateCreateResponse.md +++ b/sdks/php/docs/Model/TemplateCreateResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template` | [```\Dropbox\Sign\Model\TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | +| `template`*_required_ | [```\Dropbox\Sign\Model\TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.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/TemplateEditResponse.md b/sdks/php/docs/Model/TemplateEditResponse.md index aaa91a556..b343db573 100644 --- a/sdks/php/docs/Model/TemplateEditResponse.md +++ b/sdks/php/docs/Model/TemplateEditResponse.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template_id` | ```string``` | The id of the Template. | | +| `template_id`*_required_ | ```string``` | The id of the Template. | | [[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/TemplateGetResponse.md b/sdks/php/docs/Model/TemplateGetResponse.md index bf65941c6..0aba7b381 100644 --- a/sdks/php/docs/Model/TemplateGetResponse.md +++ b/sdks/php/docs/Model/TemplateGetResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template` | [```\Dropbox\Sign\Model\TemplateResponse```](TemplateResponse.md) | | | +| `template`*_required_ | [```\Dropbox\Sign\Model\TemplateResponse```](TemplateResponse.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/TemplateListResponse.md b/sdks/php/docs/Model/TemplateListResponse.md index f49368a1c..9723b1385 100644 --- a/sdks/php/docs/Model/TemplateListResponse.md +++ b/sdks/php/docs/Model/TemplateListResponse.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `templates` | [```\Dropbox\Sign\Model\TemplateResponse[]```](TemplateResponse.md) | List of templates that the API caller has access to. | | -| `list_info` | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.md) | | | +| `templates`*_required_ | [```\Dropbox\Sign\Model\TemplateResponse[]```](TemplateResponse.md) | List of templates that the API caller has access to. | | +| `list_info`*_required_ | [```\Dropbox\Sign\Model\ListInfoResponse```](ListInfoResponse.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/TemplateUpdateFilesResponse.md b/sdks/php/docs/Model/TemplateUpdateFilesResponse.md index 75f259eae..5d28cef0d 100644 --- a/sdks/php/docs/Model/TemplateUpdateFilesResponse.md +++ b/sdks/php/docs/Model/TemplateUpdateFilesResponse.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `template` | [```\Dropbox\Sign\Model\TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | +| `template`*_required_ | [```\Dropbox\Sign\Model\TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.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/UnclaimedDraftCreateResponse.md b/sdks/php/docs/Model/UnclaimedDraftCreateResponse.md index 8b4e5abbd..666b4ae1f 100644 --- a/sdks/php/docs/Model/UnclaimedDraftCreateResponse.md +++ b/sdks/php/docs/Model/UnclaimedDraftCreateResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -| `unclaimed_draft` | [```\Dropbox\Sign\Model\UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | +| `unclaimed_draft`*_required_ | [```\Dropbox\Sign\Model\UnclaimedDraftResponse```](UnclaimedDraftResponse.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/openapi-config.yaml b/sdks/php/openapi-config.yaml index d93266974..773838fe8 100644 --- a/sdks/php/openapi-config.yaml +++ b/sdks/php/openapi-config.yaml @@ -4,11 +4,18 @@ typeMappings: additionalProperties: packageName: dropbox/sign packageVersion: "^1.3.0" - artifactVersion: 1.5-dev + artifactVersion: 1.6-dev invokerPackage: "Dropbox\\Sign" sortModelPropertiesByRequiredFlag: true srcBasePath: src phpVersion: 7.4 + composerPackageName: "dropbox/sign" + artifactUrl: "https://hellosign.com" + licenseName: "MIT" + developerOrganization: "Dropbox Sign" + developerOrganizationUrl: "https://hellosign.com" + developerOrganizationEmail: "apisupport@hellosign.com" + useCustomTemplateCode: true files: EventCallbackHelper.mustache: templateType: SupportingFiles diff --git a/sdks/php/phpunit.xml.dist b/sdks/php/phpunit.xml.dist index b04c85f79..d53f74070 100644 --- a/sdks/php/phpunit.xml.dist +++ b/sdks/php/phpunit.xml.dist @@ -8,8 +8,7 @@ - ./test/Api - ./test/Model + ./test diff --git a/sdks/php/run-build b/sdks/php/run-build index 2818bb63b..f2d645a92 100755 --- a/sdks/php/run-build +++ b/sdks/php/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/ef882a4e6c6066007952de3bd7013f9940dc0de7/modules/openapi-generator/src/main/resources/php +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/php set -e @@ -10,7 +10,7 @@ WORKING_DIR="/app/php" docker run --rm \ -v "${DIR}/:/local" \ -v "${DIR}/openapi-sdk.yaml:/local/openapi-sdk.yaml" \ - openapitools/openapi-generator-cli:v5.3.0 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ @@ -22,10 +22,10 @@ bash "${DIR}/bin/php" composer install printf "\n" printf "Adding examples to Docs ...\n" -bash "${DIR}/bin/php" ./bin/generate-examples.php +bash "${DIR}/bin/php-8" ./bin/generate-examples.php printf "Running php-cs-fixer ...\n" -bash "${DIR}/bin/php" ./vendor/bin/php-cs-fixer fix --verbose +bash "${DIR}/bin/php-8" ./vendor/bin/php-cs-fixer fix --verbose printf "Replacing strings ...\n" docker run --rm \ diff --git a/sdks/php/src/Api/AccountApi.php b/sdks/php/src/Api/AccountApi.php index 9b2517429..cfdc96f11 100644 --- a/sdks/php/src/Api/AccountApi.php +++ b/sdks/php/src/Api/AccountApi.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -36,11 +35,11 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use GuzzleHttp\Utils; use InvalidArgumentException; +use JsonException; use Psr\Http\Message\ResponseInterface; use RuntimeException; @@ -48,34 +47,41 @@ * AccountApi Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class AccountApi { - /** - * @var ClientInterface - */ + /** @var ClientInterface */ protected $client; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @var HeaderSelector - */ + /** @var HeaderSelector */ protected $headerSelector; - /** - * @var int Host index - */ + /** @var int Host index */ protected $hostIndex; /** - * @var ResponseInterface|null + * @var string[] * */ + public const contentTypes = [ + 'accountCreate' => [ + 'application/json', + ], + 'accountGet' => [ + 'application/json', + ], + 'accountUpdate' => [ + 'application/json', + ], + 'accountVerify' => [ + 'application/json', + ], + ]; + + /** @var ResponseInterface|null */ protected $response; /** @@ -97,6 +103,7 @@ public function __construct( * Set the host index * * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future */ public function setHostIndex(int $hostIndex): void { @@ -107,6 +114,7 @@ public function setHostIndex(int $hostIndex): void * Get the host index * * @return int Host index + * @deprecated To be made private in the future */ public function getHostIndex() { @@ -136,14 +144,13 @@ public function getResponse() * * @param Model\AccountCreateRequest $account_create_request account_create_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\AccountCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function accountCreate(Model\AccountCreateRequest $account_create_request) { list($response) = $this->accountCreateWithHttpInfo($account_create_request); - return $response; } @@ -153,14 +160,16 @@ public function accountCreate(Model\AccountCreateRequest $account_create_request * Create Account * * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\AccountCreateResponse, 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 ::accountCreate. This method will eventually become unavailable */ - public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_create_request) + public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { - $request = $this->accountCreateRequest($account_create_request); + $request = $this->accountCreateRequest($account_create_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -170,14 +179,14 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -190,51 +199,73 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\AccountCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountCreateResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\AccountCreateResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\AccountCreateResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountCreateResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\AccountCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -243,28 +274,19 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\AccountCreateResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\AccountCreateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -275,13 +297,15 @@ public function accountCreateWithHttpInfo(Model\AccountCreateRequest $account_cr * Create Account * * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateAsync(Model\AccountCreateRequest $account_create_request) + public function accountCreateAsync(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { - return $this->accountCreateAsyncWithHttpInfo($account_create_request) + return $this->accountCreateAsyncWithHttpInfo($account_create_request, $contentType) ->then( function ($response) { return $response[0]; @@ -295,23 +319,28 @@ function ($response) { * Create Account * * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateAsyncWithHttpInfo(Model\AccountCreateRequest $account_create_request) + public function accountCreateAsyncWithHttpInfo(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { $returnType = '\Dropbox\Sign\Model\AccountCreateResponse'; - $request = $this->accountCreateRequest($account_create_request); + $request = $this->accountCreateRequest($account_create_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -331,7 +360,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -341,11 +370,13 @@ function ($exception) { * Create request for operation 'accountCreate' * * @param Model\AccountCreateRequest $account_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountCreate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::accountCreate. This method will eventually become unavailable */ - public function accountCreateRequest(Model\AccountCreateRequest $account_create_request) + public function accountCreateRequest(Model\AccountCreateRequest $account_create_request, string $contentType = self::contentTypes['accountCreate'][0]) { // verify the required parameter 'account_create_request' is set if ($account_create_request === null || (is_array($account_create_request) && count($account_create_request) === 0)) { @@ -355,9 +386,11 @@ public function accountCreateRequest(Model\AccountCreateRequest $account_create_ } $resourcePath = '/account/create'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $account_create_request @@ -365,21 +398,17 @@ public function accountCreateRequest(Model\AccountCreateRequest $account_create_ $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_create_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_create_request)); } else { $httpBody = $account_create_request; } @@ -398,22 +427,22 @@ public function accountCreateRequest(Model\AccountCreateRequest $account_create_ // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $account_create_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -437,11 +466,11 @@ public function accountCreateRequest(Model\AccountCreateRequest $account_create_ $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -452,17 +481,16 @@ public function accountCreateRequest(Model\AccountCreateRequest $account_create_ * * Get Account * - * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) * @param string $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\AccountGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function accountGet(string $account_id = null, string $email_address = null) { list($response) = $this->accountGetWithHttpInfo($account_id, $email_address); - return $response; } @@ -471,16 +499,18 @@ public function accountGet(string $account_id = null, string $email_address = nu * * Get Account * - * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) * @param string $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\AccountGetResponse, 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 ::accountGet. This method will eventually become unavailable */ - public function accountGetWithHttpInfo(string $account_id = null, string $email_address = null) + public function accountGetWithHttpInfo(string $account_id = null, string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { - $request = $this->accountGetRequest($account_id, $email_address); + $request = $this->accountGetRequest($account_id, $email_address, $contentType); try { $options = $this->createHttpClientOption(); @@ -490,14 +520,14 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -510,51 +540,73 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\AccountGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\AccountGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\AccountGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -563,28 +615,19 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\AccountGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\AccountGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -594,15 +637,17 @@ public function accountGetWithHttpInfo(string $account_id = null, string $email_ * * Get Account * - * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) * @param string $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetAsync(string $account_id = null, string $email_address = null) + public function accountGetAsync(string $account_id = null, string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { - return $this->accountGetAsyncWithHttpInfo($account_id, $email_address) + return $this->accountGetAsyncWithHttpInfo($account_id, $email_address, $contentType) ->then( function ($response) { return $response[0]; @@ -615,25 +660,30 @@ function ($response) { * * Get Account * - * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) * @param string $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetAsyncWithHttpInfo(string $account_id = null, string $email_address = null) + public function accountGetAsyncWithHttpInfo(string $account_id = null, string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; - $request = $this->accountGetRequest($account_id, $email_address); + $request = $this->accountGetRequest($account_id, $email_address, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -653,7 +703,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -662,53 +712,47 @@ function ($exception) { /** * Create request for operation 'accountGet' * - * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) + * @param string $account_id `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) * @param string $email_address `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountGet'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::accountGet. This method will eventually become unavailable */ - public function accountGetRequest(string $account_id = null, string $email_address = null) + public function accountGetRequest(string $account_id = null, string $email_address = null, string $contentType = self::contentTypes['accountGet'][0]) { $resourcePath = '/account'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($account_id !== null) { - if ('form' === 'form' && is_array($account_id)) { - foreach ($account_id as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['account_id'] = $account_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $account_id, + 'account_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($email_address !== null) { - if ('form' === 'form' && is_array($email_address)) { - foreach ($email_address as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['email_address'] = $email_address; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $email_address, + 'email_address', // param base name + 'string', // 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) { @@ -726,18 +770,19 @@ public function accountGetRequest(string $account_id = null, string $email_addre // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -761,11 +806,11 @@ public function accountGetRequest(string $account_id = null, string $email_addre $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -778,14 +823,13 @@ public function accountGetRequest(string $account_id = null, string $email_addre * * @param Model\AccountUpdateRequest $account_update_request account_update_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\AccountGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function accountUpdate(Model\AccountUpdateRequest $account_update_request) { list($response) = $this->accountUpdateWithHttpInfo($account_update_request); - return $response; } @@ -795,14 +839,16 @@ public function accountUpdate(Model\AccountUpdateRequest $account_update_request * Update Account * * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\AccountGetResponse, 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 ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_update_request) + public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { - $request = $this->accountUpdateRequest($account_update_request); + $request = $this->accountUpdateRequest($account_update_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -812,14 +858,14 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -832,51 +878,73 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\AccountGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\AccountGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\AccountGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -885,28 +953,19 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\AccountGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\AccountGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -917,13 +976,15 @@ public function accountUpdateWithHttpInfo(Model\AccountUpdateRequest $account_up * Update Account * * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateAsync(Model\AccountUpdateRequest $account_update_request) + public function accountUpdateAsync(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { - return $this->accountUpdateAsyncWithHttpInfo($account_update_request) + return $this->accountUpdateAsyncWithHttpInfo($account_update_request, $contentType) ->then( function ($response) { return $response[0]; @@ -937,23 +998,28 @@ function ($response) { * Update Account * * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateAsyncWithHttpInfo(Model\AccountUpdateRequest $account_update_request) + public function accountUpdateAsyncWithHttpInfo(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\AccountGetResponse'; - $request = $this->accountUpdateRequest($account_update_request); + $request = $this->accountUpdateRequest($account_update_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -973,7 +1039,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -983,11 +1049,13 @@ function ($exception) { * Create request for operation 'accountUpdate' * * @param Model\AccountUpdateRequest $account_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountUpdate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::accountUpdate. This method will eventually become unavailable */ - public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_request) + public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_request, string $contentType = self::contentTypes['accountUpdate'][0]) { // verify the required parameter 'account_update_request' is set if ($account_update_request === null || (is_array($account_update_request) && count($account_update_request) === 0)) { @@ -997,9 +1065,11 @@ public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_ } $resourcePath = '/account'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $account_update_request @@ -1007,21 +1077,17 @@ public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_ $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_update_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_update_request)); } else { $httpBody = $account_update_request; } @@ -1040,22 +1106,22 @@ public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_ // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $account_update_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1079,11 +1145,11 @@ public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_ $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1096,14 +1162,13 @@ public function accountUpdateRequest(Model\AccountUpdateRequest $account_update_ * * @param Model\AccountVerifyRequest $account_verify_request account_verify_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\AccountVerifyResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function accountVerify(Model\AccountVerifyRequest $account_verify_request) { list($response) = $this->accountVerifyWithHttpInfo($account_verify_request); - return $response; } @@ -1113,14 +1178,16 @@ public function accountVerify(Model\AccountVerifyRequest $account_verify_request * Verify Account * * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\AccountVerifyResponse, 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 ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_verify_request) + public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { - $request = $this->accountVerifyRequest($account_verify_request); + $request = $this->accountVerifyRequest($account_verify_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1130,14 +1197,14 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1150,51 +1217,73 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\AccountVerifyResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountVerifyResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\AccountVerifyResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\AccountVerifyResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\AccountVerifyResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\AccountVerifyResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1203,28 +1292,19 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\AccountVerifyResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\AccountVerifyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1235,13 +1315,15 @@ public function accountVerifyWithHttpInfo(Model\AccountVerifyRequest $account_ve * Verify Account * * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyAsync(Model\AccountVerifyRequest $account_verify_request) + public function accountVerifyAsync(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { - return $this->accountVerifyAsyncWithHttpInfo($account_verify_request) + return $this->accountVerifyAsyncWithHttpInfo($account_verify_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1255,23 +1337,28 @@ function ($response) { * Verify Account * * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyAsyncWithHttpInfo(Model\AccountVerifyRequest $account_verify_request) + public function accountVerifyAsyncWithHttpInfo(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { $returnType = '\Dropbox\Sign\Model\AccountVerifyResponse'; - $request = $this->accountVerifyRequest($account_verify_request); + $request = $this->accountVerifyRequest($account_verify_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1291,7 +1378,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1301,11 +1388,13 @@ function ($exception) { * Create request for operation 'accountVerify' * * @param Model\AccountVerifyRequest $account_verify_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['accountVerify'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::accountVerify. This method will eventually become unavailable */ - public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_request) + public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_request, string $contentType = self::contentTypes['accountVerify'][0]) { // verify the required parameter 'account_verify_request' is set if ($account_verify_request === null || (is_array($account_verify_request) && count($account_verify_request) === 0)) { @@ -1315,9 +1404,11 @@ public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_ } $resourcePath = '/account/verify'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $account_verify_request @@ -1325,21 +1416,17 @@ public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_ $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_verify_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($account_verify_request)); } else { $httpBody = $account_verify_request; } @@ -1358,22 +1445,22 @@ public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_ // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $account_verify_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1397,11 +1484,11 @@ public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_ $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1410,8 +1497,8 @@ public function accountVerifyRequest(Model\AccountVerifyRequest $account_verify_ /** * Create http client option * - * @throws RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1425,4 +1512,66 @@ protected function createHttpClientOption() 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/Api/ApiAppApi.php b/sdks/php/src/Api/ApiAppApi.php index 2f158ac84..07dd3db63 100644 --- a/sdks/php/src/Api/ApiAppApi.php +++ b/sdks/php/src/Api/ApiAppApi.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -36,11 +35,11 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use GuzzleHttp\Utils; use InvalidArgumentException; +use JsonException; use Psr\Http\Message\ResponseInterface; use RuntimeException; @@ -48,34 +47,46 @@ * ApiAppApi Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class ApiAppApi { - /** - * @var ClientInterface - */ + /** @var ClientInterface */ protected $client; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @var HeaderSelector - */ + /** @var HeaderSelector */ protected $headerSelector; - /** - * @var int Host index - */ + /** @var int Host index */ protected $hostIndex; /** - * @var ResponseInterface|null + * @var string[] * */ + public const contentTypes = [ + 'apiAppCreate' => [ + 'application/json', + 'multipart/form-data', + ], + 'apiAppDelete' => [ + 'application/json', + ], + 'apiAppGet' => [ + 'application/json', + ], + 'apiAppList' => [ + 'application/json', + ], + 'apiAppUpdate' => [ + 'application/json', + 'multipart/form-data', + ], + ]; + + /** @var ResponseInterface|null */ protected $response; /** @@ -97,6 +108,7 @@ public function __construct( * Set the host index * * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future */ public function setHostIndex(int $hostIndex): void { @@ -107,6 +119,7 @@ public function setHostIndex(int $hostIndex): void * Get the host index * * @return int Host index + * @deprecated To be made private in the future */ public function getHostIndex() { @@ -136,14 +149,13 @@ public function getResponse() * * @param Model\ApiAppCreateRequest $api_app_create_request api_app_create_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\ApiAppGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function apiAppCreate(Model\ApiAppCreateRequest $api_app_create_request) { list($response) = $this->apiAppCreateWithHttpInfo($api_app_create_request); - return $response; } @@ -153,14 +165,16 @@ public function apiAppCreate(Model\ApiAppCreateRequest $api_app_create_request) * Create API App * * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\ApiAppGetResponse, 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 ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_create_request) + public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { - $request = $this->apiAppCreateRequest($api_app_create_request); + $request = $this->apiAppCreateRequest($api_app_create_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -170,14 +184,14 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -190,51 +204,73 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 201) { - if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 201: + if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\ApiAppGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -243,28 +279,19 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 201) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ApiAppGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\ApiAppGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -275,13 +302,15 @@ public function apiAppCreateWithHttpInfo(Model\ApiAppCreateRequest $api_app_crea * Create API App * * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateAsync(Model\ApiAppCreateRequest $api_app_create_request) + public function apiAppCreateAsync(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { - return $this->apiAppCreateAsyncWithHttpInfo($api_app_create_request) + return $this->apiAppCreateAsyncWithHttpInfo($api_app_create_request, $contentType) ->then( function ($response) { return $response[0]; @@ -295,23 +324,28 @@ function ($response) { * Create API App * * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateAsyncWithHttpInfo(Model\ApiAppCreateRequest $api_app_create_request) + public function apiAppCreateAsyncWithHttpInfo(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; - $request = $this->apiAppCreateRequest($api_app_create_request); + $request = $this->apiAppCreateRequest($api_app_create_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -331,7 +365,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -341,11 +375,13 @@ function ($exception) { * Create request for operation 'apiAppCreate' * * @param Model\ApiAppCreateRequest $api_app_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppCreate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::apiAppCreate. This method will eventually become unavailable */ - public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_request) + public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_request, string $contentType = self::contentTypes['apiAppCreate'][0]) { // verify the required parameter 'api_app_create_request' is set if ($api_app_create_request === null || (is_array($api_app_create_request) && count($api_app_create_request) === 0)) { @@ -355,9 +391,11 @@ public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_re } $resourcePath = '/api_app'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $api_app_create_request @@ -365,21 +403,17 @@ public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_re $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($api_app_create_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($api_app_create_request)); } else { $httpBody = $api_app_create_request; } @@ -398,22 +432,22 @@ public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_re // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $api_app_create_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -437,11 +471,11 @@ public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_re $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -454,9 +488,8 @@ public function apiAppCreateRequest(Model\ApiAppCreateRequest $api_app_create_re * * @param string $client_id The client id of the API App to delete. (required) * - * @throws ApiException on non-2xx response + * @throws ApiException on non-2xx response or if the response body is not in the expected format * @throws InvalidArgumentException - * @return void */ public function apiAppDelete(string $client_id) { @@ -468,15 +501,17 @@ public function apiAppDelete(string $client_id) * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @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 ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteWithHttpInfo(string $client_id) + public function apiAppDeleteWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { - $request = $this->apiAppDeleteRequest($client_id); + $request = $this->apiAppDeleteRequest($client_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -486,14 +521,14 @@ public function apiAppDeleteWithHttpInfo(string $client_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -506,29 +541,21 @@ public function apiAppDeleteWithHttpInfo(string $client_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { } - throw $e; } } @@ -538,14 +565,16 @@ public function apiAppDeleteWithHttpInfo(string $client_id) * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteAsync(string $client_id) + public function apiAppDeleteAsync(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { - return $this->apiAppDeleteAsyncWithHttpInfo($client_id) + return $this->apiAppDeleteAsyncWithHttpInfo($client_id, $contentType) ->then( function ($response) { return $response[0]; @@ -558,15 +587,17 @@ function ($response) { * * Delete API App * - * @param string $client_id The client id of the API App to delete. (required) + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteAsyncWithHttpInfo(string $client_id) + public function apiAppDeleteAsyncWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { $returnType = ''; - $request = $this->apiAppDeleteRequest($client_id); + $request = $this->apiAppDeleteRequest($client_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -585,7 +616,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -594,12 +625,14 @@ function ($exception) { /** * Create request for operation 'apiAppDelete' * - * @param string $client_id The client id of the API App to delete. (required) + * @param string $client_id The client id of the API App to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppDelete'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::apiAppDelete. This method will eventually become unavailable */ - public function apiAppDeleteRequest(string $client_id) + public function apiAppDeleteRequest(string $client_id, string $contentType = self::contentTypes['apiAppDelete'][0]) { // verify the required parameter 'client_id' is set if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) { @@ -609,32 +642,26 @@ public function apiAppDeleteRequest(string $client_id) } $resourcePath = '/api_app/{client_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($client_id !== null) { $resourcePath = str_replace( - '{' . 'client_id' . '}', + '{client_id}', ObjectSerializer::toPathValue($client_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -652,18 +679,19 @@ public function apiAppDeleteRequest(string $client_id) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -687,11 +715,11 @@ public function apiAppDeleteRequest(string $client_id) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -704,14 +732,13 @@ public function apiAppDeleteRequest(string $client_id) * * @param string $client_id The client id of the API App to retrieve. (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\ApiAppGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function apiAppGet(string $client_id) { list($response) = $this->apiAppGetWithHttpInfo($client_id); - return $response; } @@ -720,15 +747,17 @@ public function apiAppGet(string $client_id) * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\ApiAppGetResponse, 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 ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetWithHttpInfo(string $client_id) + public function apiAppGetWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { - $request = $this->apiAppGetRequest($client_id); + $request = $this->apiAppGetRequest($client_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -738,14 +767,14 @@ public function apiAppGetWithHttpInfo(string $client_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -758,51 +787,73 @@ public function apiAppGetWithHttpInfo(string $client_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\ApiAppGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -811,28 +862,19 @@ public function apiAppGetWithHttpInfo(string $client_id) $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ApiAppGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\ApiAppGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -842,14 +884,16 @@ public function apiAppGetWithHttpInfo(string $client_id) * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetAsync(string $client_id) + public function apiAppGetAsync(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { - return $this->apiAppGetAsyncWithHttpInfo($client_id) + return $this->apiAppGetAsyncWithHttpInfo($client_id, $contentType) ->then( function ($response) { return $response[0]; @@ -862,24 +906,29 @@ function ($response) { * * Get API App * - * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetAsyncWithHttpInfo(string $client_id) + public function apiAppGetAsyncWithHttpInfo(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; - $request = $this->apiAppGetRequest($client_id); + $request = $this->apiAppGetRequest($client_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -899,7 +948,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -908,12 +957,14 @@ function ($exception) { /** * Create request for operation 'apiAppGet' * - * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $client_id The client id of the API App to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppGet'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::apiAppGet. This method will eventually become unavailable */ - public function apiAppGetRequest(string $client_id) + public function apiAppGetRequest(string $client_id, string $contentType = self::contentTypes['apiAppGet'][0]) { // verify the required parameter 'client_id' is set if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) { @@ -923,32 +974,26 @@ public function apiAppGetRequest(string $client_id) } $resourcePath = '/api_app/{client_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($client_id !== null) { $resourcePath = str_replace( - '{' . 'client_id' . '}', + '{client_id}', ObjectSerializer::toPathValue($client_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -966,18 +1011,19 @@ public function apiAppGetRequest(string $client_id) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1001,11 +1047,11 @@ public function apiAppGetRequest(string $client_id) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1016,17 +1062,16 @@ public function apiAppGetRequest(string $client_id) * * List API Apps * - * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\ApiAppListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function apiAppList(int $page = 1, int $page_size = 20) { list($response) = $this->apiAppListWithHttpInfo($page, $page_size); - return $response; } @@ -1035,16 +1080,18 @@ public function apiAppList(int $page = 1, int $page_size = 20) * * List API Apps * - * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\ApiAppListResponse, 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 ::apiAppList. This method will eventually become unavailable */ - public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20) + public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { - $request = $this->apiAppListRequest($page, $page_size); + $request = $this->apiAppListRequest($page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -1054,14 +1101,14 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1074,51 +1121,73 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\ApiAppListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppListResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\ApiAppListResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\ApiAppListResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppListResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\ApiAppListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1127,28 +1196,19 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20) $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ApiAppListResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\ApiAppListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1158,15 +1218,17 @@ public function apiAppListWithHttpInfo(int $page = 1, int $page_size = 20) * * List API Apps * - * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListAsync(int $page = 1, int $page_size = 20) + public function apiAppListAsync(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { - return $this->apiAppListAsyncWithHttpInfo($page, $page_size) + return $this->apiAppListAsyncWithHttpInfo($page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -1179,25 +1241,30 @@ function ($response) { * * List API Apps * - * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListAsyncWithHttpInfo(int $page = 1, int $page_size = 20) + public function apiAppListAsyncWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppListResponse'; - $request = $this->apiAppListRequest($page, $page_size); + $request = $this->apiAppListRequest($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 + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1217,7 +1284,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1226,53 +1293,47 @@ function ($exception) { /** * Create request for operation 'apiAppList' * - * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param int $page Which page number of the API App List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppList'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::apiAppList. This method will eventually become unavailable */ - public function apiAppListRequest(int $page = 1, int $page_size = 20) + public function apiAppListRequest(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['apiAppList'][0]) { $resourcePath = '/api_app/list'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($page !== null) { - if ('form' === 'form' && is_array($page)) { - foreach ($page as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page'] = $page; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_size !== null) { - if ('form' === 'form' && is_array($page_size)) { - foreach ($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page_size'] = $page_size; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $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) { @@ -1290,18 +1351,19 @@ public function apiAppListRequest(int $page = 1, int $page_size = 20) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1325,11 +1387,11 @@ public function apiAppListRequest(int $page = 1, int $page_size = 20) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1340,17 +1402,16 @@ public function apiAppListRequest(int $page = 1, int $page_size = 20) * * Update API App * - * @param string $client_id The client id of the API App to update. (required) + * @param string $client_id The client id of the API App to update. (required) * @param Model\ApiAppUpdateRequest $api_app_update_request api_app_update_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\ApiAppGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function apiAppUpdate(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request) { list($response) = $this->apiAppUpdateWithHttpInfo($client_id, $api_app_update_request); - return $response; } @@ -1359,16 +1420,18 @@ public function apiAppUpdate(string $client_id, Model\ApiAppUpdateRequest $api_a * * Update API App * - * @param string $client_id The client id of the API App to update. (required) + * @param string $client_id The client id of the API App to update. (required) * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\ApiAppGetResponse, 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 ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request) + public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { - $request = $this->apiAppUpdateRequest($client_id, $api_app_update_request); + $request = $this->apiAppUpdateRequest($client_id, $api_app_update_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1378,14 +1441,14 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1398,51 +1461,73 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\ApiAppGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\ApiAppGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ApiAppGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1451,28 +1536,19 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ApiAppGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\ApiAppGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1482,15 +1558,17 @@ public function apiAppUpdateWithHttpInfo(string $client_id, Model\ApiAppUpdateRe * * Update API App * - * @param string $client_id The client id of the API App to update. (required) + * @param string $client_id The client id of the API App to update. (required) * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateAsync(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request) + public function apiAppUpdateAsync(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { - return $this->apiAppUpdateAsyncWithHttpInfo($client_id, $api_app_update_request) + return $this->apiAppUpdateAsyncWithHttpInfo($client_id, $api_app_update_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1503,25 +1581,30 @@ function ($response) { * * Update API App * - * @param string $client_id The client id of the API App to update. (required) + * @param string $client_id The client id of the API App to update. (required) * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateAsyncWithHttpInfo(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request) + public function apiAppUpdateAsyncWithHttpInfo(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\ApiAppGetResponse'; - $request = $this->apiAppUpdateRequest($client_id, $api_app_update_request); + $request = $this->apiAppUpdateRequest($client_id, $api_app_update_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1541,7 +1624,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1550,13 +1633,15 @@ function ($exception) { /** * Create request for operation 'apiAppUpdate' * - * @param string $client_id The client id of the API App to update. (required) + * @param string $client_id The client id of the API App to update. (required) * @param Model\ApiAppUpdateRequest $api_app_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAppUpdate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::apiAppUpdate. This method will eventually become unavailable */ - public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request) + public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest $api_app_update_request, string $contentType = self::contentTypes['apiAppUpdate'][0]) { // verify the required parameter 'client_id' is set if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) { @@ -1564,6 +1649,7 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest 'Missing the required parameter $client_id when calling apiAppUpdate' ); } + // verify the required parameter 'api_app_update_request' is set if ($api_app_update_request === null || (is_array($api_app_update_request) && count($api_app_update_request) === 0)) { throw new InvalidArgumentException( @@ -1572,9 +1658,11 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest } $resourcePath = '/api_app/{client_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $api_app_update_request @@ -1585,27 +1673,23 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest // path params if ($client_id !== null) { $resourcePath = str_replace( - '{' . 'client_id' . '}', + '{client_id}', ObjectSerializer::toPathValue($client_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($api_app_update_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($api_app_update_request)); } else { $httpBody = $api_app_update_request; } @@ -1624,22 +1708,22 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $api_app_update_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1663,11 +1747,11 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1676,8 +1760,8 @@ public function apiAppUpdateRequest(string $client_id, Model\ApiAppUpdateRequest /** * Create http client option * - * @throws RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1691,4 +1775,66 @@ protected function createHttpClientOption() 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/Api/BulkSendJobApi.php b/sdks/php/src/Api/BulkSendJobApi.php index 3656b9587..77ad055c7 100644 --- a/sdks/php/src/Api/BulkSendJobApi.php +++ b/sdks/php/src/Api/BulkSendJobApi.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -36,11 +35,11 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use GuzzleHttp\Utils; use InvalidArgumentException; +use JsonException; use Psr\Http\Message\ResponseInterface; use RuntimeException; @@ -48,34 +47,35 @@ * BulkSendJobApi Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class BulkSendJobApi { - /** - * @var ClientInterface - */ + /** @var ClientInterface */ protected $client; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @var HeaderSelector - */ + /** @var HeaderSelector */ protected $headerSelector; - /** - * @var int Host index - */ + /** @var int Host index */ protected $hostIndex; /** - * @var ResponseInterface|null + * @var string[] * */ + public const contentTypes = [ + 'bulkSendJobGet' => [ + 'application/json', + ], + 'bulkSendJobList' => [ + 'application/json', + ], + ]; + + /** @var ResponseInterface|null */ protected $response; /** @@ -97,6 +97,7 @@ public function __construct( * Set the host index * * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future */ public function setHostIndex(int $hostIndex): void { @@ -107,6 +108,7 @@ public function setHostIndex(int $hostIndex): void * Get the host index * * @return int Host index + * @deprecated To be made private in the future */ public function getHostIndex() { @@ -135,17 +137,16 @@ public function getResponse() * Get Bulk Send Job * * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\BulkSendJobGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function bulkSendJobGet(string $bulk_send_job_id, int $page = 1, int $page_size = 20) { list($response) = $this->bulkSendJobGetWithHttpInfo($bulk_send_job_id, $page, $page_size); - return $response; } @@ -155,16 +156,18 @@ public function bulkSendJobGet(string $bulk_send_job_id, int $page = 1, int $pag * Get Bulk Send Job * * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\BulkSendJobGetResponse, 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 ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = 1, int $page_size = 20) + public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { - $request = $this->bulkSendJobGetRequest($bulk_send_job_id, $page, $page_size); + $request = $this->bulkSendJobGetRequest($bulk_send_job_id, $page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -174,14 +177,14 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -194,51 +197,73 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\BulkSendJobGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\BulkSendJobGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\BulkSendJobGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\BulkSendJobGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -247,28 +272,19 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\BulkSendJobGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\BulkSendJobGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -279,15 +295,17 @@ public function bulkSendJobGetWithHttpInfo(string $bulk_send_job_id, int $page = * Get Bulk Send Job * * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetAsync(string $bulk_send_job_id, int $page = 1, int $page_size = 20) + public function bulkSendJobGetAsync(string $bulk_send_job_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { - return $this->bulkSendJobGetAsyncWithHttpInfo($bulk_send_job_id, $page, $page_size) + return $this->bulkSendJobGetAsyncWithHttpInfo($bulk_send_job_id, $page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -301,25 +319,30 @@ function ($response) { * Get Bulk Send Job * * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetAsyncWithHttpInfo(string $bulk_send_job_id, int $page = 1, int $page_size = 20) + public function bulkSendJobGetAsyncWithHttpInfo(string $bulk_send_job_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobGetResponse'; - $request = $this->bulkSendJobGetRequest($bulk_send_job_id, $page, $page_size); + $request = $this->bulkSendJobGetRequest($bulk_send_job_id, $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 + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -339,7 +362,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -349,13 +372,15 @@ function ($exception) { * Create request for operation 'bulkSendJobGet' * * @param string $bulk_send_job_id The id of the BulkSendJob to retrieve. (required) - * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int $page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobGet'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::bulkSendJobGet. This method will eventually become unavailable */ - public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, int $page_size = 20) + public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobGet'][0]) { // verify the required parameter 'bulk_send_job_id' is set if ($bulk_send_job_id === null || (is_array($bulk_send_job_id) && count($bulk_send_job_id) === 0)) { @@ -365,53 +390,45 @@ public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, i } $resourcePath = '/bulk_send_job/{bulk_send_job_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($page !== null) { - if ('form' === 'form' && is_array($page)) { - foreach ($page as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page'] = $page; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_size !== null) { - if ('form' === 'form' && is_array($page_size)) { - foreach ($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page_size'] = $page_size; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page_size', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params if ($bulk_send_job_id !== null) { $resourcePath = str_replace( - '{' . 'bulk_send_job_id' . '}', + '{bulk_send_job_id}', ObjectSerializer::toPathValue($bulk_send_job_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -429,18 +446,19 @@ public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, i // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -464,11 +482,11 @@ public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, i $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -479,17 +497,16 @@ public function bulkSendJobGetRequest(string $bulk_send_job_id, int $page = 1, i * * List Bulk Send Jobs * - * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\BulkSendJobListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function bulkSendJobList(int $page = 1, int $page_size = 20) { list($response) = $this->bulkSendJobListWithHttpInfo($page, $page_size); - return $response; } @@ -498,16 +515,18 @@ public function bulkSendJobList(int $page = 1, int $page_size = 20) * * List Bulk Send Jobs * - * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\BulkSendJobListResponse, 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 ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20) + public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { - $request = $this->bulkSendJobListRequest($page, $page_size); + $request = $this->bulkSendJobListRequest($page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -517,14 +536,14 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -537,51 +556,73 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\BulkSendJobListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobListResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\BulkSendJobListResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\BulkSendJobListResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobListResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\BulkSendJobListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -590,28 +631,19 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20) $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\BulkSendJobListResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\BulkSendJobListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -621,15 +653,17 @@ public function bulkSendJobListWithHttpInfo(int $page = 1, int $page_size = 20) * * List Bulk Send Jobs * - * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListAsync(int $page = 1, int $page_size = 20) + public function bulkSendJobListAsync(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { - return $this->bulkSendJobListAsyncWithHttpInfo($page, $page_size) + return $this->bulkSendJobListAsyncWithHttpInfo($page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -642,25 +676,30 @@ function ($response) { * * List Bulk Send Jobs * - * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListAsyncWithHttpInfo(int $page = 1, int $page_size = 20) + public function bulkSendJobListAsyncWithHttpInfo(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobListResponse'; - $request = $this->bulkSendJobListRequest($page, $page_size); + $request = $this->bulkSendJobListRequest($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 + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -680,7 +719,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -689,53 +728,47 @@ function ($exception) { /** * Create request for operation 'bulkSendJobList' * - * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param int $page Which page number of the BulkSendJob List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['bulkSendJobList'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::bulkSendJobList. This method will eventually become unavailable */ - public function bulkSendJobListRequest(int $page = 1, int $page_size = 20) + public function bulkSendJobListRequest(int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['bulkSendJobList'][0]) { $resourcePath = '/bulk_send_job/list'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($page !== null) { - if ('form' === 'form' && is_array($page)) { - foreach ($page as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page'] = $page; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_size !== null) { - if ('form' === 'form' && is_array($page_size)) { - foreach ($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page_size'] = $page_size; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $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) { @@ -753,18 +786,19 @@ public function bulkSendJobListRequest(int $page = 1, int $page_size = 20) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -788,11 +822,11 @@ public function bulkSendJobListRequest(int $page = 1, int $page_size = 20) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -801,8 +835,8 @@ public function bulkSendJobListRequest(int $page = 1, int $page_size = 20) /** * Create http client option * - * @throws RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -816,4 +850,66 @@ protected function createHttpClientOption() 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/Api/EmbeddedApi.php b/sdks/php/src/Api/EmbeddedApi.php index 727145692..364e5f7e7 100644 --- a/sdks/php/src/Api/EmbeddedApi.php +++ b/sdks/php/src/Api/EmbeddedApi.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -36,11 +35,11 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use GuzzleHttp\Utils; use InvalidArgumentException; +use JsonException; use Psr\Http\Message\ResponseInterface; use RuntimeException; @@ -48,34 +47,35 @@ * EmbeddedApi Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class EmbeddedApi { - /** - * @var ClientInterface - */ + /** @var ClientInterface */ protected $client; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @var HeaderSelector - */ + /** @var HeaderSelector */ protected $headerSelector; - /** - * @var int Host index - */ + /** @var int Host index */ protected $hostIndex; /** - * @var ResponseInterface|null + * @var string[] * */ + public const contentTypes = [ + 'embeddedEditUrl' => [ + 'application/json', + ], + 'embeddedSignUrl' => [ + 'application/json', + ], + ]; + + /** @var ResponseInterface|null */ protected $response; /** @@ -97,6 +97,7 @@ public function __construct( * Set the host index * * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future */ public function setHostIndex(int $hostIndex): void { @@ -107,6 +108,7 @@ public function setHostIndex(int $hostIndex): void * Get the host index * * @return int Host index + * @deprecated To be made private in the future */ public function getHostIndex() { @@ -134,17 +136,16 @@ public function getResponse() * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) + * @param string $template_id The id of the template to edit. (required) * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request embedded_edit_url_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\EmbeddedEditUrlResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function embeddedEditUrl(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request) { list($response) = $this->embeddedEditUrlWithHttpInfo($template_id, $embedded_edit_url_request); - return $response; } @@ -153,16 +154,18 @@ public function embeddedEditUrl(string $template_id, Model\EmbeddedEditUrlReques * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) + * @param string $template_id The id of the template to edit. (required) * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\EmbeddedEditUrlResponse, 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 ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request) + public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { - $request = $this->embeddedEditUrlRequest($template_id, $embedded_edit_url_request); + $request = $this->embeddedEditUrlRequest($template_id, $embedded_edit_url_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -172,14 +175,14 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -192,51 +195,73 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\EmbeddedEditUrlResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\EmbeddedEditUrlResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\EmbeddedEditUrlResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\EmbeddedEditUrlResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\EmbeddedEditUrlResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\EmbeddedEditUrlResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -245,28 +270,19 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\EmbeddedEditUrlResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\EmbeddedEditUrlResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -276,15 +292,17 @@ public function embeddedEditUrlWithHttpInfo(string $template_id, Model\EmbeddedE * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) + * @param string $template_id The id of the template to edit. (required) * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlAsync(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request) + public function embeddedEditUrlAsync(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { - return $this->embeddedEditUrlAsyncWithHttpInfo($template_id, $embedded_edit_url_request) + return $this->embeddedEditUrlAsyncWithHttpInfo($template_id, $embedded_edit_url_request, $contentType) ->then( function ($response) { return $response[0]; @@ -297,25 +315,30 @@ function ($response) { * * Get Embedded Template Edit URL * - * @param string $template_id The id of the template to edit. (required) + * @param string $template_id The id of the template to edit. (required) * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlAsyncWithHttpInfo(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request) + public function embeddedEditUrlAsyncWithHttpInfo(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { $returnType = '\Dropbox\Sign\Model\EmbeddedEditUrlResponse'; - $request = $this->embeddedEditUrlRequest($template_id, $embedded_edit_url_request); + $request = $this->embeddedEditUrlRequest($template_id, $embedded_edit_url_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -335,7 +358,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -344,13 +367,15 @@ function ($exception) { /** * Create request for operation 'embeddedEditUrl' * - * @param string $template_id The id of the template to edit. (required) + * @param string $template_id The id of the template to edit. (required) * @param Model\EmbeddedEditUrlRequest $embedded_edit_url_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedEditUrl'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::embeddedEditUrl. This method will eventually become unavailable */ - public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request) + public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUrlRequest $embedded_edit_url_request, string $contentType = self::contentTypes['embeddedEditUrl'][0]) { // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { @@ -358,6 +383,7 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr 'Missing the required parameter $template_id when calling embeddedEditUrl' ); } + // verify the required parameter 'embedded_edit_url_request' is set if ($embedded_edit_url_request === null || (is_array($embedded_edit_url_request) && count($embedded_edit_url_request) === 0)) { throw new InvalidArgumentException( @@ -366,9 +392,11 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr } $resourcePath = '/embedded/edit_url/{template_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $embedded_edit_url_request @@ -379,27 +407,23 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($embedded_edit_url_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($embedded_edit_url_request)); } else { $httpBody = $embedded_edit_url_request; } @@ -418,22 +442,22 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $embedded_edit_url_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -457,11 +481,11 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -474,14 +498,13 @@ public function embeddedEditUrlRequest(string $template_id, Model\EmbeddedEditUr * * @param string $signature_id The id of the signature to get a signature url for. (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\EmbeddedSignUrlResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function embeddedSignUrl(string $signature_id) { list($response) = $this->embeddedSignUrlWithHttpInfo($signature_id); - return $response; } @@ -491,14 +514,16 @@ public function embeddedSignUrl(string $signature_id) * Get Embedded Sign URL * * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\EmbeddedSignUrlResponse, 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 ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlWithHttpInfo(string $signature_id) + public function embeddedSignUrlWithHttpInfo(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { - $request = $this->embeddedSignUrlRequest($signature_id); + $request = $this->embeddedSignUrlRequest($signature_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -508,14 +533,14 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -528,51 +553,73 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\EmbeddedSignUrlResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\EmbeddedSignUrlResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\EmbeddedSignUrlResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\EmbeddedSignUrlResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\EmbeddedSignUrlResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\EmbeddedSignUrlResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -581,28 +628,19 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id) $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\EmbeddedSignUrlResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\EmbeddedSignUrlResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -613,13 +651,15 @@ public function embeddedSignUrlWithHttpInfo(string $signature_id) * Get Embedded Sign URL * * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlAsync(string $signature_id) + public function embeddedSignUrlAsync(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { - return $this->embeddedSignUrlAsyncWithHttpInfo($signature_id) + return $this->embeddedSignUrlAsyncWithHttpInfo($signature_id, $contentType) ->then( function ($response) { return $response[0]; @@ -633,23 +673,28 @@ function ($response) { * Get Embedded Sign URL * * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlAsyncWithHttpInfo(string $signature_id) + public function embeddedSignUrlAsyncWithHttpInfo(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { $returnType = '\Dropbox\Sign\Model\EmbeddedSignUrlResponse'; - $request = $this->embeddedSignUrlRequest($signature_id); + $request = $this->embeddedSignUrlRequest($signature_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -669,7 +714,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -679,11 +724,13 @@ function ($exception) { * Create request for operation 'embeddedSignUrl' * * @param string $signature_id The id of the signature to get a signature url for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['embeddedSignUrl'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::embeddedSignUrl. This method will eventually become unavailable */ - public function embeddedSignUrlRequest(string $signature_id) + public function embeddedSignUrlRequest(string $signature_id, string $contentType = self::contentTypes['embeddedSignUrl'][0]) { // verify the required parameter 'signature_id' is set if ($signature_id === null || (is_array($signature_id) && count($signature_id) === 0)) { @@ -693,32 +740,26 @@ public function embeddedSignUrlRequest(string $signature_id) } $resourcePath = '/embedded/sign_url/{signature_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($signature_id !== null) { $resourcePath = str_replace( - '{' . 'signature_id' . '}', + '{signature_id}', ObjectSerializer::toPathValue($signature_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -736,18 +777,19 @@ public function embeddedSignUrlRequest(string $signature_id) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -771,11 +813,11 @@ public function embeddedSignUrlRequest(string $signature_id) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -784,8 +826,8 @@ public function embeddedSignUrlRequest(string $signature_id) /** * Create http client option * - * @throws RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -799,4 +841,66 @@ protected function createHttpClientOption() 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/Api/FaxLineApi.php b/sdks/php/src/Api/FaxLineApi.php new file mode 100644 index 000000000..65cefff54 --- /dev/null +++ b/sdks/php/src/Api/FaxLineApi.php @@ -0,0 +1,2545 @@ + [ + 'application/json', + ], + 'faxLineAreaCodeGet' => [ + 'application/json', + ], + 'faxLineCreate' => [ + 'application/json', + ], + 'faxLineDelete' => [ + 'application/json', + ], + 'faxLineGet' => [ + 'application/json', + ], + 'faxLineList' => [ + 'application/json', + ], + 'faxLineRemoveUser' => [ + 'application/json', + ], + ]; + + /** @var ResponseInterface|null */ + protected $response; + + /** + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + Configuration $config = null, + ClientInterface $client = null, + HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future + */ + public function setHostIndex(int $hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + * @deprecated To be made private in the future + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Operation faxLineAddUser + * + * Add Fax Line User + * + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request fax_line_add_user_request (required) + * + * @return Model\FaxLineResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function faxLineAddUser(Model\FaxLineAddUserRequest $fax_line_add_user_request) + { + list($response) = $this->faxLineAddUserWithHttpInfo($fax_line_add_user_request); + return $response; + } + + /** + * Operation faxLineAddUserWithHttpInfo + * + * Add Fax Line User + * + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * + * @return array of Model\FaxLineResponse, 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 ::faxLineAddUser. This method will eventually become unavailable + */ + public function faxLineAddUserWithHttpInfo(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + { + $request = $this->faxLineAddUserRequest($fax_line_add_user_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\FaxLineResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxLineResponse' !== '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\FaxLineResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; + 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\FaxLineResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation faxLineAddUserAsync + * + * Add Fax Line User + * + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable + */ + public function faxLineAddUserAsync(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + { + return $this->faxLineAddUserAsyncWithHttpInfo($fax_line_add_user_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxLineAddUserAsyncWithHttpInfo + * + * Add Fax Line User + * + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable + */ + public function faxLineAddUserAsyncWithHttpInfo(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; + $request = $this->faxLineAddUserRequest($fax_line_add_user_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 'faxLineAddUser' + * + * @param Model\FaxLineAddUserRequest $fax_line_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAddUser'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineAddUser. This method will eventually become unavailable + */ + public function faxLineAddUserRequest(Model\FaxLineAddUserRequest $fax_line_add_user_request, string $contentType = self::contentTypes['faxLineAddUser'][0]) + { + // verify the required parameter 'fax_line_add_user_request' is set + if ($fax_line_add_user_request === null || (is_array($fax_line_add_user_request) && count($fax_line_add_user_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $fax_line_add_user_request when calling faxLineAddUser' + ); + } + + $resourcePath = '/fax_line/add_user'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $fax_line_add_user_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_line_add_user_request)); + } else { + $httpBody = $fax_line_add_user_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_line_add_user_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( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation faxLineAreaCodeGet + * + * Get Available Fax Line Area Codes + * + * @param string $country Filter area codes by country. (required) + * @param string $state Filter area codes by state. (optional) + * @param string $province Filter area codes by province. (optional) + * @param string $city Filter area codes by city. (optional) + * + * @return Model\FaxLineAreaCodeGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function faxLineAreaCodeGet(string $country, string $state = null, string $province = null, string $city = null) + { + list($response) = $this->faxLineAreaCodeGetWithHttpInfo($country, $state, $province, $city); + return $response; + } + + /** + * Operation faxLineAreaCodeGetWithHttpInfo + * + * Get Available Fax Line Area Codes + * + * @param string $country Filter area codes by country. (required) + * @param string $state Filter area codes by state. (optional) + * @param string $province Filter area codes by province. (optional) + * @param string $city Filter area codes by city. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * + * @return array of Model\FaxLineAreaCodeGetResponse, 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 ::faxLineAreaCodeGet. This method will eventually become unavailable + */ + public function faxLineAreaCodeGetWithHttpInfo(string $country, string $state = null, string $province = null, string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + { + $request = $this->faxLineAreaCodeGetRequest($country, $state, $province, $city, $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\FaxLineAreaCodeGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse' !== '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\FaxLineAreaCodeGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse'; + 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\FaxLineAreaCodeGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation faxLineAreaCodeGetAsync + * + * Get Available Fax Line Area Codes + * + * @param string $country Filter area codes by country. (required) + * @param string $state Filter area codes by state. (optional) + * @param string $province Filter area codes by province. (optional) + * @param string $city Filter area codes by city. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable + */ + public function faxLineAreaCodeGetAsync(string $country, string $state = null, string $province = null, string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + { + return $this->faxLineAreaCodeGetAsyncWithHttpInfo($country, $state, $province, $city, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxLineAreaCodeGetAsyncWithHttpInfo + * + * Get Available Fax Line Area Codes + * + * @param string $country Filter area codes by country. (required) + * @param string $state Filter area codes by state. (optional) + * @param string $province Filter area codes by province. (optional) + * @param string $city Filter area codes by city. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable + */ + public function faxLineAreaCodeGetAsyncWithHttpInfo(string $country, string $state = null, string $province = null, string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxLineAreaCodeGetResponse'; + $request = $this->faxLineAreaCodeGetRequest($country, $state, $province, $city, $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 'faxLineAreaCodeGet' + * + * @param string $country Filter area codes by country. (required) + * @param string $state Filter area codes by state. (optional) + * @param string $province Filter area codes by province. (optional) + * @param string $city Filter area codes by city. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineAreaCodeGet'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineAreaCodeGet. This method will eventually become unavailable + */ + public function faxLineAreaCodeGetRequest(string $country, string $state = null, string $province = null, string $city = null, string $contentType = self::contentTypes['faxLineAreaCodeGet'][0]) + { + // verify the required parameter 'country' is set + if ($country === null || (is_array($country) && count($country) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $country when calling faxLineAreaCodeGet' + ); + } + + $resourcePath = '/fax_line/area_codes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $country, + 'country', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $state, + 'state', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $province, + 'province', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $city, + 'city', // param base name + 'string', // 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 faxLineCreate + * + * Purchase Fax Line + * + * @param Model\FaxLineCreateRequest $fax_line_create_request fax_line_create_request (required) + * + * @return Model\FaxLineResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function faxLineCreate(Model\FaxLineCreateRequest $fax_line_create_request) + { + list($response) = $this->faxLineCreateWithHttpInfo($fax_line_create_request); + return $response; + } + + /** + * Operation faxLineCreateWithHttpInfo + * + * Purchase Fax Line + * + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * + * @return array of Model\FaxLineResponse, 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 ::faxLineCreate. This method will eventually become unavailable + */ + public function faxLineCreateWithHttpInfo(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + { + $request = $this->faxLineCreateRequest($fax_line_create_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + $this->response = $response; + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string)$e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int)$e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + 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\FaxLineResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxLineResponse' !== '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\FaxLineResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; + 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\FaxLineResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation faxLineCreateAsync + * + * Purchase Fax Line + * + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable + */ + public function faxLineCreateAsync(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + { + return $this->faxLineCreateAsyncWithHttpInfo($fax_line_create_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxLineCreateAsyncWithHttpInfo + * + * Purchase Fax Line + * + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable + */ + public function faxLineCreateAsyncWithHttpInfo(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; + $request = $this->faxLineCreateRequest($fax_line_create_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string)$response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'faxLineCreate' + * + * @param Model\FaxLineCreateRequest $fax_line_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineCreate'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineCreate. This method will eventually become unavailable + */ + public function faxLineCreateRequest(Model\FaxLineCreateRequest $fax_line_create_request, string $contentType = self::contentTypes['faxLineCreate'][0]) + { + // verify the required parameter 'fax_line_create_request' is set + if ($fax_line_create_request === null || (is_array($fax_line_create_request) && count($fax_line_create_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $fax_line_create_request when calling faxLineCreate' + ); + } + + $resourcePath = '/fax_line/create'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $fax_line_create_request + ); + + $multipart = !empty($formParams); + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) === 0) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fax_line_create_request)); + } else { + $httpBody = $fax_line_create_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem, + ]; + } + } + // for HTTP post (form) + if (!empty($body)) { + $multipartContents[] = [ + 'name' => 'body', + 'contents' => $body, + 'headers' => ['Content-Type' => 'application/json'], + ]; + } + + if ($payloadHook = $this->config->getPayloadHook()) { + $payloadHook('multipart', $multipartContents, $fax_line_create_request); + } + $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername())) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ':'); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation faxLineDelete + * + * Delete Fax Line + * + * @param Model\FaxLineDeleteRequest $fax_line_delete_request fax_line_delete_request (required) + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function faxLineDelete(Model\FaxLineDeleteRequest $fax_line_delete_request) + { + $this->faxLineDeleteWithHttpInfo($fax_line_delete_request); + } + + /** + * Operation faxLineDeleteWithHttpInfo + * + * Delete Fax Line + * + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] 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 ::faxLineDelete. This method will eventually become unavailable + */ + public function faxLineDeleteWithHttpInfo(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + { + $request = $this->faxLineDeleteRequest($fax_line_delete_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() + ); + } + + 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 faxLineDeleteAsync + * + * Delete Fax Line + * + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable + */ + public function faxLineDeleteAsync(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + { + return $this->faxLineDeleteAsyncWithHttpInfo($fax_line_delete_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxLineDeleteAsyncWithHttpInfo + * + * Delete Fax Line + * + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable + */ + public function faxLineDeleteAsyncWithHttpInfo(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + { + $returnType = ''; + $request = $this->faxLineDeleteRequest($fax_line_delete_request, $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 'faxLineDelete' + * + * @param Model\FaxLineDeleteRequest $fax_line_delete_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineDelete'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineDelete. This method will eventually become unavailable + */ + public function faxLineDeleteRequest(Model\FaxLineDeleteRequest $fax_line_delete_request, string $contentType = self::contentTypes['faxLineDelete'][0]) + { + // verify the required parameter 'fax_line_delete_request' is set + if ($fax_line_delete_request === null || (is_array($fax_line_delete_request) && count($fax_line_delete_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $fax_line_delete_request when calling faxLineDelete' + ); + } + + $resourcePath = '/fax_line'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $fax_line_delete_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_line_delete_request)); + } else { + $httpBody = $fax_line_delete_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_line_delete_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( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation faxLineGet + * + * Get Fax Line + * + * @param string $number The Fax Line number. (required) + * + * @return Model\FaxLineResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function faxLineGet(string $number) + { + list($response) = $this->faxLineGetWithHttpInfo($number); + return $response; + } + + /** + * Operation faxLineGetWithHttpInfo + * + * Get Fax Line + * + * @param string $number The Fax Line number. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * + * @return array of Model\FaxLineResponse, 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 ::faxLineGet. This method will eventually become unavailable + */ + public function faxLineGetWithHttpInfo(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) + { + $request = $this->faxLineGetRequest($number, $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\FaxLineResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxLineResponse' !== '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\FaxLineResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; + 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\FaxLineResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation faxLineGetAsync + * + * Get Fax Line + * + * @param string $number The Fax Line number. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable + */ + public function faxLineGetAsync(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) + { + return $this->faxLineGetAsyncWithHttpInfo($number, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxLineGetAsyncWithHttpInfo + * + * Get Fax Line + * + * @param string $number The Fax Line number. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable + */ + public function faxLineGetAsyncWithHttpInfo(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; + $request = $this->faxLineGetRequest($number, $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 'faxLineGet' + * + * @param string $number The Fax Line number. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineGet'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineGet. This method will eventually become unavailable + */ + public function faxLineGetRequest(string $number, string $contentType = self::contentTypes['faxLineGet'][0]) + { + // verify the required parameter 'number' is set + if ($number === null || (is_array($number) && count($number) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $number when calling faxLineGet' + ); + } + + $resourcePath = '/fax_line'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $number, + 'number', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem, + ]; + } + } + // for HTTP post (form) + if (!empty($body)) { + $multipartContents[] = [ + 'name' => 'body', + 'contents' => $body, + 'headers' => ['Content-Type' => 'application/json'], + ]; + } + + $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername())) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ':'); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation faxLineList + * + * List Fax Lines + * + * @param string $account_id Account ID (optional) + * @param int $page Page (optional, default to 1) + * @param int $page_size Page size (optional, default to 20) + * @param bool $show_team_lines Show team lines (optional) + * + * @return Model\FaxLineListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function faxLineList(string $account_id = null, int $page = 1, int $page_size = 20, bool $show_team_lines = null) + { + list($response) = $this->faxLineListWithHttpInfo($account_id, $page, $page_size, $show_team_lines); + return $response; + } + + /** + * Operation faxLineListWithHttpInfo + * + * List Fax Lines + * + * @param string $account_id Account ID (optional) + * @param int $page Page (optional, default to 1) + * @param int $page_size Page size (optional, default to 20) + * @param bool $show_team_lines Show team lines (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * + * @return array of Model\FaxLineListResponse, 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 ::faxLineList. This method will eventually become unavailable + */ + public function faxLineListWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + { + $request = $this->faxLineListRequest($account_id, $page, $page_size, $show_team_lines, $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\FaxLineListResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxLineListResponse' !== '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\FaxLineListResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxLineListResponse'; + 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\FaxLineListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation faxLineListAsync + * + * List Fax Lines + * + * @param string $account_id Account ID (optional) + * @param int $page Page (optional, default to 1) + * @param int $page_size Page size (optional, default to 20) + * @param bool $show_team_lines Show team lines (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable + */ + public function faxLineListAsync(string $account_id = null, int $page = 1, int $page_size = 20, bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + { + return $this->faxLineListAsyncWithHttpInfo($account_id, $page, $page_size, $show_team_lines, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxLineListAsyncWithHttpInfo + * + * List Fax Lines + * + * @param string $account_id Account ID (optional) + * @param int $page Page (optional, default to 1) + * @param int $page_size Page size (optional, default to 20) + * @param bool $show_team_lines Show team lines (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable + */ + public function faxLineListAsyncWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxLineListResponse'; + $request = $this->faxLineListRequest($account_id, $page, $page_size, $show_team_lines, $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 'faxLineList' + * + * @param string $account_id Account ID (optional) + * @param int $page Page (optional, default to 1) + * @param int $page_size Page size (optional, default to 20) + * @param bool $show_team_lines Show team lines (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineList'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineList. This method will eventually become unavailable + */ + public function faxLineListRequest(string $account_id = null, int $page = 1, int $page_size = 20, bool $show_team_lines = null, string $contentType = self::contentTypes['faxLineList'][0]) + { + $resourcePath = '/fax_line/list'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $account_id, + 'account_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // 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 + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $show_team_lines, + 'show_team_lines', // param base name + 'boolean', // 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 faxLineRemoveUser + * + * Remove Fax Line Access + * + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request fax_line_remove_user_request (required) + * + * @return Model\FaxLineResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + */ + public function faxLineRemoveUser(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request) + { + list($response) = $this->faxLineRemoveUserWithHttpInfo($fax_line_remove_user_request); + return $response; + } + + /** + * Operation faxLineRemoveUserWithHttpInfo + * + * Remove Fax Line Access + * + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * + * @return array of Model\FaxLineResponse, 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 ::faxLineRemoveUser. This method will eventually become unavailable + */ + public function faxLineRemoveUserWithHttpInfo(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + { + $request = $this->faxLineRemoveUserRequest($fax_line_remove_user_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\FaxLineResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FaxLineResponse' !== '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\FaxLineResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; + } + + $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; + 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\FaxLineResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation faxLineRemoveUserAsync + * + * Remove Fax Line Access + * + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable + */ + public function faxLineRemoveUserAsync(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + { + return $this->faxLineRemoveUserAsyncWithHttpInfo($fax_line_remove_user_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation faxLineRemoveUserAsyncWithHttpInfo + * + * Remove Fax Line Access + * + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable + */ + public function faxLineRemoveUserAsyncWithHttpInfo(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + { + $returnType = '\Dropbox\Sign\Model\FaxLineResponse'; + $request = $this->faxLineRemoveUserRequest($fax_line_remove_user_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 'faxLineRemoveUser' + * + * @param Model\FaxLineRemoveUserRequest $fax_line_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['faxLineRemoveUser'] to see the possible values for this operation + * + * @return Request + * @throws InvalidArgumentException + * @deprecated Prefer to use ::faxLineRemoveUser. This method will eventually become unavailable + */ + public function faxLineRemoveUserRequest(Model\FaxLineRemoveUserRequest $fax_line_remove_user_request, string $contentType = self::contentTypes['faxLineRemoveUser'][0]) + { + // verify the required parameter 'fax_line_remove_user_request' is set + if ($fax_line_remove_user_request === null || (is_array($fax_line_remove_user_request) && count($fax_line_remove_user_request) === 0)) { + throw new InvalidArgumentException( + 'Missing the required parameter $fax_line_remove_user_request when calling faxLineRemoveUser' + ); + } + + $resourcePath = '/fax_line/remove_user'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + $formParams = ObjectSerializer::getFormParams( + $fax_line_remove_user_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_line_remove_user_request)); + } else { + $httpBody = $fax_line_remove_user_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_line_remove_user_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( + 'PUT', + $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/Api/OAuthApi.php b/sdks/php/src/Api/OAuthApi.php index 8f52cb8a9..6fa77398a 100644 --- a/sdks/php/src/Api/OAuthApi.php +++ b/sdks/php/src/Api/OAuthApi.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -36,11 +35,11 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use GuzzleHttp\Utils; use InvalidArgumentException; +use JsonException; use Psr\Http\Message\ResponseInterface; use RuntimeException; @@ -48,34 +47,35 @@ * OAuthApi Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class OAuthApi { - /** - * @var ClientInterface - */ + /** @var ClientInterface */ protected $client; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @var HeaderSelector - */ + /** @var HeaderSelector */ protected $headerSelector; - /** - * @var int Host index - */ + /** @var int Host index */ protected $hostIndex; /** - * @var ResponseInterface|null + * @var string[] * */ + public const contentTypes = [ + 'oauthTokenGenerate' => [ + 'application/json', + ], + 'oauthTokenRefresh' => [ + 'application/json', + ], + ]; + + /** @var ResponseInterface|null */ protected $response; /** @@ -97,6 +97,7 @@ public function __construct( * Set the host index * * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future */ public function setHostIndex(int $hostIndex): void { @@ -107,6 +108,7 @@ public function setHostIndex(int $hostIndex): void * Get the host index * * @return int Host index + * @deprecated To be made private in the future */ public function getHostIndex() { @@ -134,19 +136,19 @@ public function getResponse() * * OAuth Token Generate * - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request o_auth_token_generate_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\OAuthTokenResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function oauthTokenGenerate(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request) { list($response) = $this->oauthTokenGenerateWithHttpInfo($o_auth_token_generate_request); - return $response; } @@ -155,18 +157,23 @@ public function oauthTokenGenerate(Model\OAuthTokenGenerateRequest $o_auth_token * * OAuth Token Generate * - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\OAuthTokenResponse, 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 ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request) + public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { - $request = $this->oauthTokenGenerateRequest($o_auth_token_generate_request); + $request = $this->oauthTokenGenerateRequest($o_auth_token_generate_request, $hostIndex, $variables, $contentType); try { $options = $this->createHttpClientOption(); @@ -176,14 +183,14 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -196,35 +203,64 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\OAuthTokenResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\OAuthTokenResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\OAuthTokenResponse' !== '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\OAuthTokenResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\OAuthTokenResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -233,17 +269,16 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\OAuthTokenResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\OAuthTokenResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -253,17 +288,22 @@ public function oauthTokenGenerateWithHttpInfo(Model\OAuthTokenGenerateRequest $ * * OAuth Token Generate * - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateAsync(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request) + public function oauthTokenGenerateAsync(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { - return $this->oauthTokenGenerateAsyncWithHttpInfo($o_auth_token_generate_request) + return $this->oauthTokenGenerateAsyncWithHttpInfo($o_auth_token_generate_request, $hostIndex, $variables, $contentType) ->then( function ($response) { return $response[0]; @@ -276,27 +316,35 @@ function ($response) { * * OAuth Token Generate * - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateAsyncWithHttpInfo(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request) + public function oauthTokenGenerateAsyncWithHttpInfo(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; - $request = $this->oauthTokenGenerateRequest($o_auth_token_generate_request); + $request = $this->oauthTokenGenerateRequest($o_auth_token_generate_request, $hostIndex, $variables, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -316,7 +364,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -325,15 +373,20 @@ function ($exception) { /** * Create request for operation 'oauthTokenGenerate' * - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * * @param Model\OAuthTokenGenerateRequest $o_auth_token_generate_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenGenerate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::oauthTokenGenerate. This method will eventually become unavailable */ - public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request) + public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_auth_token_generate_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenGenerate'][0]) { // verify the required parameter 'o_auth_token_generate_request' is set if ($o_auth_token_generate_request === null || (is_array($o_auth_token_generate_request) && count($o_auth_token_generate_request) === 0)) { @@ -343,9 +396,11 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut } $resourcePath = '/oauth/token'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $o_auth_token_generate_request @@ -353,21 +408,17 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($o_auth_token_generate_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($o_auth_token_generate_request)); } else { $httpBody = $o_auth_token_generate_request; } @@ -386,22 +437,22 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $o_auth_token_generate_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -416,15 +467,19 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut $headers ); - $operationHosts = ['https://app.hellosign.com']; - if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { - throw new InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than " . sizeof($operationHosts)); + // Preserve the original behavior of server indexing. + if ($hostIndex === null) { + $hostIndex = $this->hostIndex; } - $operationHost = $operationHosts[$this->hostIndex]; - $query = Psr7\Query::build($queryParams); + $hostSettings = $this->getHostSettingsForoauthTokenGenerate(); - return new Psr7\Request( + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than " . count($hostSettings)); + } + $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, @@ -432,24 +487,39 @@ public function oauthTokenGenerateRequest(Model\OAuthTokenGenerateRequest $o_aut ); } + /** + * Returns an array of host settings for Operation oauthTokenGenerate + * + * @return array an array of host settings + */ + protected function getHostSettingsForoauthTokenGenerate(): array + { + return [ + [ + 'url' => 'https://app.hellosign.com', + 'description' => 'No description provided', + ], + ]; + } + /** * Operation oauthTokenRefresh * * OAuth Token Refresh * - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request o_auth_token_refresh_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\OAuthTokenResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function oauthTokenRefresh(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request) { list($response) = $this->oauthTokenRefreshWithHttpInfo($o_auth_token_refresh_request); - return $response; } @@ -458,18 +528,23 @@ public function oauthTokenRefresh(Model\OAuthTokenRefreshRequest $o_auth_token_r * * OAuth Token Refresh * - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\OAuthTokenResponse, 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 ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request) + public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { - $request = $this->oauthTokenRefreshRequest($o_auth_token_refresh_request); + $request = $this->oauthTokenRefreshRequest($o_auth_token_refresh_request, $hostIndex, $variables, $contentType); try { $options = $this->createHttpClientOption(); @@ -479,14 +554,14 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -499,35 +574,64 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\OAuthTokenResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\OAuthTokenResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\OAuthTokenResponse' !== '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\OAuthTokenResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\OAuthTokenResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -536,17 +640,16 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\OAuthTokenResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\OAuthTokenResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -556,17 +659,22 @@ public function oauthTokenRefreshWithHttpInfo(Model\OAuthTokenRefreshRequest $o_ * * OAuth Token Refresh * - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshAsync(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request) + public function oauthTokenRefreshAsync(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { - return $this->oauthTokenRefreshAsyncWithHttpInfo($o_auth_token_refresh_request) + return $this->oauthTokenRefreshAsyncWithHttpInfo($o_auth_token_refresh_request, $hostIndex, $variables, $contentType) ->then( function ($response) { return $response[0]; @@ -579,27 +687,35 @@ function ($response) { * * OAuth Token Refresh * - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshAsyncWithHttpInfo(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request) + public function oauthTokenRefreshAsyncWithHttpInfo(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { $returnType = '\Dropbox\Sign\Model\OAuthTokenResponse'; - $request = $this->oauthTokenRefreshRequest($o_auth_token_refresh_request); + $request = $this->oauthTokenRefreshRequest($o_auth_token_refresh_request, $hostIndex, $variables, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -619,7 +735,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -628,15 +744,20 @@ function ($exception) { /** * Create request for operation 'oauthTokenRefresh' * - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. * URL: https://app.hellosign.com * * @param Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request (required) + * @param int|null $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['oauthTokenRefresh'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::oauthTokenRefresh. This method will eventually become unavailable */ - public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request) + public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_token_refresh_request, ?int $hostIndex = null, array $variables = [], string $contentType = self::contentTypes['oauthTokenRefresh'][0]) { // verify the required parameter 'o_auth_token_refresh_request' is set if ($o_auth_token_refresh_request === null || (is_array($o_auth_token_refresh_request) && count($o_auth_token_refresh_request) === 0)) { @@ -646,9 +767,11 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ } $resourcePath = '/oauth/token?refresh'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $o_auth_token_refresh_request @@ -656,21 +779,17 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($o_auth_token_refresh_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($o_auth_token_refresh_request)); } else { $httpBody = $o_auth_token_refresh_request; } @@ -689,22 +808,22 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $o_auth_token_refresh_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -719,15 +838,19 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ $headers ); - $operationHosts = ['https://app.hellosign.com']; - if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { - throw new InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than " . sizeof($operationHosts)); + // Preserve the original behavior of server indexing. + if ($hostIndex === null) { + $hostIndex = $this->hostIndex; } - $operationHost = $operationHosts[$this->hostIndex]; - $query = Psr7\Query::build($queryParams); + $hostSettings = $this->getHostSettingsForoauthTokenRefresh(); - return new Psr7\Request( + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than " . count($hostSettings)); + } + $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, @@ -735,11 +858,26 @@ public function oauthTokenRefreshRequest(Model\OAuthTokenRefreshRequest $o_auth_ ); } + /** + * Returns an array of host settings for Operation oauthTokenRefresh + * + * @return array an array of host settings + */ + protected function getHostSettingsForoauthTokenRefresh(): array + { + return [ + [ + 'url' => 'https://app.hellosign.com', + 'description' => 'No description provided', + ], + ]; + } + /** * Create http client option * - * @throws RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -753,4 +891,66 @@ protected function createHttpClientOption() 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/Api/ReportApi.php b/sdks/php/src/Api/ReportApi.php index 4c4cedadc..987fc25fe 100644 --- a/sdks/php/src/Api/ReportApi.php +++ b/sdks/php/src/Api/ReportApi.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -36,11 +35,11 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use GuzzleHttp\Utils; use InvalidArgumentException; +use JsonException; use Psr\Http\Message\ResponseInterface; use RuntimeException; @@ -48,34 +47,32 @@ * ReportApi Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class ReportApi { - /** - * @var ClientInterface - */ + /** @var ClientInterface */ protected $client; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @var HeaderSelector - */ + /** @var HeaderSelector */ protected $headerSelector; - /** - * @var int Host index - */ + /** @var int Host index */ protected $hostIndex; /** - * @var ResponseInterface|null + * @var string[] * */ + public const contentTypes = [ + 'reportCreate' => [ + 'application/json', + ], + ]; + + /** @var ResponseInterface|null */ protected $response; /** @@ -97,6 +94,7 @@ public function __construct( * Set the host index * * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future */ public function setHostIndex(int $hostIndex): void { @@ -107,6 +105,7 @@ public function setHostIndex(int $hostIndex): void * Get the host index * * @return int Host index + * @deprecated To be made private in the future */ public function getHostIndex() { @@ -136,14 +135,13 @@ public function getResponse() * * @param Model\ReportCreateRequest $report_create_request report_create_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\ReportCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function reportCreate(Model\ReportCreateRequest $report_create_request) { list($response) = $this->reportCreateWithHttpInfo($report_create_request); - return $response; } @@ -153,14 +151,16 @@ public function reportCreate(Model\ReportCreateRequest $report_create_request) * Create Report * * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\ReportCreateResponse, 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 ::reportCreate. This method will eventually become unavailable */ - public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_create_request) + public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { - $request = $this->reportCreateRequest($report_create_request); + $request = $this->reportCreateRequest($report_create_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -170,14 +170,14 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -190,51 +190,73 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\ReportCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ReportCreateResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\ReportCreateResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\ReportCreateResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ReportCreateResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\ReportCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -243,28 +265,19 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ReportCreateResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\ReportCreateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -275,13 +288,15 @@ public function reportCreateWithHttpInfo(Model\ReportCreateRequest $report_creat * Create Report * * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateAsync(Model\ReportCreateRequest $report_create_request) + public function reportCreateAsync(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { - return $this->reportCreateAsyncWithHttpInfo($report_create_request) + return $this->reportCreateAsyncWithHttpInfo($report_create_request, $contentType) ->then( function ($response) { return $response[0]; @@ -295,23 +310,28 @@ function ($response) { * Create Report * * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateAsyncWithHttpInfo(Model\ReportCreateRequest $report_create_request) + public function reportCreateAsyncWithHttpInfo(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { $returnType = '\Dropbox\Sign\Model\ReportCreateResponse'; - $request = $this->reportCreateRequest($report_create_request); + $request = $this->reportCreateRequest($report_create_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -331,7 +351,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -341,11 +361,13 @@ function ($exception) { * Create request for operation 'reportCreate' * * @param Model\ReportCreateRequest $report_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['reportCreate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::reportCreate. This method will eventually become unavailable */ - public function reportCreateRequest(Model\ReportCreateRequest $report_create_request) + public function reportCreateRequest(Model\ReportCreateRequest $report_create_request, string $contentType = self::contentTypes['reportCreate'][0]) { // verify the required parameter 'report_create_request' is set if ($report_create_request === null || (is_array($report_create_request) && count($report_create_request) === 0)) { @@ -355,9 +377,11 @@ public function reportCreateRequest(Model\ReportCreateRequest $report_create_req } $resourcePath = '/report/create'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $report_create_request @@ -365,21 +389,17 @@ public function reportCreateRequest(Model\ReportCreateRequest $report_create_req $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($report_create_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($report_create_request)); } else { $httpBody = $report_create_request; } @@ -398,22 +418,22 @@ public function reportCreateRequest(Model\ReportCreateRequest $report_create_req // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $report_create_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -433,11 +453,11 @@ public function reportCreateRequest(Model\ReportCreateRequest $report_create_req $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -446,8 +466,8 @@ public function reportCreateRequest(Model\ReportCreateRequest $report_create_req /** * Create http client option * - * @throws RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -461,4 +481,66 @@ protected function createHttpClientOption() 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/Api/SignatureRequestApi.php b/sdks/php/src/Api/SignatureRequestApi.php index 3de87a5da..e8da69d75 100644 --- a/sdks/php/src/Api/SignatureRequestApi.php +++ b/sdks/php/src/Api/SignatureRequestApi.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -36,11 +35,11 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use GuzzleHttp\Utils; use InvalidArgumentException; +use JsonException; use Psr\Http\Message\ResponseInterface; use RuntimeException; use SplFileObject; @@ -49,34 +48,83 @@ * SignatureRequestApi Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class SignatureRequestApi { - /** - * @var ClientInterface - */ + /** @var ClientInterface */ protected $client; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @var HeaderSelector - */ + /** @var HeaderSelector */ protected $headerSelector; - /** - * @var int Host index - */ + /** @var int Host index */ protected $hostIndex; /** - * @var ResponseInterface|null + * @var string[] * */ + public const contentTypes = [ + 'signatureRequestBulkCreateEmbeddedWithTemplate' => [ + 'application/json', + 'multipart/form-data', + ], + 'signatureRequestBulkSendWithTemplate' => [ + 'application/json', + 'multipart/form-data', + ], + 'signatureRequestCancel' => [ + 'application/json', + ], + 'signatureRequestCreateEmbedded' => [ + 'application/json', + 'multipart/form-data', + ], + 'signatureRequestCreateEmbeddedWithTemplate' => [ + 'application/json', + 'multipart/form-data', + ], + 'signatureRequestFiles' => [ + 'application/json', + ], + 'signatureRequestFilesAsDataUri' => [ + 'application/json', + ], + 'signatureRequestFilesAsFileUrl' => [ + 'application/json', + ], + 'signatureRequestGet' => [ + 'application/json', + ], + 'signatureRequestList' => [ + 'application/json', + ], + 'signatureRequestReleaseHold' => [ + 'application/json', + ], + 'signatureRequestRemind' => [ + 'application/json', + ], + 'signatureRequestRemove' => [ + 'application/json', + ], + 'signatureRequestSend' => [ + 'application/json', + 'multipart/form-data', + ], + 'signatureRequestSendWithTemplate' => [ + 'application/json', + 'multipart/form-data', + ], + 'signatureRequestUpdate' => [ + 'application/json', + ], + ]; + + /** @var ResponseInterface|null */ protected $response; /** @@ -98,6 +146,7 @@ public function __construct( * Set the host index * * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future */ public function setHostIndex(int $hostIndex): void { @@ -108,6 +157,7 @@ public function setHostIndex(int $hostIndex): void * Get the host index * * @return int Host index + * @deprecated To be made private in the future */ public function getHostIndex() { @@ -137,14 +187,13 @@ public function getResponse() * * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request signature_request_bulk_create_embedded_with_template_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\BulkSendJobSendResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestBulkCreateEmbeddedWithTemplate(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request) { list($response) = $this->signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo($signature_request_bulk_create_embedded_with_template_request); - return $response; } @@ -154,14 +203,16 @@ public function signatureRequestBulkCreateEmbeddedWithTemplate(Model\SignatureRe * Embedded Bulk Send with Template * * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\BulkSendJobSendResponse, 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 ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request) + public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { - $request = $this->signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature_request_bulk_create_embedded_with_template_request); + $request = $this->signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature_request_bulk_create_embedded_with_template_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -171,14 +222,14 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -191,51 +242,73 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobSendResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobSendResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -244,28 +317,19 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\BulkSendJobSendResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\BulkSendJobSendResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -276,13 +340,15 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(Model * Embedded Bulk Send with Template * * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateAsync(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request) + public function signatureRequestBulkCreateEmbeddedWithTemplateAsync(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { - return $this->signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_bulk_create_embedded_with_template_request) + return $this->signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_bulk_create_embedded_with_template_request, $contentType) ->then( function ($response) { return $response[0]; @@ -296,23 +362,28 @@ function ($response) { * Embedded Bulk Send with Template * * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request) + public function signatureRequestBulkCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; - $request = $this->signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature_request_bulk_create_embedded_with_template_request); + $request = $this->signatureRequestBulkCreateEmbeddedWithTemplateRequest($signature_request_bulk_create_embedded_with_template_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -332,7 +403,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -342,11 +413,13 @@ function ($exception) { * Create request for operation 'signatureRequestBulkCreateEmbeddedWithTemplate' * * @param Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestBulkCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request) + public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\SignatureRequestBulkCreateEmbeddedWithTemplateRequest $signature_request_bulk_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkCreateEmbeddedWithTemplate'][0]) { // verify the required parameter 'signature_request_bulk_create_embedded_with_template_request' is set if ($signature_request_bulk_create_embedded_with_template_request === null || (is_array($signature_request_bulk_create_embedded_with_template_request) && count($signature_request_bulk_create_embedded_with_template_request) === 0)) { @@ -356,9 +429,11 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\Sign } $resourcePath = '/signature_request/bulk_create_embedded_with_template'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $signature_request_bulk_create_embedded_with_template_request @@ -366,21 +441,17 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\Sign $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_bulk_create_embedded_with_template_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_bulk_create_embedded_with_template_request)); } else { $httpBody = $signature_request_bulk_create_embedded_with_template_request; } @@ -399,22 +470,22 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\Sign // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $signature_request_bulk_create_embedded_with_template_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -434,11 +505,11 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\Sign $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -451,14 +522,13 @@ public function signatureRequestBulkCreateEmbeddedWithTemplateRequest(Model\Sign * * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request signature_request_bulk_send_with_template_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\BulkSendJobSendResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestBulkSendWithTemplate(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request) { list($response) = $this->signatureRequestBulkSendWithTemplateWithHttpInfo($signature_request_bulk_send_with_template_request); - return $response; } @@ -468,14 +538,16 @@ public function signatureRequestBulkSendWithTemplate(Model\SignatureRequestBulkS * Bulk Send with Template * * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\BulkSendJobSendResponse, 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 ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request) + public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { - $request = $this->signatureRequestBulkSendWithTemplateRequest($signature_request_bulk_send_with_template_request); + $request = $this->signatureRequestBulkSendWithTemplateRequest($signature_request_bulk_send_with_template_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -485,14 +557,14 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -505,51 +577,73 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobSendResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\BulkSendJobSendResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\BulkSendJobSendResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -558,28 +652,19 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\BulkSendJobSendResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\BulkSendJobSendResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -590,13 +675,15 @@ public function signatureRequestBulkSendWithTemplateWithHttpInfo(Model\Signature * Bulk Send with Template * * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateAsync(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request) + public function signatureRequestBulkSendWithTemplateAsync(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { - return $this->signatureRequestBulkSendWithTemplateAsyncWithHttpInfo($signature_request_bulk_send_with_template_request) + return $this->signatureRequestBulkSendWithTemplateAsyncWithHttpInfo($signature_request_bulk_send_with_template_request, $contentType) ->then( function ($response) { return $response[0]; @@ -610,23 +697,28 @@ function ($response) { * Bulk Send with Template * * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateAsyncWithHttpInfo(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request) + public function signatureRequestBulkSendWithTemplateAsyncWithHttpInfo(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\BulkSendJobSendResponse'; - $request = $this->signatureRequestBulkSendWithTemplateRequest($signature_request_bulk_send_with_template_request); + $request = $this->signatureRequestBulkSendWithTemplateRequest($signature_request_bulk_send_with_template_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -646,7 +738,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -656,11 +748,13 @@ function ($exception) { * Create request for operation 'signatureRequestBulkSendWithTemplate' * * @param Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestBulkSendWithTemplate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestBulkSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request) + public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureRequestBulkSendWithTemplateRequest $signature_request_bulk_send_with_template_request, string $contentType = self::contentTypes['signatureRequestBulkSendWithTemplate'][0]) { // verify the required parameter 'signature_request_bulk_send_with_template_request' is set if ($signature_request_bulk_send_with_template_request === null || (is_array($signature_request_bulk_send_with_template_request) && count($signature_request_bulk_send_with_template_request) === 0)) { @@ -670,9 +764,11 @@ public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureReque } $resourcePath = '/signature_request/bulk_send_with_template'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $signature_request_bulk_send_with_template_request @@ -680,21 +776,17 @@ public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureReque $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_bulk_send_with_template_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_bulk_send_with_template_request)); } else { $httpBody = $signature_request_bulk_send_with_template_request; } @@ -713,22 +805,22 @@ public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureReque // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $signature_request_bulk_send_with_template_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -752,11 +844,11 @@ public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureReque $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -769,9 +861,8 @@ public function signatureRequestBulkSendWithTemplateRequest(Model\SignatureReque * * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) * - * @throws ApiException on non-2xx response + * @throws ApiException on non-2xx response or if the response body is not in the expected format * @throws InvalidArgumentException - * @return void */ public function signatureRequestCancel(string $signature_request_id) { @@ -784,14 +875,16 @@ public function signatureRequestCancel(string $signature_request_id) * Cancel Incomplete Signature Request * * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @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 ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelWithHttpInfo(string $signature_request_id) + public function signatureRequestCancelWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { - $request = $this->signatureRequestCancelRequest($signature_request_id); + $request = $this->signatureRequestCancelRequest($signature_request_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -801,14 +894,14 @@ public function signatureRequestCancelWithHttpInfo(string $signature_request_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -821,29 +914,21 @@ public function signatureRequestCancelWithHttpInfo(string $signature_request_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { } - throw $e; } } @@ -854,13 +939,15 @@ public function signatureRequestCancelWithHttpInfo(string $signature_request_id) * Cancel Incomplete Signature Request * * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelAsync(string $signature_request_id) + public function signatureRequestCancelAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { - return $this->signatureRequestCancelAsyncWithHttpInfo($signature_request_id) + return $this->signatureRequestCancelAsyncWithHttpInfo($signature_request_id, $contentType) ->then( function ($response) { return $response[0]; @@ -874,14 +961,16 @@ function ($response) { * Cancel Incomplete Signature Request * * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelAsyncWithHttpInfo(string $signature_request_id) + public function signatureRequestCancelAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { $returnType = ''; - $request = $this->signatureRequestCancelRequest($signature_request_id); + $request = $this->signatureRequestCancelRequest($signature_request_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -900,7 +989,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -910,11 +999,13 @@ function ($exception) { * Create request for operation 'signatureRequestCancel' * * @param string $signature_request_id The id of the incomplete SignatureRequest to cancel. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCancel'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestCancel. This method will eventually become unavailable */ - public function signatureRequestCancelRequest(string $signature_request_id) + public function signatureRequestCancelRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestCancel'][0]) { // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { @@ -924,32 +1015,26 @@ public function signatureRequestCancelRequest(string $signature_request_id) } $resourcePath = '/signature_request/cancel/{signature_request_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -967,18 +1052,19 @@ public function signatureRequestCancelRequest(string $signature_request_id) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1002,11 +1088,11 @@ public function signatureRequestCancelRequest(string $signature_request_id) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1019,14 +1105,13 @@ public function signatureRequestCancelRequest(string $signature_request_id) * * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request signature_request_create_embedded_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestCreateEmbedded(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request) { list($response) = $this->signatureRequestCreateEmbeddedWithHttpInfo($signature_request_create_embedded_request); - return $response; } @@ -1036,14 +1121,16 @@ public function signatureRequestCreateEmbedded(Model\SignatureRequestCreateEmbed * Create Embedded Signature Request * * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request) + public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { - $request = $this->signatureRequestCreateEmbeddedRequest($signature_request_create_embedded_request); + $request = $this->signatureRequestCreateEmbeddedRequest($signature_request_create_embedded_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1053,14 +1140,14 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1073,51 +1160,73 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1126,28 +1235,19 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\SignatureRequestGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1158,13 +1258,15 @@ public function signatureRequestCreateEmbeddedWithHttpInfo(Model\SignatureReques * Create Embedded Signature Request * * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedAsync(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request) + public function signatureRequestCreateEmbeddedAsync(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { - return $this->signatureRequestCreateEmbeddedAsyncWithHttpInfo($signature_request_create_embedded_request) + return $this->signatureRequestCreateEmbeddedAsyncWithHttpInfo($signature_request_create_embedded_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1178,23 +1280,28 @@ function ($response) { * Create Embedded Signature Request * * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedAsyncWithHttpInfo(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request) + public function signatureRequestCreateEmbeddedAsyncWithHttpInfo(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; - $request = $this->signatureRequestCreateEmbeddedRequest($signature_request_create_embedded_request); + $request = $this->signatureRequestCreateEmbeddedRequest($signature_request_create_embedded_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1214,7 +1321,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1224,11 +1331,13 @@ function ($exception) { * Create request for operation 'signatureRequestCreateEmbedded' * * @param Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbedded'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestCreateEmbedded. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request) + public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCreateEmbeddedRequest $signature_request_create_embedded_request, string $contentType = self::contentTypes['signatureRequestCreateEmbedded'][0]) { // verify the required parameter 'signature_request_create_embedded_request' is set if ($signature_request_create_embedded_request === null || (is_array($signature_request_create_embedded_request) && count($signature_request_create_embedded_request) === 0)) { @@ -1238,9 +1347,11 @@ public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCrea } $resourcePath = '/signature_request/create_embedded'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $signature_request_create_embedded_request @@ -1248,21 +1359,17 @@ public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCrea $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_create_embedded_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_create_embedded_request)); } else { $httpBody = $signature_request_create_embedded_request; } @@ -1281,22 +1388,22 @@ public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCrea // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $signature_request_create_embedded_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1320,11 +1427,11 @@ public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCrea $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1337,14 +1444,13 @@ public function signatureRequestCreateEmbeddedRequest(Model\SignatureRequestCrea * * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request signature_request_create_embedded_with_template_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestCreateEmbeddedWithTemplate(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request) { list($response) = $this->signatureRequestCreateEmbeddedWithTemplateWithHttpInfo($signature_request_create_embedded_with_template_request); - return $response; } @@ -1354,14 +1460,16 @@ public function signatureRequestCreateEmbeddedWithTemplate(Model\SignatureReques * Create Embedded Signature Request with Template * * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request) + public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { - $request = $this->signatureRequestCreateEmbeddedWithTemplateRequest($signature_request_create_embedded_with_template_request); + $request = $this->signatureRequestCreateEmbeddedWithTemplateRequest($signature_request_create_embedded_with_template_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1371,14 +1479,14 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1391,51 +1499,73 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1444,28 +1574,19 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\SignatureRequestGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1476,13 +1597,15 @@ public function signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(Model\Sig * Create Embedded Signature Request with Template * * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateAsync(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request) + public function signatureRequestCreateEmbeddedWithTemplateAsync(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { - return $this->signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_create_embedded_with_template_request) + return $this->signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo($signature_request_create_embedded_with_template_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1496,23 +1619,28 @@ function ($response) { * Create Embedded Signature Request with Template * * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request) + public function signatureRequestCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; - $request = $this->signatureRequestCreateEmbeddedWithTemplateRequest($signature_request_create_embedded_with_template_request); + $request = $this->signatureRequestCreateEmbeddedWithTemplateRequest($signature_request_create_embedded_with_template_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1532,7 +1660,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1542,11 +1670,13 @@ function ($exception) { * Create request for operation 'signatureRequestCreateEmbeddedWithTemplate' * * @param Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request) + public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\SignatureRequestCreateEmbeddedWithTemplateRequest $signature_request_create_embedded_with_template_request, string $contentType = self::contentTypes['signatureRequestCreateEmbeddedWithTemplate'][0]) { // verify the required parameter 'signature_request_create_embedded_with_template_request' is set if ($signature_request_create_embedded_with_template_request === null || (is_array($signature_request_create_embedded_with_template_request) && count($signature_request_create_embedded_with_template_request) === 0)) { @@ -1556,9 +1686,11 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur } $resourcePath = '/signature_request/create_embedded_with_template'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $signature_request_create_embedded_with_template_request @@ -1566,21 +1698,17 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_create_embedded_with_template_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_create_embedded_with_template_request)); } else { $httpBody = $signature_request_create_embedded_with_template_request; } @@ -1599,22 +1727,22 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $signature_request_create_embedded_with_template_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1638,11 +1766,11 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1654,16 +1782,15 @@ public function signatureRequestCreateEmbeddedWithTemplateRequest(Model\Signatur * Download Files * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return SplFileObject + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestFiles(string $signature_request_id, string $file_type = 'pdf') { list($response) = $this->signatureRequestFilesWithHttpInfo($signature_request_id, $file_type); - return $response; } @@ -1673,15 +1800,17 @@ public function signatureRequestFiles(string $signature_request_id, string $file * Download Files * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @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 ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesWithHttpInfo(string $signature_request_id, string $file_type = 'pdf') + public function signatureRequestFilesWithHttpInfo(string $signature_request_id, string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { - $request = $this->signatureRequestFilesRequest($signature_request_id, $file_type); + $request = $this->signatureRequestFilesRequest($signature_request_id, $file_type, $contentType); try { $options = $this->createHttpClientOption(); @@ -1691,14 +1820,14 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1711,51 +1840,73 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + 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, '\Dropbox\Sign\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\SplFileObject'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1764,28 +1915,19 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\SplFileObject', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + 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; } } @@ -1796,14 +1938,16 @@ public function signatureRequestFilesWithHttpInfo(string $signature_request_id, * Download Files * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesAsync(string $signature_request_id, string $file_type = 'pdf') + public function signatureRequestFilesAsync(string $signature_request_id, string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { - return $this->signatureRequestFilesAsyncWithHttpInfo($signature_request_id, $file_type) + return $this->signatureRequestFilesAsyncWithHttpInfo($signature_request_id, $file_type, $contentType) ->then( function ($response) { return $response[0]; @@ -1817,24 +1961,29 @@ function ($response) { * Download Files * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesAsyncWithHttpInfo(string $signature_request_id, string $file_type = 'pdf') + public function signatureRequestFilesAsyncWithHttpInfo(string $signature_request_id, string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { $returnType = '\SplFileObject'; - $request = $this->signatureRequestFilesRequest($signature_request_id, $file_type); + $request = $this->signatureRequestFilesRequest($signature_request_id, $file_type, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1854,7 +2003,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1864,12 +2013,14 @@ function ($exception) { * Create request for operation 'signatureRequestFiles' * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to 'pdf') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFiles'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestFiles. This method will eventually become unavailable */ - public function signatureRequestFilesRequest(string $signature_request_id, string $file_type = 'pdf') + public function signatureRequestFilesRequest(string $signature_request_id, string $file_type = 'pdf', string $contentType = self::contentTypes['signatureRequestFiles'][0]) { // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { @@ -1879,43 +2030,36 @@ public function signatureRequestFilesRequest(string $signature_request_id, strin } $resourcePath = '/signature_request/files/{signature_request_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($file_type !== null) { - if ('form' === 'form' && is_array($file_type)) { - foreach ($file_type as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['file_type'] = $file_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $file_type, + 'file_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/pdf', 'application/zip', 'application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/zip', 'application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1933,18 +2077,19 @@ public function signatureRequestFilesRequest(string $signature_request_id, strin // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1968,11 +2113,11 @@ public function signatureRequestFilesRequest(string $signature_request_id, strin $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1985,14 +2130,13 @@ public function signatureRequestFilesRequest(string $signature_request_id, strin * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\FileResponseDataUri + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestFilesAsDataUri(string $signature_request_id) { list($response) = $this->signatureRequestFilesAsDataUriWithHttpInfo($signature_request_id); - return $response; } @@ -2002,14 +2146,16 @@ public function signatureRequestFilesAsDataUri(string $signature_request_id) * Download Files as Data Uri * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\FileResponseDataUri, 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 ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_request_id) + public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { - $request = $this->signatureRequestFilesAsDataUriRequest($signature_request_id); + $request = $this->signatureRequestFilesAsDataUriRequest($signature_request_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2019,14 +2165,14 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2039,51 +2185,73 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\FileResponseDataUri' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponseDataUri', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\FileResponseDataUri' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FileResponseDataUri' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponseDataUri', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -2092,28 +2260,19 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\FileResponseDataUri', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\FileResponseDataUri', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2124,13 +2283,15 @@ public function signatureRequestFilesAsDataUriWithHttpInfo(string $signature_req * Download Files as Data Uri * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriAsync(string $signature_request_id) + public function signatureRequestFilesAsDataUriAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { - return $this->signatureRequestFilesAsDataUriAsyncWithHttpInfo($signature_request_id) + return $this->signatureRequestFilesAsDataUriAsyncWithHttpInfo($signature_request_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2144,23 +2305,28 @@ function ($response) { * Download Files as Data Uri * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriAsyncWithHttpInfo(string $signature_request_id) + public function signatureRequestFilesAsDataUriAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; - $request = $this->signatureRequestFilesAsDataUriRequest($signature_request_id); + $request = $this->signatureRequestFilesAsDataUriRequest($signature_request_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2180,7 +2346,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2190,11 +2356,13 @@ function ($exception) { * Create request for operation 'signatureRequestFilesAsDataUri' * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsDataUri'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestFilesAsDataUri. This method will eventually become unavailable */ - public function signatureRequestFilesAsDataUriRequest(string $signature_request_id) + public function signatureRequestFilesAsDataUriRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestFilesAsDataUri'][0]) { // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { @@ -2204,32 +2372,26 @@ public function signatureRequestFilesAsDataUriRequest(string $signature_request_ } $resourcePath = '/signature_request/files_as_data_uri/{signature_request_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2247,18 +2409,19 @@ public function signatureRequestFilesAsDataUriRequest(string $signature_request_ // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2282,11 +2445,11 @@ public function signatureRequestFilesAsDataUriRequest(string $signature_request_ $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2298,16 +2461,15 @@ public function signatureRequestFilesAsDataUriRequest(string $signature_request_ * Download Files as File Url * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\FileResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestFilesAsFileUrl(string $signature_request_id, int $force_download = 1) { list($response) = $this->signatureRequestFilesAsFileUrlWithHttpInfo($signature_request_id, $force_download); - return $response; } @@ -2317,15 +2479,17 @@ public function signatureRequestFilesAsFileUrl(string $signature_request_id, int * Download Files as File Url * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\FileResponse, 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 ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_request_id, int $force_download = 1) + public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_request_id, int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { - $request = $this->signatureRequestFilesAsFileUrlRequest($signature_request_id, $force_download); + $request = $this->signatureRequestFilesAsFileUrlRequest($signature_request_id, $force_download, $contentType); try { $options = $this->createHttpClientOption(); @@ -2335,14 +2499,14 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2355,51 +2519,73 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\FileResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\FileResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FileResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\FileResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -2408,28 +2594,19 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\FileResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\FileResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2440,14 +2617,16 @@ public function signatureRequestFilesAsFileUrlWithHttpInfo(string $signature_req * Download Files as File Url * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlAsync(string $signature_request_id, int $force_download = 1) + public function signatureRequestFilesAsFileUrlAsync(string $signature_request_id, int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { - return $this->signatureRequestFilesAsFileUrlAsyncWithHttpInfo($signature_request_id, $force_download) + return $this->signatureRequestFilesAsFileUrlAsyncWithHttpInfo($signature_request_id, $force_download, $contentType) ->then( function ($response) { return $response[0]; @@ -2461,24 +2640,29 @@ function ($response) { * Download Files as File Url * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlAsyncWithHttpInfo(string $signature_request_id, int $force_download = 1) + public function signatureRequestFilesAsFileUrlAsyncWithHttpInfo(string $signature_request_id, int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponse'; - $request = $this->signatureRequestFilesAsFileUrlRequest($signature_request_id, $force_download); + $request = $this->signatureRequestFilesAsFileUrlRequest($signature_request_id, $force_download, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2498,7 +2682,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2508,12 +2692,14 @@ function ($exception) { * Create request for operation 'signatureRequestFilesAsFileUrl' * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestFilesAsFileUrl'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestFilesAsFileUrl. This method will eventually become unavailable */ - public function signatureRequestFilesAsFileUrlRequest(string $signature_request_id, int $force_download = 1) + public function signatureRequestFilesAsFileUrlRequest(string $signature_request_id, int $force_download = 1, string $contentType = self::contentTypes['signatureRequestFilesAsFileUrl'][0]) { // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { @@ -2523,43 +2709,36 @@ public function signatureRequestFilesAsFileUrlRequest(string $signature_request_ } $resourcePath = '/signature_request/files_as_file_url/{signature_request_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($force_download !== null) { - if ('form' === 'form' && is_array($force_download)) { - foreach ($force_download as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['force_download'] = $force_download; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force_download, + 'force_download', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2577,18 +2756,19 @@ public function signatureRequestFilesAsFileUrlRequest(string $signature_request_ // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2612,11 +2792,11 @@ public function signatureRequestFilesAsFileUrlRequest(string $signature_request_ $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2629,14 +2809,13 @@ public function signatureRequestFilesAsFileUrlRequest(string $signature_request_ * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestGet(string $signature_request_id) { list($response) = $this->signatureRequestGetWithHttpInfo($signature_request_id); - return $response; } @@ -2646,14 +2825,16 @@ public function signatureRequestGet(string $signature_request_id) * Get Signature Request * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetWithHttpInfo(string $signature_request_id) + public function signatureRequestGetWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { - $request = $this->signatureRequestGetRequest($signature_request_id); + $request = $this->signatureRequestGetRequest($signature_request_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2663,14 +2844,14 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2683,51 +2864,73 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -2736,28 +2939,19 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id) $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\SignatureRequestGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2768,13 +2962,15 @@ public function signatureRequestGetWithHttpInfo(string $signature_request_id) * Get Signature Request * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetAsync(string $signature_request_id) + public function signatureRequestGetAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { - return $this->signatureRequestGetAsyncWithHttpInfo($signature_request_id) + return $this->signatureRequestGetAsyncWithHttpInfo($signature_request_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2788,23 +2984,28 @@ function ($response) { * Get Signature Request * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetAsyncWithHttpInfo(string $signature_request_id) + public function signatureRequestGetAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; - $request = $this->signatureRequestGetRequest($signature_request_id); + $request = $this->signatureRequestGetRequest($signature_request_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2824,7 +3025,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2834,11 +3035,13 @@ function ($exception) { * Create request for operation 'signatureRequestGet' * * @param string $signature_request_id The id of the SignatureRequest to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestGet'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestGet. This method will eventually become unavailable */ - public function signatureRequestGetRequest(string $signature_request_id) + public function signatureRequestGetRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestGet'][0]) { // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { @@ -2848,32 +3051,26 @@ public function signatureRequestGetRequest(string $signature_request_id) } $resourcePath = '/signature_request/{signature_request_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2891,18 +3088,19 @@ public function signatureRequestGetRequest(string $signature_request_id) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2926,11 +3124,11 @@ public function signatureRequestGetRequest(string $signature_request_id) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2942,18 +3140,17 @@ public function signatureRequestGetRequest(string $signature_request_id) * List Signature Requests * * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\SignatureRequestListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestList(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) { list($response) = $this->signatureRequestListWithHttpInfo($account_id, $page, $page_size, $query); - return $response; } @@ -2962,18 +3159,20 @@ public function signatureRequestList(string $account_id = null, int $page = 1, i * * List Signature Requests * - * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\SignatureRequestListResponse, 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 ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) + public function signatureRequestListWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { - $request = $this->signatureRequestListRequest($account_id, $page, $page_size, $query); + $request = $this->signatureRequestListRequest($account_id, $page, $page_size, $query, $contentType); try { $options = $this->createHttpClientOption(); @@ -2983,14 +3182,14 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3003,51 +3202,73 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\SignatureRequestListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestListResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestListResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestListResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestListResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\SignatureRequestListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -3056,28 +3277,19 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\SignatureRequestListResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -3087,17 +3299,19 @@ public function signatureRequestListWithHttpInfo(string $account_id = null, int * * List Signature Requests * - * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListAsync(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) + public function signatureRequestListAsync(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { - return $this->signatureRequestListAsyncWithHttpInfo($account_id, $page, $page_size, $query) + return $this->signatureRequestListAsyncWithHttpInfo($account_id, $page, $page_size, $query, $contentType) ->then( function ($response) { return $response[0]; @@ -3110,27 +3324,32 @@ function ($response) { * * List Signature Requests * - * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListAsyncWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) + public function signatureRequestListAsyncWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestListResponse'; - $request = $this->signatureRequestListRequest($account_id, $page, $page_size, $query); + $request = $this->signatureRequestListRequest($account_id, $page, $page_size, $query, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3150,7 +3369,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3159,75 +3378,67 @@ function ($exception) { /** * Create request for operation 'signatureRequestList' * - * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int $page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestList'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestList. This method will eventually become unavailable */ - public function signatureRequestListRequest(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) + public function signatureRequestListRequest(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['signatureRequestList'][0]) { $resourcePath = '/signature_request/list'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($account_id !== null) { - if ('form' === 'form' && is_array($account_id)) { - foreach ($account_id as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['account_id'] = $account_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $account_id, + 'account_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page !== null) { - if ('form' === 'form' && is_array($page)) { - foreach ($page as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page'] = $page; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_size !== null) { - if ('form' === 'form' && is_array($page_size)) { - foreach ($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page_size'] = $page_size; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page_size', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($query !== null) { - if ('form' === 'form' && is_array($query)) { - foreach ($query as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['query'] = $query; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $query, + 'query', // param base name + 'string', // 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) { @@ -3245,18 +3456,19 @@ public function signatureRequestListRequest(string $account_id = null, int $page // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3280,11 +3492,11 @@ public function signatureRequestListRequest(string $account_id = null, int $page $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3297,14 +3509,13 @@ public function signatureRequestListRequest(string $account_id = null, int $page * * @param string $signature_request_id The id of the SignatureRequest to release. (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestReleaseHold(string $signature_request_id) { list($response) = $this->signatureRequestReleaseHoldWithHttpInfo($signature_request_id); - return $response; } @@ -3314,14 +3525,16 @@ public function signatureRequestReleaseHold(string $signature_request_id) * Release On-Hold Signature Request * * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldWithHttpInfo(string $signature_request_id) + public function signatureRequestReleaseHoldWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { - $request = $this->signatureRequestReleaseHoldRequest($signature_request_id); + $request = $this->signatureRequestReleaseHoldRequest($signature_request_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3331,14 +3544,14 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3351,51 +3564,73 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -3404,28 +3639,19 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\SignatureRequestGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -3436,13 +3662,15 @@ public function signatureRequestReleaseHoldWithHttpInfo(string $signature_reques * Release On-Hold Signature Request * * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldAsync(string $signature_request_id) + public function signatureRequestReleaseHoldAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { - return $this->signatureRequestReleaseHoldAsyncWithHttpInfo($signature_request_id) + return $this->signatureRequestReleaseHoldAsyncWithHttpInfo($signature_request_id, $contentType) ->then( function ($response) { return $response[0]; @@ -3456,23 +3684,28 @@ function ($response) { * Release On-Hold Signature Request * * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldAsyncWithHttpInfo(string $signature_request_id) + public function signatureRequestReleaseHoldAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; - $request = $this->signatureRequestReleaseHoldRequest($signature_request_id); + $request = $this->signatureRequestReleaseHoldRequest($signature_request_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3492,7 +3725,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3502,11 +3735,13 @@ function ($exception) { * Create request for operation 'signatureRequestReleaseHold' * * @param string $signature_request_id The id of the SignatureRequest to release. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestReleaseHold'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestReleaseHold. This method will eventually become unavailable */ - public function signatureRequestReleaseHoldRequest(string $signature_request_id) + public function signatureRequestReleaseHoldRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestReleaseHold'][0]) { // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { @@ -3516,32 +3751,26 @@ public function signatureRequestReleaseHoldRequest(string $signature_request_id) } $resourcePath = '/signature_request/release_hold/{signature_request_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3559,18 +3788,19 @@ public function signatureRequestReleaseHoldRequest(string $signature_request_id) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3594,11 +3824,11 @@ public function signatureRequestReleaseHoldRequest(string $signature_request_id) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3609,17 +3839,16 @@ public function signatureRequestReleaseHoldRequest(string $signature_request_id) * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) * @param Model\SignatureRequestRemindRequest $signature_request_remind_request signature_request_remind_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestRemind(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request) { list($response) = $this->signatureRequestRemindWithHttpInfo($signature_request_id, $signature_request_remind_request); - return $response; } @@ -3628,16 +3857,18 @@ public function signatureRequestRemind(string $signature_request_id, Model\Signa * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindWithHttpInfo(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request) + public function signatureRequestRemindWithHttpInfo(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { - $request = $this->signatureRequestRemindRequest($signature_request_id, $signature_request_remind_request); + $request = $this->signatureRequestRemindRequest($signature_request_id, $signature_request_remind_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3647,14 +3878,14 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3667,51 +3898,73 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -3720,28 +3973,19 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\SignatureRequestGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -3751,15 +3995,17 @@ public function signatureRequestRemindWithHttpInfo(string $signature_request_id, * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindAsync(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request) + public function signatureRequestRemindAsync(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { - return $this->signatureRequestRemindAsyncWithHttpInfo($signature_request_id, $signature_request_remind_request) + return $this->signatureRequestRemindAsyncWithHttpInfo($signature_request_id, $signature_request_remind_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3772,25 +4018,30 @@ function ($response) { * * Send Request Reminder * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request) + public function signatureRequestRemindAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; - $request = $this->signatureRequestRemindRequest($signature_request_id, $signature_request_remind_request); + $request = $this->signatureRequestRemindRequest($signature_request_id, $signature_request_remind_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3810,7 +4061,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3819,13 +4070,15 @@ function ($exception) { /** * Create request for operation 'signatureRequestRemind' * - * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) + * @param string $signature_request_id The id of the SignatureRequest to send a reminder for. (required) * @param Model\SignatureRequestRemindRequest $signature_request_remind_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemind'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestRemind. This method will eventually become unavailable */ - public function signatureRequestRemindRequest(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request) + public function signatureRequestRemindRequest(string $signature_request_id, Model\SignatureRequestRemindRequest $signature_request_remind_request, string $contentType = self::contentTypes['signatureRequestRemind'][0]) { // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { @@ -3833,6 +4086,7 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode 'Missing the required parameter $signature_request_id when calling signatureRequestRemind' ); } + // verify the required parameter 'signature_request_remind_request' is set if ($signature_request_remind_request === null || (is_array($signature_request_remind_request) && count($signature_request_remind_request) === 0)) { throw new InvalidArgumentException( @@ -3841,9 +4095,11 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode } $resourcePath = '/signature_request/remind/{signature_request_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $signature_request_remind_request @@ -3854,27 +4110,23 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_remind_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_remind_request)); } else { $httpBody = $signature_request_remind_request; } @@ -3893,22 +4145,22 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $signature_request_remind_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3932,11 +4184,11 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3949,9 +4201,8 @@ public function signatureRequestRemindRequest(string $signature_request_id, Mode * * @param string $signature_request_id The id of the SignatureRequest to remove. (required) * - * @throws ApiException on non-2xx response + * @throws ApiException on non-2xx response or if the response body is not in the expected format * @throws InvalidArgumentException - * @return void */ public function signatureRequestRemove(string $signature_request_id) { @@ -3964,14 +4215,16 @@ public function signatureRequestRemove(string $signature_request_id) * Remove Signature Request Access * * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @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 ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveWithHttpInfo(string $signature_request_id) + public function signatureRequestRemoveWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { - $request = $this->signatureRequestRemoveRequest($signature_request_id); + $request = $this->signatureRequestRemoveRequest($signature_request_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3981,14 +4234,14 @@ public function signatureRequestRemoveWithHttpInfo(string $signature_request_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -4001,29 +4254,21 @@ public function signatureRequestRemoveWithHttpInfo(string $signature_request_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { } - throw $e; } } @@ -4034,13 +4279,15 @@ public function signatureRequestRemoveWithHttpInfo(string $signature_request_id) * Remove Signature Request Access * * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveAsync(string $signature_request_id) + public function signatureRequestRemoveAsync(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { - return $this->signatureRequestRemoveAsyncWithHttpInfo($signature_request_id) + return $this->signatureRequestRemoveAsyncWithHttpInfo($signature_request_id, $contentType) ->then( function ($response) { return $response[0]; @@ -4054,14 +4301,16 @@ function ($response) { * Remove Signature Request Access * * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveAsyncWithHttpInfo(string $signature_request_id) + public function signatureRequestRemoveAsyncWithHttpInfo(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { $returnType = ''; - $request = $this->signatureRequestRemoveRequest($signature_request_id); + $request = $this->signatureRequestRemoveRequest($signature_request_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4080,7 +4329,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -4090,11 +4339,13 @@ function ($exception) { * Create request for operation 'signatureRequestRemove' * * @param string $signature_request_id The id of the SignatureRequest to remove. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestRemove'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestRemove. This method will eventually become unavailable */ - public function signatureRequestRemoveRequest(string $signature_request_id) + public function signatureRequestRemoveRequest(string $signature_request_id, string $contentType = self::contentTypes['signatureRequestRemove'][0]) { // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { @@ -4104,32 +4355,26 @@ public function signatureRequestRemoveRequest(string $signature_request_id) } $resourcePath = '/signature_request/remove/{signature_request_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4147,18 +4392,19 @@ public function signatureRequestRemoveRequest(string $signature_request_id) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4178,11 +4424,11 @@ public function signatureRequestRemoveRequest(string $signature_request_id) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4195,14 +4441,13 @@ public function signatureRequestRemoveRequest(string $signature_request_id) * * @param Model\SignatureRequestSendRequest $signature_request_send_request signature_request_send_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestSend(Model\SignatureRequestSendRequest $signature_request_send_request) { list($response) = $this->signatureRequestSendWithHttpInfo($signature_request_send_request); - return $response; } @@ -4212,14 +4457,16 @@ public function signatureRequestSend(Model\SignatureRequestSendRequest $signatur * Send Signature Request * * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendRequest $signature_request_send_request) + public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { - $request = $this->signatureRequestSendRequest($signature_request_send_request); + $request = $this->signatureRequestSendRequest($signature_request_send_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -4229,14 +4476,14 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -4249,51 +4496,73 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -4302,28 +4571,19 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\SignatureRequestGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -4334,13 +4594,15 @@ public function signatureRequestSendWithHttpInfo(Model\SignatureRequestSendReque * Send Signature Request * * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendAsync(Model\SignatureRequestSendRequest $signature_request_send_request) + public function signatureRequestSendAsync(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { - return $this->signatureRequestSendAsyncWithHttpInfo($signature_request_send_request) + return $this->signatureRequestSendAsyncWithHttpInfo($signature_request_send_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4354,23 +4616,28 @@ function ($response) { * Send Signature Request * * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendAsyncWithHttpInfo(Model\SignatureRequestSendRequest $signature_request_send_request) + public function signatureRequestSendAsyncWithHttpInfo(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; - $request = $this->signatureRequestSendRequest($signature_request_send_request); + $request = $this->signatureRequestSendRequest($signature_request_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 + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4390,7 +4657,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -4400,11 +4667,13 @@ function ($exception) { * Create request for operation 'signatureRequestSend' * * @param Model\SignatureRequestSendRequest $signature_request_send_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSend'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestSend. This method will eventually become unavailable */ - public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $signature_request_send_request) + public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $signature_request_send_request, string $contentType = self::contentTypes['signatureRequestSend'][0]) { // verify the required parameter 'signature_request_send_request' is set if ($signature_request_send_request === null || (is_array($signature_request_send_request) && count($signature_request_send_request) === 0)) { @@ -4414,9 +4683,11 @@ public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $s } $resourcePath = '/signature_request/send'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $signature_request_send_request @@ -4424,21 +4695,17 @@ public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $s $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_send_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_send_request)); } else { $httpBody = $signature_request_send_request; } @@ -4457,22 +4724,22 @@ public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $s // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $signature_request_send_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4496,11 +4763,11 @@ public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $s $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4513,14 +4780,13 @@ public function signatureRequestSendRequest(Model\SignatureRequestSendRequest $s * * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request signature_request_send_with_template_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestSendWithTemplate(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request) { list($response) = $this->signatureRequestSendWithTemplateWithHttpInfo($signature_request_send_with_template_request); - return $response; } @@ -4530,14 +4796,16 @@ public function signatureRequestSendWithTemplate(Model\SignatureRequestSendWithT * Send with Template * * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request) + public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { - $request = $this->signatureRequestSendWithTemplateRequest($signature_request_send_with_template_request); + $request = $this->signatureRequestSendWithTemplateRequest($signature_request_send_with_template_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -4547,14 +4815,14 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -4567,51 +4835,73 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -4620,28 +4910,19 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\SignatureRequestGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -4652,13 +4933,15 @@ public function signatureRequestSendWithTemplateWithHttpInfo(Model\SignatureRequ * Send with Template * * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateAsync(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request) + public function signatureRequestSendWithTemplateAsync(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { - return $this->signatureRequestSendWithTemplateAsyncWithHttpInfo($signature_request_send_with_template_request) + return $this->signatureRequestSendWithTemplateAsyncWithHttpInfo($signature_request_send_with_template_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4672,23 +4955,28 @@ function ($response) { * Send with Template * * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateAsyncWithHttpInfo(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request) + public function signatureRequestSendWithTemplateAsyncWithHttpInfo(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; - $request = $this->signatureRequestSendWithTemplateRequest($signature_request_send_with_template_request); + $request = $this->signatureRequestSendWithTemplateRequest($signature_request_send_with_template_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4708,7 +4996,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -4718,11 +5006,13 @@ function ($exception) { * Create request for operation 'signatureRequestSendWithTemplate' * * @param Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestSendWithTemplate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestSendWithTemplate. This method will eventually become unavailable */ - public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request) + public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSendWithTemplateRequest $signature_request_send_with_template_request, string $contentType = self::contentTypes['signatureRequestSendWithTemplate'][0]) { // verify the required parameter 'signature_request_send_with_template_request' is set if ($signature_request_send_with_template_request === null || (is_array($signature_request_send_with_template_request) && count($signature_request_send_with_template_request) === 0)) { @@ -4732,9 +5022,11 @@ public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSe } $resourcePath = '/signature_request/send_with_template'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $signature_request_send_with_template_request @@ -4742,21 +5034,17 @@ public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSe $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_send_with_template_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_send_with_template_request)); } else { $httpBody = $signature_request_send_with_template_request; } @@ -4775,22 +5063,22 @@ public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSe // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $signature_request_send_with_template_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4814,11 +5102,11 @@ public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSe $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4829,17 +5117,16 @@ public function signatureRequestSendWithTemplateRequest(Model\SignatureRequestSe * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param string $signature_request_id The id of the SignatureRequest to update. (required) * @param Model\SignatureRequestUpdateRequest $signature_request_update_request signature_request_update_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\SignatureRequestGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function signatureRequestUpdate(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request) { list($response) = $this->signatureRequestUpdateWithHttpInfo($signature_request_id, $signature_request_update_request); - return $response; } @@ -4848,16 +5135,18 @@ public function signatureRequestUpdate(string $signature_request_id, Model\Signa * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param string $signature_request_id The id of the SignatureRequest to update. (required) * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\SignatureRequestGetResponse, HTTP status code, HTTP response headers (array of strings) + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException + * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request) + public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { - $request = $this->signatureRequestUpdateRequest($signature_request_id, $signature_request_update_request); + $request = $this->signatureRequestUpdateRequest($signature_request_id, $signature_request_update_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -4867,14 +5156,14 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -4887,51 +5176,73 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\SignatureRequestGetResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\SignatureRequestGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -4940,28 +5251,19 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\SignatureRequestGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\SignatureRequestGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -4971,15 +5273,17 @@ public function signatureRequestUpdateWithHttpInfo(string $signature_request_id, * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param string $signature_request_id The id of the SignatureRequest to update. (required) * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateAsync(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request) + public function signatureRequestUpdateAsync(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { - return $this->signatureRequestUpdateAsyncWithHttpInfo($signature_request_id, $signature_request_update_request) + return $this->signatureRequestUpdateAsyncWithHttpInfo($signature_request_id, $signature_request_update_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4992,25 +5296,30 @@ function ($response) { * * Update Signature Request * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param string $signature_request_id The id of the SignatureRequest to update. (required) * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request) + public function signatureRequestUpdateAsyncWithHttpInfo(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\SignatureRequestGetResponse'; - $request = $this->signatureRequestUpdateRequest($signature_request_id, $signature_request_update_request); + $request = $this->signatureRequestUpdateRequest($signature_request_id, $signature_request_update_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5030,7 +5339,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -5039,13 +5348,15 @@ function ($exception) { /** * Create request for operation 'signatureRequestUpdate' * - * @param string $signature_request_id The id of the SignatureRequest to update. (required) + * @param string $signature_request_id The id of the SignatureRequest to update. (required) * @param Model\SignatureRequestUpdateRequest $signature_request_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['signatureRequestUpdate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::signatureRequestUpdate. This method will eventually become unavailable */ - public function signatureRequestUpdateRequest(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request) + public function signatureRequestUpdateRequest(string $signature_request_id, Model\SignatureRequestUpdateRequest $signature_request_update_request, string $contentType = self::contentTypes['signatureRequestUpdate'][0]) { // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { @@ -5053,6 +5364,7 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode 'Missing the required parameter $signature_request_id when calling signatureRequestUpdate' ); } + // verify the required parameter 'signature_request_update_request' is set if ($signature_request_update_request === null || (is_array($signature_request_update_request) && count($signature_request_update_request) === 0)) { throw new InvalidArgumentException( @@ -5061,9 +5373,11 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode } $resourcePath = '/signature_request/update/{signature_request_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $signature_request_update_request @@ -5074,27 +5388,23 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_update_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($signature_request_update_request)); } else { $httpBody = $signature_request_update_request; } @@ -5113,22 +5423,22 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $signature_request_update_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5152,11 +5462,11 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5165,8 +5475,8 @@ public function signatureRequestUpdateRequest(string $signature_request_id, Mode /** * Create http client option * - * @throws RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -5180,4 +5490,66 @@ protected function createHttpClientOption() 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/Api/TeamApi.php b/sdks/php/src/Api/TeamApi.php index c0883aa81..ec599b4ac 100644 --- a/sdks/php/src/Api/TeamApi.php +++ b/sdks/php/src/Api/TeamApi.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -36,11 +35,11 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use GuzzleHttp\Utils; use InvalidArgumentException; +use JsonException; use Psr\Http\Message\ResponseInterface; use RuntimeException; @@ -48,34 +47,59 @@ * TeamApi Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class TeamApi { - /** - * @var ClientInterface - */ + /** @var ClientInterface */ protected $client; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @var HeaderSelector - */ + /** @var HeaderSelector */ protected $headerSelector; - /** - * @var int Host index - */ + /** @var int Host index */ protected $hostIndex; /** - * @var ResponseInterface|null + * @var string[] * */ + public const contentTypes = [ + 'teamAddMember' => [ + 'application/json', + ], + 'teamCreate' => [ + 'application/json', + ], + 'teamDelete' => [ + 'application/json', + ], + 'teamGet' => [ + 'application/json', + ], + 'teamInfo' => [ + 'application/json', + ], + 'teamInvites' => [ + 'application/json', + ], + 'teamMembers' => [ + 'application/json', + ], + 'teamRemoveMember' => [ + 'application/json', + ], + 'teamSubTeams' => [ + 'application/json', + ], + 'teamUpdate' => [ + 'application/json', + ], + ]; + + /** @var ResponseInterface|null */ protected $response; /** @@ -97,6 +121,7 @@ public function __construct( * Set the host index * * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future */ public function setHostIndex(int $hostIndex): void { @@ -107,6 +132,7 @@ public function setHostIndex(int $hostIndex): void * Get the host index * * @return int Host index + * @deprecated To be made private in the future */ public function getHostIndex() { @@ -135,16 +161,15 @@ public function getResponse() * Add User to Team * * @param Model\TeamAddMemberRequest $team_add_member_request team_add_member_request (required) - * @param string $team_id The id of the team. (optional) + * @param string $team_id The id of the team. (optional) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TeamGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function teamAddMember(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null) { list($response) = $this->teamAddMemberWithHttpInfo($team_add_member_request, $team_id); - return $response; } @@ -154,15 +179,17 @@ public function teamAddMember(Model\TeamAddMemberRequest $team_add_member_reques * Add User to Team * * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string $team_id The id of the team. (optional) + * @param string $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TeamGetResponse, 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 ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null) + public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { - $request = $this->teamAddMemberRequest($team_add_member_request, $team_id); + $request = $this->teamAddMemberRequest($team_add_member_request, $team_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -172,14 +199,14 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -192,51 +219,73 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TeamGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -245,28 +294,19 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TeamGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TeamGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -277,14 +317,16 @@ public function teamAddMemberWithHttpInfo(Model\TeamAddMemberRequest $team_add_m * Add User to Team * * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string $team_id The id of the team. (optional) + * @param string $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberAsync(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null) + public function teamAddMemberAsync(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { - return $this->teamAddMemberAsyncWithHttpInfo($team_add_member_request, $team_id) + return $this->teamAddMemberAsyncWithHttpInfo($team_add_member_request, $team_id, $contentType) ->then( function ($response) { return $response[0]; @@ -298,24 +340,29 @@ function ($response) { * Add User to Team * * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string $team_id The id of the team. (optional) + * @param string $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberAsyncWithHttpInfo(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null) + public function teamAddMemberAsyncWithHttpInfo(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; - $request = $this->teamAddMemberRequest($team_add_member_request, $team_id); + $request = $this->teamAddMemberRequest($team_add_member_request, $team_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -335,7 +382,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -345,12 +392,14 @@ function ($exception) { * Create request for operation 'teamAddMember' * * @param Model\TeamAddMemberRequest $team_add_member_request (required) - * @param string $team_id The id of the team. (optional) + * @param string $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamAddMember'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::teamAddMember. This method will eventually become unavailable */ - public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null) + public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member_request, string $team_id = null, string $contentType = self::contentTypes['teamAddMember'][0]) { // verify the required parameter 'team_add_member_request' is set if ($team_add_member_request === null || (is_array($team_add_member_request) && count($team_add_member_request) === 0)) { @@ -360,42 +409,38 @@ public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member } $resourcePath = '/team/add_member'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $team_add_member_request ); $multipart = !empty($formParams); - // query params - if ($team_id !== null) { - if ('form' === 'form' && is_array($team_id)) { - foreach ($team_id as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['team_id'] = $team_id; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $team_id, + 'team_id', // param base name + 'string', // 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 ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_add_member_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_add_member_request)); } else { $httpBody = $team_add_member_request; } @@ -414,22 +459,22 @@ public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $team_add_member_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -453,11 +498,11 @@ public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -470,14 +515,13 @@ public function teamAddMemberRequest(Model\TeamAddMemberRequest $team_add_member * * @param Model\TeamCreateRequest $team_create_request team_create_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TeamGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function teamCreate(Model\TeamCreateRequest $team_create_request) { list($response) = $this->teamCreateWithHttpInfo($team_create_request); - return $response; } @@ -487,14 +531,16 @@ public function teamCreate(Model\TeamCreateRequest $team_create_request) * Create Team * * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TeamGetResponse, 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 ::teamCreate. This method will eventually become unavailable */ - public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_request) + public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { - $request = $this->teamCreateRequest($team_create_request); + $request = $this->teamCreateRequest($team_create_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -504,14 +550,14 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -524,51 +570,73 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TeamGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -577,28 +645,19 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TeamGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TeamGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -609,13 +668,15 @@ public function teamCreateWithHttpInfo(Model\TeamCreateRequest $team_create_requ * Create Team * * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateAsync(Model\TeamCreateRequest $team_create_request) + public function teamCreateAsync(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { - return $this->teamCreateAsyncWithHttpInfo($team_create_request) + return $this->teamCreateAsyncWithHttpInfo($team_create_request, $contentType) ->then( function ($response) { return $response[0]; @@ -629,23 +690,28 @@ function ($response) { * Create Team * * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateAsyncWithHttpInfo(Model\TeamCreateRequest $team_create_request) + public function teamCreateAsyncWithHttpInfo(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; - $request = $this->teamCreateRequest($team_create_request); + $request = $this->teamCreateRequest($team_create_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -665,7 +731,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -675,11 +741,13 @@ function ($exception) { * Create request for operation 'teamCreate' * * @param Model\TeamCreateRequest $team_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamCreate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::teamCreate. This method will eventually become unavailable */ - public function teamCreateRequest(Model\TeamCreateRequest $team_create_request) + public function teamCreateRequest(Model\TeamCreateRequest $team_create_request, string $contentType = self::contentTypes['teamCreate'][0]) { // verify the required parameter 'team_create_request' is set if ($team_create_request === null || (is_array($team_create_request) && count($team_create_request) === 0)) { @@ -689,9 +757,11 @@ public function teamCreateRequest(Model\TeamCreateRequest $team_create_request) } $resourcePath = '/team/create'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $team_create_request @@ -699,21 +769,17 @@ public function teamCreateRequest(Model\TeamCreateRequest $team_create_request) $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_create_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_create_request)); } else { $httpBody = $team_create_request; } @@ -732,22 +798,22 @@ public function teamCreateRequest(Model\TeamCreateRequest $team_create_request) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $team_create_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -771,11 +837,11 @@ public function teamCreateRequest(Model\TeamCreateRequest $team_create_request) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -786,9 +852,8 @@ public function teamCreateRequest(Model\TeamCreateRequest $team_create_request) * * Delete Team * - * @throws ApiException on non-2xx response + * @throws ApiException on non-2xx response or if the response body is not in the expected format * @throws InvalidArgumentException - * @return void */ public function teamDelete() { @@ -800,13 +865,16 @@ public function teamDelete() * * Delete Team * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] 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 ::teamDelete. This method will eventually become unavailable */ - public function teamDeleteWithHttpInfo() + public function teamDeleteWithHttpInfo(string $contentType = self::contentTypes['teamDelete'][0]) { - $request = $this->teamDeleteRequest(); + $request = $this->teamDeleteRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -816,14 +884,14 @@ public function teamDeleteWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -836,29 +904,21 @@ public function teamDeleteWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { } - throw $e; } } @@ -868,12 +928,15 @@ public function teamDeleteWithHttpInfo() * * Delete Team * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ - public function teamDeleteAsync() + public function teamDeleteAsync(string $contentType = self::contentTypes['teamDelete'][0]) { - return $this->teamDeleteAsyncWithHttpInfo() + return $this->teamDeleteAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -886,13 +949,16 @@ function ($response) { * * Delete Team * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ - public function teamDeleteAsyncWithHttpInfo() + public function teamDeleteAsyncWithHttpInfo(string $contentType = self::contentTypes['teamDelete'][0]) { $returnType = ''; - $request = $this->teamDeleteRequest(); + $request = $this->teamDeleteRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -911,7 +977,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -920,29 +986,26 @@ function ($exception) { /** * Create request for operation 'teamDelete' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamDelete'] to see the possible values for this operation + * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::teamDelete. This method will eventually become unavailable */ - public function teamDeleteRequest() + public function teamDeleteRequest(string $contentType = self::contentTypes['teamDelete'][0]) { $resourcePath = '/team/destroy'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -960,18 +1023,19 @@ public function teamDeleteRequest() // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -995,11 +1059,11 @@ public function teamDeleteRequest() $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1010,14 +1074,13 @@ public function teamDeleteRequest() * * Get Team * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TeamGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function teamGet() { list($response) = $this->teamGetWithHttpInfo(); - return $response; } @@ -1026,13 +1089,16 @@ public function teamGet() * * Get Team * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * * @return array of Model\TeamGetResponse, 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 ::teamGet. This method will eventually become unavailable */ - public function teamGetWithHttpInfo() + public function teamGetWithHttpInfo(string $contentType = self::contentTypes['teamGet'][0]) { - $request = $this->teamGetRequest(); + $request = $this->teamGetRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -1042,14 +1108,14 @@ public function teamGetWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1062,51 +1128,73 @@ public function teamGetWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TeamGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1115,28 +1203,19 @@ public function teamGetWithHttpInfo() $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TeamGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TeamGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1146,12 +1225,15 @@ public function teamGetWithHttpInfo() * * Get Team * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ - public function teamGetAsync() + public function teamGetAsync(string $contentType = self::contentTypes['teamGet'][0]) { - return $this->teamGetAsyncWithHttpInfo() + return $this->teamGetAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -1164,22 +1246,28 @@ function ($response) { * * Get Team * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ - public function teamGetAsyncWithHttpInfo() + public function teamGetAsyncWithHttpInfo(string $contentType = self::contentTypes['teamGet'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; - $request = $this->teamGetRequest(); + $request = $this->teamGetRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1199,7 +1287,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1208,29 +1296,26 @@ function ($exception) { /** * Create request for operation 'teamGet' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamGet'] to see the possible values for this operation + * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::teamGet. This method will eventually become unavailable */ - public function teamGetRequest() + public function teamGetRequest(string $contentType = self::contentTypes['teamGet'][0]) { $resourcePath = '/team'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1248,18 +1333,19 @@ public function teamGetRequest() // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1283,11 +1369,11 @@ public function teamGetRequest() $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1300,14 +1386,13 @@ public function teamGetRequest() * * @param string $team_id The id of the team. (optional) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TeamGetInfoResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function teamInfo(string $team_id = null) { list($response) = $this->teamInfoWithHttpInfo($team_id); - return $response; } @@ -1316,15 +1401,17 @@ public function teamInfo(string $team_id = null) * * Get Team Info * - * @param string $team_id The id of the team. (optional) + * @param string $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TeamGetInfoResponse, 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 ::teamInfo. This method will eventually become unavailable */ - public function teamInfoWithHttpInfo(string $team_id = null) + public function teamInfoWithHttpInfo(string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { - $request = $this->teamInfoRequest($team_id); + $request = $this->teamInfoRequest($team_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1334,14 +1421,14 @@ public function teamInfoWithHttpInfo(string $team_id = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1354,51 +1441,73 @@ public function teamInfoWithHttpInfo(string $team_id = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TeamGetInfoResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetInfoResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TeamGetInfoResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TeamGetInfoResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetInfoResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TeamGetInfoResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1407,28 +1516,19 @@ public function teamInfoWithHttpInfo(string $team_id = null) $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TeamGetInfoResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TeamGetInfoResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1438,14 +1538,16 @@ public function teamInfoWithHttpInfo(string $team_id = null) * * Get Team Info * - * @param string $team_id The id of the team. (optional) + * @param string $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoAsync(string $team_id = null) + public function teamInfoAsync(string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { - return $this->teamInfoAsyncWithHttpInfo($team_id) + return $this->teamInfoAsyncWithHttpInfo($team_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1458,24 +1560,29 @@ function ($response) { * * Get Team Info * - * @param string $team_id The id of the team. (optional) + * @param string $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoAsyncWithHttpInfo(string $team_id = null) + public function teamInfoAsyncWithHttpInfo(string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetInfoResponse'; - $request = $this->teamInfoRequest($team_id); + $request = $this->teamInfoRequest($team_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1495,7 +1602,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1504,42 +1611,37 @@ function ($exception) { /** * Create request for operation 'teamInfo' * - * @param string $team_id The id of the team. (optional) + * @param string $team_id The id of the team. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInfo'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::teamInfo. This method will eventually become unavailable */ - public function teamInfoRequest(string $team_id = null) + public function teamInfoRequest(string $team_id = null, string $contentType = self::contentTypes['teamInfo'][0]) { $resourcePath = '/team/info'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($team_id !== null) { - if ('form' === 'form' && is_array($team_id)) { - foreach ($team_id as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['team_id'] = $team_id; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $team_id, + 'team_id', // param base name + 'string', // 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) { @@ -1557,18 +1659,19 @@ public function teamInfoRequest(string $team_id = null) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1592,11 +1695,11 @@ public function teamInfoRequest(string $team_id = null) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1609,14 +1712,13 @@ public function teamInfoRequest(string $team_id = null) * * @param string $email_address The email address for which to display the team invites. (optional) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TeamInvitesResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function teamInvites(string $email_address = null) { list($response) = $this->teamInvitesWithHttpInfo($email_address); - return $response; } @@ -1626,14 +1728,16 @@ public function teamInvites(string $email_address = null) * List Team Invites * * @param string $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TeamInvitesResponse, 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 ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesWithHttpInfo(string $email_address = null) + public function teamInvitesWithHttpInfo(string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { - $request = $this->teamInvitesRequest($email_address); + $request = $this->teamInvitesRequest($email_address, $contentType); try { $options = $this->createHttpClientOption(); @@ -1643,14 +1747,14 @@ public function teamInvitesWithHttpInfo(string $email_address = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1663,51 +1767,73 @@ public function teamInvitesWithHttpInfo(string $email_address = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TeamInvitesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamInvitesResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TeamInvitesResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TeamInvitesResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamInvitesResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TeamInvitesResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1716,28 +1842,19 @@ public function teamInvitesWithHttpInfo(string $email_address = null) $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TeamInvitesResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TeamInvitesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1748,13 +1865,15 @@ public function teamInvitesWithHttpInfo(string $email_address = null) * List Team Invites * * @param string $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesAsync(string $email_address = null) + public function teamInvitesAsync(string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { - return $this->teamInvitesAsyncWithHttpInfo($email_address) + return $this->teamInvitesAsyncWithHttpInfo($email_address, $contentType) ->then( function ($response) { return $response[0]; @@ -1768,23 +1887,28 @@ function ($response) { * List Team Invites * * @param string $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesAsyncWithHttpInfo(string $email_address = null) + public function teamInvitesAsyncWithHttpInfo(string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { $returnType = '\Dropbox\Sign\Model\TeamInvitesResponse'; - $request = $this->teamInvitesRequest($email_address); + $request = $this->teamInvitesRequest($email_address, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1804,7 +1928,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1814,41 +1938,36 @@ function ($exception) { * Create request for operation 'teamInvites' * * @param string $email_address The email address for which to display the team invites. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamInvites'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::teamInvites. This method will eventually become unavailable */ - public function teamInvitesRequest(string $email_address = null) + public function teamInvitesRequest(string $email_address = null, string $contentType = self::contentTypes['teamInvites'][0]) { $resourcePath = '/team/invites'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($email_address !== null) { - if ('form' === 'form' && is_array($email_address)) { - foreach ($email_address as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['email_address'] = $email_address; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $email_address, + 'email_address', // param base name + 'string', // 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) { @@ -1866,18 +1985,19 @@ public function teamInvitesRequest(string $email_address = null) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1901,11 +2021,11 @@ public function teamInvitesRequest(string $email_address = null) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1916,18 +2036,17 @@ public function teamInvitesRequest(string $email_address = null) * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TeamMembersResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function teamMembers(string $team_id, int $page = 1, int $page_size = 20) { list($response) = $this->teamMembersWithHttpInfo($team_id, $page, $page_size); - return $response; } @@ -1936,17 +2055,19 @@ public function teamMembers(string $team_id, int $page = 1, int $page_size = 20) * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TeamMembersResponse, 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 ::teamMembers. This method will eventually become unavailable */ - public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20) + public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { - $request = $this->teamMembersRequest($team_id, $page, $page_size); + $request = $this->teamMembersRequest($team_id, $page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -1956,14 +2077,14 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1976,51 +2097,73 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TeamMembersResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamMembersResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TeamMembersResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TeamMembersResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamMembersResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TeamMembersResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -2029,28 +2172,19 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TeamMembersResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TeamMembersResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2060,16 +2194,18 @@ public function teamMembersWithHttpInfo(string $team_id, int $page = 1, int $pag * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersAsync(string $team_id, int $page = 1, int $page_size = 20) + public function teamMembersAsync(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { - return $this->teamMembersAsyncWithHttpInfo($team_id, $page, $page_size) + return $this->teamMembersAsyncWithHttpInfo($team_id, $page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -2082,26 +2218,31 @@ function ($response) { * * List Team Members * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersAsyncWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20) + public function teamMembersAsyncWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { $returnType = '\Dropbox\Sign\Model\TeamMembersResponse'; - $request = $this->teamMembersRequest($team_id, $page, $page_size); + $request = $this->teamMembersRequest($team_id, $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 + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2121,7 +2262,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2130,14 +2271,16 @@ function ($exception) { /** * Create request for operation 'teamMembers' * - * @param string $team_id The id of the team that a member list is being requested from. (required) - * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the team that a member list is being requested from. (required) + * @param int $page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamMembers'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::teamMembers. This method will eventually become unavailable */ - public function teamMembersRequest(string $team_id, int $page = 1, int $page_size = 20) + public function teamMembersRequest(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamMembers'][0]) { // verify the required parameter 'team_id' is set if ($team_id === null || (is_array($team_id) && count($team_id) === 0)) { @@ -2145,6 +2288,7 @@ public function teamMembersRequest(string $team_id, int $page = 1, int $page_siz 'Missing the required parameter $team_id when calling teamMembers' ); } + if ($page_size !== null && $page_size > 100) { throw new InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamMembers, must be smaller than or equal to 100.'); } @@ -2153,53 +2297,45 @@ public function teamMembersRequest(string $team_id, int $page = 1, int $page_siz } $resourcePath = '/team/members/{team_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($page !== null) { - if ('form' === 'form' && is_array($page)) { - foreach ($page as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page'] = $page; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_size !== null) { - if ('form' === 'form' && is_array($page_size)) { - foreach ($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page_size'] = $page_size; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page_size', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params if ($team_id !== null) { $resourcePath = str_replace( - '{' . 'team_id' . '}', + '{team_id}', ObjectSerializer::toPathValue($team_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2217,18 +2353,19 @@ public function teamMembersRequest(string $team_id, int $page = 1, int $page_siz // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2252,11 +2389,11 @@ public function teamMembersRequest(string $team_id, int $page = 1, int $page_siz $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2269,14 +2406,13 @@ public function teamMembersRequest(string $team_id, int $page = 1, int $page_siz * * @param Model\TeamRemoveMemberRequest $team_remove_member_request team_remove_member_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TeamGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function teamRemoveMember(Model\TeamRemoveMemberRequest $team_remove_member_request) { list($response) = $this->teamRemoveMemberWithHttpInfo($team_remove_member_request); - return $response; } @@ -2286,14 +2422,16 @@ public function teamRemoveMember(Model\TeamRemoveMemberRequest $team_remove_memb * Remove User from Team * * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TeamGetResponse, 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 ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team_remove_member_request) + public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { - $request = $this->teamRemoveMemberRequest($team_remove_member_request); + $request = $this->teamRemoveMemberRequest($team_remove_member_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2303,14 +2441,14 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2323,51 +2461,73 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 201) { - if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 201: + if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TeamGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -2376,28 +2536,19 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 201) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TeamGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TeamGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2408,13 +2559,15 @@ public function teamRemoveMemberWithHttpInfo(Model\TeamRemoveMemberRequest $team * Remove User from Team * * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberAsync(Model\TeamRemoveMemberRequest $team_remove_member_request) + public function teamRemoveMemberAsync(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { - return $this->teamRemoveMemberAsyncWithHttpInfo($team_remove_member_request) + return $this->teamRemoveMemberAsyncWithHttpInfo($team_remove_member_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2428,23 +2581,28 @@ function ($response) { * Remove User from Team * * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberAsyncWithHttpInfo(Model\TeamRemoveMemberRequest $team_remove_member_request) + public function teamRemoveMemberAsyncWithHttpInfo(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; - $request = $this->teamRemoveMemberRequest($team_remove_member_request); + $request = $this->teamRemoveMemberRequest($team_remove_member_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2464,7 +2622,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2474,11 +2632,13 @@ function ($exception) { * Create request for operation 'teamRemoveMember' * * @param Model\TeamRemoveMemberRequest $team_remove_member_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamRemoveMember'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::teamRemoveMember. This method will eventually become unavailable */ - public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remove_member_request) + public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remove_member_request, string $contentType = self::contentTypes['teamRemoveMember'][0]) { // verify the required parameter 'team_remove_member_request' is set if ($team_remove_member_request === null || (is_array($team_remove_member_request) && count($team_remove_member_request) === 0)) { @@ -2488,9 +2648,11 @@ public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remo } $resourcePath = '/team/remove_member'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $team_remove_member_request @@ -2498,21 +2660,17 @@ public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remo $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_remove_member_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_remove_member_request)); } else { $httpBody = $team_remove_member_request; } @@ -2531,22 +2689,22 @@ public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remo // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $team_remove_member_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2570,11 +2728,11 @@ public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remo $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2585,18 +2743,17 @@ public function teamRemoveMemberRequest(Model\TeamRemoveMemberRequest $team_remo * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the parent Team. (required) + * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TeamSubTeamsResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function teamSubTeams(string $team_id, int $page = 1, int $page_size = 20) { list($response) = $this->teamSubTeamsWithHttpInfo($team_id, $page, $page_size); - return $response; } @@ -2605,17 +2762,19 @@ public function teamSubTeams(string $team_id, int $page = 1, int $page_size = 20 * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the parent Team. (required) + * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TeamSubTeamsResponse, 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 ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20) + public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { - $request = $this->teamSubTeamsRequest($team_id, $page, $page_size); + $request = $this->teamSubTeamsRequest($team_id, $page, $page_size, $contentType); try { $options = $this->createHttpClientOption(); @@ -2625,14 +2784,14 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2645,51 +2804,73 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TeamSubTeamsResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamSubTeamsResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TeamSubTeamsResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TeamSubTeamsResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamSubTeamsResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TeamSubTeamsResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -2698,28 +2879,19 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TeamSubTeamsResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TeamSubTeamsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2729,16 +2901,18 @@ public function teamSubTeamsWithHttpInfo(string $team_id, int $page = 1, int $pa * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the parent Team. (required) + * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsAsync(string $team_id, int $page = 1, int $page_size = 20) + public function teamSubTeamsAsync(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { - return $this->teamSubTeamsAsyncWithHttpInfo($team_id, $page, $page_size) + return $this->teamSubTeamsAsyncWithHttpInfo($team_id, $page, $page_size, $contentType) ->then( function ($response) { return $response[0]; @@ -2751,26 +2925,31 @@ function ($response) { * * List Sub Teams * - * @param string $team_id The id of the parent Team. (required) - * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the parent Team. (required) + * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsAsyncWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20) + public function teamSubTeamsAsyncWithHttpInfo(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { $returnType = '\Dropbox\Sign\Model\TeamSubTeamsResponse'; - $request = $this->teamSubTeamsRequest($team_id, $page, $page_size); + $request = $this->teamSubTeamsRequest($team_id, $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 + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2790,7 +2969,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2799,14 +2978,16 @@ function ($exception) { /** * Create request for operation 'teamSubTeams' * - * @param string $team_id The id of the parent Team. (required) - * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $team_id The id of the parent Team. (required) + * @param int $page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamSubTeams'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::teamSubTeams. This method will eventually become unavailable */ - public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_size = 20) + public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_size = 20, string $contentType = self::contentTypes['teamSubTeams'][0]) { // verify the required parameter 'team_id' is set if ($team_id === null || (is_array($team_id) && count($team_id) === 0)) { @@ -2814,6 +2995,7 @@ public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_si 'Missing the required parameter $team_id when calling teamSubTeams' ); } + if ($page_size !== null && $page_size > 100) { throw new InvalidArgumentException('invalid value for "$page_size" when calling TeamApi.teamSubTeams, must be smaller than or equal to 100.'); } @@ -2822,53 +3004,45 @@ public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_si } $resourcePath = '/team/sub_teams/{team_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($page !== null) { - if ('form' === 'form' && is_array($page)) { - foreach ($page as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page'] = $page; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_size !== null) { - if ('form' === 'form' && is_array($page_size)) { - foreach ($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page_size'] = $page_size; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page_size', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params if ($team_id !== null) { $resourcePath = str_replace( - '{' . 'team_id' . '}', + '{team_id}', ObjectSerializer::toPathValue($team_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2886,18 +3060,19 @@ public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_si // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2921,11 +3096,11 @@ public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_si $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2938,14 +3113,13 @@ public function teamSubTeamsRequest(string $team_id, int $page = 1, int $page_si * * @param Model\TeamUpdateRequest $team_update_request team_update_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TeamGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function teamUpdate(Model\TeamUpdateRequest $team_update_request) { list($response) = $this->teamUpdateWithHttpInfo($team_update_request); - return $response; } @@ -2955,14 +3129,16 @@ public function teamUpdate(Model\TeamUpdateRequest $team_update_request) * Update Team * * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TeamGetResponse, 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 ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_request) + public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { - $request = $this->teamUpdateRequest($team_update_request); + $request = $this->teamUpdateRequest($team_update_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2972,14 +3148,14 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2992,51 +3168,73 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TeamGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TeamGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TeamGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -3045,28 +3243,19 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TeamGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TeamGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -3077,13 +3266,15 @@ public function teamUpdateWithHttpInfo(Model\TeamUpdateRequest $team_update_requ * Update Team * * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateAsync(Model\TeamUpdateRequest $team_update_request) + public function teamUpdateAsync(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { - return $this->teamUpdateAsyncWithHttpInfo($team_update_request) + return $this->teamUpdateAsyncWithHttpInfo($team_update_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3097,23 +3288,28 @@ function ($response) { * Update Team * * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateAsyncWithHttpInfo(Model\TeamUpdateRequest $team_update_request) + public function teamUpdateAsyncWithHttpInfo(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { $returnType = '\Dropbox\Sign\Model\TeamGetResponse'; - $request = $this->teamUpdateRequest($team_update_request); + $request = $this->teamUpdateRequest($team_update_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3133,7 +3329,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3143,11 +3339,13 @@ function ($exception) { * Create request for operation 'teamUpdate' * * @param Model\TeamUpdateRequest $team_update_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['teamUpdate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::teamUpdate. This method will eventually become unavailable */ - public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request) + public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request, string $contentType = self::contentTypes['teamUpdate'][0]) { // verify the required parameter 'team_update_request' is set if ($team_update_request === null || (is_array($team_update_request) && count($team_update_request) === 0)) { @@ -3157,9 +3355,11 @@ public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request) } $resourcePath = '/team'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $team_update_request @@ -3167,21 +3367,17 @@ public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request) $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_update_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($team_update_request)); } else { $httpBody = $team_update_request; } @@ -3200,22 +3396,22 @@ public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $team_update_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3239,11 +3435,11 @@ public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3252,8 +3448,8 @@ public function teamUpdateRequest(Model\TeamUpdateRequest $team_update_request) /** * Create http client option * - * @throws RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -3267,4 +3463,66 @@ protected function createHttpClientOption() 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/Api/TemplateApi.php b/sdks/php/src/Api/TemplateApi.php index 92f2406b5..6b356fc7b 100644 --- a/sdks/php/src/Api/TemplateApi.php +++ b/sdks/php/src/Api/TemplateApi.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -36,11 +35,11 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use GuzzleHttp\Utils; use InvalidArgumentException; +use JsonException; use Psr\Http\Message\ResponseInterface; use RuntimeException; use SplFileObject; @@ -49,34 +48,65 @@ * TemplateApi Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class TemplateApi { - /** - * @var ClientInterface - */ + /** @var ClientInterface */ protected $client; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @var HeaderSelector - */ + /** @var HeaderSelector */ protected $headerSelector; - /** - * @var int Host index - */ + /** @var int Host index */ protected $hostIndex; /** - * @var ResponseInterface|null - */ + * @var string[] * + */ + public const contentTypes = [ + 'templateAddUser' => [ + 'application/json', + ], + 'templateCreate' => [ + 'application/json', + 'multipart/form-data', + ], + 'templateCreateEmbeddedDraft' => [ + 'application/json', + 'multipart/form-data', + ], + 'templateDelete' => [ + 'application/json', + ], + 'templateFiles' => [ + 'application/json', + ], + 'templateFilesAsDataUri' => [ + 'application/json', + ], + 'templateFilesAsFileUrl' => [ + 'application/json', + ], + 'templateGet' => [ + 'application/json', + ], + 'templateList' => [ + 'application/json', + ], + 'templateRemoveUser' => [ + 'application/json', + ], + 'templateUpdateFiles' => [ + 'application/json', + 'multipart/form-data', + ], + ]; + + /** @var ResponseInterface|null */ protected $response; /** @@ -98,6 +128,7 @@ public function __construct( * Set the host index * * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future */ public function setHostIndex(int $hostIndex): void { @@ -108,6 +139,7 @@ public function setHostIndex(int $hostIndex): void * Get the host index * * @return int Host index + * @deprecated To be made private in the future */ public function getHostIndex() { @@ -135,17 +167,16 @@ public function getResponse() * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) + * @param string $template_id The id of the Template to give the Account access to. (required) * @param Model\TemplateAddUserRequest $template_add_user_request template_add_user_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TemplateGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function templateAddUser(string $template_id, Model\TemplateAddUserRequest $template_add_user_request) { list($response) = $this->templateAddUserWithHttpInfo($template_id, $template_add_user_request); - return $response; } @@ -154,16 +185,18 @@ public function templateAddUser(string $template_id, Model\TemplateAddUserReques * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) + * @param string $template_id The id of the Template to give the Account access to. (required) * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TemplateGetResponse, 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 ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateAddUserRequest $template_add_user_request) + public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { - $request = $this->templateAddUserRequest($template_id, $template_add_user_request); + $request = $this->templateAddUserRequest($template_id, $template_add_user_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -173,14 +206,14 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -193,51 +226,73 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TemplateGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -246,28 +301,19 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TemplateGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TemplateGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -277,15 +323,17 @@ public function templateAddUserWithHttpInfo(string $template_id, Model\TemplateA * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) + * @param string $template_id The id of the Template to give the Account access to. (required) * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserAsync(string $template_id, Model\TemplateAddUserRequest $template_add_user_request) + public function templateAddUserAsync(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { - return $this->templateAddUserAsyncWithHttpInfo($template_id, $template_add_user_request) + return $this->templateAddUserAsyncWithHttpInfo($template_id, $template_add_user_request, $contentType) ->then( function ($response) { return $response[0]; @@ -298,25 +346,30 @@ function ($response) { * * Add User to Template * - * @param string $template_id The id of the Template to give the Account access to. (required) + * @param string $template_id The id of the Template to give the Account access to. (required) * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserAsyncWithHttpInfo(string $template_id, Model\TemplateAddUserRequest $template_add_user_request) + public function templateAddUserAsyncWithHttpInfo(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; - $request = $this->templateAddUserRequest($template_id, $template_add_user_request); + $request = $this->templateAddUserRequest($template_id, $template_add_user_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -336,7 +389,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -345,13 +398,15 @@ function ($exception) { /** * Create request for operation 'templateAddUser' * - * @param string $template_id The id of the Template to give the Account access to. (required) + * @param string $template_id The id of the Template to give the Account access to. (required) * @param Model\TemplateAddUserRequest $template_add_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateAddUser'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateAddUser. This method will eventually become unavailable */ - public function templateAddUserRequest(string $template_id, Model\TemplateAddUserRequest $template_add_user_request) + public function templateAddUserRequest(string $template_id, Model\TemplateAddUserRequest $template_add_user_request, string $contentType = self::contentTypes['templateAddUser'][0]) { // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { @@ -359,6 +414,7 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse 'Missing the required parameter $template_id when calling templateAddUser' ); } + // verify the required parameter 'template_add_user_request' is set if ($template_add_user_request === null || (is_array($template_add_user_request) && count($template_add_user_request) === 0)) { throw new InvalidArgumentException( @@ -367,9 +423,11 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse } $resourcePath = '/template/add_user/{template_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $template_add_user_request @@ -380,27 +438,23 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_add_user_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_add_user_request)); } else { $httpBody = $template_add_user_request; } @@ -419,22 +473,22 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $template_add_user_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -458,11 +512,11 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -475,14 +529,13 @@ public function templateAddUserRequest(string $template_id, Model\TemplateAddUse * * @param Model\TemplateCreateRequest $template_create_request template_create_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TemplateCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function templateCreate(Model\TemplateCreateRequest $template_create_request) { list($response) = $this->templateCreateWithHttpInfo($template_create_request); - return $response; } @@ -492,14 +545,16 @@ public function templateCreate(Model\TemplateCreateRequest $template_create_requ * Create Template * * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TemplateCreateResponse, 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 ::templateCreate. This method will eventually become unavailable */ - public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template_create_request) + public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { - $request = $this->templateCreateRequest($template_create_request); + $request = $this->templateCreateRequest($template_create_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -509,14 +564,14 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -529,51 +584,73 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TemplateCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateCreateResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TemplateCreateResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TemplateCreateResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateCreateResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TemplateCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -582,28 +659,19 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TemplateCreateResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TemplateCreateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -614,13 +682,15 @@ public function templateCreateWithHttpInfo(Model\TemplateCreateRequest $template * Create Template * * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateAsync(Model\TemplateCreateRequest $template_create_request) + public function templateCreateAsync(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { - return $this->templateCreateAsyncWithHttpInfo($template_create_request) + return $this->templateCreateAsyncWithHttpInfo($template_create_request, $contentType) ->then( function ($response) { return $response[0]; @@ -634,23 +704,28 @@ function ($response) { * Create Template * * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateAsyncWithHttpInfo(Model\TemplateCreateRequest $template_create_request) + public function templateCreateAsyncWithHttpInfo(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateCreateResponse'; - $request = $this->templateCreateRequest($template_create_request); + $request = $this->templateCreateRequest($template_create_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -670,7 +745,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -680,11 +755,13 @@ function ($exception) { * Create request for operation 'templateCreate' * * @param Model\TemplateCreateRequest $template_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateCreate. This method will eventually become unavailable */ - public function templateCreateRequest(Model\TemplateCreateRequest $template_create_request) + public function templateCreateRequest(Model\TemplateCreateRequest $template_create_request, string $contentType = self::contentTypes['templateCreate'][0]) { // verify the required parameter 'template_create_request' is set if ($template_create_request === null || (is_array($template_create_request) && count($template_create_request) === 0)) { @@ -694,9 +771,11 @@ public function templateCreateRequest(Model\TemplateCreateRequest $template_crea } $resourcePath = '/template/create'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $template_create_request @@ -704,21 +783,17 @@ public function templateCreateRequest(Model\TemplateCreateRequest $template_crea $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_create_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_create_request)); } else { $httpBody = $template_create_request; } @@ -737,22 +812,22 @@ public function templateCreateRequest(Model\TemplateCreateRequest $template_crea // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $template_create_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -776,11 +851,11 @@ public function templateCreateRequest(Model\TemplateCreateRequest $template_crea $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -793,14 +868,13 @@ public function templateCreateRequest(Model\TemplateCreateRequest $template_crea * * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request template_create_embedded_draft_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TemplateCreateEmbeddedDraftResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function templateCreateEmbeddedDraft(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request) { list($response) = $this->templateCreateEmbeddedDraftWithHttpInfo($template_create_embedded_draft_request); - return $response; } @@ -810,14 +884,16 @@ public function templateCreateEmbeddedDraft(Model\TemplateCreateEmbeddedDraftReq * Create Embedded Template Draft * * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TemplateCreateEmbeddedDraftResponse, 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 ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request) + public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { - $request = $this->templateCreateEmbeddedDraftRequest($template_create_embedded_draft_request); + $request = $this->templateCreateEmbeddedDraftRequest($template_create_embedded_draft_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -827,14 +903,14 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -847,51 +923,73 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -900,28 +998,19 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -932,13 +1021,15 @@ public function templateCreateEmbeddedDraftWithHttpInfo(Model\TemplateCreateEmbe * Create Embedded Template Draft * * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftAsync(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request) + public function templateCreateEmbeddedDraftAsync(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { - return $this->templateCreateEmbeddedDraftAsyncWithHttpInfo($template_create_embedded_draft_request) + return $this->templateCreateEmbeddedDraftAsyncWithHttpInfo($template_create_embedded_draft_request, $contentType) ->then( function ($response) { return $response[0]; @@ -952,23 +1043,28 @@ function ($response) { * Create Embedded Template Draft * * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftAsyncWithHttpInfo(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request) + public function templateCreateEmbeddedDraftAsyncWithHttpInfo(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateCreateEmbeddedDraftResponse'; - $request = $this->templateCreateEmbeddedDraftRequest($template_create_embedded_draft_request); + $request = $this->templateCreateEmbeddedDraftRequest($template_create_embedded_draft_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -988,7 +1084,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -998,11 +1094,13 @@ function ($exception) { * Create request for operation 'templateCreateEmbeddedDraft' * * @param Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateCreateEmbeddedDraft'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateCreateEmbeddedDraft. This method will eventually become unavailable */ - public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request) + public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedDraftRequest $template_create_embedded_draft_request, string $contentType = self::contentTypes['templateCreateEmbeddedDraft'][0]) { // verify the required parameter 'template_create_embedded_draft_request' is set if ($template_create_embedded_draft_request === null || (is_array($template_create_embedded_draft_request) && count($template_create_embedded_draft_request) === 0)) { @@ -1012,9 +1110,11 @@ public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedD } $resourcePath = '/template/create_embedded_draft'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $template_create_embedded_draft_request @@ -1022,21 +1122,17 @@ public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedD $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_create_embedded_draft_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_create_embedded_draft_request)); } else { $httpBody = $template_create_embedded_draft_request; } @@ -1055,22 +1151,22 @@ public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedD // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $template_create_embedded_draft_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1094,11 +1190,11 @@ public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedD $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1111,9 +1207,8 @@ public function templateCreateEmbeddedDraftRequest(Model\TemplateCreateEmbeddedD * * @param string $template_id The id of the Template to delete. (required) * - * @throws ApiException on non-2xx response + * @throws ApiException on non-2xx response or if the response body is not in the expected format * @throws InvalidArgumentException - * @return void */ public function templateDelete(string $template_id) { @@ -1126,14 +1221,16 @@ public function templateDelete(string $template_id) * Delete Template * * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @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 ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteWithHttpInfo(string $template_id) + public function templateDeleteWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) { - $request = $this->templateDeleteRequest($template_id); + $request = $this->templateDeleteRequest($template_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1143,14 +1240,14 @@ public function templateDeleteWithHttpInfo(string $template_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1163,29 +1260,21 @@ public function templateDeleteWithHttpInfo(string $template_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { } - throw $e; } } @@ -1196,13 +1285,15 @@ public function templateDeleteWithHttpInfo(string $template_id) * Delete Template * * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteAsync(string $template_id) + public function templateDeleteAsync(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) { - return $this->templateDeleteAsyncWithHttpInfo($template_id) + return $this->templateDeleteAsyncWithHttpInfo($template_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1216,14 +1307,16 @@ function ($response) { * Delete Template * * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteAsyncWithHttpInfo(string $template_id) + public function templateDeleteAsyncWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) { $returnType = ''; - $request = $this->templateDeleteRequest($template_id); + $request = $this->templateDeleteRequest($template_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1242,7 +1335,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1252,11 +1345,13 @@ function ($exception) { * Create request for operation 'templateDelete' * * @param string $template_id The id of the Template to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateDelete'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateDelete. This method will eventually become unavailable */ - public function templateDeleteRequest(string $template_id) + public function templateDeleteRequest(string $template_id, string $contentType = self::contentTypes['templateDelete'][0]) { // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { @@ -1266,32 +1361,26 @@ public function templateDeleteRequest(string $template_id) } $resourcePath = '/template/delete/{template_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1309,18 +1398,19 @@ public function templateDeleteRequest(string $template_id) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1344,11 +1434,11 @@ public function templateDeleteRequest(string $template_id) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1360,16 +1450,15 @@ public function templateDeleteRequest(string $template_id) * Get Template Files * * @param string $template_id The id of the template files to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return SplFileObject + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function templateFiles(string $template_id, string $file_type = null) { list($response) = $this->templateFilesWithHttpInfo($template_id, $file_type); - return $response; } @@ -1379,15 +1468,17 @@ public function templateFiles(string $template_id, string $file_type = null) * Get Template Files * * @param string $template_id The id of the template files to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @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 ::templateFiles. This method will eventually become unavailable */ - public function templateFilesWithHttpInfo(string $template_id, string $file_type = null) + public function templateFilesWithHttpInfo(string $template_id, string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { - $request = $this->templateFilesRequest($template_id, $file_type); + $request = $this->templateFilesRequest($template_id, $file_type, $contentType); try { $options = $this->createHttpClientOption(); @@ -1397,14 +1488,14 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1417,51 +1508,73 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + 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, '\Dropbox\Sign\Model\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\SplFileObject'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1470,28 +1583,19 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\SplFileObject', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + 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; } } @@ -1502,14 +1606,16 @@ public function templateFilesWithHttpInfo(string $template_id, string $file_type * Get Template Files * * @param string $template_id The id of the template files to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesAsync(string $template_id, string $file_type = null) + public function templateFilesAsync(string $template_id, string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { - return $this->templateFilesAsyncWithHttpInfo($template_id, $file_type) + return $this->templateFilesAsyncWithHttpInfo($template_id, $file_type, $contentType) ->then( function ($response) { return $response[0]; @@ -1523,24 +1629,29 @@ function ($response) { * Get Template Files * * @param string $template_id The id of the template files to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesAsyncWithHttpInfo(string $template_id, string $file_type = null) + public function templateFilesAsyncWithHttpInfo(string $template_id, string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { $returnType = '\SplFileObject'; - $request = $this->templateFilesRequest($template_id, $file_type); + $request = $this->templateFilesRequest($template_id, $file_type, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1560,7 +1671,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1570,12 +1681,14 @@ function ($exception) { * Create request for operation 'templateFiles' * * @param string $template_id The id of the template files to retrieve. (required) - * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFiles'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateFiles. This method will eventually become unavailable */ - public function templateFilesRequest(string $template_id, string $file_type = null) + public function templateFilesRequest(string $template_id, string $file_type = null, string $contentType = self::contentTypes['templateFiles'][0]) { // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { @@ -1585,43 +1698,36 @@ public function templateFilesRequest(string $template_id, string $file_type = nu } $resourcePath = '/template/files/{template_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($file_type !== null) { - if ('form' === 'form' && is_array($file_type)) { - foreach ($file_type as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['file_type'] = $file_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $file_type, + 'file_type', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/pdf', 'application/zip', 'application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/pdf', 'application/zip', 'application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1639,18 +1745,19 @@ public function templateFilesRequest(string $template_id, string $file_type = nu // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1674,11 +1781,11 @@ public function templateFilesRequest(string $template_id, string $file_type = nu $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1691,14 +1798,13 @@ public function templateFilesRequest(string $template_id, string $file_type = nu * * @param string $template_id The id of the template files to retrieve. (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\FileResponseDataUri + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function templateFilesAsDataUri(string $template_id) { list($response) = $this->templateFilesAsDataUriWithHttpInfo($template_id); - return $response; } @@ -1708,14 +1814,16 @@ public function templateFilesAsDataUri(string $template_id) * Get Template Files as Data Uri * * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\FileResponseDataUri, 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 ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriWithHttpInfo(string $template_id) + public function templateFilesAsDataUriWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { - $request = $this->templateFilesAsDataUriRequest($template_id); + $request = $this->templateFilesAsDataUriRequest($template_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1725,14 +1833,14 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1745,51 +1853,73 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\FileResponseDataUri' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponseDataUri', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\FileResponseDataUri' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FileResponseDataUri' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponseDataUri', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1798,28 +1928,19 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id) $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\FileResponseDataUri', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\FileResponseDataUri', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1830,13 +1951,15 @@ public function templateFilesAsDataUriWithHttpInfo(string $template_id) * Get Template Files as Data Uri * * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriAsync(string $template_id) + public function templateFilesAsDataUriAsync(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { - return $this->templateFilesAsDataUriAsyncWithHttpInfo($template_id) + return $this->templateFilesAsDataUriAsyncWithHttpInfo($template_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1850,23 +1973,28 @@ function ($response) { * Get Template Files as Data Uri * * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriAsyncWithHttpInfo(string $template_id) + public function templateFilesAsDataUriAsyncWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponseDataUri'; - $request = $this->templateFilesAsDataUriRequest($template_id); + $request = $this->templateFilesAsDataUriRequest($template_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1886,7 +2014,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1896,11 +2024,13 @@ function ($exception) { * Create request for operation 'templateFilesAsDataUri' * * @param string $template_id The id of the template files to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsDataUri'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateFilesAsDataUri. This method will eventually become unavailable */ - public function templateFilesAsDataUriRequest(string $template_id) + public function templateFilesAsDataUriRequest(string $template_id, string $contentType = self::contentTypes['templateFilesAsDataUri'][0]) { // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { @@ -1910,32 +2040,26 @@ public function templateFilesAsDataUriRequest(string $template_id) } $resourcePath = '/template/files_as_data_uri/{template_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1953,18 +2077,19 @@ public function templateFilesAsDataUriRequest(string $template_id) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1988,11 +2113,11 @@ public function templateFilesAsDataUriRequest(string $template_id) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2003,17 +2128,16 @@ public function templateFilesAsDataUriRequest(string $template_id) * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $template_id The id of the template files to retrieve. (required) + * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\FileResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function templateFilesAsFileUrl(string $template_id, int $force_download = 1) { list($response) = $this->templateFilesAsFileUrlWithHttpInfo($template_id, $force_download); - return $response; } @@ -2022,16 +2146,18 @@ public function templateFilesAsFileUrl(string $template_id, int $force_download * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $template_id The id of the template files to retrieve. (required) + * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\FileResponse, 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 ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $force_download = 1) + public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { - $request = $this->templateFilesAsFileUrlRequest($template_id, $force_download); + $request = $this->templateFilesAsFileUrlRequest($template_id, $force_download, $contentType); try { $options = $this->createHttpClientOption(); @@ -2041,14 +2167,14 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2061,51 +2187,73 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\FileResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\FileResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\FileResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\FileResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\FileResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -2114,28 +2262,19 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\FileResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\FileResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2145,15 +2284,17 @@ public function templateFilesAsFileUrlWithHttpInfo(string $template_id, int $for * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $template_id The id of the template files to retrieve. (required) + * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlAsync(string $template_id, int $force_download = 1) + public function templateFilesAsFileUrlAsync(string $template_id, int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { - return $this->templateFilesAsFileUrlAsyncWithHttpInfo($template_id, $force_download) + return $this->templateFilesAsFileUrlAsyncWithHttpInfo($template_id, $force_download, $contentType) ->then( function ($response) { return $response[0]; @@ -2166,25 +2307,30 @@ function ($response) { * * Get Template Files as File Url * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $template_id The id of the template files to retrieve. (required) + * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlAsyncWithHttpInfo(string $template_id, int $force_download = 1) + public function templateFilesAsFileUrlAsyncWithHttpInfo(string $template_id, int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { $returnType = '\Dropbox\Sign\Model\FileResponse'; - $request = $this->templateFilesAsFileUrlRequest($template_id, $force_download); + $request = $this->templateFilesAsFileUrlRequest($template_id, $force_download, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2204,7 +2350,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2213,13 +2359,15 @@ function ($exception) { /** * Create request for operation 'templateFilesAsFileUrl' * - * @param string $template_id The id of the template files to retrieve. (required) - * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $template_id The id of the template files to retrieve. (required) + * @param int $force_download By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateFilesAsFileUrl'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateFilesAsFileUrl. This method will eventually become unavailable */ - public function templateFilesAsFileUrlRequest(string $template_id, int $force_download = 1) + public function templateFilesAsFileUrlRequest(string $template_id, int $force_download = 1, string $contentType = self::contentTypes['templateFilesAsFileUrl'][0]) { // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { @@ -2229,43 +2377,36 @@ public function templateFilesAsFileUrlRequest(string $template_id, int $force_do } $resourcePath = '/template/files_as_file_url/{template_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($force_download !== null) { - if ('form' === 'form' && is_array($force_download)) { - foreach ($force_download as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['force_download'] = $force_download; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $force_download, + 'force_download', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2283,18 +2424,19 @@ public function templateFilesAsFileUrlRequest(string $template_id, int $force_do // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2318,11 +2460,11 @@ public function templateFilesAsFileUrlRequest(string $template_id, int $force_do $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2335,14 +2477,13 @@ public function templateFilesAsFileUrlRequest(string $template_id, int $force_do * * @param string $template_id The id of the Template to retrieve. (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TemplateGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function templateGet(string $template_id) { list($response) = $this->templateGetWithHttpInfo($template_id); - return $response; } @@ -2352,14 +2493,16 @@ public function templateGet(string $template_id) * Get Template * * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TemplateGetResponse, 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 ::templateGet. This method will eventually become unavailable */ - public function templateGetWithHttpInfo(string $template_id) + public function templateGetWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) { - $request = $this->templateGetRequest($template_id); + $request = $this->templateGetRequest($template_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2369,14 +2512,14 @@ public function templateGetWithHttpInfo(string $template_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2389,51 +2532,73 @@ public function templateGetWithHttpInfo(string $template_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TemplateGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -2442,28 +2607,19 @@ public function templateGetWithHttpInfo(string $template_id) $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TemplateGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TemplateGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2474,13 +2630,15 @@ public function templateGetWithHttpInfo(string $template_id) * Get Template * * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetAsync(string $template_id) + public function templateGetAsync(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) { - return $this->templateGetAsyncWithHttpInfo($template_id) + return $this->templateGetAsyncWithHttpInfo($template_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2494,23 +2652,28 @@ function ($response) { * Get Template * * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetAsyncWithHttpInfo(string $template_id) + public function templateGetAsyncWithHttpInfo(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; - $request = $this->templateGetRequest($template_id); + $request = $this->templateGetRequest($template_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2530,7 +2693,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2540,11 +2703,13 @@ function ($exception) { * Create request for operation 'templateGet' * * @param string $template_id The id of the Template to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateGet'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateGet. This method will eventually become unavailable */ - public function templateGetRequest(string $template_id) + public function templateGetRequest(string $template_id, string $contentType = self::contentTypes['templateGet'][0]) { // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { @@ -2554,32 +2719,26 @@ public function templateGetRequest(string $template_id) } $resourcePath = '/template/{template_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2597,18 +2756,19 @@ public function templateGetRequest(string $template_id) // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2632,11 +2792,11 @@ public function templateGetRequest(string $template_id) $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2648,18 +2808,17 @@ public function templateGetRequest(string $template_id) * List Templates * * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TemplateListResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function templateList(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) { list($response) = $this->templateListWithHttpInfo($account_id, $page, $page_size, $query); - return $response; } @@ -2668,18 +2827,20 @@ public function templateList(string $account_id = null, int $page = 1, int $page * * List Templates * - * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TemplateListResponse, 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 ::templateList. This method will eventually become unavailable */ - public function templateListWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) + public function templateListWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['templateList'][0]) { - $request = $this->templateListRequest($account_id, $page, $page_size, $query); + $request = $this->templateListRequest($account_id, $page, $page_size, $query, $contentType); try { $options = $this->createHttpClientOption(); @@ -2689,14 +2850,14 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -2709,51 +2870,73 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TemplateListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateListResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TemplateListResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TemplateListResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateListResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TemplateListResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -2762,28 +2945,19 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TemplateListResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TemplateListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -2793,17 +2967,19 @@ public function templateListWithHttpInfo(string $account_id = null, int $page = * * List Templates * - * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListAsync(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) + public function templateListAsync(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['templateList'][0]) { - return $this->templateListAsyncWithHttpInfo($account_id, $page, $page_size, $query) + return $this->templateListAsyncWithHttpInfo($account_id, $page, $page_size, $query, $contentType) ->then( function ($response) { return $response[0]; @@ -2816,27 +2992,32 @@ function ($response) { * * List Templates * - * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListAsyncWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) + public function templateListAsyncWithHttpInfo(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['templateList'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateListResponse'; - $request = $this->templateListRequest($account_id, $page, $page_size, $query); + $request = $this->templateListRequest($account_id, $page, $page_size, $query, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2856,7 +3037,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -2865,15 +3046,17 @@ function ($exception) { /** * Create request for operation 'templateList' * - * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $account_id Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) + * @param int $page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) + * @param int $page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) + * @param string $query String that includes search terms and/or fields to be used to filter the Template objects. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateList'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateList. This method will eventually become unavailable */ - public function templateListRequest(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null) + public function templateListRequest(string $account_id = null, int $page = 1, int $page_size = 20, string $query = null, string $contentType = self::contentTypes['templateList'][0]) { if ($page_size !== null && $page_size > 100) { throw new InvalidArgumentException('invalid value for "$page_size" when calling TemplateApi.templateList, must be smaller than or equal to 100.'); @@ -2883,64 +3066,54 @@ public function templateListRequest(string $account_id = null, int $page = 1, in } $resourcePath = '/template/list'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - - $formParams = []; $multipart = false; // query params - if ($account_id !== null) { - if ('form' === 'form' && is_array($account_id)) { - foreach ($account_id as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['account_id'] = $account_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $account_id, + 'account_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page !== null) { - if ('form' === 'form' && is_array($page)) { - foreach ($page as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page'] = $page; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_size !== null) { - if ('form' === 'form' && is_array($page_size)) { - foreach ($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['page_size'] = $page_size; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'page_size', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($query !== null) { - if ('form' === 'form' && is_array($query)) { - foreach ($query as $key => $value) { - $queryParams[$key] = $value; - } - } else { - $queryParams['query'] = $query; - } - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $query, + 'query', // param base name + 'string', // 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) { @@ -2958,18 +3131,19 @@ public function templateListRequest(string $account_id = null, int $page = 1, in // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2993,11 +3167,11 @@ public function templateListRequest(string $account_id = null, int $page = 1, in $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3008,17 +3182,16 @@ public function templateListRequest(string $account_id = null, int $page = 1, in * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param string $template_id The id of the Template to remove the Account's access to. (required) * @param Model\TemplateRemoveUserRequest $template_remove_user_request template_remove_user_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TemplateGetResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function templateRemoveUser(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request) { list($response) = $this->templateRemoveUserWithHttpInfo($template_id, $template_remove_user_request); - return $response; } @@ -3027,16 +3200,18 @@ public function templateRemoveUser(string $template_id, Model\TemplateRemoveUser * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param string $template_id The id of the Template to remove the Account's access to. (required) * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TemplateGetResponse, 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 ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserWithHttpInfo(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request) + public function templateRemoveUserWithHttpInfo(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { - $request = $this->templateRemoveUserRequest($template_id, $template_remove_user_request); + $request = $this->templateRemoveUserRequest($template_id, $template_remove_user_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3046,14 +3221,14 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3066,51 +3241,73 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TemplateGetResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TemplateGetResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateGetResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -3119,28 +3316,19 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TemplateGetResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TemplateGetResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -3150,15 +3338,17 @@ public function templateRemoveUserWithHttpInfo(string $template_id, Model\Templa * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param string $template_id The id of the Template to remove the Account's access to. (required) * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserAsync(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request) + public function templateRemoveUserAsync(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { - return $this->templateRemoveUserAsyncWithHttpInfo($template_id, $template_remove_user_request) + return $this->templateRemoveUserAsyncWithHttpInfo($template_id, $template_remove_user_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3171,25 +3361,30 @@ function ($response) { * * Remove User from Template * - * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param string $template_id The id of the Template to remove the Account's access to. (required) * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserAsyncWithHttpInfo(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request) + public function templateRemoveUserAsyncWithHttpInfo(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateGetResponse'; - $request = $this->templateRemoveUserRequest($template_id, $template_remove_user_request); + $request = $this->templateRemoveUserRequest($template_id, $template_remove_user_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3209,7 +3404,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3218,13 +3413,15 @@ function ($exception) { /** * Create request for operation 'templateRemoveUser' * - * @param string $template_id The id of the Template to remove the Account's access to. (required) + * @param string $template_id The id of the Template to remove the Account's access to. (required) * @param Model\TemplateRemoveUserRequest $template_remove_user_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateRemoveUser'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateRemoveUser. This method will eventually become unavailable */ - public function templateRemoveUserRequest(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request) + public function templateRemoveUserRequest(string $template_id, Model\TemplateRemoveUserRequest $template_remove_user_request, string $contentType = self::contentTypes['templateRemoveUser'][0]) { // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { @@ -3232,6 +3429,7 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem 'Missing the required parameter $template_id when calling templateRemoveUser' ); } + // verify the required parameter 'template_remove_user_request' is set if ($template_remove_user_request === null || (is_array($template_remove_user_request) && count($template_remove_user_request) === 0)) { throw new InvalidArgumentException( @@ -3240,9 +3438,11 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem } $resourcePath = '/template/remove_user/{template_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $template_remove_user_request @@ -3253,27 +3453,23 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_remove_user_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_remove_user_request)); } else { $httpBody = $template_remove_user_request; } @@ -3292,22 +3488,22 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $template_remove_user_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3331,11 +3527,11 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3346,17 +3542,16 @@ public function templateRemoveUserRequest(string $template_id, Model\TemplateRem * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) + * @param string $template_id The ID of the template whose files to update. (required) * @param Model\TemplateUpdateFilesRequest $template_update_files_request template_update_files_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\TemplateUpdateFilesResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function templateUpdateFiles(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request) { list($response) = $this->templateUpdateFilesWithHttpInfo($template_id, $template_update_files_request); - return $response; } @@ -3365,16 +3560,18 @@ public function templateUpdateFiles(string $template_id, Model\TemplateUpdateFil * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) + * @param string $template_id The ID of the template whose files to update. (required) * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\TemplateUpdateFilesResponse, 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 ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesWithHttpInfo(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request) + public function templateUpdateFilesWithHttpInfo(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { - $request = $this->templateUpdateFilesRequest($template_id, $template_update_files_request); + $request = $this->templateUpdateFilesRequest($template_id, $template_update_files_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3384,14 +3581,14 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -3404,51 +3601,73 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\TemplateUpdateFilesResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateUpdateFilesResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\TemplateUpdateFilesResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\TemplateUpdateFilesResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\TemplateUpdateFilesResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\TemplateUpdateFilesResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -3457,28 +3676,19 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\TemplateUpdateFilesResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; + } + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\TemplateUpdateFilesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -3488,15 +3698,17 @@ public function templateUpdateFilesWithHttpInfo(string $template_id, Model\Templ * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) + * @param string $template_id The ID of the template whose files to update. (required) * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesAsync(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request) + public function templateUpdateFilesAsync(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { - return $this->templateUpdateFilesAsyncWithHttpInfo($template_id, $template_update_files_request) + return $this->templateUpdateFilesAsyncWithHttpInfo($template_id, $template_update_files_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3509,25 +3721,30 @@ function ($response) { * * Update Template Files * - * @param string $template_id The ID of the template whose files to update. (required) + * @param string $template_id The ID of the template whose files to update. (required) * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesAsyncWithHttpInfo(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request) + public function templateUpdateFilesAsyncWithHttpInfo(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { $returnType = '\Dropbox\Sign\Model\TemplateUpdateFilesResponse'; - $request = $this->templateUpdateFilesRequest($template_id, $template_update_files_request); + $request = $this->templateUpdateFilesRequest($template_id, $template_update_files_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3547,7 +3764,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -3556,13 +3773,15 @@ function ($exception) { /** * Create request for operation 'templateUpdateFiles' * - * @param string $template_id The ID of the template whose files to update. (required) + * @param string $template_id The ID of the template whose files to update. (required) * @param Model\TemplateUpdateFilesRequest $template_update_files_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['templateUpdateFiles'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::templateUpdateFiles. This method will eventually become unavailable */ - public function templateUpdateFilesRequest(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request) + public function templateUpdateFilesRequest(string $template_id, Model\TemplateUpdateFilesRequest $template_update_files_request, string $contentType = self::contentTypes['templateUpdateFiles'][0]) { // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { @@ -3570,6 +3789,7 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp 'Missing the required parameter $template_id when calling templateUpdateFiles' ); } + // verify the required parameter 'template_update_files_request' is set if ($template_update_files_request === null || (is_array($template_update_files_request) && count($template_update_files_request) === 0)) { throw new InvalidArgumentException( @@ -3578,9 +3798,11 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp } $resourcePath = '/template/update_files/{template_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $template_update_files_request @@ -3591,27 +3813,23 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp // path params if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', + '{template_id}', ObjectSerializer::toPathValue($template_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_update_files_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($template_update_files_request)); } else { $httpBody = $template_update_files_request; } @@ -3630,22 +3848,22 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $template_update_files_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3669,11 +3887,11 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3682,8 +3900,8 @@ public function templateUpdateFilesRequest(string $template_id, Model\TemplateUp /** * Create http client option * - * @throws RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -3697,4 +3915,66 @@ protected function createHttpClientOption() 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/Api/UnclaimedDraftApi.php b/sdks/php/src/Api/UnclaimedDraftApi.php index a83572a10..3886a87c5 100644 --- a/sdks/php/src/Api/UnclaimedDraftApi.php +++ b/sdks/php/src/Api/UnclaimedDraftApi.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -36,11 +35,11 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Promise; -use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use GuzzleHttp\Utils; use InvalidArgumentException; +use JsonException; use Psr\Http\Message\ResponseInterface; use RuntimeException; @@ -48,34 +47,44 @@ * UnclaimedDraftApi Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class UnclaimedDraftApi { - /** - * @var ClientInterface - */ + /** @var ClientInterface */ protected $client; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @var HeaderSelector - */ + /** @var HeaderSelector */ protected $headerSelector; - /** - * @var int Host index - */ + /** @var int Host index */ protected $hostIndex; /** - * @var ResponseInterface|null + * @var string[] * */ + public const contentTypes = [ + 'unclaimedDraftCreate' => [ + 'application/json', + 'multipart/form-data', + ], + 'unclaimedDraftCreateEmbedded' => [ + 'application/json', + 'multipart/form-data', + ], + 'unclaimedDraftCreateEmbeddedWithTemplate' => [ + 'application/json', + 'multipart/form-data', + ], + 'unclaimedDraftEditAndResend' => [ + 'application/json', + ], + ]; + + /** @var ResponseInterface|null */ protected $response; /** @@ -97,6 +106,7 @@ public function __construct( * Set the host index * * @param int $hostIndex Host index (required) + * @deprecated To be made private in the future */ public function setHostIndex(int $hostIndex): void { @@ -107,6 +117,7 @@ public function setHostIndex(int $hostIndex): void * Get the host index * * @return int Host index + * @deprecated To be made private in the future */ public function getHostIndex() { @@ -136,14 +147,13 @@ public function getResponse() * * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request unclaimed_draft_create_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\UnclaimedDraftCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function unclaimedDraftCreate(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request) { list($response) = $this->unclaimedDraftCreateWithHttpInfo($unclaimed_draft_create_request); - return $response; } @@ -153,14 +163,16 @@ public function unclaimedDraftCreate(Model\UnclaimedDraftCreateRequest $unclaime * Create Unclaimed Draft * * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\UnclaimedDraftCreateResponse, 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 ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request) + public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { - $request = $this->unclaimedDraftCreateRequest($unclaimed_draft_create_request); + $request = $this->unclaimedDraftCreateRequest($unclaimed_draft_create_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -170,14 +182,14 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -190,51 +202,73 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -243,28 +277,19 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -275,13 +300,15 @@ public function unclaimedDraftCreateWithHttpInfo(Model\UnclaimedDraftCreateReque * Create Unclaimed Draft * * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateAsync(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request) + public function unclaimedDraftCreateAsync(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { - return $this->unclaimedDraftCreateAsyncWithHttpInfo($unclaimed_draft_create_request) + return $this->unclaimedDraftCreateAsyncWithHttpInfo($unclaimed_draft_create_request, $contentType) ->then( function ($response) { return $response[0]; @@ -295,23 +322,28 @@ function ($response) { * Create Unclaimed Draft * * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateAsyncWithHttpInfo(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request) + public function unclaimedDraftCreateAsyncWithHttpInfo(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; - $request = $this->unclaimedDraftCreateRequest($unclaimed_draft_create_request); + $request = $this->unclaimedDraftCreateRequest($unclaimed_draft_create_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -331,7 +363,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -341,11 +373,13 @@ function ($exception) { * Create request for operation 'unclaimedDraftCreate' * * @param Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::unclaimedDraftCreate. This method will eventually become unavailable */ - public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request) + public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $unclaimed_draft_create_request, string $contentType = self::contentTypes['unclaimedDraftCreate'][0]) { // verify the required parameter 'unclaimed_draft_create_request' is set if ($unclaimed_draft_create_request === null || (is_array($unclaimed_draft_create_request) && count($unclaimed_draft_create_request) === 0)) { @@ -355,9 +389,11 @@ public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $u } $resourcePath = '/unclaimed_draft/create'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $unclaimed_draft_create_request @@ -365,21 +401,17 @@ public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $u $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_request)); } else { $httpBody = $unclaimed_draft_create_request; } @@ -398,22 +430,22 @@ public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $u // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $unclaimed_draft_create_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -437,11 +469,11 @@ public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $u $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -454,14 +486,13 @@ public function unclaimedDraftCreateRequest(Model\UnclaimedDraftCreateRequest $u * * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request unclaimed_draft_create_embedded_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\UnclaimedDraftCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function unclaimedDraftCreateEmbedded(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request) { list($response) = $this->unclaimedDraftCreateEmbeddedWithHttpInfo($unclaimed_draft_create_embedded_request); - return $response; } @@ -471,14 +502,16 @@ public function unclaimedDraftCreateEmbedded(Model\UnclaimedDraftCreateEmbeddedR * Create Embedded Unclaimed Draft * * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\UnclaimedDraftCreateResponse, 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 ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request) + public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { - $request = $this->unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embedded_request); + $request = $this->unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embedded_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -488,14 +521,14 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -508,51 +541,73 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -561,28 +616,19 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -593,13 +639,15 @@ public function unclaimedDraftCreateEmbeddedWithHttpInfo(Model\UnclaimedDraftCre * Create Embedded Unclaimed Draft * * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedAsync(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request) + public function unclaimedDraftCreateEmbeddedAsync(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { - return $this->unclaimedDraftCreateEmbeddedAsyncWithHttpInfo($unclaimed_draft_create_embedded_request) + return $this->unclaimedDraftCreateEmbeddedAsyncWithHttpInfo($unclaimed_draft_create_embedded_request, $contentType) ->then( function ($response) { return $response[0]; @@ -613,23 +661,28 @@ function ($response) { * Create Embedded Unclaimed Draft * * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedAsyncWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request) + public function unclaimedDraftCreateEmbeddedAsyncWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; - $request = $this->unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embedded_request); + $request = $this->unclaimedDraftCreateEmbeddedRequest($unclaimed_draft_create_embedded_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -649,7 +702,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -659,11 +712,13 @@ function ($exception) { * Create request for operation 'unclaimedDraftCreateEmbedded' * * @param Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbedded'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::unclaimedDraftCreateEmbedded. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request) + public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEmbeddedRequest $unclaimed_draft_create_embedded_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbedded'][0]) { // verify the required parameter 'unclaimed_draft_create_embedded_request' is set if ($unclaimed_draft_create_embedded_request === null || (is_array($unclaimed_draft_create_embedded_request) && count($unclaimed_draft_create_embedded_request) === 0)) { @@ -673,9 +728,11 @@ public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEm } $resourcePath = '/unclaimed_draft/create_embedded'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $unclaimed_draft_create_embedded_request @@ -683,21 +740,17 @@ public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEm $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_embedded_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_embedded_request)); } else { $httpBody = $unclaimed_draft_create_embedded_request; } @@ -716,22 +769,22 @@ public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEm // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $unclaimed_draft_create_embedded_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -755,11 +808,11 @@ public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEm $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -772,14 +825,13 @@ public function unclaimedDraftCreateEmbeddedRequest(Model\UnclaimedDraftCreateEm * * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request unclaimed_draft_create_embedded_with_template_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\UnclaimedDraftCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function unclaimedDraftCreateEmbeddedWithTemplate(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request) { list($response) = $this->unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo($unclaimed_draft_create_embedded_with_template_request); - return $response; } @@ -789,14 +841,16 @@ public function unclaimedDraftCreateEmbeddedWithTemplate(Model\UnclaimedDraftCre * Create Embedded Unclaimed Draft with Template * * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\UnclaimedDraftCreateResponse, 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 ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request) + public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { - $request = $this->unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft_create_embedded_with_template_request); + $request = $this->unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft_create_embedded_with_template_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -806,14 +860,14 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -826,51 +880,73 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -879,28 +955,19 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -911,13 +978,15 @@ public function unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(Model\Uncla * Create Embedded Unclaimed Draft with Template * * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateAsync(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request) + public function unclaimedDraftCreateEmbeddedWithTemplateAsync(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { - return $this->unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo($unclaimed_draft_create_embedded_with_template_request) + return $this->unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo($unclaimed_draft_create_embedded_with_template_request, $contentType) ->then( function ($response) { return $response[0]; @@ -931,23 +1000,28 @@ function ($response) { * Create Embedded Unclaimed Draft with Template * * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request) + public function unclaimedDraftCreateEmbeddedWithTemplateAsyncWithHttpInfo(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; - $request = $this->unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft_create_embedded_with_template_request); + $request = $this->unclaimedDraftCreateEmbeddedWithTemplateRequest($unclaimed_draft_create_embedded_with_template_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -967,7 +1041,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -977,11 +1051,13 @@ function ($exception) { * Create request for operation 'unclaimedDraftCreateEmbeddedWithTemplate' * * @param Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::unclaimedDraftCreateEmbeddedWithTemplate. This method will eventually become unavailable */ - public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request) + public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedDraftCreateEmbeddedWithTemplateRequest $unclaimed_draft_create_embedded_with_template_request, string $contentType = self::contentTypes['unclaimedDraftCreateEmbeddedWithTemplate'][0]) { // verify the required parameter 'unclaimed_draft_create_embedded_with_template_request' is set if ($unclaimed_draft_create_embedded_with_template_request === null || (is_array($unclaimed_draft_create_embedded_with_template_request) && count($unclaimed_draft_create_embedded_with_template_request) === 0)) { @@ -991,9 +1067,11 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedD } $resourcePath = '/unclaimed_draft/create_embedded_with_template'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $unclaimed_draft_create_embedded_with_template_request @@ -1001,21 +1079,17 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedD $multipart = !empty($formParams); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json', 'multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_embedded_with_template_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_create_embedded_with_template_request)); } else { $httpBody = $unclaimed_draft_create_embedded_with_template_request; } @@ -1034,22 +1108,22 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedD // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $unclaimed_draft_create_embedded_with_template_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1073,11 +1147,11 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedD $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1088,17 +1162,16 @@ public function unclaimedDraftCreateEmbeddedWithTemplateRequest(Model\UnclaimedD * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request unclaimed_draft_edit_and_resend_request (required) * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return Model\UnclaimedDraftCreateResponse + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws InvalidArgumentException */ public function unclaimedDraftEditAndResend(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request) { list($response) = $this->unclaimedDraftEditAndResendWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request); - return $response; } @@ -1107,16 +1180,18 @@ public function unclaimedDraftEditAndResend(string $signature_request_id, Model\ * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * - * @throws ApiException on non-2xx response - * @throws InvalidArgumentException * @return array of Model\UnclaimedDraftCreateResponse, 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 ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request) + public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { - $request = $this->unclaimedDraftEditAndResendRequest($signature_request_id, $unclaimed_draft_edit_and_resend_request); + $request = $this->unclaimedDraftEditAndResendRequest($signature_request_id, $unclaimed_draft_edit_and_resend_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -1126,14 +1201,14 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null + $e->getResponse() ? (string)$e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), + (int)$e->getCode(), null, null ); @@ -1146,51 +1221,73 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - (string) $request->getUri() + (string)$request->getUri() ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } - $statusCode = $response->getStatusCode(); - - if ($statusCode === 200) { - if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + $result = $this->handleRangeCodeResponse( + $response, + '4XX', + '\Dropbox\Sign\Model\ErrorResponse' + ); + if ($result) { + return $result; } - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('\Dropbox\Sign\Model\ErrorResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + switch ($statusCode) { + case 200: + if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' === '\SplFileObject') { + $content = $response->getBody(); // stream goes to serializer + } else { + $content = (string)$response->getBody(); + if ('\Dropbox\Sign\Model\UnclaimedDraftCreateResponse' !== '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\ErrorResponse', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; + return [ + ObjectSerializer::deserialize($content, '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', []), + $response->getStatusCode(), + $response->getHeaders(), + ]; } $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $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 [ @@ -1199,28 +1296,19 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques $response->getHeaders(), ]; } catch (ApiException $e) { - $statusCode = $e->getCode(); - - if ($statusCode === 200) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + if ($this->handleRangeCodeException($e, '4XX', '\Dropbox\Sign\Model\ErrorResponse')) { + throw $e; } - - $rangeCodeLeft = (int) (substr('4XX', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('4XX', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Dropbox\Sign\Model\ErrorResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } - throw $e; } } @@ -1230,15 +1318,17 @@ public function unclaimedDraftEditAndResendWithHttpInfo(string $signature_reques * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendAsync(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request) + public function unclaimedDraftEditAndResendAsync(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { - return $this->unclaimedDraftEditAndResendAsyncWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request) + return $this->unclaimedDraftEditAndResendAsyncWithHttpInfo($signature_request_id, $unclaimed_draft_edit_and_resend_request, $contentType) ->then( function ($response) { return $response[0]; @@ -1251,25 +1341,30 @@ function ($response) { * * Edit and Resend Unclaimed Draft * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * + * @return \GuzzleHttp\Promise\PromiseInterface * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendAsyncWithHttpInfo(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request) + public function unclaimedDraftEditAndResendAsyncWithHttpInfo(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { $returnType = '\Dropbox\Sign\Model\UnclaimedDraftCreateResponse'; - $request = $this->unclaimedDraftEditAndResendRequest($signature_request_id, $unclaimed_draft_edit_and_resend_request); + $request = $this->unclaimedDraftEditAndResendRequest($signature_request_id, $unclaimed_draft_edit_and_resend_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer + $content = $response->getBody(); // stream goes to serializer } else { - $content = (string) $response->getBody(); + $content = (string)$response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1289,7 +1384,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - (string) $response->getBody() + (string)$response->getBody() ); } ); @@ -1298,13 +1393,15 @@ function ($exception) { /** * Create request for operation 'unclaimedDraftEditAndResend' * - * @param string $signature_request_id The ID of the signature request to edit and resend. (required) + * @param string $signature_request_id The ID of the signature request to edit and resend. (required) * @param Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['unclaimedDraftEditAndResend'] to see the possible values for this operation * + * @return Request * @throws InvalidArgumentException - * @return Psr7\Request + * @deprecated Prefer to use ::unclaimedDraftEditAndResend. This method will eventually become unavailable */ - public function unclaimedDraftEditAndResendRequest(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request) + public function unclaimedDraftEditAndResendRequest(string $signature_request_id, Model\UnclaimedDraftEditAndResendRequest $unclaimed_draft_edit_and_resend_request, string $contentType = self::contentTypes['unclaimedDraftEditAndResend'][0]) { // verify the required parameter 'signature_request_id' is set if ($signature_request_id === null || (is_array($signature_request_id) && count($signature_request_id) === 0)) { @@ -1312,6 +1409,7 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, 'Missing the required parameter $signature_request_id when calling unclaimedDraftEditAndResend' ); } + // verify the required parameter 'unclaimed_draft_edit_and_resend_request' is set if ($unclaimed_draft_edit_and_resend_request === null || (is_array($unclaimed_draft_edit_and_resend_request) && count($unclaimed_draft_edit_and_resend_request) === 0)) { throw new InvalidArgumentException( @@ -1320,9 +1418,11 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, } $resourcePath = '/unclaimed_draft/edit_and_resend/{signature_request_id}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; $formParams = ObjectSerializer::getFormParams( $unclaimed_draft_edit_and_resend_request @@ -1333,27 +1433,23 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, // path params if ($signature_request_id !== null) { $resourcePath = str_replace( - '{' . 'signature_request_id' . '}', + '{signature_request_id}', ObjectSerializer::toPathValue($signature_request_id), $resourcePath ); } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + $multipart ? ['multipart/form-data'] : ['application/json'], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_edit_and_resend_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + // if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($unclaimed_draft_edit_and_resend_request)); } else { $httpBody = $unclaimed_draft_edit_and_resend_request; } @@ -1372,22 +1468,22 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, // for HTTP post (form) if (!empty($body)) { $multipartContents[] = [ - 'name' => 'body', + 'name' => 'body', 'contents' => $body, - 'headers' => ['Content-Type' => 'application/json'], + 'headers' => ['Content-Type' => 'application/json'], ]; } if ($payloadHook = $this->config->getPayloadHook()) { $payloadHook('multipart', $multipartContents, $unclaimed_draft_edit_and_resend_request); } - - $httpBody = new Psr7\MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); + $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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1411,11 +1507,11 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, $headers ); - $query = Psr7\Query::build($queryParams); - - return new Psr7\Request( + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1424,8 +1520,8 @@ public function unclaimedDraftEditAndResendRequest(string $signature_request_id, /** * Create http client option * - * @throws RuntimeException on file opening failure * @return array of http client options + * @throws RuntimeException on file opening failure */ protected function createHttpClientOption() { @@ -1439,4 +1535,66 @@ protected function createHttpClientOption() 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/ApiException.php b/sdks/php/src/ApiException.php index d86bb4224..3d4a49ca7 100644 --- a/sdks/php/src/ApiException.php +++ b/sdks/php/src/ApiException.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -34,7 +33,6 @@ * ApiException Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class ApiException extends Exception @@ -49,7 +47,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -63,10 +61,10 @@ class ApiException extends Exception /** * Constructor * - * @param string $message Error message - * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header - * @param stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string + * @param string $message Error message + * @param int $code HTTP status code + * @param string[][]|null $responseHeaders HTTP response header + * @param stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ public function __construct(string $message = '', int $code = 0, ?array $responseHeaders = [], $responseBody = null) { @@ -78,7 +76,7 @@ public function __construct(string $message = '', int $code = 0, ?array $respons /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { @@ -98,9 +96,7 @@ public function getResponseBody() /** * Sets the deserialized response object (during deserialization) * - * @param mixed $obj Deserialized response object - * - * @return void + * @param string|int|object|array|mixed $obj Deserialized response object */ public function setResponseObject($obj) { diff --git a/sdks/php/src/Configuration.php b/sdks/php/src/Configuration.php index 584f4a2a2..8d4d1a042 100644 --- a/sdks/php/src/Configuration.php +++ b/sdks/php/src/Configuration.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -34,15 +33,29 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class Configuration { + public const BOOLEAN_FORMAT_INT = 'int'; + public const BOOLEAN_FORMAT_STRING = 'string'; + + /** @var Configuration */ + private static $defaultConfiguration; + /** - * @var Configuration + * Associate array to store API key(s) + * + * @var string[] */ - private static $defaultConfiguration; + protected $apiKeys = []; + + /** + * Associate array to store API prefix (e.g. Bearer) + * + * @var string[] + */ + protected $apiKeyPrefixes = []; /** * Access token for OAuth/Bearer authentication @@ -51,6 +64,13 @@ class Configuration */ protected $accessToken = ''; + /** + * Boolean format for query string + * + * @var string + */ + protected $booleanFormatForQueryString = self::BOOLEAN_FORMAT_INT; + /** * Username for HTTP basic authentication * @@ -58,6 +78,13 @@ class Configuration */ protected $username = ''; + /** + * Password for HTTP basic authentication + * + * @var string + */ + protected $password = ''; + /** * The host * @@ -70,7 +97,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/1.5-dev/PHP'; + protected $userAgent = 'OpenAPI-Generator/1.6-dev/PHP'; /** * Debug switch (default set to false) @@ -101,7 +128,7 @@ class Configuration protected $options = []; /** @var ?callable */ - protected $payloadHook = null; + protected $payloadHook; /** * Constructor @@ -111,17 +138,68 @@ public function __construct() $this->tempFolderPath = sys_get_temp_dir(); } + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + protected function setApiKey(string $apiKeyIdentifier, string $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string|null API key or token + */ + protected function getApiKey(string $apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + protected function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string|null + */ + protected function getApiKeyPrefix(string $apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + /** * Sets the access token for OAuth * * @param string $accessToken Token for OAuth * - * @return self + * @return $this */ public function setAccessToken(string $accessToken) { $this->accessToken = $accessToken; - return $this; } @@ -136,14 +214,39 @@ public function getAccessToken() } /** - * Sets the API key + * Sets boolean format for query string. + * + * @param string $booleanFormat Boolean format for query string + * + * @return $this + */ + protected function setBooleanFormatForQueryString(string $booleanFormat) + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. * - * @param string $key API key or token + * @return string Boolean format for query string */ - public function setUsername(string $key): self + public function getBooleanFormatForQueryString(): string { - $this->username = $key; + return $this->booleanFormatForQueryString; + } + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername(string $username) + { + $this->username = $username; return $this; } @@ -157,17 +260,39 @@ public function getUsername() return $this->username; } + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + protected function setPassword(string $password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + protected function getPassword() + { + return $this->password; + } + /** * Sets the host * * @param string $host Host * - * @return self + * @return $this */ public function setHost(string $host) { $this->host = $host; - return $this; } @@ -186,8 +311,8 @@ public function getHost() * * @param string $userAgent the user agent of the api client * + * @return $this * @throws InvalidArgumentException - * @return self */ public function setUserAgent(string $userAgent) { @@ -196,7 +321,6 @@ public function setUserAgent(string $userAgent) } $this->userAgent = $userAgent; - return $this; } @@ -215,12 +339,11 @@ public function getUserAgent() * * @param bool $debug Debug flag * - * @return self + * @return $this */ public function setDebug(bool $debug) { $this->debug = $debug; - return $this; } @@ -239,12 +362,11 @@ public function getDebug() * * @param string $debugFile Debug file * - * @return self + * @return $this */ public function setDebugFile(string $debugFile) { $this->debugFile = $debugFile; - return $this; } @@ -263,12 +385,11 @@ public function getDebugFile() * * @param string $tempFolderPath Temp folder path * - * @return self + * @return $this */ public function setTempFolderPath(string $tempFolderPath) { $this->tempFolderPath = $tempFolderPath; - return $this; } @@ -300,8 +421,6 @@ public static function getDefaultConfiguration() * Sets the default configuration instance * * @param Configuration $config An instance of the Configuration Object - * - * @return void */ public static function setDefaultConfiguration(Configuration $config) { @@ -319,12 +438,37 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 3.0.0' . PHP_EOL; - $report .= ' SDK Package Version: 1.5-dev' . PHP_EOL; + $report .= ' SDK Package Version: 1.6-dev' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; } + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return string|null API key with the prefix + */ + protected function getApiKeyWithPrefix(string $apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + /** * Returns an array of host settings * @@ -341,35 +485,34 @@ public function getHostSettings() } /** - * Returns URL based on the index and variables + * Returns URL based on host settings, index and variables * - * @param int $index index of the host settings - * @param array|null $variables hash of variable and the corresponding value (optional) - * @return string URL based on host settings + * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients + * @param int $hostIndex index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings */ - public function getHostFromSettings(int $index, ?array $variables = null) + public static function getHostString(array $hostSettings, int $hostIndex, array $variables = null) { if (null === $variables) { $variables = []; } - $hosts = $this->getHostSettings(); - // check array index out of bound - if ($index < 0 || $index >= sizeof($hosts)) { - throw new InvalidArgumentException("Invalid index $index when selecting the host. Must be less than " . sizeof($hosts)); + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than " . count($hostSettings)); } - $host = $hosts[$index]; + $host = $hostSettings[$hostIndex]; $url = $host['url']; // go through variable and assign a value foreach ($host['variables'] ?? [] as $name => $variable) { if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable['enum_values'], true)) { // check to see if the value is in the enum + if (!isset($variable['enum_values']) || in_array($variables[$name], $variable['enum_values'], true)) { // check to see if the value is in the enum $url = str_replace('{' . $name . '}', $variables[$name], $url); } else { - throw new InvalidArgumentException("The variable `$name` in the host URL has invalid value " . $variables[$name] . '. Must be ' . join(',', $variable['enum_values']) . '.'); + throw new InvalidArgumentException("The variable `{$name}` in the host URL has invalid value " . $variables[$name] . '. Must be ' . join(',', $variable['enum_values']) . '.'); } } else { // use default value @@ -381,8 +524,17 @@ public function getHostFromSettings(int $index, ?array $variables = null) } /** - * Set extra request options + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings */ + public function getHostFromSettings(int $index, ?array $variables = null) + { + return self::getHostString($this->getHostSettings(), $index, $variables); + } + public function setOptions(array $options): self { $this->options = $options; diff --git a/sdks/php/src/EventCallbackHelper.php b/sdks/php/src/EventCallbackHelper.php index 094e770c4..16e76ec8b 100644 --- a/sdks/php/src/EventCallbackHelper.php +++ b/sdks/php/src/EventCallbackHelper.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -32,7 +31,6 @@ * EventCallbackHelper Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ abstract class EventCallbackHelper diff --git a/sdks/php/src/HeaderSelector.php b/sdks/php/src/HeaderSelector.php index 8529bc2a2..fe1faf2c1 100644 --- a/sdks/php/src/HeaderSelector.php +++ b/sdks/php/src/HeaderSelector.php @@ -4,7 +4,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -16,7 +15,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -28,20 +27,18 @@ namespace Dropbox\Sign; /** - * ApiException Class Doc Comment + * HeaderSelector Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class HeaderSelector { /** - * @param string[] $accept - * @param string[] $contentTypes - * @return array + * @param string[] $accept + * @return string[] */ - public function selectHeaders(array $accept, array $contentTypes) + public function selectHeaders(array $accept, string $contentType, bool $isMultipart): array { $headers = []; @@ -50,57 +47,183 @@ public function selectHeaders(array $accept, array $contentTypes) $headers['Accept'] = $accept; } - $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + if (!$isMultipart) { + if ($contentType === '') { + $contentType = 'application/json'; + } + + $headers['Content-Type'] = $contentType; + } return $headers; } /** - * @param string[] $accept - * @return array + * Return the header 'Accept' based on an array of Accept provided. + * + * @param string[] $accept Array of header + * + * @return string|null Accept (e.g. application/json) */ - public function selectHeadersForMultipart(array $accept) + private function selectAcceptHeader(array $accept): ?string { - $headers = $this->selectHeaders($accept, []); + // filter out empty entries + $accept = array_filter($accept); - unset($headers['Content-Type']); + if (count($accept) === 0) { + return null; + } - return $headers; + // If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + // If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + if (count($headersWithJson) === 0) { + return implode(',', $accept); + } + + // If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + // to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); } /** - * Return the header 'Accept' based on an array of Accept provided + * Create an Accept header string from the given "Accept" headers array, recalculating all weights * - * @param string[] $accept Array of header + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" * - * @return string|null Accept (e.g. application/json) + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") */ - private function selectAcceptHeader(array $accept) + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { - return null; - } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { - return implode(',', $jsonAccept); - } else { - return implode(',', $accept); + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach ($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); } /** - * Return the content type based on an array of content-type provided + * Given an Accept header, returns an associative array splitting the header and its weight * - * @param string[] $contentType Array fo content-type + * @param string $header "Accept" Header * - * @return string Content-Type (e.g. application/json) + * @return array with the header and its weight */ - private function selectContentTypeHeader(array $contentType) + private function getHeaderAndWeight(string $header): array { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { - return 'application/json'; + // matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; } else { - return implode(',', $contentType); + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; + } + + return $headerData; + } + + /** + * @param array[] $headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if ($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + private function buildAcceptHeader(string $header, int $weight): string + { + if ($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor(log10($currentWeight - 1)); } } diff --git a/sdks/php/src/Model/AccountCreateRequest.php b/sdks/php/src/Model/AccountCreateRequest.php index 299eefa02..f4b927310 100644 --- a/sdks/php/src/Model/AccountCreateRequest.php +++ b/sdks/php/src/Model/AccountCreateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * AccountCreateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class AccountCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -80,6 +77,25 @@ class AccountCreateRequest implements ModelInterface, ArrayAccess, JsonSerializa 'locale' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'email_address' => false, + 'client_id' => false, + 'client_secret' => false, + 'locale' => 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 * @@ -100,6 +116,50 @@ 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 @@ -181,40 +241,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['client_secret'] = $data['client_secret'] ?? null; - $this->container['locale'] = $data['locale'] ?? null; + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('client_secret', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountCreateRequest { - /** @var AccountCreateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var AccountCreateRequest */ + return ObjectSerializer::deserialize( $data, AccountCreateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -229,7 +307,6 @@ public function listInvalidProperties() if ($this->container['email_address'] === null) { $invalidProperties[] = "'email_address' can't be null"; } - return $invalidProperties; } @@ -263,6 +340,9 @@ public function getEmailAddress() */ public function setEmailAddress(string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -287,6 +367,9 @@ public function getClientId() */ public function setClientId(?string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -311,6 +394,9 @@ public function getClientSecret() */ public function setClientSecret(?string $client_secret) { + if (is_null($client_secret)) { + throw new InvalidArgumentException('non-nullable client_secret cannot be null'); + } $this->container['client_secret'] = $client_secret; return $this; @@ -335,6 +421,9 @@ public function getLocale() */ public function setLocale(?string $locale) { + if (is_null($locale)) { + throw new InvalidArgumentException('non-nullable locale cannot be null'); + } $this->container['locale'] = $locale; return $this; @@ -343,12 +432,10 @@ public function setLocale(?string $locale) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -356,7 +443,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -369,13 +456,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -387,12 +472,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -401,8 +484,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/AccountCreateResponse.php b/sdks/php/src/Model/AccountCreateResponse.php index 931e9cd7f..66e9a34d4 100644 --- a/sdks/php/src/Model/AccountCreateResponse.php +++ b/sdks/php/src/Model/AccountCreateResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * AccountCreateResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class AccountCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +75,24 @@ class AccountCreateResponse implements ModelInterface, ArrayAccess, JsonSerializ 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account' => false, + 'oauth_data' => 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 * @@ -99,6 +113,50 @@ 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 @@ -177,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account'] = $data['account'] ?? null; - $this->container['oauth_data'] = $data['oauth_data'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('account', $data ?? [], null); + $this->setIfExists('oauth_data', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountCreateResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountCreateResponse { - /** @var AccountCreateResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var AccountCreateResponse */ + return ObjectSerializer::deserialize( $data, AccountCreateResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -221,6 +297,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['account'] === null) { + $invalidProperties[] = "'account' can't be null"; + } return $invalidProperties; } @@ -238,7 +317,7 @@ public function valid() /** * Gets account * - * @return AccountResponse|null + * @return AccountResponse */ public function getAccount() { @@ -248,12 +327,15 @@ public function getAccount() /** * Sets account * - * @param AccountResponse|null $account account + * @param AccountResponse $account account * * @return self */ - public function setAccount(?AccountResponse $account) + public function setAccount(AccountResponse $account) { + if (is_null($account)) { + throw new InvalidArgumentException('non-nullable account cannot be null'); + } $this->container['account'] = $account; return $this; @@ -278,6 +360,9 @@ public function getOauthData() */ public function setOauthData(?OAuthTokenResponse $oauth_data) { + if (is_null($oauth_data)) { + throw new InvalidArgumentException('non-nullable oauth_data cannot be null'); + } $this->container['oauth_data'] = $oauth_data; return $this; @@ -302,6 +387,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -310,12 +398,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,7 +409,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -336,13 +422,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -354,12 +438,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -368,8 +450,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/AccountGetResponse.php b/sdks/php/src/Model/AccountGetResponse.php index d572c01fb..b59da1285 100644 --- a/sdks/php/src/Model/AccountGetResponse.php +++ b/sdks/php/src/Model/AccountGetResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * AccountGetResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class AccountGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class AccountGetResponse implements ModelInterface, ArrayAccess, JsonSerializabl 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account'] = $data['account'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('account', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountGetResponse { - /** @var AccountGetResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var AccountGetResponse */ + return ObjectSerializer::deserialize( $data, AccountGetResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['account'] === null) { + $invalidProperties[] = "'account' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets account * - * @return AccountResponse|null + * @return AccountResponse */ public function getAccount() { @@ -242,12 +320,15 @@ public function getAccount() /** * Sets account * - * @param AccountResponse|null $account account + * @param AccountResponse $account account * * @return self */ - public function setAccount(?AccountResponse $account) + public function setAccount(AccountResponse $account) { + if (is_null($account)) { + throw new InvalidArgumentException('non-nullable account cannot be null'); + } $this->container['account'] = $account; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/AccountResponse.php b/sdks/php/src/Model/AccountResponse.php index e9089384d..3fb1a1869 100644 --- a/sdks/php/src/Model/AccountResponse.php +++ b/sdks/php/src/Model/AccountResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * AccountResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class AccountResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -95,6 +91,32 @@ class AccountResponse implements ModelInterface, ArrayAccess, JsonSerializable 'usage' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account_id' => false, + 'email_address' => false, + 'is_locked' => false, + 'is_paid_hs' => false, + 'is_paid_hf' => false, + 'quotas' => false, + 'callback_url' => true, + 'role_code' => true, + 'team_id' => true, + 'locale' => true, + 'usage' => 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 * @@ -115,6 +137,50 @@ 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 @@ -217,47 +283,65 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account_id'] = $data['account_id'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['is_locked'] = $data['is_locked'] ?? null; - $this->container['is_paid_hs'] = $data['is_paid_hs'] ?? null; - $this->container['is_paid_hf'] = $data['is_paid_hf'] ?? null; - $this->container['quotas'] = $data['quotas'] ?? null; - $this->container['callback_url'] = $data['callback_url'] ?? null; - $this->container['role_code'] = $data['role_code'] ?? null; - $this->container['team_id'] = $data['team_id'] ?? null; - $this->container['locale'] = $data['locale'] ?? null; - $this->container['usage'] = $data['usage'] ?? null; + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('is_locked', $data ?? [], null); + $this->setIfExists('is_paid_hs', $data ?? [], null); + $this->setIfExists('is_paid_hf', $data ?? [], null); + $this->setIfExists('quotas', $data ?? [], null); + $this->setIfExists('callback_url', $data ?? [], null); + $this->setIfExists('role_code', $data ?? [], null); + $this->setIfExists('team_id', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('usage', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountResponse { - /** @var AccountResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var AccountResponse */ + return ObjectSerializer::deserialize( $data, AccountResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -267,9 +351,7 @@ public static function init(array $data): AccountResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -302,6 +384,9 @@ public function getAccountId() */ public function setAccountId(?string $account_id) { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } $this->container['account_id'] = $account_id; return $this; @@ -326,6 +411,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -350,6 +438,9 @@ public function getIsLocked() */ public function setIsLocked(?bool $is_locked) { + if (is_null($is_locked)) { + throw new InvalidArgumentException('non-nullable is_locked cannot be null'); + } $this->container['is_locked'] = $is_locked; return $this; @@ -374,6 +465,9 @@ public function getIsPaidHs() */ public function setIsPaidHs(?bool $is_paid_hs) { + if (is_null($is_paid_hs)) { + throw new InvalidArgumentException('non-nullable is_paid_hs cannot be null'); + } $this->container['is_paid_hs'] = $is_paid_hs; return $this; @@ -398,6 +492,9 @@ public function getIsPaidHf() */ public function setIsPaidHf(?bool $is_paid_hf) { + if (is_null($is_paid_hf)) { + throw new InvalidArgumentException('non-nullable is_paid_hf cannot be null'); + } $this->container['is_paid_hf'] = $is_paid_hf; return $this; @@ -422,6 +519,9 @@ public function getQuotas() */ public function setQuotas(?AccountResponseQuotas $quotas) { + if (is_null($quotas)) { + throw new InvalidArgumentException('non-nullable quotas cannot be null'); + } $this->container['quotas'] = $quotas; return $this; @@ -446,6 +546,16 @@ public function getCallbackUrl() */ public function setCallbackUrl(?string $callback_url) { + if (is_null($callback_url)) { + array_push($this->openAPINullablesSetToNull, 'callback_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('callback_url', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['callback_url'] = $callback_url; return $this; @@ -470,6 +580,16 @@ public function getRoleCode() */ public function setRoleCode(?string $role_code) { + if (is_null($role_code)) { + array_push($this->openAPINullablesSetToNull, 'role_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('role_code', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['role_code'] = $role_code; return $this; @@ -494,6 +614,16 @@ public function getTeamId() */ public function setTeamId(?string $team_id) { + if (is_null($team_id)) { + array_push($this->openAPINullablesSetToNull, 'team_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('team_id', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['team_id'] = $team_id; return $this; @@ -518,6 +648,16 @@ public function getLocale() */ public function setLocale(?string $locale) { + if (is_null($locale)) { + array_push($this->openAPINullablesSetToNull, 'locale'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('locale', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['locale'] = $locale; return $this; @@ -542,6 +682,9 @@ public function getUsage() */ public function setUsage(?AccountResponseUsage $usage) { + if (is_null($usage)) { + throw new InvalidArgumentException('non-nullable usage cannot be null'); + } $this->container['usage'] = $usage; return $this; @@ -550,12 +693,10 @@ public function setUsage(?AccountResponseUsage $usage) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -563,7 +704,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -576,13 +717,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -594,12 +733,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -608,8 +745,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/AccountResponseQuotas.php b/sdks/php/src/Model/AccountResponseQuotas.php index cccd306d1..3ec8d7a9e 100644 --- a/sdks/php/src/Model/AccountResponseQuotas.php +++ b/sdks/php/src/Model/AccountResponseQuotas.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,12 +37,8 @@ * * @category Class * @description Details concerning remaining monthly quotas. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class AccountResponseQuotas implements ModelInterface, ArrayAccess, JsonSerializable { @@ -86,6 +81,27 @@ class AccountResponseQuotas implements ModelInterface, ArrayAccess, JsonSerializ 'num_fax_pages_left' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'api_signature_requests_left' => true, + 'documents_left' => true, + 'templates_total' => true, + 'templates_left' => true, + 'sms_verifications_left' => true, + 'num_fax_pages_left' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +122,50 @@ 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 @@ -193,42 +253,60 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['api_signature_requests_left'] = $data['api_signature_requests_left'] ?? null; - $this->container['documents_left'] = $data['documents_left'] ?? null; - $this->container['templates_total'] = $data['templates_total'] ?? null; - $this->container['templates_left'] = $data['templates_left'] ?? null; - $this->container['sms_verifications_left'] = $data['sms_verifications_left'] ?? null; - $this->container['num_fax_pages_left'] = $data['num_fax_pages_left'] ?? null; + $this->setIfExists('api_signature_requests_left', $data ?? [], null); + $this->setIfExists('documents_left', $data ?? [], null); + $this->setIfExists('templates_total', $data ?? [], null); + $this->setIfExists('templates_left', $data ?? [], null); + $this->setIfExists('sms_verifications_left', $data ?? [], null); + $this->setIfExists('num_fax_pages_left', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountResponseQuotas { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountResponseQuotas { - /** @var AccountResponseQuotas $obj */ - $obj = ObjectSerializer::deserialize( + /** @var AccountResponseQuotas */ + return ObjectSerializer::deserialize( $data, AccountResponseQuotas::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -238,9 +316,7 @@ public static function init(array $data): AccountResponseQuotas */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -273,6 +349,16 @@ public function getApiSignatureRequestsLeft() */ public function setApiSignatureRequestsLeft(?int $api_signature_requests_left) { + if (is_null($api_signature_requests_left)) { + array_push($this->openAPINullablesSetToNull, 'api_signature_requests_left'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('api_signature_requests_left', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['api_signature_requests_left'] = $api_signature_requests_left; return $this; @@ -297,6 +383,16 @@ public function getDocumentsLeft() */ public function setDocumentsLeft(?int $documents_left) { + if (is_null($documents_left)) { + array_push($this->openAPINullablesSetToNull, 'documents_left'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('documents_left', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['documents_left'] = $documents_left; return $this; @@ -321,6 +417,16 @@ public function getTemplatesTotal() */ public function setTemplatesTotal(?int $templates_total) { + if (is_null($templates_total)) { + array_push($this->openAPINullablesSetToNull, 'templates_total'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('templates_total', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['templates_total'] = $templates_total; return $this; @@ -345,6 +451,16 @@ public function getTemplatesLeft() */ public function setTemplatesLeft(?int $templates_left) { + if (is_null($templates_left)) { + array_push($this->openAPINullablesSetToNull, 'templates_left'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('templates_left', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['templates_left'] = $templates_left; return $this; @@ -369,6 +485,16 @@ public function getSmsVerificationsLeft() */ public function setSmsVerificationsLeft(?int $sms_verifications_left) { + if (is_null($sms_verifications_left)) { + array_push($this->openAPINullablesSetToNull, 'sms_verifications_left'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sms_verifications_left', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['sms_verifications_left'] = $sms_verifications_left; return $this; @@ -393,6 +519,16 @@ public function getNumFaxPagesLeft() */ public function setNumFaxPagesLeft(?int $num_fax_pages_left) { + if (is_null($num_fax_pages_left)) { + array_push($this->openAPINullablesSetToNull, 'num_fax_pages_left'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('num_fax_pages_left', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['num_fax_pages_left'] = $num_fax_pages_left; return $this; @@ -401,12 +537,10 @@ public function setNumFaxPagesLeft(?int $num_fax_pages_left) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -414,7 +548,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -427,13 +561,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -445,12 +577,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -459,8 +589,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/AccountResponseUsage.php b/sdks/php/src/Model/AccountResponseUsage.php index 847becac0..94eb509e7 100644 --- a/sdks/php/src/Model/AccountResponseUsage.php +++ b/sdks/php/src/Model/AccountResponseUsage.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,12 +37,8 @@ * * @category Class * @description Details concerning monthly usage - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class AccountResponseUsage implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +71,22 @@ class AccountResponseUsage implements ModelInterface, ArrayAccess, JsonSerializa 'fax_pages_sent' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'fax_pages_sent' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +107,50 @@ 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 @@ -168,37 +223,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['fax_pages_sent'] = $data['fax_pages_sent'] ?? null; + $this->setIfExists('fax_pages_sent', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountResponseUsage { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountResponseUsage { - /** @var AccountResponseUsage $obj */ - $obj = ObjectSerializer::deserialize( + /** @var AccountResponseUsage */ + return ObjectSerializer::deserialize( $data, AccountResponseUsage::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -208,9 +281,7 @@ public static function init(array $data): AccountResponseUsage */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -243,6 +314,16 @@ public function getFaxPagesSent() */ public function setFaxPagesSent(?int $fax_pages_sent) { + if (is_null($fax_pages_sent)) { + array_push($this->openAPINullablesSetToNull, 'fax_pages_sent'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fax_pages_sent', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['fax_pages_sent'] = $fax_pages_sent; return $this; @@ -251,12 +332,10 @@ public function setFaxPagesSent(?int $fax_pages_sent) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -264,7 +343,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -277,13 +356,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -295,12 +372,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -309,8 +384,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/AccountUpdateRequest.php b/sdks/php/src/Model/AccountUpdateRequest.php index 9eb908f5b..34a65c498 100644 --- a/sdks/php/src/Model/AccountUpdateRequest.php +++ b/sdks/php/src/Model/AccountUpdateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * AccountUpdateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class AccountUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +75,24 @@ class AccountUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializa 'locale' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account_id' => true, + 'callback_url' => false, + 'locale' => 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 * @@ -98,6 +113,50 @@ 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 @@ -176,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account_id'] = $data['account_id'] ?? null; - $this->container['callback_url'] = $data['callback_url'] ?? null; - $this->container['locale'] = $data['locale'] ?? null; + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('callback_url', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountUpdateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountUpdateRequest { - /** @var AccountUpdateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var AccountUpdateRequest */ + return ObjectSerializer::deserialize( $data, AccountUpdateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -218,9 +295,7 @@ public static function init(array $data): AccountUpdateRequest */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -253,6 +328,16 @@ public function getAccountId() */ public function setAccountId(?string $account_id) { + if (is_null($account_id)) { + array_push($this->openAPINullablesSetToNull, 'account_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('account_id', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['account_id'] = $account_id; return $this; @@ -277,6 +362,9 @@ public function getCallbackUrl() */ public function setCallbackUrl(?string $callback_url) { + if (is_null($callback_url)) { + throw new InvalidArgumentException('non-nullable callback_url cannot be null'); + } $this->container['callback_url'] = $callback_url; return $this; @@ -301,6 +389,9 @@ public function getLocale() */ public function setLocale(?string $locale) { + if (is_null($locale)) { + throw new InvalidArgumentException('non-nullable locale cannot be null'); + } $this->container['locale'] = $locale; return $this; @@ -309,12 +400,10 @@ public function setLocale(?string $locale) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -322,7 +411,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -335,13 +424,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -353,12 +440,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -367,8 +452,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/AccountVerifyRequest.php b/sdks/php/src/Model/AccountVerifyRequest.php index 123cb57b2..d8731ea40 100644 --- a/sdks/php/src/Model/AccountVerifyRequest.php +++ b/sdks/php/src/Model/AccountVerifyRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * AccountVerifyRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class AccountVerifyRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -74,6 +71,22 @@ class AccountVerifyRequest implements ModelInterface, ArrayAccess, JsonSerializa 'email_address' => 'email', ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'email_address' => 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 * @@ -94,6 +107,50 @@ 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 @@ -166,37 +223,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['email_address'] = $data['email_address'] ?? null; + $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountVerifyRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountVerifyRequest { - /** @var AccountVerifyRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var AccountVerifyRequest */ + return ObjectSerializer::deserialize( $data, AccountVerifyRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -211,7 +286,6 @@ public function listInvalidProperties() if ($this->container['email_address'] === null) { $invalidProperties[] = "'email_address' can't be null"; } - return $invalidProperties; } @@ -245,6 +319,9 @@ public function getEmailAddress() */ public function setEmailAddress(string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -253,12 +330,10 @@ public function setEmailAddress(string $email_address) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -266,7 +341,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -279,13 +354,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -297,12 +370,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -311,8 +382,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/AccountVerifyResponse.php b/sdks/php/src/Model/AccountVerifyResponse.php index 51983c5de..f8f6a65e5 100644 --- a/sdks/php/src/Model/AccountVerifyResponse.php +++ b/sdks/php/src/Model/AccountVerifyResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * AccountVerifyResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class AccountVerifyResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class AccountVerifyResponse implements ModelInterface, ArrayAccess, JsonSerializ 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account'] = $data['account'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('account', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountVerifyResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountVerifyResponse { - /** @var AccountVerifyResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var AccountVerifyResponse */ + return ObjectSerializer::deserialize( $data, AccountVerifyResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -213,9 +288,7 @@ public static function init(array $data): AccountVerifyResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -248,6 +321,9 @@ public function getAccount() */ public function setAccount(?AccountVerifyResponseAccount $account) { + if (is_null($account)) { + throw new InvalidArgumentException('non-nullable account cannot be null'); + } $this->container['account'] = $account; return $this; @@ -272,6 +348,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +359,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +370,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +383,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +399,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +411,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/AccountVerifyResponseAccount.php b/sdks/php/src/Model/AccountVerifyResponseAccount.php index 1e045182f..34a1de5e9 100644 --- a/sdks/php/src/Model/AccountVerifyResponseAccount.php +++ b/sdks/php/src/Model/AccountVerifyResponseAccount.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * AccountVerifyResponseAccount Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class AccountVerifyResponseAccount implements ModelInterface, ArrayAccess, JsonSerializable { @@ -75,6 +71,22 @@ class AccountVerifyResponseAccount implements ModelInterface, ArrayAccess, JsonS 'email_address' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'email_address' => 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 * @@ -95,6 +107,50 @@ 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 @@ -167,37 +223,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['email_address'] = $data['email_address'] ?? null; + $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): AccountVerifyResponseAccount { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): AccountVerifyResponseAccount { - /** @var AccountVerifyResponseAccount $obj */ - $obj = ObjectSerializer::deserialize( + /** @var AccountVerifyResponseAccount */ + return ObjectSerializer::deserialize( $data, AccountVerifyResponseAccount::class, ); + } - return $obj; + /** + * 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; } /** @@ -207,9 +281,7 @@ public static function init(array $data): AccountVerifyResponseAccount */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -242,6 +314,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -250,12 +325,10 @@ public function setEmailAddress(?string $email_address) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -263,7 +336,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -276,13 +349,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -294,12 +365,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -308,8 +377,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ApiAppCreateRequest.php b/sdks/php/src/Model/ApiAppCreateRequest.php index c863aad89..d31444091 100644 --- a/sdks/php/src/Model/ApiAppCreateRequest.php +++ b/sdks/php/src/Model/ApiAppCreateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * ApiAppCreateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ApiAppCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -88,6 +84,28 @@ class ApiAppCreateRequest implements ModelInterface, ArrayAccess, JsonSerializab 'white_labeling_options' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'domains' => false, + 'name' => false, + 'callback_url' => false, + 'custom_logo_file' => false, + 'oauth' => false, + 'options' => false, + 'white_labeling_options' => 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 * @@ -108,6 +126,50 @@ 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 @@ -198,43 +260,61 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['domains'] = $data['domains'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['callback_url'] = $data['callback_url'] ?? null; - $this->container['custom_logo_file'] = $data['custom_logo_file'] ?? null; - $this->container['oauth'] = $data['oauth'] ?? null; - $this->container['options'] = $data['options'] ?? null; - $this->container['white_labeling_options'] = $data['white_labeling_options'] ?? null; + $this->setIfExists('domains', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('callback_url', $data ?? [], null); + $this->setIfExists('custom_logo_file', $data ?? [], null); + $this->setIfExists('oauth', $data ?? [], null); + $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('white_labeling_options', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppCreateRequest { - /** @var ApiAppCreateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ApiAppCreateRequest */ + return ObjectSerializer::deserialize( $data, ApiAppCreateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -249,18 +329,17 @@ public function listInvalidProperties() if ($this->container['domains'] === null) { $invalidProperties[] = "'domains' can't be null"; } - if ((count($this->container['domains']) > 2)) { + if (count($this->container['domains']) > 2) { $invalidProperties[] = "invalid value for 'domains', number of items must be less than or equal to 2."; } - if ((count($this->container['domains']) < 1)) { + if (count($this->container['domains']) < 1) { $invalidProperties[] = "invalid value for 'domains', number of items must be greater than or equal to 1."; } if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } - return $invalidProperties; } @@ -294,10 +373,14 @@ public function getDomains() */ public function setDomains(array $domains) { - if ((count($domains) > 2)) { + if (is_null($domains)) { + throw new InvalidArgumentException('non-nullable domains cannot be null'); + } + + if (count($domains) > 2) { throw new InvalidArgumentException('invalid value for $domains when calling ApiAppCreateRequest., number of items must be less than or equal to 2.'); } - if ((count($domains) < 1)) { + if (count($domains) < 1) { throw new InvalidArgumentException('invalid length for $domains when calling ApiAppCreateRequest., number of items must be greater than or equal to 1.'); } $this->container['domains'] = $domains; @@ -324,6 +407,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -348,6 +434,9 @@ public function getCallbackUrl() */ public function setCallbackUrl(?string $callback_url) { + if (is_null($callback_url)) { + throw new InvalidArgumentException('non-nullable callback_url cannot be null'); + } $this->container['callback_url'] = $callback_url; return $this; @@ -372,6 +461,9 @@ public function getCustomLogoFile() */ public function setCustomLogoFile(?SplFileObject $custom_logo_file) { + if (is_null($custom_logo_file)) { + throw new InvalidArgumentException('non-nullable custom_logo_file cannot be null'); + } $this->container['custom_logo_file'] = $custom_logo_file; return $this; @@ -396,6 +488,9 @@ public function getOauth() */ public function setOauth(?SubOAuth $oauth) { + if (is_null($oauth)) { + throw new InvalidArgumentException('non-nullable oauth cannot be null'); + } $this->container['oauth'] = $oauth; return $this; @@ -420,6 +515,9 @@ public function getOptions() */ public function setOptions(?SubOptions $options) { + if (is_null($options)) { + throw new InvalidArgumentException('non-nullable options cannot be null'); + } $this->container['options'] = $options; return $this; @@ -444,6 +542,9 @@ public function getWhiteLabelingOptions() */ public function setWhiteLabelingOptions(?SubWhiteLabelingOptions $white_labeling_options) { + if (is_null($white_labeling_options)) { + throw new InvalidArgumentException('non-nullable white_labeling_options cannot be null'); + } $this->container['white_labeling_options'] = $white_labeling_options; return $this; @@ -452,12 +553,10 @@ public function setWhiteLabelingOptions(?SubWhiteLabelingOptions $white_labeling /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -465,7 +564,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -478,13 +577,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -496,12 +593,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -510,8 +605,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ApiAppGetResponse.php b/sdks/php/src/Model/ApiAppGetResponse.php index 7314d7b04..f95c2b6e0 100644 --- a/sdks/php/src/Model/ApiAppGetResponse.php +++ b/sdks/php/src/Model/ApiAppGetResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * ApiAppGetResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class ApiAppGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class ApiAppGetResponse implements ModelInterface, ArrayAccess, JsonSerializable 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'api_app' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['api_app'] = $data['api_app'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('api_app', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppGetResponse { - /** @var ApiAppGetResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ApiAppGetResponse */ + return ObjectSerializer::deserialize( $data, ApiAppGetResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['api_app'] === null) { + $invalidProperties[] = "'api_app' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets api_app * - * @return ApiAppResponse|null + * @return ApiAppResponse */ public function getApiApp() { @@ -242,12 +320,15 @@ public function getApiApp() /** * Sets api_app * - * @param ApiAppResponse|null $api_app api_app + * @param ApiAppResponse $api_app api_app * * @return self */ - public function setApiApp(?ApiAppResponse $api_app) + public function setApiApp(ApiAppResponse $api_app) { + if (is_null($api_app)) { + throw new InvalidArgumentException('non-nullable api_app cannot be null'); + } $this->container['api_app'] = $api_app; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ApiAppListResponse.php b/sdks/php/src/Model/ApiAppListResponse.php index c795f6428..44afca3c1 100644 --- a/sdks/php/src/Model/ApiAppListResponse.php +++ b/sdks/php/src/Model/ApiAppListResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * ApiAppListResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class ApiAppListResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +75,24 @@ class ApiAppListResponse implements ModelInterface, ArrayAccess, JsonSerializabl 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'api_apps' => false, + 'list_info' => 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 * @@ -99,6 +113,50 @@ 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 @@ -177,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['api_apps'] = $data['api_apps'] ?? null; - $this->container['list_info'] = $data['list_info'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('api_apps', $data ?? [], null); + $this->setIfExists('list_info', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppListResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppListResponse { - /** @var ApiAppListResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ApiAppListResponse */ + return ObjectSerializer::deserialize( $data, ApiAppListResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -221,6 +297,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['api_apps'] === null) { + $invalidProperties[] = "'api_apps' can't be null"; + } + if ($this->container['list_info'] === null) { + $invalidProperties[] = "'list_info' can't be null"; + } return $invalidProperties; } @@ -238,7 +320,7 @@ public function valid() /** * Gets api_apps * - * @return ApiAppResponse[]|null + * @return ApiAppResponse[] */ public function getApiApps() { @@ -248,12 +330,15 @@ public function getApiApps() /** * Sets api_apps * - * @param ApiAppResponse[]|null $api_apps contains information about API Apps + * @param ApiAppResponse[] $api_apps contains information about API Apps * * @return self */ - public function setApiApps(?array $api_apps) + public function setApiApps(array $api_apps) { + if (is_null($api_apps)) { + throw new InvalidArgumentException('non-nullable api_apps cannot be null'); + } $this->container['api_apps'] = $api_apps; return $this; @@ -262,7 +347,7 @@ public function setApiApps(?array $api_apps) /** * Gets list_info * - * @return ListInfoResponse|null + * @return ListInfoResponse */ public function getListInfo() { @@ -272,12 +357,15 @@ public function getListInfo() /** * Sets list_info * - * @param ListInfoResponse|null $list_info list_info + * @param ListInfoResponse $list_info list_info * * @return self */ - public function setListInfo(?ListInfoResponse $list_info) + 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; @@ -302,6 +390,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -310,12 +401,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,7 +412,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -336,13 +425,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -354,12 +441,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -368,8 +453,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ApiAppResponse.php b/sdks/php/src/Model/ApiAppResponse.php index cbc677357..3e214031d 100644 --- a/sdks/php/src/Model/ApiAppResponse.php +++ b/sdks/php/src/Model/ApiAppResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Contains information about an API App. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class ApiAppResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -94,6 +90,31 @@ class ApiAppResponse implements ModelInterface, ArrayAccess, JsonSerializable 'white_labeling_options' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'callback_url' => true, + 'client_id' => false, + 'created_at' => false, + 'domains' => false, + 'name' => false, + 'is_approved' => false, + 'oauth' => true, + 'options' => true, + 'owner_account' => false, + 'white_labeling_options' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +135,50 @@ 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 @@ -213,46 +278,64 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['callback_url'] = $data['callback_url'] ?? null; - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['domains'] = $data['domains'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['is_approved'] = $data['is_approved'] ?? null; - $this->container['oauth'] = $data['oauth'] ?? null; - $this->container['options'] = $data['options'] ?? null; - $this->container['owner_account'] = $data['owner_account'] ?? null; - $this->container['white_labeling_options'] = $data['white_labeling_options'] ?? null; + $this->setIfExists('callback_url', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('domains', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('is_approved', $data ?? [], null); + $this->setIfExists('oauth', $data ?? [], null); + $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('owner_account', $data ?? [], null); + $this->setIfExists('white_labeling_options', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppResponse { - /** @var ApiAppResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ApiAppResponse */ + return ObjectSerializer::deserialize( $data, ApiAppResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -262,9 +345,7 @@ public static function init(array $data): ApiAppResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -297,6 +378,16 @@ public function getCallbackUrl() */ public function setCallbackUrl(?string $callback_url) { + if (is_null($callback_url)) { + array_push($this->openAPINullablesSetToNull, 'callback_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('callback_url', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['callback_url'] = $callback_url; return $this; @@ -321,6 +412,9 @@ public function getClientId() */ public function setClientId(?string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -345,6 +439,9 @@ public function getCreatedAt() */ 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; @@ -369,6 +466,9 @@ public function getDomains() */ public function setDomains(?array $domains) { + if (is_null($domains)) { + throw new InvalidArgumentException('non-nullable domains cannot be null'); + } $this->container['domains'] = $domains; return $this; @@ -393,6 +493,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -417,6 +520,9 @@ public function getIsApproved() */ public function setIsApproved(?bool $is_approved) { + if (is_null($is_approved)) { + throw new InvalidArgumentException('non-nullable is_approved cannot be null'); + } $this->container['is_approved'] = $is_approved; return $this; @@ -441,6 +547,16 @@ public function getOauth() */ public function setOauth(?ApiAppResponseOAuth $oauth) { + if (is_null($oauth)) { + array_push($this->openAPINullablesSetToNull, 'oauth'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('oauth', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['oauth'] = $oauth; return $this; @@ -465,6 +581,16 @@ public function getOptions() */ public function setOptions(?ApiAppResponseOptions $options) { + if (is_null($options)) { + array_push($this->openAPINullablesSetToNull, 'options'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('options', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['options'] = $options; return $this; @@ -489,6 +615,9 @@ public function getOwnerAccount() */ public function setOwnerAccount(?ApiAppResponseOwnerAccount $owner_account) { + if (is_null($owner_account)) { + throw new InvalidArgumentException('non-nullable owner_account cannot be null'); + } $this->container['owner_account'] = $owner_account; return $this; @@ -513,6 +642,16 @@ public function getWhiteLabelingOptions() */ public function setWhiteLabelingOptions(?ApiAppResponseWhiteLabelingOptions $white_labeling_options) { + if (is_null($white_labeling_options)) { + array_push($this->openAPINullablesSetToNull, 'white_labeling_options'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('white_labeling_options', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['white_labeling_options'] = $white_labeling_options; return $this; @@ -521,12 +660,10 @@ public function setWhiteLabelingOptions(?ApiAppResponseWhiteLabelingOptions $whi /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -534,7 +671,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -547,13 +684,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -565,12 +700,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -579,8 +712,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ApiAppResponseOAuth.php b/sdks/php/src/Model/ApiAppResponseOAuth.php index 343d42211..57a61134a 100644 --- a/sdks/php/src/Model/ApiAppResponseOAuth.php +++ b/sdks/php/src/Model/ApiAppResponseOAuth.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description An object describing the app's OAuth properties, or null if OAuth is not configured for the app. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class ApiAppResponseOAuth implements ModelInterface, ArrayAccess, JsonSerializable { @@ -82,6 +78,25 @@ class ApiAppResponseOAuth implements ModelInterface, ArrayAccess, JsonSerializab 'charges_users' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'callback_url' => false, + 'secret' => false, + 'scopes' => false, + 'charges_users' => 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 * @@ -102,6 +117,50 @@ 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 @@ -183,40 +242,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['callback_url'] = $data['callback_url'] ?? null; - $this->container['secret'] = $data['secret'] ?? null; - $this->container['scopes'] = $data['scopes'] ?? null; - $this->container['charges_users'] = $data['charges_users'] ?? null; + $this->setIfExists('callback_url', $data ?? [], null); + $this->setIfExists('secret', $data ?? [], null); + $this->setIfExists('scopes', $data ?? [], null); + $this->setIfExists('charges_users', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppResponseOAuth { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppResponseOAuth { - /** @var ApiAppResponseOAuth $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ApiAppResponseOAuth */ + return ObjectSerializer::deserialize( $data, ApiAppResponseOAuth::class, ); + } - return $obj; + /** + * 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; } /** @@ -226,9 +303,7 @@ public static function init(array $data): ApiAppResponseOAuth */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -261,6 +336,9 @@ public function getCallbackUrl() */ public function setCallbackUrl(?string $callback_url) { + if (is_null($callback_url)) { + throw new InvalidArgumentException('non-nullable callback_url cannot be null'); + } $this->container['callback_url'] = $callback_url; return $this; @@ -285,6 +363,9 @@ public function getSecret() */ public function setSecret(?string $secret) { + if (is_null($secret)) { + throw new InvalidArgumentException('non-nullable secret cannot be null'); + } $this->container['secret'] = $secret; return $this; @@ -309,6 +390,9 @@ public function getScopes() */ public function setScopes(?array $scopes) { + if (is_null($scopes)) { + throw new InvalidArgumentException('non-nullable scopes cannot be null'); + } $this->container['scopes'] = $scopes; return $this; @@ -333,6 +417,9 @@ public function getChargesUsers() */ public function setChargesUsers(?bool $charges_users) { + if (is_null($charges_users)) { + throw new InvalidArgumentException('non-nullable charges_users cannot be null'); + } $this->container['charges_users'] = $charges_users; return $this; @@ -341,12 +428,10 @@ public function setChargesUsers(?bool $charges_users) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -354,7 +439,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -367,13 +452,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -385,12 +468,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -399,8 +480,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ApiAppResponseOptions.php b/sdks/php/src/Model/ApiAppResponseOptions.php index 4e24a1f7e..99c11f02a 100644 --- a/sdks/php/src/Model/ApiAppResponseOptions.php +++ b/sdks/php/src/Model/ApiAppResponseOptions.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description An object with options that override account settings. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class ApiAppResponseOptions implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +72,22 @@ class ApiAppResponseOptions implements ModelInterface, ArrayAccess, JsonSerializ 'can_insert_everywhere' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'can_insert_everywhere' => 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 * @@ -96,6 +108,50 @@ 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 @@ -168,37 +224,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['can_insert_everywhere'] = $data['can_insert_everywhere'] ?? null; + $this->setIfExists('can_insert_everywhere', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppResponseOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppResponseOptions { - /** @var ApiAppResponseOptions $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ApiAppResponseOptions */ + return ObjectSerializer::deserialize( $data, ApiAppResponseOptions::class, ); + } - return $obj; + /** + * 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; } /** @@ -208,9 +282,7 @@ public static function init(array $data): ApiAppResponseOptions */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -243,6 +315,9 @@ public function getCanInsertEverywhere() */ public function setCanInsertEverywhere(?bool $can_insert_everywhere) { + if (is_null($can_insert_everywhere)) { + throw new InvalidArgumentException('non-nullable can_insert_everywhere cannot be null'); + } $this->container['can_insert_everywhere'] = $can_insert_everywhere; return $this; @@ -251,12 +326,10 @@ public function setCanInsertEverywhere(?bool $can_insert_everywhere) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -264,7 +337,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -277,13 +350,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -295,12 +366,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -309,8 +378,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ApiAppResponseOwnerAccount.php b/sdks/php/src/Model/ApiAppResponseOwnerAccount.php index f3fb77f97..ffc120960 100644 --- a/sdks/php/src/Model/ApiAppResponseOwnerAccount.php +++ b/sdks/php/src/Model/ApiAppResponseOwnerAccount.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description An object describing the app's owner - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class ApiAppResponseOwnerAccount implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +74,23 @@ class ApiAppResponseOwnerAccount implements ModelInterface, ArrayAccess, JsonSer 'email_address' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account_id' => false, + 'email_address' => 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 * @@ -98,6 +111,50 @@ 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 @@ -173,38 +230,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account_id'] = $data['account_id'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppResponseOwnerAccount { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppResponseOwnerAccount { - /** @var ApiAppResponseOwnerAccount $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ApiAppResponseOwnerAccount */ + return ObjectSerializer::deserialize( $data, ApiAppResponseOwnerAccount::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,9 +289,7 @@ public static function init(array $data): ApiAppResponseOwnerAccount */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -249,6 +322,9 @@ public function getAccountId() */ public function setAccountId(?string $account_id) { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } $this->container['account_id'] = $account_id; return $this; @@ -273,6 +349,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -281,12 +360,10 @@ public function setEmailAddress(?string $email_address) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -294,7 +371,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -307,13 +384,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -325,12 +400,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -339,8 +412,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php b/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php index c2c659def..95f29f5f4 100644 --- a/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php +++ b/sdks/php/src/Model/ApiAppResponseWhiteLabelingOptions.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description An object with options to customize the app's signer page - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, JsonSerializable { @@ -102,6 +98,35 @@ class ApiAppResponseWhiteLabelingOptions implements ModelInterface, ArrayAccess, 'text_color2' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'header_background_color' => false, + 'legal_version' => false, + 'link_color' => false, + 'page_background_color' => false, + 'primary_button_color' => false, + 'primary_button_color_hover' => false, + 'primary_button_text_color' => false, + 'primary_button_text_color_hover' => false, + 'secondary_button_color' => false, + 'secondary_button_color_hover' => false, + 'secondary_button_text_color' => false, + 'secondary_button_text_color_hover' => false, + 'text_color1' => false, + 'text_color2' => 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 * @@ -122,6 +147,50 @@ 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 @@ -233,50 +302,68 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['header_background_color'] = $data['header_background_color'] ?? null; - $this->container['legal_version'] = $data['legal_version'] ?? null; - $this->container['link_color'] = $data['link_color'] ?? null; - $this->container['page_background_color'] = $data['page_background_color'] ?? null; - $this->container['primary_button_color'] = $data['primary_button_color'] ?? null; - $this->container['primary_button_color_hover'] = $data['primary_button_color_hover'] ?? null; - $this->container['primary_button_text_color'] = $data['primary_button_text_color'] ?? null; - $this->container['primary_button_text_color_hover'] = $data['primary_button_text_color_hover'] ?? null; - $this->container['secondary_button_color'] = $data['secondary_button_color'] ?? null; - $this->container['secondary_button_color_hover'] = $data['secondary_button_color_hover'] ?? null; - $this->container['secondary_button_text_color'] = $data['secondary_button_text_color'] ?? null; - $this->container['secondary_button_text_color_hover'] = $data['secondary_button_text_color_hover'] ?? null; - $this->container['text_color1'] = $data['text_color1'] ?? null; - $this->container['text_color2'] = $data['text_color2'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('header_background_color', $data ?? [], null); + $this->setIfExists('legal_version', $data ?? [], null); + $this->setIfExists('link_color', $data ?? [], null); + $this->setIfExists('page_background_color', $data ?? [], null); + $this->setIfExists('primary_button_color', $data ?? [], null); + $this->setIfExists('primary_button_color_hover', $data ?? [], null); + $this->setIfExists('primary_button_text_color', $data ?? [], null); + $this->setIfExists('primary_button_text_color_hover', $data ?? [], null); + $this->setIfExists('secondary_button_color', $data ?? [], null); + $this->setIfExists('secondary_button_color_hover', $data ?? [], null); + $this->setIfExists('secondary_button_text_color', $data ?? [], null); + $this->setIfExists('secondary_button_text_color_hover', $data ?? [], null); + $this->setIfExists('text_color1', $data ?? [], null); + $this->setIfExists('text_color2', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppResponseWhiteLabelingOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppResponseWhiteLabelingOptions { - /** @var ApiAppResponseWhiteLabelingOptions $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ApiAppResponseWhiteLabelingOptions */ + return ObjectSerializer::deserialize( $data, ApiAppResponseWhiteLabelingOptions::class, ); + } - return $obj; + /** + * 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; } /** @@ -286,9 +373,7 @@ public static function init(array $data): ApiAppResponseWhiteLabelingOptions */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -321,6 +406,9 @@ public function getHeaderBackgroundColor() */ public function setHeaderBackgroundColor(?string $header_background_color) { + if (is_null($header_background_color)) { + throw new InvalidArgumentException('non-nullable header_background_color cannot be null'); + } $this->container['header_background_color'] = $header_background_color; return $this; @@ -345,6 +433,9 @@ public function getLegalVersion() */ public function setLegalVersion(?string $legal_version) { + if (is_null($legal_version)) { + throw new InvalidArgumentException('non-nullable legal_version cannot be null'); + } $this->container['legal_version'] = $legal_version; return $this; @@ -369,6 +460,9 @@ public function getLinkColor() */ public function setLinkColor(?string $link_color) { + if (is_null($link_color)) { + throw new InvalidArgumentException('non-nullable link_color cannot be null'); + } $this->container['link_color'] = $link_color; return $this; @@ -393,6 +487,9 @@ public function getPageBackgroundColor() */ public function setPageBackgroundColor(?string $page_background_color) { + if (is_null($page_background_color)) { + throw new InvalidArgumentException('non-nullable page_background_color cannot be null'); + } $this->container['page_background_color'] = $page_background_color; return $this; @@ -417,6 +514,9 @@ public function getPrimaryButtonColor() */ public function setPrimaryButtonColor(?string $primary_button_color) { + if (is_null($primary_button_color)) { + throw new InvalidArgumentException('non-nullable primary_button_color cannot be null'); + } $this->container['primary_button_color'] = $primary_button_color; return $this; @@ -441,6 +541,9 @@ public function getPrimaryButtonColorHover() */ public function setPrimaryButtonColorHover(?string $primary_button_color_hover) { + if (is_null($primary_button_color_hover)) { + throw new InvalidArgumentException('non-nullable primary_button_color_hover cannot be null'); + } $this->container['primary_button_color_hover'] = $primary_button_color_hover; return $this; @@ -465,6 +568,9 @@ public function getPrimaryButtonTextColor() */ public function setPrimaryButtonTextColor(?string $primary_button_text_color) { + if (is_null($primary_button_text_color)) { + throw new InvalidArgumentException('non-nullable primary_button_text_color cannot be null'); + } $this->container['primary_button_text_color'] = $primary_button_text_color; return $this; @@ -489,6 +595,9 @@ public function getPrimaryButtonTextColorHover() */ public function setPrimaryButtonTextColorHover(?string $primary_button_text_color_hover) { + if (is_null($primary_button_text_color_hover)) { + throw new InvalidArgumentException('non-nullable primary_button_text_color_hover cannot be null'); + } $this->container['primary_button_text_color_hover'] = $primary_button_text_color_hover; return $this; @@ -513,6 +622,9 @@ public function getSecondaryButtonColor() */ public function setSecondaryButtonColor(?string $secondary_button_color) { + if (is_null($secondary_button_color)) { + throw new InvalidArgumentException('non-nullable secondary_button_color cannot be null'); + } $this->container['secondary_button_color'] = $secondary_button_color; return $this; @@ -537,6 +649,9 @@ public function getSecondaryButtonColorHover() */ public function setSecondaryButtonColorHover(?string $secondary_button_color_hover) { + if (is_null($secondary_button_color_hover)) { + throw new InvalidArgumentException('non-nullable secondary_button_color_hover cannot be null'); + } $this->container['secondary_button_color_hover'] = $secondary_button_color_hover; return $this; @@ -561,6 +676,9 @@ public function getSecondaryButtonTextColor() */ public function setSecondaryButtonTextColor(?string $secondary_button_text_color) { + if (is_null($secondary_button_text_color)) { + throw new InvalidArgumentException('non-nullable secondary_button_text_color cannot be null'); + } $this->container['secondary_button_text_color'] = $secondary_button_text_color; return $this; @@ -585,6 +703,9 @@ public function getSecondaryButtonTextColorHover() */ public function setSecondaryButtonTextColorHover(?string $secondary_button_text_color_hover) { + if (is_null($secondary_button_text_color_hover)) { + throw new InvalidArgumentException('non-nullable secondary_button_text_color_hover cannot be null'); + } $this->container['secondary_button_text_color_hover'] = $secondary_button_text_color_hover; return $this; @@ -609,6 +730,9 @@ public function getTextColor1() */ public function setTextColor1(?string $text_color1) { + if (is_null($text_color1)) { + throw new InvalidArgumentException('non-nullable text_color1 cannot be null'); + } $this->container['text_color1'] = $text_color1; return $this; @@ -633,6 +757,9 @@ public function getTextColor2() */ public function setTextColor2(?string $text_color2) { + if (is_null($text_color2)) { + throw new InvalidArgumentException('non-nullable text_color2 cannot be null'); + } $this->container['text_color2'] = $text_color2; return $this; @@ -641,12 +768,10 @@ public function setTextColor2(?string $text_color2) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -654,7 +779,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -667,13 +792,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -685,12 +808,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -699,8 +820,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ApiAppUpdateRequest.php b/sdks/php/src/Model/ApiAppUpdateRequest.php index ddf4dcead..456d143c2 100644 --- a/sdks/php/src/Model/ApiAppUpdateRequest.php +++ b/sdks/php/src/Model/ApiAppUpdateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * ApiAppUpdateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -88,6 +84,28 @@ class ApiAppUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializab 'white_labeling_options' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'callback_url' => false, + 'custom_logo_file' => false, + 'domains' => false, + 'name' => false, + 'oauth' => false, + 'options' => false, + 'white_labeling_options' => 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 * @@ -108,6 +126,50 @@ 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 @@ -198,43 +260,61 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['callback_url'] = $data['callback_url'] ?? null; - $this->container['custom_logo_file'] = $data['custom_logo_file'] ?? null; - $this->container['domains'] = $data['domains'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['oauth'] = $data['oauth'] ?? null; - $this->container['options'] = $data['options'] ?? null; - $this->container['white_labeling_options'] = $data['white_labeling_options'] ?? null; + $this->setIfExists('callback_url', $data ?? [], null); + $this->setIfExists('custom_logo_file', $data ?? [], null); + $this->setIfExists('domains', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('oauth', $data ?? [], null); + $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('white_labeling_options', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ApiAppUpdateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ApiAppUpdateRequest { - /** @var ApiAppUpdateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ApiAppUpdateRequest */ + return ObjectSerializer::deserialize( $data, ApiAppUpdateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -283,6 +363,9 @@ public function getCallbackUrl() */ public function setCallbackUrl(?string $callback_url) { + if (is_null($callback_url)) { + throw new InvalidArgumentException('non-nullable callback_url cannot be null'); + } $this->container['callback_url'] = $callback_url; return $this; @@ -307,6 +390,9 @@ public function getCustomLogoFile() */ public function setCustomLogoFile(?SplFileObject $custom_logo_file) { + if (is_null($custom_logo_file)) { + throw new InvalidArgumentException('non-nullable custom_logo_file cannot be null'); + } $this->container['custom_logo_file'] = $custom_logo_file; return $this; @@ -331,7 +417,11 @@ public function getDomains() */ public function setDomains(?array $domains) { - if (!is_null($domains) && (count($domains) > 2)) { + if (is_null($domains)) { + throw new InvalidArgumentException('non-nullable domains cannot be null'); + } + + if (count($domains) > 2) { throw new InvalidArgumentException('invalid value for $domains when calling ApiAppUpdateRequest., number of items must be less than or equal to 2.'); } $this->container['domains'] = $domains; @@ -358,6 +448,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -382,6 +475,9 @@ public function getOauth() */ public function setOauth(?SubOAuth $oauth) { + if (is_null($oauth)) { + throw new InvalidArgumentException('non-nullable oauth cannot be null'); + } $this->container['oauth'] = $oauth; return $this; @@ -406,6 +502,9 @@ public function getOptions() */ public function setOptions(?SubOptions $options) { + if (is_null($options)) { + throw new InvalidArgumentException('non-nullable options cannot be null'); + } $this->container['options'] = $options; return $this; @@ -430,6 +529,9 @@ public function getWhiteLabelingOptions() */ public function setWhiteLabelingOptions(?SubWhiteLabelingOptions $white_labeling_options) { + if (is_null($white_labeling_options)) { + throw new InvalidArgumentException('non-nullable white_labeling_options cannot be null'); + } $this->container['white_labeling_options'] = $white_labeling_options; return $this; @@ -438,12 +540,10 @@ public function setWhiteLabelingOptions(?SubWhiteLabelingOptions $white_labeling /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -451,7 +551,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -464,13 +564,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -482,12 +580,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -496,8 +592,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/BulkSendJobGetResponse.php b/sdks/php/src/Model/BulkSendJobGetResponse.php index 455e15b74..3d97f3fe5 100644 --- a/sdks/php/src/Model/BulkSendJobGetResponse.php +++ b/sdks/php/src/Model/BulkSendJobGetResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * BulkSendJobGetResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class BulkSendJobGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -81,6 +77,25 @@ class BulkSendJobGetResponse implements ModelInterface, ArrayAccess, JsonSeriali 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'bulk_send_job' => false, + 'list_info' => false, + 'signature_requests' => 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 * @@ -101,6 +116,50 @@ 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 @@ -182,40 +241,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['bulk_send_job'] = $data['bulk_send_job'] ?? null; - $this->container['list_info'] = $data['list_info'] ?? null; - $this->container['signature_requests'] = $data['signature_requests'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('bulk_send_job', $data ?? [], null); + $this->setIfExists('list_info', $data ?? [], null); + $this->setIfExists('signature_requests', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): BulkSendJobGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): BulkSendJobGetResponse { - /** @var BulkSendJobGetResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var BulkSendJobGetResponse */ + return ObjectSerializer::deserialize( $data, BulkSendJobGetResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -227,6 +304,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['bulk_send_job'] === null) { + $invalidProperties[] = "'bulk_send_job' can't be null"; + } + if ($this->container['list_info'] === null) { + $invalidProperties[] = "'list_info' can't be null"; + } + if ($this->container['signature_requests'] === null) { + $invalidProperties[] = "'signature_requests' can't be null"; + } return $invalidProperties; } @@ -244,7 +330,7 @@ public function valid() /** * Gets bulk_send_job * - * @return BulkSendJobResponse|null + * @return BulkSendJobResponse */ public function getBulkSendJob() { @@ -254,12 +340,15 @@ public function getBulkSendJob() /** * Sets bulk_send_job * - * @param BulkSendJobResponse|null $bulk_send_job bulk_send_job + * @param BulkSendJobResponse $bulk_send_job bulk_send_job * * @return self */ - public function setBulkSendJob(?BulkSendJobResponse $bulk_send_job) + public function setBulkSendJob(BulkSendJobResponse $bulk_send_job) { + if (is_null($bulk_send_job)) { + throw new InvalidArgumentException('non-nullable bulk_send_job cannot be null'); + } $this->container['bulk_send_job'] = $bulk_send_job; return $this; @@ -268,7 +357,7 @@ public function setBulkSendJob(?BulkSendJobResponse $bulk_send_job) /** * Gets list_info * - * @return ListInfoResponse|null + * @return ListInfoResponse */ public function getListInfo() { @@ -278,12 +367,15 @@ public function getListInfo() /** * Sets list_info * - * @param ListInfoResponse|null $list_info list_info + * @param ListInfoResponse $list_info list_info * * @return self */ - public function setListInfo(?ListInfoResponse $list_info) + 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; @@ -292,7 +384,7 @@ public function setListInfo(?ListInfoResponse $list_info) /** * Gets signature_requests * - * @return BulkSendJobGetResponseSignatureRequests[]|null + * @return BulkSendJobGetResponseSignatureRequests[] */ public function getSignatureRequests() { @@ -302,12 +394,15 @@ public function getSignatureRequests() /** * Sets signature_requests * - * @param BulkSendJobGetResponseSignatureRequests[]|null $signature_requests contains information about the Signature Requests sent in bulk + * @param BulkSendJobGetResponseSignatureRequests[] $signature_requests contains information about the Signature Requests sent in bulk * * @return self */ - public function setSignatureRequests(?array $signature_requests) + public function setSignatureRequests(array $signature_requests) { + if (is_null($signature_requests)) { + throw new InvalidArgumentException('non-nullable signature_requests cannot be null'); + } $this->container['signature_requests'] = $signature_requests; return $this; @@ -332,6 +427,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -340,12 +438,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -353,7 +449,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -366,13 +462,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -384,12 +478,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -398,8 +490,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php b/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php index a3cf4a0d1..3d30a8984 100644 --- a/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php +++ b/sdks/php/src/Model/BulkSendJobGetResponseSignatureRequests.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * BulkSendJobGetResponseSignatureRequests Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAccess, JsonSerializable { @@ -123,6 +119,46 @@ class BulkSendJobGetResponseSignatureRequests implements ModelInterface, ArrayAc 'bulk_send_job_id' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'test_mode' => true, + 'signature_request_id' => false, + 'requester_email_address' => false, + 'title' => false, + 'original_title' => false, + 'subject' => true, + 'message' => true, + 'metadata' => false, + 'created_at' => false, + 'expires_at' => false, + 'is_complete' => false, + 'is_declined' => false, + 'has_error' => false, + 'files_url' => false, + 'signing_url' => true, + 'details_url' => false, + 'cc_email_addresses' => false, + 'signing_redirect_url' => true, + 'final_copy_uri' => true, + 'template_ids' => true, + 'custom_fields' => true, + 'attachments' => true, + 'response_data' => true, + 'signatures' => false, + 'bulk_send_job_id' => 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 * @@ -143,6 +179,50 @@ 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 @@ -287,61 +367,79 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['signature_request_id'] = $data['signature_request_id'] ?? null; - $this->container['requester_email_address'] = $data['requester_email_address'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['original_title'] = $data['original_title'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['expires_at'] = $data['expires_at'] ?? null; - $this->container['is_complete'] = $data['is_complete'] ?? null; - $this->container['is_declined'] = $data['is_declined'] ?? null; - $this->container['has_error'] = $data['has_error'] ?? null; - $this->container['files_url'] = $data['files_url'] ?? null; - $this->container['signing_url'] = $data['signing_url'] ?? null; - $this->container['details_url'] = $data['details_url'] ?? null; - $this->container['cc_email_addresses'] = $data['cc_email_addresses'] ?? null; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['final_copy_uri'] = $data['final_copy_uri'] ?? null; - $this->container['template_ids'] = $data['template_ids'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['attachments'] = $data['attachments'] ?? null; - $this->container['response_data'] = $data['response_data'] ?? null; - $this->container['signatures'] = $data['signatures'] ?? null; - $this->container['bulk_send_job_id'] = $data['bulk_send_job_id'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('signature_request_id', $data ?? [], null); + $this->setIfExists('requester_email_address', $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('expires_at', $data ?? [], null); + $this->setIfExists('is_complete', $data ?? [], null); + $this->setIfExists('is_declined', $data ?? [], null); + $this->setIfExists('has_error', $data ?? [], null); + $this->setIfExists('files_url', $data ?? [], null); + $this->setIfExists('signing_url', $data ?? [], null); + $this->setIfExists('details_url', $data ?? [], null); + $this->setIfExists('cc_email_addresses', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('final_copy_uri', $data ?? [], null); + $this->setIfExists('template_ids', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('response_data', $data ?? [], null); + $this->setIfExists('signatures', $data ?? [], null); + $this->setIfExists('bulk_send_job_id', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): BulkSendJobGetResponseSignatureRequests { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): BulkSendJobGetResponseSignatureRequests { - /** @var BulkSendJobGetResponseSignatureRequests $obj */ - $obj = ObjectSerializer::deserialize( + /** @var BulkSendJobGetResponseSignatureRequests */ + return ObjectSerializer::deserialize( $data, BulkSendJobGetResponseSignatureRequests::class, ); + } - return $obj; + /** + * 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; } /** @@ -351,9 +449,7 @@ public static function init(array $data): BulkSendJobGetResponseSignatureRequest */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -386,6 +482,16 @@ public function getTestMode() */ public function setTestMode(?bool $test_mode) { + if (is_null($test_mode)) { + array_push($this->openAPINullablesSetToNull, 'test_mode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('test_mode', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['test_mode'] = $test_mode; return $this; @@ -410,6 +516,9 @@ public function getSignatureRequestId() */ public function setSignatureRequestId(?string $signature_request_id) { + if (is_null($signature_request_id)) { + throw new InvalidArgumentException('non-nullable signature_request_id cannot be null'); + } $this->container['signature_request_id'] = $signature_request_id; return $this; @@ -434,6 +543,9 @@ public function getRequesterEmailAddress() */ public function setRequesterEmailAddress(?string $requester_email_address) { + if (is_null($requester_email_address)) { + throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); + } $this->container['requester_email_address'] = $requester_email_address; return $this; @@ -458,6 +570,9 @@ public function getTitle() */ public function setTitle(?string $title) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } $this->container['title'] = $title; return $this; @@ -482,6 +597,9 @@ public function getOriginalTitle() */ 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; @@ -506,6 +624,16 @@ public function getSubject() */ public function setSubject(?string $subject) { + if (is_null($subject)) { + array_push($this->openAPINullablesSetToNull, 'subject'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subject', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['subject'] = $subject; return $this; @@ -530,6 +658,16 @@ public function getMessage() */ public function setMessage(?string $message) { + if (is_null($message)) { + array_push($this->openAPINullablesSetToNull, 'message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('message', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['message'] = $message; return $this; @@ -554,6 +692,9 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } $this->container['metadata'] = $metadata; return $this; @@ -578,6 +719,9 @@ public function getCreatedAt() */ 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; @@ -602,6 +746,9 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + } $this->container['expires_at'] = $expires_at; return $this; @@ -626,6 +773,9 @@ public function getIsComplete() */ public function setIsComplete(?bool $is_complete) { + if (is_null($is_complete)) { + throw new InvalidArgumentException('non-nullable is_complete cannot be null'); + } $this->container['is_complete'] = $is_complete; return $this; @@ -650,6 +800,9 @@ public function getIsDeclined() */ public function setIsDeclined(?bool $is_declined) { + if (is_null($is_declined)) { + throw new InvalidArgumentException('non-nullable is_declined cannot be null'); + } $this->container['is_declined'] = $is_declined; return $this; @@ -674,6 +827,9 @@ public function getHasError() */ public function setHasError(?bool $has_error) { + if (is_null($has_error)) { + throw new InvalidArgumentException('non-nullable has_error cannot be null'); + } $this->container['has_error'] = $has_error; return $this; @@ -698,6 +854,9 @@ public function getFilesUrl() */ 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; @@ -722,6 +881,16 @@ public function getSigningUrl() */ public function setSigningUrl(?string $signing_url) { + if (is_null($signing_url)) { + array_push($this->openAPINullablesSetToNull, 'signing_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signing_url', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signing_url'] = $signing_url; return $this; @@ -746,6 +915,9 @@ public function getDetailsUrl() */ public function setDetailsUrl(?string $details_url) { + if (is_null($details_url)) { + throw new InvalidArgumentException('non-nullable details_url cannot be null'); + } $this->container['details_url'] = $details_url; return $this; @@ -770,6 +942,9 @@ public function getCcEmailAddresses() */ public function setCcEmailAddresses(?array $cc_email_addresses) { + if (is_null($cc_email_addresses)) { + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + } $this->container['cc_email_addresses'] = $cc_email_addresses; return $this; @@ -794,6 +969,16 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + array_push($this->openAPINullablesSetToNull, 'signing_redirect_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signing_redirect_url', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -818,6 +1003,16 @@ public function getFinalCopyUri() */ public function setFinalCopyUri(?string $final_copy_uri) { + if (is_null($final_copy_uri)) { + array_push($this->openAPINullablesSetToNull, 'final_copy_uri'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('final_copy_uri', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['final_copy_uri'] = $final_copy_uri; return $this; @@ -842,6 +1037,16 @@ public function getTemplateIds() */ public function setTemplateIds(?array $template_ids) { + if (is_null($template_ids)) { + array_push($this->openAPINullablesSetToNull, 'template_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('template_ids', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['template_ids'] = $template_ids; return $this; @@ -866,6 +1071,16 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + array_push($this->openAPINullablesSetToNull, 'custom_fields'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_fields', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -890,6 +1105,16 @@ public function getAttachments() */ public function setAttachments(?array $attachments) { + if (is_null($attachments)) { + array_push($this->openAPINullablesSetToNull, 'attachments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('attachments', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['attachments'] = $attachments; return $this; @@ -914,6 +1139,16 @@ public function getResponseData() */ public function setResponseData(?array $response_data) { + if (is_null($response_data)) { + array_push($this->openAPINullablesSetToNull, 'response_data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('response_data', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['response_data'] = $response_data; return $this; @@ -938,6 +1173,9 @@ public function getSignatures() */ public function setSignatures(?array $signatures) { + if (is_null($signatures)) { + throw new InvalidArgumentException('non-nullable signatures cannot be null'); + } $this->container['signatures'] = $signatures; return $this; @@ -962,6 +1200,9 @@ public function getBulkSendJobId() */ public function setBulkSendJobId(?string $bulk_send_job_id) { + if (is_null($bulk_send_job_id)) { + throw new InvalidArgumentException('non-nullable bulk_send_job_id cannot be null'); + } $this->container['bulk_send_job_id'] = $bulk_send_job_id; return $this; @@ -970,12 +1211,10 @@ public function setBulkSendJobId(?string $bulk_send_job_id) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -983,7 +1222,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -996,13 +1235,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1014,12 +1251,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1028,8 +1263,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/BulkSendJobListResponse.php b/sdks/php/src/Model/BulkSendJobListResponse.php index 741473fe8..8420c469f 100644 --- a/sdks/php/src/Model/BulkSendJobListResponse.php +++ b/sdks/php/src/Model/BulkSendJobListResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * BulkSendJobListResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class BulkSendJobListResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +75,24 @@ class BulkSendJobListResponse implements ModelInterface, ArrayAccess, JsonSerial 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'bulk_send_jobs' => false, + 'list_info' => 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 * @@ -99,6 +113,50 @@ 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 @@ -177,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['bulk_send_jobs'] = $data['bulk_send_jobs'] ?? null; - $this->container['list_info'] = $data['list_info'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('bulk_send_jobs', $data ?? [], null); + $this->setIfExists('list_info', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): BulkSendJobListResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): BulkSendJobListResponse { - /** @var BulkSendJobListResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var BulkSendJobListResponse */ + return ObjectSerializer::deserialize( $data, BulkSendJobListResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -221,6 +297,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['bulk_send_jobs'] === null) { + $invalidProperties[] = "'bulk_send_jobs' can't be null"; + } + if ($this->container['list_info'] === null) { + $invalidProperties[] = "'list_info' can't be null"; + } return $invalidProperties; } @@ -238,7 +320,7 @@ public function valid() /** * Gets bulk_send_jobs * - * @return BulkSendJobResponse[]|null + * @return BulkSendJobResponse[] */ public function getBulkSendJobs() { @@ -248,12 +330,15 @@ public function getBulkSendJobs() /** * Sets bulk_send_jobs * - * @param BulkSendJobResponse[]|null $bulk_send_jobs contains a list of BulkSendJobs that the API caller has access to + * @param BulkSendJobResponse[] $bulk_send_jobs contains a list of BulkSendJobs that the API caller has access to * * @return self */ - public function setBulkSendJobs(?array $bulk_send_jobs) + public function setBulkSendJobs(array $bulk_send_jobs) { + if (is_null($bulk_send_jobs)) { + throw new InvalidArgumentException('non-nullable bulk_send_jobs cannot be null'); + } $this->container['bulk_send_jobs'] = $bulk_send_jobs; return $this; @@ -262,7 +347,7 @@ public function setBulkSendJobs(?array $bulk_send_jobs) /** * Gets list_info * - * @return ListInfoResponse|null + * @return ListInfoResponse */ public function getListInfo() { @@ -272,12 +357,15 @@ public function getListInfo() /** * Sets list_info * - * @param ListInfoResponse|null $list_info list_info + * @param ListInfoResponse $list_info list_info * * @return self */ - public function setListInfo(?ListInfoResponse $list_info) + 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; @@ -302,6 +390,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -310,12 +401,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,7 +412,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -336,13 +425,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -354,12 +441,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -368,8 +453,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/BulkSendJobResponse.php b/sdks/php/src/Model/BulkSendJobResponse.php index 47c0fb6b2..fcd66e120 100644 --- a/sdks/php/src/Model/BulkSendJobResponse.php +++ b/sdks/php/src/Model/BulkSendJobResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class BulkSendJobResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -82,6 +78,25 @@ class BulkSendJobResponse implements ModelInterface, ArrayAccess, JsonSerializab 'created_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'bulk_send_job_id' => true, + 'total' => false, + 'is_creator' => false, + 'created_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 * @@ -102,6 +117,50 @@ 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 @@ -183,40 +242,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['bulk_send_job_id'] = $data['bulk_send_job_id'] ?? null; - $this->container['total'] = $data['total'] ?? null; - $this->container['is_creator'] = $data['is_creator'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; + $this->setIfExists('bulk_send_job_id', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('is_creator', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): BulkSendJobResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): BulkSendJobResponse { - /** @var BulkSendJobResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var BulkSendJobResponse */ + return ObjectSerializer::deserialize( $data, BulkSendJobResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -226,9 +303,7 @@ public static function init(array $data): BulkSendJobResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -261,6 +336,16 @@ public function getBulkSendJobId() */ public function setBulkSendJobId(?string $bulk_send_job_id) { + if (is_null($bulk_send_job_id)) { + array_push($this->openAPINullablesSetToNull, 'bulk_send_job_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bulk_send_job_id', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['bulk_send_job_id'] = $bulk_send_job_id; return $this; @@ -285,6 +370,9 @@ public function getTotal() */ public function setTotal(?int $total) { + if (is_null($total)) { + throw new InvalidArgumentException('non-nullable total cannot be null'); + } $this->container['total'] = $total; return $this; @@ -309,6 +397,9 @@ public function getIsCreator() */ public function setIsCreator(?bool $is_creator) { + if (is_null($is_creator)) { + throw new InvalidArgumentException('non-nullable is_creator cannot be null'); + } $this->container['is_creator'] = $is_creator; return $this; @@ -333,6 +424,9 @@ public function getCreatedAt() */ 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; @@ -341,12 +435,10 @@ public function setCreatedAt(?int $created_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -354,7 +446,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -367,13 +459,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -385,12 +475,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -399,8 +487,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/BulkSendJobSendResponse.php b/sdks/php/src/Model/BulkSendJobSendResponse.php index 0f4ef7b63..7797e84c7 100644 --- a/sdks/php/src/Model/BulkSendJobSendResponse.php +++ b/sdks/php/src/Model/BulkSendJobSendResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * BulkSendJobSendResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class BulkSendJobSendResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class BulkSendJobSendResponse implements ModelInterface, ArrayAccess, JsonSerial 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'bulk_send_job' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['bulk_send_job'] = $data['bulk_send_job'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('bulk_send_job', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): BulkSendJobSendResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): BulkSendJobSendResponse { - /** @var BulkSendJobSendResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var BulkSendJobSendResponse */ + return ObjectSerializer::deserialize( $data, BulkSendJobSendResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['bulk_send_job'] === null) { + $invalidProperties[] = "'bulk_send_job' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets bulk_send_job * - * @return BulkSendJobResponse|null + * @return BulkSendJobResponse */ public function getBulkSendJob() { @@ -242,12 +320,15 @@ public function getBulkSendJob() /** * Sets bulk_send_job * - * @param BulkSendJobResponse|null $bulk_send_job bulk_send_job + * @param BulkSendJobResponse $bulk_send_job bulk_send_job * * @return self */ - public function setBulkSendJob(?BulkSendJobResponse $bulk_send_job) + public function setBulkSendJob(BulkSendJobResponse $bulk_send_job) { + if (is_null($bulk_send_job)) { + throw new InvalidArgumentException('non-nullable bulk_send_job cannot be null'); + } $this->container['bulk_send_job'] = $bulk_send_job; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/EmbeddedEditUrlRequest.php b/sdks/php/src/Model/EmbeddedEditUrlRequest.php index 7fe2004c0..b4992a4c8 100644 --- a/sdks/php/src/Model/EmbeddedEditUrlRequest.php +++ b/sdks/php/src/Model/EmbeddedEditUrlRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * EmbeddedEditUrlRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -92,6 +89,31 @@ class EmbeddedEditUrlRequest implements ModelInterface, ArrayAccess, JsonSeriali 'test_mode' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'allow_edit_ccs' => false, + 'cc_roles' => false, + 'editor_options' => false, + 'force_signer_roles' => false, + 'force_subject_message' => false, + 'merge_fields' => false, + 'preview_only' => false, + 'show_preview' => false, + 'show_progress_stepper' => false, + 'test_mode' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +134,50 @@ 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 @@ -211,46 +277,64 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['allow_edit_ccs'] = $data['allow_edit_ccs'] ?? false; - $this->container['cc_roles'] = $data['cc_roles'] ?? null; - $this->container['editor_options'] = $data['editor_options'] ?? null; - $this->container['force_signer_roles'] = $data['force_signer_roles'] ?? false; - $this->container['force_subject_message'] = $data['force_subject_message'] ?? false; - $this->container['merge_fields'] = $data['merge_fields'] ?? null; - $this->container['preview_only'] = $data['preview_only'] ?? false; - $this->container['show_preview'] = $data['show_preview'] ?? false; - $this->container['show_progress_stepper'] = $data['show_progress_stepper'] ?? true; - $this->container['test_mode'] = $data['test_mode'] ?? false; + $this->setIfExists('allow_edit_ccs', $data ?? [], false); + $this->setIfExists('cc_roles', $data ?? [], null); + $this->setIfExists('editor_options', $data ?? [], null); + $this->setIfExists('force_signer_roles', $data ?? [], false); + $this->setIfExists('force_subject_message', $data ?? [], false); + $this->setIfExists('merge_fields', $data ?? [], null); + $this->setIfExists('preview_only', $data ?? [], false); + $this->setIfExists('show_preview', $data ?? [], false); + $this->setIfExists('show_progress_stepper', $data ?? [], true); + $this->setIfExists('test_mode', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EmbeddedEditUrlRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EmbeddedEditUrlRequest { - /** @var EmbeddedEditUrlRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var EmbeddedEditUrlRequest */ + return ObjectSerializer::deserialize( $data, EmbeddedEditUrlRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -260,9 +344,7 @@ public static function init(array $data): EmbeddedEditUrlRequest */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -295,6 +377,9 @@ public function getAllowEditCcs() */ public function setAllowEditCcs(?bool $allow_edit_ccs) { + if (is_null($allow_edit_ccs)) { + throw new InvalidArgumentException('non-nullable allow_edit_ccs cannot be null'); + } $this->container['allow_edit_ccs'] = $allow_edit_ccs; return $this; @@ -319,6 +404,9 @@ public function getCcRoles() */ public function setCcRoles(?array $cc_roles) { + if (is_null($cc_roles)) { + throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); + } $this->container['cc_roles'] = $cc_roles; return $this; @@ -343,6 +431,9 @@ public function getEditorOptions() */ public function setEditorOptions(?SubEditorOptions $editor_options) { + if (is_null($editor_options)) { + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + } $this->container['editor_options'] = $editor_options; return $this; @@ -367,6 +458,9 @@ public function getForceSignerRoles() */ public function setForceSignerRoles(?bool $force_signer_roles) { + if (is_null($force_signer_roles)) { + throw new InvalidArgumentException('non-nullable force_signer_roles cannot be null'); + } $this->container['force_signer_roles'] = $force_signer_roles; return $this; @@ -391,6 +485,9 @@ public function getForceSubjectMessage() */ public function setForceSubjectMessage(?bool $force_subject_message) { + if (is_null($force_subject_message)) { + throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); + } $this->container['force_subject_message'] = $force_subject_message; return $this; @@ -415,6 +512,9 @@ public function getMergeFields() */ public function setMergeFields(?array $merge_fields) { + if (is_null($merge_fields)) { + throw new InvalidArgumentException('non-nullable merge_fields cannot be null'); + } $this->container['merge_fields'] = $merge_fields; return $this; @@ -439,6 +539,9 @@ public function getPreviewOnly() */ public function setPreviewOnly(?bool $preview_only) { + if (is_null($preview_only)) { + throw new InvalidArgumentException('non-nullable preview_only cannot be null'); + } $this->container['preview_only'] = $preview_only; return $this; @@ -463,6 +566,9 @@ public function getShowPreview() */ public function setShowPreview(?bool $show_preview) { + if (is_null($show_preview)) { + throw new InvalidArgumentException('non-nullable show_preview cannot be null'); + } $this->container['show_preview'] = $show_preview; return $this; @@ -487,6 +593,9 @@ public function getShowProgressStepper() */ public function setShowProgressStepper(?bool $show_progress_stepper) { + if (is_null($show_progress_stepper)) { + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + } $this->container['show_progress_stepper'] = $show_progress_stepper; return $this; @@ -511,6 +620,9 @@ public function getTestMode() */ 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; @@ -519,12 +631,10 @@ public function setTestMode(?bool $test_mode) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -532,7 +642,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -545,13 +655,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -563,12 +671,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -577,8 +683,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/EmbeddedEditUrlResponse.php b/sdks/php/src/Model/EmbeddedEditUrlResponse.php index 79535fda8..88320ef63 100644 --- a/sdks/php/src/Model/EmbeddedEditUrlResponse.php +++ b/sdks/php/src/Model/EmbeddedEditUrlResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * EmbeddedEditUrlResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class EmbeddedEditUrlResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class EmbeddedEditUrlResponse implements ModelInterface, ArrayAccess, JsonSerial 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'embedded' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['embedded'] = $data['embedded'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('embedded', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EmbeddedEditUrlResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EmbeddedEditUrlResponse { - /** @var EmbeddedEditUrlResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var EmbeddedEditUrlResponse */ + return ObjectSerializer::deserialize( $data, EmbeddedEditUrlResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['embedded'] === null) { + $invalidProperties[] = "'embedded' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets embedded * - * @return EmbeddedEditUrlResponseEmbedded|null + * @return EmbeddedEditUrlResponseEmbedded */ public function getEmbedded() { @@ -242,12 +320,15 @@ public function getEmbedded() /** * Sets embedded * - * @param EmbeddedEditUrlResponseEmbedded|null $embedded embedded + * @param EmbeddedEditUrlResponseEmbedded $embedded embedded * * @return self */ - public function setEmbedded(?EmbeddedEditUrlResponseEmbedded $embedded) + public function setEmbedded(EmbeddedEditUrlResponseEmbedded $embedded) { + if (is_null($embedded)) { + throw new InvalidArgumentException('non-nullable embedded cannot be null'); + } $this->container['embedded'] = $embedded; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php b/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php index b568090ab..0ef35374f 100644 --- a/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php +++ b/sdks/php/src/Model/EmbeddedEditUrlResponseEmbedded.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description An embedded template object. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class EmbeddedEditUrlResponseEmbedded implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +74,23 @@ class EmbeddedEditUrlResponseEmbedded implements ModelInterface, ArrayAccess, Js 'expires_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'edit_url' => false, + 'expires_at' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +111,50 @@ 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 @@ -173,38 +230,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['edit_url'] = $data['edit_url'] ?? null; - $this->container['expires_at'] = $data['expires_at'] ?? null; + $this->setIfExists('edit_url', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EmbeddedEditUrlResponseEmbedded { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EmbeddedEditUrlResponseEmbedded { - /** @var EmbeddedEditUrlResponseEmbedded $obj */ - $obj = ObjectSerializer::deserialize( + /** @var EmbeddedEditUrlResponseEmbedded */ + return ObjectSerializer::deserialize( $data, EmbeddedEditUrlResponseEmbedded::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,9 +289,7 @@ public static function init(array $data): EmbeddedEditUrlResponseEmbedded */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -249,6 +322,9 @@ public function getEditUrl() */ public function setEditUrl(?string $edit_url) { + if (is_null($edit_url)) { + throw new InvalidArgumentException('non-nullable edit_url cannot be null'); + } $this->container['edit_url'] = $edit_url; return $this; @@ -273,6 +349,9 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + } $this->container['expires_at'] = $expires_at; return $this; @@ -281,12 +360,10 @@ public function setExpiresAt(?int $expires_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -294,7 +371,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -307,13 +384,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -325,12 +400,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -339,8 +412,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/EmbeddedSignUrlResponse.php b/sdks/php/src/Model/EmbeddedSignUrlResponse.php index 8cf8ebb71..4f91647aa 100644 --- a/sdks/php/src/Model/EmbeddedSignUrlResponse.php +++ b/sdks/php/src/Model/EmbeddedSignUrlResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * EmbeddedSignUrlResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class EmbeddedSignUrlResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class EmbeddedSignUrlResponse implements ModelInterface, ArrayAccess, JsonSerial 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'embedded' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['embedded'] = $data['embedded'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('embedded', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EmbeddedSignUrlResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EmbeddedSignUrlResponse { - /** @var EmbeddedSignUrlResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var EmbeddedSignUrlResponse */ + return ObjectSerializer::deserialize( $data, EmbeddedSignUrlResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['embedded'] === null) { + $invalidProperties[] = "'embedded' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets embedded * - * @return EmbeddedSignUrlResponseEmbedded|null + * @return EmbeddedSignUrlResponseEmbedded */ public function getEmbedded() { @@ -242,12 +320,15 @@ public function getEmbedded() /** * Sets embedded * - * @param EmbeddedSignUrlResponseEmbedded|null $embedded embedded + * @param EmbeddedSignUrlResponseEmbedded $embedded embedded * * @return self */ - public function setEmbedded(?EmbeddedSignUrlResponseEmbedded $embedded) + public function setEmbedded(EmbeddedSignUrlResponseEmbedded $embedded) { + if (is_null($embedded)) { + throw new InvalidArgumentException('non-nullable embedded cannot be null'); + } $this->container['embedded'] = $embedded; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php b/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php index b33b67d36..f8b6619ba 100644 --- a/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php +++ b/sdks/php/src/Model/EmbeddedSignUrlResponseEmbedded.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description An object that contains necessary information to set up embedded signing. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class EmbeddedSignUrlResponseEmbedded implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +74,23 @@ class EmbeddedSignUrlResponseEmbedded implements ModelInterface, ArrayAccess, Js 'expires_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'sign_url' => false, + 'expires_at' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +111,50 @@ 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 @@ -173,38 +230,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['sign_url'] = $data['sign_url'] ?? null; - $this->container['expires_at'] = $data['expires_at'] ?? null; + $this->setIfExists('sign_url', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EmbeddedSignUrlResponseEmbedded { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EmbeddedSignUrlResponseEmbedded { - /** @var EmbeddedSignUrlResponseEmbedded $obj */ - $obj = ObjectSerializer::deserialize( + /** @var EmbeddedSignUrlResponseEmbedded */ + return ObjectSerializer::deserialize( $data, EmbeddedSignUrlResponseEmbedded::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,9 +289,7 @@ public static function init(array $data): EmbeddedSignUrlResponseEmbedded */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -249,6 +322,9 @@ public function getSignUrl() */ public function setSignUrl(?string $sign_url) { + if (is_null($sign_url)) { + throw new InvalidArgumentException('non-nullable sign_url cannot be null'); + } $this->container['sign_url'] = $sign_url; return $this; @@ -273,6 +349,9 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + } $this->container['expires_at'] = $expires_at; return $this; @@ -281,12 +360,10 @@ public function setExpiresAt(?int $expires_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -294,7 +371,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -307,13 +384,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -325,12 +400,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -339,8 +412,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ErrorResponse.php b/sdks/php/src/Model/ErrorResponse.php index 4770b26d2..081ed78c0 100644 --- a/sdks/php/src/Model/ErrorResponse.php +++ b/sdks/php/src/Model/ErrorResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * ErrorResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ErrorResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -74,6 +71,22 @@ class ErrorResponse implements ModelInterface, ArrayAccess, JsonSerializable 'error' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'error' => 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 * @@ -94,6 +107,50 @@ 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 @@ -166,37 +223,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['error'] = $data['error'] ?? null; + $this->setIfExists('error', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ErrorResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ErrorResponse { - /** @var ErrorResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ErrorResponse */ + return ObjectSerializer::deserialize( $data, ErrorResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -211,7 +286,6 @@ public function listInvalidProperties() if ($this->container['error'] === null) { $invalidProperties[] = "'error' can't be null"; } - return $invalidProperties; } @@ -245,6 +319,9 @@ public function getError() */ public function setError(ErrorResponseError $error) { + if (is_null($error)) { + throw new InvalidArgumentException('non-nullable error cannot be null'); + } $this->container['error'] = $error; return $this; @@ -253,12 +330,10 @@ public function setError(ErrorResponseError $error) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -266,7 +341,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -279,13 +354,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -297,12 +370,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -311,8 +382,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ErrorResponseError.php b/sdks/php/src/Model/ErrorResponseError.php index 30c5eb346..60981920d 100644 --- a/sdks/php/src/Model/ErrorResponseError.php +++ b/sdks/php/src/Model/ErrorResponseError.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,11 +38,8 @@ * * @category Class * @description Contains information about an error that occurred. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ErrorResponseError implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +76,24 @@ class ErrorResponseError implements ModelInterface, ArrayAccess, JsonSerializabl 'error_path' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'error_msg' => false, + 'error_name' => false, + 'error_path' => 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 * @@ -99,6 +114,50 @@ 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 @@ -177,39 +236,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['error_msg'] = $data['error_msg'] ?? null; - $this->container['error_name'] = $data['error_name'] ?? null; - $this->container['error_path'] = $data['error_path'] ?? null; + $this->setIfExists('error_msg', $data ?? [], null); + $this->setIfExists('error_name', $data ?? [], null); + $this->setIfExists('error_path', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ErrorResponseError { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ErrorResponseError { - /** @var ErrorResponseError $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ErrorResponseError */ + return ObjectSerializer::deserialize( $data, ErrorResponseError::class, ); + } - return $obj; + /** + * 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; } /** @@ -227,7 +304,6 @@ public function listInvalidProperties() if ($this->container['error_name'] === null) { $invalidProperties[] = "'error_name' can't be null"; } - return $invalidProperties; } @@ -261,6 +337,9 @@ public function getErrorMsg() */ public function setErrorMsg(string $error_msg) { + if (is_null($error_msg)) { + throw new InvalidArgumentException('non-nullable error_msg cannot be null'); + } $this->container['error_msg'] = $error_msg; return $this; @@ -285,6 +364,9 @@ public function getErrorName() */ public function setErrorName(string $error_name) { + if (is_null($error_name)) { + throw new InvalidArgumentException('non-nullable error_name cannot be null'); + } $this->container['error_name'] = $error_name; return $this; @@ -309,6 +391,9 @@ public function getErrorPath() */ public function setErrorPath(?string $error_path) { + if (is_null($error_path)) { + throw new InvalidArgumentException('non-nullable error_path cannot be null'); + } $this->container['error_path'] = $error_path; return $this; @@ -317,12 +402,10 @@ public function setErrorPath(?string $error_path) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -330,7 +413,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -343,13 +426,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -361,12 +442,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -375,8 +454,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/EventCallbackRequest.php b/sdks/php/src/Model/EventCallbackRequest.php index 10819f45f..35c806b2d 100644 --- a/sdks/php/src/Model/EventCallbackRequest.php +++ b/sdks/php/src/Model/EventCallbackRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * EventCallbackRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class EventCallbackRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -80,6 +77,25 @@ class EventCallbackRequest implements ModelInterface, ArrayAccess, JsonSerializa 'template' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'event' => false, + 'account' => false, + 'signature_request' => false, + 'template' => 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 * @@ -100,6 +116,50 @@ 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 @@ -181,40 +241,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['event'] = $data['event'] ?? null; - $this->container['account'] = $data['account'] ?? null; - $this->container['signature_request'] = $data['signature_request'] ?? null; - $this->container['template'] = $data['template'] ?? null; + $this->setIfExists('event', $data ?? [], null); + $this->setIfExists('account', $data ?? [], null); + $this->setIfExists('signature_request', $data ?? [], null); + $this->setIfExists('template', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EventCallbackRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EventCallbackRequest { - /** @var EventCallbackRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var EventCallbackRequest */ + return ObjectSerializer::deserialize( $data, EventCallbackRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -229,7 +307,6 @@ public function listInvalidProperties() if ($this->container['event'] === null) { $invalidProperties[] = "'event' can't be null"; } - return $invalidProperties; } @@ -263,6 +340,9 @@ public function getEvent() */ public function setEvent(EventCallbackRequestEvent $event) { + if (is_null($event)) { + throw new InvalidArgumentException('non-nullable event cannot be null'); + } $this->container['event'] = $event; return $this; @@ -287,6 +367,9 @@ public function getAccount() */ public function setAccount(?AccountResponse $account) { + if (is_null($account)) { + throw new InvalidArgumentException('non-nullable account cannot be null'); + } $this->container['account'] = $account; return $this; @@ -311,6 +394,9 @@ public function getSignatureRequest() */ public function setSignatureRequest(?SignatureRequestResponse $signature_request) { + if (is_null($signature_request)) { + throw new InvalidArgumentException('non-nullable signature_request cannot be null'); + } $this->container['signature_request'] = $signature_request; return $this; @@ -335,6 +421,9 @@ public function getTemplate() */ public function setTemplate(?TemplateResponse $template) { + if (is_null($template)) { + throw new InvalidArgumentException('non-nullable template cannot be null'); + } $this->container['template'] = $template; return $this; @@ -343,12 +432,10 @@ public function setTemplate(?TemplateResponse $template) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -356,7 +443,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -369,13 +456,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -387,12 +472,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -401,8 +484,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/EventCallbackRequestEvent.php b/sdks/php/src/Model/EventCallbackRequestEvent.php index 0b1ba4d3d..36d99c767 100644 --- a/sdks/php/src/Model/EventCallbackRequestEvent.php +++ b/sdks/php/src/Model/EventCallbackRequestEvent.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * * @category Class * @description Basic information about the event that occurred. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class EventCallbackRequestEvent implements ModelInterface, ArrayAccess, JsonSerializable { @@ -82,6 +78,25 @@ class EventCallbackRequestEvent implements ModelInterface, ArrayAccess, JsonSeri 'event_metadata' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'event_time' => false, + 'event_type' => false, + 'event_hash' => false, + 'event_metadata' => 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 * @@ -102,6 +117,50 @@ 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 @@ -241,40 +300,58 @@ public function getEventTypeAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['event_time'] = $data['event_time'] ?? null; - $this->container['event_type'] = $data['event_type'] ?? null; - $this->container['event_hash'] = $data['event_hash'] ?? null; - $this->container['event_metadata'] = $data['event_metadata'] ?? null; + $this->setIfExists('event_time', $data ?? [], null); + $this->setIfExists('event_type', $data ?? [], null); + $this->setIfExists('event_hash', $data ?? [], null); + $this->setIfExists('event_metadata', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EventCallbackRequestEvent { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EventCallbackRequestEvent { - /** @var EventCallbackRequestEvent $obj */ - $obj = ObjectSerializer::deserialize( + /** @var EventCallbackRequestEvent */ + return ObjectSerializer::deserialize( $data, EventCallbackRequestEvent::class, ); + } - return $obj; + /** + * 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; } /** @@ -304,7 +381,6 @@ public function listInvalidProperties() if ($this->container['event_hash'] === null) { $invalidProperties[] = "'event_hash' can't be null"; } - return $invalidProperties; } @@ -338,6 +414,9 @@ public function getEventTime() */ public function setEventTime(string $event_time) { + if (is_null($event_time)) { + throw new InvalidArgumentException('non-nullable event_time cannot be null'); + } $this->container['event_time'] = $event_time; return $this; @@ -362,6 +441,9 @@ public function getEventType() */ public function setEventType(string $event_type) { + if (is_null($event_type)) { + throw new InvalidArgumentException('non-nullable event_type cannot be null'); + } $allowedValues = $this->getEventTypeAllowableValues(); if (!in_array($event_type, $allowedValues, true)) { throw new InvalidArgumentException( @@ -396,6 +478,9 @@ public function getEventHash() */ public function setEventHash(string $event_hash) { + if (is_null($event_hash)) { + throw new InvalidArgumentException('non-nullable event_hash cannot be null'); + } $this->container['event_hash'] = $event_hash; return $this; @@ -420,6 +505,9 @@ public function getEventMetadata() */ public function setEventMetadata(?EventCallbackRequestEventMetadata $event_metadata) { + if (is_null($event_metadata)) { + throw new InvalidArgumentException('non-nullable event_metadata cannot be null'); + } $this->container['event_metadata'] = $event_metadata; return $this; @@ -428,12 +516,10 @@ public function setEventMetadata(?EventCallbackRequestEventMetadata $event_metad /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -441,7 +527,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -454,13 +540,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -472,12 +556,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -486,8 +568,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/EventCallbackRequestEventMetadata.php b/sdks/php/src/Model/EventCallbackRequestEventMetadata.php index d2b207b08..c0d665c8c 100644 --- a/sdks/php/src/Model/EventCallbackRequestEventMetadata.php +++ b/sdks/php/src/Model/EventCallbackRequestEventMetadata.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,11 +37,8 @@ * * @category Class * @description Specific metadata about the event. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class EventCallbackRequestEventMetadata implements ModelInterface, ArrayAccess, JsonSerializable { @@ -81,6 +77,25 @@ class EventCallbackRequestEventMetadata implements ModelInterface, ArrayAccess, 'event_message' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'related_signature_id' => true, + 'reported_for_account_id' => true, + 'reported_for_app_id' => true, + 'event_message' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -101,6 +116,50 @@ 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 @@ -182,40 +241,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['related_signature_id'] = $data['related_signature_id'] ?? null; - $this->container['reported_for_account_id'] = $data['reported_for_account_id'] ?? null; - $this->container['reported_for_app_id'] = $data['reported_for_app_id'] ?? null; - $this->container['event_message'] = $data['event_message'] ?? null; + $this->setIfExists('related_signature_id', $data ?? [], null); + $this->setIfExists('reported_for_account_id', $data ?? [], null); + $this->setIfExists('reported_for_app_id', $data ?? [], null); + $this->setIfExists('event_message', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): EventCallbackRequestEventMetadata { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): EventCallbackRequestEventMetadata { - /** @var EventCallbackRequestEventMetadata $obj */ - $obj = ObjectSerializer::deserialize( + /** @var EventCallbackRequestEventMetadata */ + return ObjectSerializer::deserialize( $data, EventCallbackRequestEventMetadata::class, ); + } - return $obj; + /** + * 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; } /** @@ -225,9 +302,7 @@ public static function init(array $data): EventCallbackRequestEventMetadata */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -260,6 +335,16 @@ public function getRelatedSignatureId() */ public function setRelatedSignatureId(?string $related_signature_id) { + if (is_null($related_signature_id)) { + array_push($this->openAPINullablesSetToNull, 'related_signature_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('related_signature_id', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['related_signature_id'] = $related_signature_id; return $this; @@ -284,6 +369,16 @@ public function getReportedForAccountId() */ public function setReportedForAccountId(?string $reported_for_account_id) { + if (is_null($reported_for_account_id)) { + array_push($this->openAPINullablesSetToNull, 'reported_for_account_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reported_for_account_id', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['reported_for_account_id'] = $reported_for_account_id; return $this; @@ -308,6 +403,16 @@ public function getReportedForAppId() */ public function setReportedForAppId(?string $reported_for_app_id) { + if (is_null($reported_for_app_id)) { + array_push($this->openAPINullablesSetToNull, 'reported_for_app_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reported_for_app_id', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['reported_for_app_id'] = $reported_for_app_id; return $this; @@ -332,6 +437,16 @@ public function getEventMessage() */ public function setEventMessage(?string $event_message) { + if (is_null($event_message)) { + array_push($this->openAPINullablesSetToNull, 'event_message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('event_message', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['event_message'] = $event_message; return $this; @@ -340,12 +455,10 @@ public function setEventMessage(?string $event_message) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -353,7 +466,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -366,13 +479,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -384,12 +495,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -398,8 +507,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/FaxLineAddUserRequest.php b/sdks/php/src/Model/FaxLineAddUserRequest.php new file mode 100644 index 000000000..b7e2c849a --- /dev/null +++ b/sdks/php/src/Model/FaxLineAddUserRequest.php @@ -0,0 +1,484 @@ + + */ +class FaxLineAddUserRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxLineAddUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'number' => 'string', + 'account_id' => 'string', + 'email_address' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'number' => null, + 'account_id' => null, + 'email_address' => 'email', + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'number' => false, + 'account_id' => false, + 'email_address' => 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 = [ + 'number' => 'number', + 'account_id' => 'account_id', + 'email_address' => 'email_address', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'number' => 'setNumber', + 'account_id' => 'setAccountId', + 'email_address' => 'setEmailAddress', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'number' => 'getNumber', + 'account_id' => 'getAccountId', + 'email_address' => 'getEmailAddress', + ]; + + /** + * 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('number', $data ?? [], null); + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxLineAddUserRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxLineAddUserRequest + { + /** @var FaxLineAddUserRequest */ + return ObjectSerializer::deserialize( + $data, + FaxLineAddUserRequest::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['number'] === null) { + $invalidProperties[] = "'number' 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 number + * + * @return string + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string $number the Fax Line number + * + * @return self + */ + public function setNumber(string $number) + { + if (is_null($number)) { + throw new InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id Account ID + * + * @return self + */ + public function setAccountId(?string $account_id) + { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } + $this->container['account_id'] = $account_id; + + return $this; + } + + /** + * Gets email_address + * + * @return string|null + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string|null $email_address Email address + * + * @return self + */ + public function setEmailAddress(?string $email_address) + { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } + $this->container['email_address'] = $email_address; + + 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/FaxLineAreaCodeGetCountryEnum.php b/sdks/php/src/Model/FaxLineAreaCodeGetCountryEnum.php new file mode 100644 index 000000000..1b96f68c7 --- /dev/null +++ b/sdks/php/src/Model/FaxLineAreaCodeGetCountryEnum.php @@ -0,0 +1,59 @@ + + */ +class FaxLineAreaCodeGetResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxLineAreaCodeGetResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'area_codes' => 'int[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'area_codes' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'area_codes' => 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 = [ + 'area_codes' => 'area_codes', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'area_codes' => 'setAreaCodes', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'area_codes' => 'getAreaCodes', + ]; + + /** + * 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('area_codes', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxLineAreaCodeGetResponse + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxLineAreaCodeGetResponse + { + /** @var FaxLineAreaCodeGetResponse */ + return ObjectSerializer::deserialize( + $data, + FaxLineAreaCodeGetResponse::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['area_codes'] === null) { + $invalidProperties[] = "'area_codes' 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 area_codes + * + * @return int[] + */ + public function getAreaCodes() + { + return $this->container['area_codes']; + } + + /** + * Sets area_codes + * + * @param int[] $area_codes area_codes + * + * @return self + */ + public function setAreaCodes(array $area_codes) + { + if (is_null($area_codes)) { + throw new InvalidArgumentException('non-nullable area_codes cannot be null'); + } + $this->container['area_codes'] = $area_codes; + + 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/FaxLineAreaCodeGetStateEnum.php b/sdks/php/src/Model/FaxLineAreaCodeGetStateEnum.php new file mode 100644 index 000000000..db4f35fd0 --- /dev/null +++ b/sdks/php/src/Model/FaxLineAreaCodeGetStateEnum.php @@ -0,0 +1,203 @@ + + */ +class FaxLineCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxLineCreateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'area_code' => 'int', + 'country' => 'string', + 'city' => 'string', + 'account_id' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'area_code' => null, + 'country' => null, + 'city' => null, + 'account_id' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'area_code' => false, + 'country' => false, + 'city' => false, + 'account_id' => 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 = [ + 'area_code' => 'area_code', + 'country' => 'country', + 'city' => 'city', + 'account_id' => 'account_id', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'area_code' => 'setAreaCode', + 'country' => 'setCountry', + 'city' => 'setCity', + 'account_id' => 'setAccountId', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'area_code' => 'getAreaCode', + 'country' => 'getCountry', + 'city' => 'getCity', + 'account_id' => 'getAccountId', + ]; + + /** + * 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 COUNTRY_CA = 'CA'; + public const COUNTRY_US = 'US'; + public const COUNTRY_UK = 'UK'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCountryAllowableValues() + { + return [ + self::COUNTRY_CA, + self::COUNTRY_US, + self::COUNTRY_UK, + ]; + } + + /** + * 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('area_code', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('account_id', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxLineCreateRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxLineCreateRequest + { + /** @var FaxLineCreateRequest */ + return ObjectSerializer::deserialize( + $data, + FaxLineCreateRequest::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['area_code'] === null) { + $invalidProperties[] = "'area_code' can't be null"; + } + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + $allowedValues = $this->getCountryAllowableValues(); + if (!is_null($this->container['country']) && !in_array($this->container['country'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'country', must be one of '%s'", + $this->container['country'], + 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 area_code + * + * @return int + */ + public function getAreaCode() + { + return $this->container['area_code']; + } + + /** + * Sets area_code + * + * @param int $area_code Area code + * + * @return self + */ + public function setAreaCode(int $area_code) + { + if (is_null($area_code)) { + throw new InvalidArgumentException('non-nullable area_code cannot be null'); + } + $this->container['area_code'] = $area_code; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country Country + * + * @return self + */ + public function setCountry(string $country) + { + if (is_null($country)) { + throw new InvalidArgumentException('non-nullable country cannot be null'); + } + $allowedValues = $this->getCountryAllowableValues(); + if (!in_array($country, $allowedValues, true)) { + throw new InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'country', must be one of '%s'", + $country, + implode("', '", $allowedValues) + ) + ); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city City + * + * @return self + */ + public function setCity(?string $city) + { + if (is_null($city)) { + throw new InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id Account ID + * + * @return self + */ + public function setAccountId(?string $account_id) + { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } + $this->container['account_id'] = $account_id; + + 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/FaxLineDeleteRequest.php b/sdks/php/src/Model/FaxLineDeleteRequest.php new file mode 100644 index 000000000..1fc4fa4a6 --- /dev/null +++ b/sdks/php/src/Model/FaxLineDeleteRequest.php @@ -0,0 +1,416 @@ + + */ +class FaxLineDeleteRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxLineDeleteRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'number' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'number' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'number' => 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 = [ + 'number' => 'number', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'number' => 'setNumber', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'number' => 'getNumber', + ]; + + /** + * 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('number', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxLineDeleteRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxLineDeleteRequest + { + /** @var FaxLineDeleteRequest */ + return ObjectSerializer::deserialize( + $data, + FaxLineDeleteRequest::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['number'] === null) { + $invalidProperties[] = "'number' 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 number + * + * @return string + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string $number the Fax Line number + * + * @return self + */ + public function setNumber(string $number) + { + if (is_null($number)) { + throw new InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + 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/FaxLineListResponse.php b/sdks/php/src/Model/FaxLineListResponse.php new file mode 100644 index 000000000..1b32ad49c --- /dev/null +++ b/sdks/php/src/Model/FaxLineListResponse.php @@ -0,0 +1,487 @@ + + */ +class FaxLineListResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxLineListResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'list_info' => '\Dropbox\Sign\Model\ListInfoResponse', + 'fax_lines' => '\Dropbox\Sign\Model\FaxLineResponseFaxLine[]', + '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 = [ + 'list_info' => null, + 'fax_lines' => null, + 'warnings' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'list_info' => false, + 'fax_lines' => 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 = [ + 'list_info' => 'list_info', + 'fax_lines' => 'fax_lines', + 'warnings' => 'warnings', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'list_info' => 'setListInfo', + 'fax_lines' => 'setFaxLines', + 'warnings' => 'setWarnings', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'list_info' => 'getListInfo', + 'fax_lines' => 'getFaxLines', + '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('list_info', $data ?? [], null); + $this->setIfExists('fax_lines', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxLineListResponse + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxLineListResponse + { + /** @var FaxLineListResponse */ + return ObjectSerializer::deserialize( + $data, + FaxLineListResponse::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['list_info'] === null) { + $invalidProperties[] = "'list_info' can't be null"; + } + if ($this->container['fax_lines'] === null) { + $invalidProperties[] = "'fax_lines' 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 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; + } + + /** + * Gets fax_lines + * + * @return FaxLineResponseFaxLine[] + */ + public function getFaxLines() + { + return $this->container['fax_lines']; + } + + /** + * Sets fax_lines + * + * @param FaxLineResponseFaxLine[] $fax_lines fax_lines + * + * @return self + */ + public function setFaxLines(array $fax_lines) + { + if (is_null($fax_lines)) { + throw new InvalidArgumentException('non-nullable fax_lines cannot be null'); + } + $this->container['fax_lines'] = $fax_lines; + + return $this; + } + + /** + * Gets warnings + * + * @return WarningResponse|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param WarningResponse|null $warnings warnings + * + * @return self + */ + public function setWarnings(?WarningResponse $warnings) + { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } + $this->container['warnings'] = $warnings; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/php/src/Model/FaxLineRemoveUserRequest.php b/sdks/php/src/Model/FaxLineRemoveUserRequest.php new file mode 100644 index 000000000..5bec49060 --- /dev/null +++ b/sdks/php/src/Model/FaxLineRemoveUserRequest.php @@ -0,0 +1,484 @@ + + */ +class FaxLineRemoveUserRequest implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxLineRemoveUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'number' => 'string', + 'account_id' => 'string', + 'email_address' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'number' => null, + 'account_id' => null, + 'email_address' => 'email', + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'number' => false, + 'account_id' => false, + 'email_address' => 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 = [ + 'number' => 'number', + 'account_id' => 'account_id', + 'email_address' => 'email_address', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'number' => 'setNumber', + 'account_id' => 'setAccountId', + 'email_address' => 'setEmailAddress', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'number' => 'getNumber', + 'account_id' => 'getAccountId', + 'email_address' => 'getEmailAddress', + ]; + + /** + * 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('number', $data ?? [], null); + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxLineRemoveUserRequest + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxLineRemoveUserRequest + { + /** @var FaxLineRemoveUserRequest */ + return ObjectSerializer::deserialize( + $data, + FaxLineRemoveUserRequest::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['number'] === null) { + $invalidProperties[] = "'number' 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 number + * + * @return string + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string $number the Fax Line number + * + * @return self + */ + public function setNumber(string $number) + { + if (is_null($number)) { + throw new InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets account_id + * + * @return string|null + */ + public function getAccountId() + { + return $this->container['account_id']; + } + + /** + * Sets account_id + * + * @param string|null $account_id Account ID + * + * @return self + */ + public function setAccountId(?string $account_id) + { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } + $this->container['account_id'] = $account_id; + + return $this; + } + + /** + * Gets email_address + * + * @return string|null + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param string|null $email_address Email address + * + * @return self + */ + public function setEmailAddress(?string $email_address) + { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } + $this->container['email_address'] = $email_address; + + 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/FaxLineResponse.php b/sdks/php/src/Model/FaxLineResponse.php new file mode 100644 index 000000000..c30616f6c --- /dev/null +++ b/sdks/php/src/Model/FaxLineResponse.php @@ -0,0 +1,450 @@ + + */ +class FaxLineResponse implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxLineResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fax_line' => '\Dropbox\Sign\Model\FaxLineResponseFaxLine', + '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_line' => null, + 'warnings' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'fax_line' => 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_line' => 'fax_line', + 'warnings' => 'warnings', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fax_line' => 'setFaxLine', + 'warnings' => 'setWarnings', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fax_line' => 'getFaxLine', + '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_line', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxLineResponse + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxLineResponse + { + /** @var FaxLineResponse */ + return ObjectSerializer::deserialize( + $data, + FaxLineResponse::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_line'] === null) { + $invalidProperties[] = "'fax_line' 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_line + * + * @return FaxLineResponseFaxLine + */ + public function getFaxLine() + { + return $this->container['fax_line']; + } + + /** + * Sets fax_line + * + * @param FaxLineResponseFaxLine $fax_line fax_line + * + * @return self + */ + public function setFaxLine(FaxLineResponseFaxLine $fax_line) + { + if (is_null($fax_line)) { + throw new InvalidArgumentException('non-nullable fax_line cannot be null'); + } + $this->container['fax_line'] = $fax_line; + + return $this; + } + + /** + * Gets warnings + * + * @return WarningResponse|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param WarningResponse|null $warnings warnings + * + * @return self + */ + public function setWarnings(?WarningResponse $warnings) + { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } + $this->container['warnings'] = $warnings; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + */ + #[ReturnTypeWillChange] + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + #[ReturnTypeWillChange] + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_UNESCAPED_SLASHES + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/sdks/php/src/Model/FaxLineResponseFaxLine.php b/sdks/php/src/Model/FaxLineResponseFaxLine.php new file mode 100644 index 000000000..4a3fe8fa7 --- /dev/null +++ b/sdks/php/src/Model/FaxLineResponseFaxLine.php @@ -0,0 +1,513 @@ + + */ +class FaxLineResponseFaxLine implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FaxLineResponseFaxLine'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'number' => 'string', + 'created_at' => 'int', + 'updated_at' => 'int', + 'accounts' => '\Dropbox\Sign\Model\AccountResponse[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'number' => null, + 'created_at' => null, + 'updated_at' => null, + 'accounts' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'number' => false, + 'created_at' => false, + 'updated_at' => false, + 'accounts' => 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 = [ + 'number' => 'number', + 'created_at' => 'created_at', + 'updated_at' => 'updated_at', + 'accounts' => 'accounts', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'number' => 'setNumber', + 'created_at' => 'setCreatedAt', + 'updated_at' => 'setUpdatedAt', + 'accounts' => 'setAccounts', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'number' => 'getNumber', + 'created_at' => 'getCreatedAt', + 'updated_at' => 'getUpdatedAt', + 'accounts' => 'getAccounts', + ]; + + /** + * 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('number', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('accounts', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ + public static function fromArray(array $data): FaxLineResponseFaxLine + { + return self::init($data); + } + + /** + * Attempt to instantiate and hydrate a new instance of this class + */ + public static function init(array $data): FaxLineResponseFaxLine + { + /** @var FaxLineResponseFaxLine */ + return ObjectSerializer::deserialize( + $data, + FaxLineResponseFaxLine::class, + ); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string|int|object|array|mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets number + * + * @return string|null + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string|null $number Number + * + * @return self + */ + public function setNumber(?string $number) + { + if (is_null($number)) { + throw new InvalidArgumentException('non-nullable number cannot be null'); + } + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets created_at + * + * @return int|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param int|null $created_at Created at + * + * @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 updated_at + * + * @return int|null + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param int|null $updated_at Updated at + * + * @return self + */ + public function setUpdatedAt(?int $updated_at) + { + if (is_null($updated_at)) { + throw new InvalidArgumentException('non-nullable updated_at cannot be null'); + } + $this->container['updated_at'] = $updated_at; + + return $this; + } + + /** + * Gets accounts + * + * @return AccountResponse[]|null + */ + public function getAccounts() + { + return $this->container['accounts']; + } + + /** + * Sets accounts + * + * @param AccountResponse[]|null $accounts accounts + * + * @return self + */ + public function setAccounts(?array $accounts) + { + if (is_null($accounts)) { + throw new InvalidArgumentException('non-nullable accounts cannot be null'); + } + $this->container['accounts'] = $accounts; + + 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/FileResponse.php b/sdks/php/src/Model/FileResponse.php index 62c76b97e..3ebdc3378 100644 --- a/sdks/php/src/Model/FileResponse.php +++ b/sdks/php/src/Model/FileResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * FileResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class FileResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class FileResponse implements ModelInterface, ArrayAccess, JsonSerializable 'expires_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'file_url' => false, + 'expires_at' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['file_url'] = $data['file_url'] ?? null; - $this->container['expires_at'] = $data['expires_at'] ?? null; + $this->setIfExists('file_url', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FileResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FileResponse { - /** @var FileResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var FileResponse */ + return ObjectSerializer::deserialize( $data, FileResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -215,6 +290,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['file_url'] === null) { + $invalidProperties[] = "'file_url' can't be null"; + } + if ($this->container['expires_at'] === null) { + $invalidProperties[] = "'expires_at' can't be null"; + } return $invalidProperties; } @@ -232,7 +313,7 @@ public function valid() /** * Gets file_url * - * @return string|null + * @return string */ public function getFileUrl() { @@ -242,12 +323,15 @@ public function getFileUrl() /** * Sets file_url * - * @param string|null $file_url URL to the file + * @param string $file_url URL to the file * * @return self */ - public function setFileUrl(?string $file_url) + public function setFileUrl(string $file_url) { + if (is_null($file_url)) { + throw new InvalidArgumentException('non-nullable file_url cannot be null'); + } $this->container['file_url'] = $file_url; return $this; @@ -256,7 +340,7 @@ public function setFileUrl(?string $file_url) /** * Gets expires_at * - * @return int|null + * @return int */ public function getExpiresAt() { @@ -266,12 +350,15 @@ public function getExpiresAt() /** * Sets expires_at * - * @param int|null $expires_at when the link expires + * @param int $expires_at when the link expires * * @return self */ - public function setExpiresAt(?int $expires_at) + public function setExpiresAt(int $expires_at) { + if (is_null($expires_at)) { + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + } $this->container['expires_at'] = $expires_at; return $this; @@ -280,12 +367,10 @@ public function setExpiresAt(?int $expires_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +378,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +391,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +407,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +419,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/FileResponseDataUri.php b/sdks/php/src/Model/FileResponseDataUri.php index 1ff596a9a..474e8a73d 100644 --- a/sdks/php/src/Model/FileResponseDataUri.php +++ b/sdks/php/src/Model/FileResponseDataUri.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * FileResponseDataUri Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class FileResponseDataUri implements ModelInterface, ArrayAccess, JsonSerializable { @@ -75,6 +71,22 @@ class FileResponseDataUri implements ModelInterface, ArrayAccess, JsonSerializab 'data_uri' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'data_uri' => 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 * @@ -95,6 +107,50 @@ 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 @@ -167,37 +223,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['data_uri'] = $data['data_uri'] ?? null; + $this->setIfExists('data_uri', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): FileResponseDataUri { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): FileResponseDataUri { - /** @var FileResponseDataUri $obj */ - $obj = ObjectSerializer::deserialize( + /** @var FileResponseDataUri */ + return ObjectSerializer::deserialize( $data, FileResponseDataUri::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -209,6 +283,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['data_uri'] === null) { + $invalidProperties[] = "'data_uri' can't be null"; + } return $invalidProperties; } @@ -226,7 +303,7 @@ public function valid() /** * Gets data_uri * - * @return string|null + * @return string */ public function getDataUri() { @@ -236,12 +313,15 @@ public function getDataUri() /** * Sets data_uri * - * @param string|null $data_uri file as base64 encoded string + * @param string $data_uri file as base64 encoded string * * @return self */ - public function setDataUri(?string $data_uri) + public function setDataUri(string $data_uri) { + if (is_null($data_uri)) { + throw new InvalidArgumentException('non-nullable data_uri cannot be null'); + } $this->container['data_uri'] = $data_uri; return $this; @@ -250,12 +330,10 @@ public function setDataUri(?string $data_uri) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -263,7 +341,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -276,13 +354,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -294,12 +370,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -308,8 +382,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ListInfoResponse.php b/sdks/php/src/Model/ListInfoResponse.php index 33100c388..623284e41 100644 --- a/sdks/php/src/Model/ListInfoResponse.php +++ b/sdks/php/src/Model/ListInfoResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Contains pagination information about the data returned. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class ListInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -82,6 +78,25 @@ class ListInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable 'page_size' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'num_pages' => false, + 'num_results' => true, + 'page' => false, + 'page_size' => 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 * @@ -102,6 +117,50 @@ 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 @@ -183,40 +242,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['num_pages'] = $data['num_pages'] ?? null; - $this->container['num_results'] = $data['num_results'] ?? null; - $this->container['page'] = $data['page'] ?? null; - $this->container['page_size'] = $data['page_size'] ?? null; + $this->setIfExists('num_pages', $data ?? [], null); + $this->setIfExists('num_results', $data ?? [], null); + $this->setIfExists('page', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ListInfoResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ListInfoResponse { - /** @var ListInfoResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ListInfoResponse */ + return ObjectSerializer::deserialize( $data, ListInfoResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -226,9 +303,7 @@ public static function init(array $data): ListInfoResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -261,6 +336,9 @@ public function getNumPages() */ public function setNumPages(?int $num_pages) { + if (is_null($num_pages)) { + throw new InvalidArgumentException('non-nullable num_pages cannot be null'); + } $this->container['num_pages'] = $num_pages; return $this; @@ -285,6 +363,16 @@ public function getNumResults() */ public function setNumResults(?int $num_results) { + if (is_null($num_results)) { + array_push($this->openAPINullablesSetToNull, 'num_results'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('num_results', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['num_results'] = $num_results; return $this; @@ -309,6 +397,9 @@ public function getPage() */ public function setPage(?int $page) { + if (is_null($page)) { + throw new InvalidArgumentException('non-nullable page cannot be null'); + } $this->container['page'] = $page; return $this; @@ -333,6 +424,9 @@ public function getPageSize() */ public function setPageSize(?int $page_size) { + if (is_null($page_size)) { + throw new InvalidArgumentException('non-nullable page_size cannot be null'); + } $this->container['page_size'] = $page_size; return $this; @@ -341,12 +435,10 @@ public function setPageSize(?int $page_size) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -354,7 +446,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -367,13 +459,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -385,12 +475,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -399,8 +487,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ModelInterface.php b/sdks/php/src/Model/ModelInterface.php index c26c5c647..0bc2f212e 100644 --- a/sdks/php/src/Model/ModelInterface.php +++ b/sdks/php/src/Model/ModelInterface.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,8 +29,6 @@ /** * Interface abstracting model access. - * - * @author OpenAPI Generator team */ interface ModelInterface { @@ -91,4 +88,14 @@ public function listInvalidProperties(); * @return bool */ public function valid(); + + /** + * Checks if a property is nullable + */ + public static function isNullable(string $property): bool; + + /** + * Checks if a nullable property is set to null. + */ + public function isNullableSetToNull(string $property): bool; } diff --git a/sdks/php/src/Model/OAuthTokenGenerateRequest.php b/sdks/php/src/Model/OAuthTokenGenerateRequest.php index 3c23513e9..38a0395d1 100644 --- a/sdks/php/src/Model/OAuthTokenGenerateRequest.php +++ b/sdks/php/src/Model/OAuthTokenGenerateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * OAuthTokenGenerateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class OAuthTokenGenerateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -82,6 +79,26 @@ class OAuthTokenGenerateRequest implements ModelInterface, ArrayAccess, JsonSeri 'state' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'client_id' => false, + 'client_secret' => false, + 'code' => false, + 'grant_type' => false, + 'state' => 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 * @@ -102,6 +119,50 @@ 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 @@ -186,41 +247,59 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['client_secret'] = $data['client_secret'] ?? null; - $this->container['code'] = $data['code'] ?? null; - $this->container['grant_type'] = $data['grant_type'] ?? 'authorization_code'; - $this->container['state'] = $data['state'] ?? null; + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('client_secret', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('grant_type', $data ?? [], 'authorization_code'); + $this->setIfExists('state', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): OAuthTokenGenerateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): OAuthTokenGenerateRequest { - /** @var OAuthTokenGenerateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var OAuthTokenGenerateRequest */ + return ObjectSerializer::deserialize( $data, OAuthTokenGenerateRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -247,7 +326,6 @@ public function listInvalidProperties() if ($this->container['state'] === null) { $invalidProperties[] = "'state' can't be null"; } - return $invalidProperties; } @@ -281,6 +359,9 @@ public function getClientId() */ public function setClientId(string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -305,6 +386,9 @@ public function getClientSecret() */ public function setClientSecret(string $client_secret) { + if (is_null($client_secret)) { + throw new InvalidArgumentException('non-nullable client_secret cannot be null'); + } $this->container['client_secret'] = $client_secret; return $this; @@ -329,6 +413,9 @@ public function getCode() */ public function setCode(string $code) { + if (is_null($code)) { + throw new InvalidArgumentException('non-nullable code cannot be null'); + } $this->container['code'] = $code; return $this; @@ -353,6 +440,9 @@ public function getGrantType() */ public function setGrantType(string $grant_type) { + if (is_null($grant_type)) { + throw new InvalidArgumentException('non-nullable grant_type cannot be null'); + } $this->container['grant_type'] = $grant_type; return $this; @@ -377,6 +467,9 @@ public function getState() */ public function setState(string $state) { + if (is_null($state)) { + throw new InvalidArgumentException('non-nullable state cannot be null'); + } $this->container['state'] = $state; return $this; @@ -385,12 +478,10 @@ public function setState(string $state) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -398,7 +489,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -411,13 +502,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -429,12 +518,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -443,8 +530,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/OAuthTokenRefreshRequest.php b/sdks/php/src/Model/OAuthTokenRefreshRequest.php index 5bd36eb93..c4c7f93be 100644 --- a/sdks/php/src/Model/OAuthTokenRefreshRequest.php +++ b/sdks/php/src/Model/OAuthTokenRefreshRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * OAuthTokenRefreshRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class OAuthTokenRefreshRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +73,23 @@ class OAuthTokenRefreshRequest implements ModelInterface, ArrayAccess, JsonSeria 'refresh_token' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'grant_type' => false, + 'refresh_token' => 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 * @@ -96,6 +110,50 @@ 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 @@ -171,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['grant_type'] = $data['grant_type'] ?? 'refresh_token'; - $this->container['refresh_token'] = $data['refresh_token'] ?? null; + $this->setIfExists('grant_type', $data ?? [], 'refresh_token'); + $this->setIfExists('refresh_token', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): OAuthTokenRefreshRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): OAuthTokenRefreshRequest { - /** @var OAuthTokenRefreshRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var OAuthTokenRefreshRequest */ + return ObjectSerializer::deserialize( $data, OAuthTokenRefreshRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -220,7 +296,6 @@ public function listInvalidProperties() if ($this->container['refresh_token'] === null) { $invalidProperties[] = "'refresh_token' can't be null"; } - return $invalidProperties; } @@ -254,6 +329,9 @@ public function getGrantType() */ public function setGrantType(string $grant_type) { + if (is_null($grant_type)) { + throw new InvalidArgumentException('non-nullable grant_type cannot be null'); + } $this->container['grant_type'] = $grant_type; return $this; @@ -278,6 +356,9 @@ public function getRefreshToken() */ public function setRefreshToken(string $refresh_token) { + if (is_null($refresh_token)) { + throw new InvalidArgumentException('non-nullable refresh_token cannot be null'); + } $this->container['refresh_token'] = $refresh_token; return $this; @@ -286,12 +367,10 @@ public function setRefreshToken(string $refresh_token) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -299,7 +378,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -312,13 +391,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -330,12 +407,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -344,8 +419,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/OAuthTokenResponse.php b/sdks/php/src/Model/OAuthTokenResponse.php index 791384e4c..8c83de78e 100644 --- a/sdks/php/src/Model/OAuthTokenResponse.php +++ b/sdks/php/src/Model/OAuthTokenResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * OAuthTokenResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class OAuthTokenResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -83,6 +79,26 @@ class OAuthTokenResponse implements ModelInterface, ArrayAccess, JsonSerializabl 'state' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'access_token' => false, + 'token_type' => false, + 'refresh_token' => false, + 'expires_in' => false, + 'state' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -103,6 +119,50 @@ 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 @@ -187,41 +247,59 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['access_token'] = $data['access_token'] ?? null; - $this->container['token_type'] = $data['token_type'] ?? null; - $this->container['refresh_token'] = $data['refresh_token'] ?? null; - $this->container['expires_in'] = $data['expires_in'] ?? null; - $this->container['state'] = $data['state'] ?? null; + $this->setIfExists('access_token', $data ?? [], null); + $this->setIfExists('token_type', $data ?? [], null); + $this->setIfExists('refresh_token', $data ?? [], null); + $this->setIfExists('expires_in', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): OAuthTokenResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): OAuthTokenResponse { - /** @var OAuthTokenResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var OAuthTokenResponse */ + return ObjectSerializer::deserialize( $data, OAuthTokenResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -231,9 +309,7 @@ public static function init(array $data): OAuthTokenResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -266,6 +342,9 @@ public function getAccessToken() */ public function setAccessToken(?string $access_token) { + if (is_null($access_token)) { + throw new InvalidArgumentException('non-nullable access_token cannot be null'); + } $this->container['access_token'] = $access_token; return $this; @@ -290,6 +369,9 @@ public function getTokenType() */ public function setTokenType(?string $token_type) { + if (is_null($token_type)) { + throw new InvalidArgumentException('non-nullable token_type cannot be null'); + } $this->container['token_type'] = $token_type; return $this; @@ -314,6 +396,9 @@ public function getRefreshToken() */ public function setRefreshToken(?string $refresh_token) { + if (is_null($refresh_token)) { + throw new InvalidArgumentException('non-nullable refresh_token cannot be null'); + } $this->container['refresh_token'] = $refresh_token; return $this; @@ -338,6 +423,9 @@ public function getExpiresIn() */ public function setExpiresIn(?int $expires_in) { + if (is_null($expires_in)) { + throw new InvalidArgumentException('non-nullable expires_in cannot be null'); + } $this->container['expires_in'] = $expires_in; return $this; @@ -362,6 +450,16 @@ public function getState() */ public function setState(?string $state) { + if (is_null($state)) { + array_push($this->openAPINullablesSetToNull, 'state'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('state', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['state'] = $state; return $this; @@ -370,12 +468,10 @@ public function setState(?string $state) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -383,7 +479,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -396,13 +492,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,12 +508,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -428,8 +520,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ReportCreateRequest.php b/sdks/php/src/Model/ReportCreateRequest.php index 9d2fbb387..58029634b 100644 --- a/sdks/php/src/Model/ReportCreateRequest.php +++ b/sdks/php/src/Model/ReportCreateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,11 +37,8 @@ * ReportCreateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ReportCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +75,24 @@ class ReportCreateRequest implements ModelInterface, ArrayAccess, JsonSerializab 'start_date' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'end_date' => false, + 'report_type' => false, + 'start_date' => 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 * @@ -99,6 +113,50 @@ 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 @@ -193,39 +251,57 @@ public function getReportTypeAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['end_date'] = $data['end_date'] ?? null; - $this->container['report_type'] = $data['report_type'] ?? null; - $this->container['start_date'] = $data['start_date'] ?? null; + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('report_type', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ReportCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ReportCreateRequest { - /** @var ReportCreateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ReportCreateRequest */ + return ObjectSerializer::deserialize( $data, ReportCreateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -243,18 +319,17 @@ public function listInvalidProperties() if ($this->container['report_type'] === null) { $invalidProperties[] = "'report_type' can't be null"; } - if ((count($this->container['report_type']) > 2)) { + if (count($this->container['report_type']) > 2) { $invalidProperties[] = "invalid value for 'report_type', number of items must be less than or equal to 2."; } - if ((count($this->container['report_type']) < 1)) { + if (count($this->container['report_type']) < 1) { $invalidProperties[] = "invalid value for 'report_type', number of items must be greater than or equal to 1."; } if ($this->container['start_date'] === null) { $invalidProperties[] = "'start_date' can't be null"; } - return $invalidProperties; } @@ -288,6 +363,9 @@ public function getEndDate() */ public function setEndDate(string $end_date) { + if (is_null($end_date)) { + throw new InvalidArgumentException('non-nullable end_date cannot be null'); + } $this->container['end_date'] = $end_date; return $this; @@ -312,6 +390,9 @@ public function getReportType() */ public function setReportType(array $report_type) { + if (is_null($report_type)) { + throw new InvalidArgumentException('non-nullable report_type cannot be null'); + } $allowedValues = $this->getReportTypeAllowableValues(); if (array_diff($report_type, $allowedValues)) { throw new InvalidArgumentException( @@ -322,10 +403,10 @@ public function setReportType(array $report_type) ); } - if ((count($report_type) > 2)) { + if (count($report_type) > 2) { throw new InvalidArgumentException('invalid value for $report_type when calling ReportCreateRequest., number of items must be less than or equal to 2.'); } - if ((count($report_type) < 1)) { + if (count($report_type) < 1) { throw new InvalidArgumentException('invalid length for $report_type when calling ReportCreateRequest., number of items must be greater than or equal to 1.'); } $this->container['report_type'] = $report_type; @@ -352,6 +433,9 @@ public function getStartDate() */ public function setStartDate(string $start_date) { + if (is_null($start_date)) { + throw new InvalidArgumentException('non-nullable start_date cannot be null'); + } $this->container['start_date'] = $start_date; return $this; @@ -360,12 +444,10 @@ public function setStartDate(string $start_date) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -373,7 +455,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -386,13 +468,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -404,12 +484,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -418,8 +496,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ReportCreateResponse.php b/sdks/php/src/Model/ReportCreateResponse.php index 73f63b485..415406e3c 100644 --- a/sdks/php/src/Model/ReportCreateResponse.php +++ b/sdks/php/src/Model/ReportCreateResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * ReportCreateResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class ReportCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class ReportCreateResponse implements ModelInterface, ArrayAccess, JsonSerializa 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'report' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['report'] = $data['report'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('report', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ReportCreateResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ReportCreateResponse { - /** @var ReportCreateResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ReportCreateResponse */ + return ObjectSerializer::deserialize( $data, ReportCreateResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['report'] === null) { + $invalidProperties[] = "'report' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets report * - * @return ReportResponse|null + * @return ReportResponse */ public function getReport() { @@ -242,12 +320,15 @@ public function getReport() /** * Sets report * - * @param ReportResponse|null $report report + * @param ReportResponse $report report * * @return self */ - public function setReport(?ReportResponse $report) + public function setReport(ReportResponse $report) { + if (is_null($report)) { + throw new InvalidArgumentException('non-nullable report cannot be null'); + } $this->container['report'] = $report; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/ReportResponse.php b/sdks/php/src/Model/ReportResponse.php index 018938b1d..c2d024ca1 100644 --- a/sdks/php/src/Model/ReportResponse.php +++ b/sdks/php/src/Model/ReportResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,12 +38,8 @@ * * @category Class * @description Contains information about the report request. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class ReportResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -83,6 +78,25 @@ class ReportResponse implements ModelInterface, ArrayAccess, JsonSerializable 'report_type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'success' => false, + 'start_date' => false, + 'end_date' => false, + 'report_type' => 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 * @@ -103,6 +117,50 @@ 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 @@ -200,40 +258,58 @@ public function getReportTypeAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['success'] = $data['success'] ?? null; - $this->container['start_date'] = $data['start_date'] ?? null; - $this->container['end_date'] = $data['end_date'] ?? null; - $this->container['report_type'] = $data['report_type'] ?? null; + $this->setIfExists('success', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('report_type', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): ReportResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): ReportResponse { - /** @var ReportResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var ReportResponse */ + return ObjectSerializer::deserialize( $data, ReportResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -243,9 +319,7 @@ public static function init(array $data): ReportResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -278,6 +352,9 @@ public function getSuccess() */ public function setSuccess(?string $success) { + if (is_null($success)) { + throw new InvalidArgumentException('non-nullable success cannot be null'); + } $this->container['success'] = $success; return $this; @@ -302,6 +379,9 @@ public function getStartDate() */ public function setStartDate(?string $start_date) { + if (is_null($start_date)) { + throw new InvalidArgumentException('non-nullable start_date cannot be null'); + } $this->container['start_date'] = $start_date; return $this; @@ -326,6 +406,9 @@ public function getEndDate() */ public function setEndDate(?string $end_date) { + if (is_null($end_date)) { + throw new InvalidArgumentException('non-nullable end_date cannot be null'); + } $this->container['end_date'] = $end_date; return $this; @@ -350,8 +433,11 @@ public function getReportType() */ public function setReportType(?array $report_type) { + if (is_null($report_type)) { + throw new InvalidArgumentException('non-nullable report_type cannot be null'); + } $allowedValues = $this->getReportTypeAllowableValues(); - if (!is_null($report_type) && array_diff($report_type, $allowedValues)) { + if (array_diff($report_type, $allowedValues)) { throw new InvalidArgumentException( sprintf( "Invalid value for 'report_type', must be one of '%s'", @@ -367,12 +453,10 @@ public function setReportType(?array $report_type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -380,7 +464,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -393,13 +477,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -411,12 +493,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -425,8 +505,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php index 3be6909ed..9c5947fec 100644 --- a/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * SignatureRequestBulkCreateEmbeddedWithTemplateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -100,6 +96,34 @@ class SignatureRequestBulkCreateEmbeddedWithTemplateRequest implements ModelInte 'title' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_ids' => false, + 'client_id' => false, + 'signer_file' => false, + 'signer_list' => false, + 'allow_decline' => false, + 'ccs' => false, + 'custom_fields' => false, + 'message' => false, + 'metadata' => false, + 'signing_redirect_url' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -120,6 +144,50 @@ 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 @@ -228,49 +296,67 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template_ids'] = $data['template_ids'] ?? null; - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['signer_file'] = $data['signer_file'] ?? null; - $this->container['signer_list'] = $data['signer_list'] ?? null; - $this->container['allow_decline'] = $data['allow_decline'] ?? false; - $this->container['ccs'] = $data['ccs'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['title'] = $data['title'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('template_ids', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('signer_file', $data ?? [], null); + $this->setIfExists('signer_list', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('ccs', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestBulkCreateEmbeddedWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestBulkCreateEmbeddedWithTemplateRequest { - /** @var SignatureRequestBulkCreateEmbeddedWithTemplateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestBulkCreateEmbeddedWithTemplateRequest */ + return ObjectSerializer::deserialize( $data, SignatureRequestBulkCreateEmbeddedWithTemplateRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -333,6 +419,9 @@ public function getTemplateIds() */ public function setTemplateIds(array $template_ids) { + if (is_null($template_ids)) { + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + } $this->container['template_ids'] = $template_ids; return $this; @@ -357,6 +446,9 @@ public function getClientId() */ public function setClientId(string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -381,6 +473,9 @@ public function getSignerFile() */ public function setSignerFile(?SplFileObject $signer_file) { + if (is_null($signer_file)) { + throw new InvalidArgumentException('non-nullable signer_file cannot be null'); + } $this->container['signer_file'] = $signer_file; return $this; @@ -405,6 +500,9 @@ public function getSignerList() */ public function setSignerList(?array $signer_list) { + if (is_null($signer_list)) { + throw new InvalidArgumentException('non-nullable signer_list cannot be null'); + } $this->container['signer_list'] = $signer_list; return $this; @@ -429,6 +527,9 @@ public function getAllowDecline() */ public function setAllowDecline(?bool $allow_decline) { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } $this->container['allow_decline'] = $allow_decline; return $this; @@ -453,6 +554,9 @@ public function getCcs() */ public function setCcs(?array $ccs) { + if (is_null($ccs)) { + throw new InvalidArgumentException('non-nullable ccs cannot be null'); + } $this->container['ccs'] = $ccs; return $this; @@ -477,6 +581,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -501,7 +608,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } @@ -529,6 +639,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -553,6 +667,9 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -577,7 +694,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 255)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } @@ -605,6 +725,9 @@ public function getTestMode() */ 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; @@ -629,7 +752,10 @@ public function getTitle() */ public function setTitle(?string $title) { - if (!is_null($title) && (mb_strlen($title) > 255)) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestBulkCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } @@ -641,12 +767,10 @@ public function setTitle(?string $title) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -654,7 +778,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -667,13 +791,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -685,12 +807,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -699,8 +819,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php index b90dbac52..26092eb3f 100644 --- a/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestBulkSendWithTemplateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * SignatureRequestBulkSendWithTemplateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -100,6 +96,34 @@ class SignatureRequestBulkSendWithTemplateRequest implements ModelInterface, Arr 'title' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_ids' => false, + 'signer_file' => false, + 'signer_list' => false, + 'allow_decline' => false, + 'ccs' => false, + 'client_id' => false, + 'custom_fields' => false, + 'message' => false, + 'metadata' => false, + 'signing_redirect_url' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -120,6 +144,50 @@ 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 @@ -228,49 +296,67 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template_ids'] = $data['template_ids'] ?? null; - $this->container['signer_file'] = $data['signer_file'] ?? null; - $this->container['signer_list'] = $data['signer_list'] ?? null; - $this->container['allow_decline'] = $data['allow_decline'] ?? false; - $this->container['ccs'] = $data['ccs'] ?? null; - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['title'] = $data['title'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('template_ids', $data ?? [], null); + $this->setIfExists('signer_file', $data ?? [], null); + $this->setIfExists('signer_list', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('ccs', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestBulkSendWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestBulkSendWithTemplateRequest { - /** @var SignatureRequestBulkSendWithTemplateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestBulkSendWithTemplateRequest */ + return ObjectSerializer::deserialize( $data, SignatureRequestBulkSendWithTemplateRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -330,6 +416,9 @@ public function getTemplateIds() */ public function setTemplateIds(array $template_ids) { + if (is_null($template_ids)) { + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + } $this->container['template_ids'] = $template_ids; return $this; @@ -354,6 +443,9 @@ public function getSignerFile() */ public function setSignerFile(?SplFileObject $signer_file) { + if (is_null($signer_file)) { + throw new InvalidArgumentException('non-nullable signer_file cannot be null'); + } $this->container['signer_file'] = $signer_file; return $this; @@ -378,6 +470,9 @@ public function getSignerList() */ public function setSignerList(?array $signer_list) { + if (is_null($signer_list)) { + throw new InvalidArgumentException('non-nullable signer_list cannot be null'); + } $this->container['signer_list'] = $signer_list; return $this; @@ -402,6 +497,9 @@ public function getAllowDecline() */ public function setAllowDecline(?bool $allow_decline) { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } $this->container['allow_decline'] = $allow_decline; return $this; @@ -426,6 +524,9 @@ public function getCcs() */ public function setCcs(?array $ccs) { + if (is_null($ccs)) { + throw new InvalidArgumentException('non-nullable ccs cannot be null'); + } $this->container['ccs'] = $ccs; return $this; @@ -450,6 +551,9 @@ public function getClientId() */ public function setClientId(?string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -474,6 +578,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -498,7 +605,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 5000.'); } @@ -526,6 +636,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -550,6 +664,9 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -574,7 +691,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 255)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 255.'); } @@ -602,6 +722,9 @@ public function getTestMode() */ 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; @@ -626,7 +749,10 @@ public function getTitle() */ public function setTitle(?string $title) { - if (!is_null($title) && (mb_strlen($title) > 255)) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestBulkSendWithTemplateRequest., must be smaller than or equal to 255.'); } @@ -638,12 +764,10 @@ public function setTitle(?string $title) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -651,7 +775,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -664,13 +788,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -682,12 +804,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -696,8 +816,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php b/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php index 0f7456177..7d14b823c 100644 --- a/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php +++ b/sdks/php/src/Model/SignatureRequestCreateEmbeddedRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * SignatureRequestCreateEmbeddedRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -122,6 +118,45 @@ class SignatureRequestCreateEmbeddedRequest implements ModelInterface, ArrayAcce 'expires_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'client_id' => false, + 'files' => false, + 'file_urls' => false, + 'signers' => false, + 'grouped_signers' => false, + 'allow_decline' => false, + 'allow_reassign' => false, + 'attachments' => false, + 'cc_email_addresses' => false, + 'custom_fields' => false, + 'field_options' => false, + 'form_field_groups' => false, + 'form_field_rules' => false, + 'form_fields_per_document' => false, + 'hide_text_tags' => false, + 'message' => false, + 'metadata' => false, + 'signing_options' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + 'use_text_tags' => false, + 'populate_auto_fill_fields' => false, + 'expires_at' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -142,6 +177,50 @@ 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 @@ -283,60 +362,78 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['files'] = $data['files'] ?? null; - $this->container['file_urls'] = $data['file_urls'] ?? null; - $this->container['signers'] = $data['signers'] ?? null; - $this->container['grouped_signers'] = $data['grouped_signers'] ?? null; - $this->container['allow_decline'] = $data['allow_decline'] ?? false; - $this->container['allow_reassign'] = $data['allow_reassign'] ?? false; - $this->container['attachments'] = $data['attachments'] ?? null; - $this->container['cc_email_addresses'] = $data['cc_email_addresses'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['field_options'] = $data['field_options'] ?? null; - $this->container['form_field_groups'] = $data['form_field_groups'] ?? null; - $this->container['form_field_rules'] = $data['form_field_rules'] ?? null; - $this->container['form_fields_per_document'] = $data['form_fields_per_document'] ?? null; - $this->container['hide_text_tags'] = $data['hide_text_tags'] ?? false; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['signing_options'] = $data['signing_options'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['title'] = $data['title'] ?? null; - $this->container['use_text_tags'] = $data['use_text_tags'] ?? false; - $this->container['populate_auto_fill_fields'] = $data['populate_auto_fill_fields'] ?? false; - $this->container['expires_at'] = $data['expires_at'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('grouped_signers', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('allow_reassign', $data ?? [], false); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('cc_email_addresses', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('field_options', $data ?? [], null); + $this->setIfExists('form_field_groups', $data ?? [], null); + $this->setIfExists('form_field_rules', $data ?? [], null); + $this->setIfExists('form_fields_per_document', $data ?? [], null); + $this->setIfExists('hide_text_tags', $data ?? [], false); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('use_text_tags', $data ?? [], false); + $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); + $this->setIfExists('expires_at', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestCreateEmbeddedRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestCreateEmbeddedRequest { - /** @var SignatureRequestCreateEmbeddedRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestCreateEmbeddedRequest */ + return ObjectSerializer::deserialize( $data, SignatureRequestCreateEmbeddedRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -396,6 +493,9 @@ public function getClientId() */ public function setClientId(string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -420,6 +520,9 @@ public function getFiles() */ public function setFiles(?array $files) { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } $this->container['files'] = $files; return $this; @@ -444,6 +547,9 @@ public function getFileUrls() */ 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; @@ -468,6 +574,9 @@ public function getSigners() */ public function setSigners(?array $signers) { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } $this->container['signers'] = $signers; return $this; @@ -492,6 +601,9 @@ public function getGroupedSigners() */ public function setGroupedSigners(?array $grouped_signers) { + if (is_null($grouped_signers)) { + throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); + } $this->container['grouped_signers'] = $grouped_signers; return $this; @@ -516,6 +628,9 @@ public function getAllowDecline() */ public function setAllowDecline(?bool $allow_decline) { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } $this->container['allow_decline'] = $allow_decline; return $this; @@ -540,6 +655,9 @@ public function getAllowReassign() */ public function setAllowReassign(?bool $allow_reassign) { + if (is_null($allow_reassign)) { + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + } $this->container['allow_reassign'] = $allow_reassign; return $this; @@ -564,6 +682,9 @@ public function getAttachments() */ public function setAttachments(?array $attachments) { + if (is_null($attachments)) { + throw new InvalidArgumentException('non-nullable attachments cannot be null'); + } $this->container['attachments'] = $attachments; return $this; @@ -588,6 +709,9 @@ public function getCcEmailAddresses() */ public function setCcEmailAddresses(?array $cc_email_addresses) { + if (is_null($cc_email_addresses)) { + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + } $this->container['cc_email_addresses'] = $cc_email_addresses; return $this; @@ -612,6 +736,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -636,6 +763,9 @@ public function getFieldOptions() */ public function setFieldOptions(?SubFieldOptions $field_options) { + if (is_null($field_options)) { + throw new InvalidArgumentException('non-nullable field_options cannot be null'); + } $this->container['field_options'] = $field_options; return $this; @@ -660,6 +790,9 @@ public function getFormFieldGroups() */ public function setFormFieldGroups(?array $form_field_groups) { + if (is_null($form_field_groups)) { + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + } $this->container['form_field_groups'] = $form_field_groups; return $this; @@ -684,6 +817,9 @@ public function getFormFieldRules() */ public function setFormFieldRules(?array $form_field_rules) { + if (is_null($form_field_rules)) { + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + } $this->container['form_field_rules'] = $form_field_rules; return $this; @@ -708,6 +844,9 @@ public function getFormFieldsPerDocument() */ public function setFormFieldsPerDocument(?array $form_fields_per_document) { + if (is_null($form_fields_per_document)) { + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + } $this->container['form_fields_per_document'] = $form_fields_per_document; return $this; @@ -732,6 +871,9 @@ public function getHideTextTags() */ public function setHideTextTags(?bool $hide_text_tags) { + if (is_null($hide_text_tags)) { + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + } $this->container['hide_text_tags'] = $hide_text_tags; return $this; @@ -756,7 +898,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 5000.'); } @@ -784,6 +929,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -808,6 +957,9 @@ public function getSigningOptions() */ public function setSigningOptions(?SubSigningOptions $signing_options) { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } $this->container['signing_options'] = $signing_options; return $this; @@ -832,7 +984,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 255)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 255.'); } @@ -860,6 +1015,9 @@ public function getTestMode() */ 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; @@ -884,7 +1042,10 @@ public function getTitle() */ public function setTitle(?string $title) { - if (!is_null($title) && (mb_strlen($title) > 255)) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestCreateEmbeddedRequest., must be smaller than or equal to 255.'); } @@ -912,6 +1073,9 @@ public function getUseTextTags() */ public function setUseTextTags(?bool $use_text_tags) { + if (is_null($use_text_tags)) { + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + } $this->container['use_text_tags'] = $use_text_tags; return $this; @@ -936,6 +1100,9 @@ public function getPopulateAutoFillFields() */ public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) { + if (is_null($populate_auto_fill_fields)) { + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; return $this; @@ -960,6 +1127,16 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['expires_at'] = $expires_at; return $this; @@ -968,12 +1145,10 @@ public function setExpiresAt(?int $expires_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -981,7 +1156,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -994,13 +1169,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1012,12 +1185,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1026,8 +1197,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php index 5a9d50c4c..b98f7b8b7 100644 --- a/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * SignatureRequestCreateEmbeddedWithTemplateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -104,6 +100,36 @@ class SignatureRequestCreateEmbeddedWithTemplateRequest implements ModelInterfac 'populate_auto_fill_fields' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_ids' => false, + 'client_id' => false, + 'signers' => false, + 'allow_decline' => false, + 'ccs' => false, + 'custom_fields' => false, + 'files' => false, + 'file_urls' => false, + 'message' => false, + 'metadata' => false, + 'signing_options' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + 'populate_auto_fill_fields' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -124,6 +150,50 @@ 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 @@ -238,51 +308,69 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template_ids'] = $data['template_ids'] ?? null; - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['signers'] = $data['signers'] ?? null; - $this->container['allow_decline'] = $data['allow_decline'] ?? false; - $this->container['ccs'] = $data['ccs'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['files'] = $data['files'] ?? null; - $this->container['file_urls'] = $data['file_urls'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['signing_options'] = $data['signing_options'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['title'] = $data['title'] ?? null; - $this->container['populate_auto_fill_fields'] = $data['populate_auto_fill_fields'] ?? false; - } - - /** @deprecated use ::init() */ + $this->setIfExists('template_ids', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('ccs', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestCreateEmbeddedWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestCreateEmbeddedWithTemplateRequest { - /** @var SignatureRequestCreateEmbeddedWithTemplateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestCreateEmbeddedWithTemplateRequest */ + return ObjectSerializer::deserialize( $data, SignatureRequestCreateEmbeddedWithTemplateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -348,6 +436,9 @@ public function getTemplateIds() */ public function setTemplateIds(array $template_ids) { + if (is_null($template_ids)) { + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + } $this->container['template_ids'] = $template_ids; return $this; @@ -372,6 +463,9 @@ public function getClientId() */ public function setClientId(string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -396,6 +490,9 @@ public function getSigners() */ public function setSigners(array $signers) { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } $this->container['signers'] = $signers; return $this; @@ -420,6 +517,9 @@ public function getAllowDecline() */ public function setAllowDecline(?bool $allow_decline) { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } $this->container['allow_decline'] = $allow_decline; return $this; @@ -444,6 +544,9 @@ public function getCcs() */ public function setCcs(?array $ccs) { + if (is_null($ccs)) { + throw new InvalidArgumentException('non-nullable ccs cannot be null'); + } $this->container['ccs'] = $ccs; return $this; @@ -468,6 +571,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -492,6 +598,9 @@ public function getFiles() */ public function setFiles(?array $files) { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } $this->container['files'] = $files; return $this; @@ -516,6 +625,9 @@ public function getFileUrls() */ 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; @@ -540,7 +652,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } @@ -568,6 +683,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -592,6 +711,9 @@ public function getSigningOptions() */ public function setSigningOptions(?SubSigningOptions $signing_options) { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } $this->container['signing_options'] = $signing_options; return $this; @@ -616,7 +738,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 255)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } @@ -644,6 +769,9 @@ public function getTestMode() */ 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; @@ -668,7 +796,10 @@ public function getTitle() */ public function setTitle(?string $title) { - if (!is_null($title) && (mb_strlen($title) > 255)) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } @@ -696,6 +827,9 @@ public function getPopulateAutoFillFields() */ public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) { + if (is_null($populate_auto_fill_fields)) { + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; return $this; @@ -704,12 +838,10 @@ public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -717,7 +849,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -730,13 +862,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -748,12 +878,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -762,8 +890,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestGetResponse.php b/sdks/php/src/Model/SignatureRequestGetResponse.php index 607e3b2bb..97f5f7c9f 100644 --- a/sdks/php/src/Model/SignatureRequestGetResponse.php +++ b/sdks/php/src/Model/SignatureRequestGetResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * SignatureRequestGetResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class SignatureRequestGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class SignatureRequestGetResponse implements ModelInterface, ArrayAccess, JsonSe 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'signature_request' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['signature_request'] = $data['signature_request'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('signature_request', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestGetResponse { - /** @var SignatureRequestGetResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestGetResponse */ + return ObjectSerializer::deserialize( $data, SignatureRequestGetResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['signature_request'] === null) { + $invalidProperties[] = "'signature_request' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets signature_request * - * @return SignatureRequestResponse|null + * @return SignatureRequestResponse */ public function getSignatureRequest() { @@ -242,12 +320,15 @@ public function getSignatureRequest() /** * Sets signature_request * - * @param SignatureRequestResponse|null $signature_request signature_request + * @param SignatureRequestResponse $signature_request signature_request * * @return self */ - public function setSignatureRequest(?SignatureRequestResponse $signature_request) + public function setSignatureRequest(SignatureRequestResponse $signature_request) { + if (is_null($signature_request)) { + throw new InvalidArgumentException('non-nullable signature_request cannot be null'); + } $this->container['signature_request'] = $signature_request; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestListResponse.php b/sdks/php/src/Model/SignatureRequestListResponse.php index 0152544e9..659908071 100644 --- a/sdks/php/src/Model/SignatureRequestListResponse.php +++ b/sdks/php/src/Model/SignatureRequestListResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * SignatureRequestListResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class SignatureRequestListResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +75,24 @@ class SignatureRequestListResponse implements ModelInterface, ArrayAccess, JsonS 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'signature_requests' => false, + 'list_info' => 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 * @@ -99,6 +113,50 @@ 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 @@ -177,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['signature_requests'] = $data['signature_requests'] ?? null; - $this->container['list_info'] = $data['list_info'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('signature_requests', $data ?? [], null); + $this->setIfExists('list_info', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestListResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestListResponse { - /** @var SignatureRequestListResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestListResponse */ + return ObjectSerializer::deserialize( $data, SignatureRequestListResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -221,6 +297,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['signature_requests'] === null) { + $invalidProperties[] = "'signature_requests' can't be null"; + } + if ($this->container['list_info'] === null) { + $invalidProperties[] = "'list_info' can't be null"; + } return $invalidProperties; } @@ -238,7 +320,7 @@ public function valid() /** * Gets signature_requests * - * @return SignatureRequestResponse[]|null + * @return SignatureRequestResponse[] */ public function getSignatureRequests() { @@ -248,12 +330,15 @@ public function getSignatureRequests() /** * Sets signature_requests * - * @param SignatureRequestResponse[]|null $signature_requests contains information about signature requests + * @param SignatureRequestResponse[] $signature_requests contains information about signature requests * * @return self */ - public function setSignatureRequests(?array $signature_requests) + public function setSignatureRequests(array $signature_requests) { + if (is_null($signature_requests)) { + throw new InvalidArgumentException('non-nullable signature_requests cannot be null'); + } $this->container['signature_requests'] = $signature_requests; return $this; @@ -262,7 +347,7 @@ public function setSignatureRequests(?array $signature_requests) /** * Gets list_info * - * @return ListInfoResponse|null + * @return ListInfoResponse */ public function getListInfo() { @@ -272,12 +357,15 @@ public function getListInfo() /** * Sets list_info * - * @param ListInfoResponse|null $list_info list_info + * @param ListInfoResponse $list_info list_info * * @return self */ - public function setListInfo(?ListInfoResponse $list_info) + 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; @@ -302,6 +390,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -310,12 +401,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,7 +412,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -336,13 +425,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -354,12 +441,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -368,8 +453,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestRemindRequest.php b/sdks/php/src/Model/SignatureRequestRemindRequest.php index 3ebd94f21..5662351ef 100644 --- a/sdks/php/src/Model/SignatureRequestRemindRequest.php +++ b/sdks/php/src/Model/SignatureRequestRemindRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SignatureRequestRemindRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestRemindRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +73,23 @@ class SignatureRequestRemindRequest implements ModelInterface, ArrayAccess, Json 'name' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'email_address' => false, + 'name' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +110,50 @@ 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 @@ -171,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['name'] = $data['name'] ?? null; + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestRemindRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestRemindRequest { - /** @var SignatureRequestRemindRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestRemindRequest */ + return ObjectSerializer::deserialize( $data, SignatureRequestRemindRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -217,7 +293,6 @@ public function listInvalidProperties() if ($this->container['email_address'] === null) { $invalidProperties[] = "'email_address' can't be null"; } - return $invalidProperties; } @@ -251,6 +326,9 @@ public function getEmailAddress() */ public function setEmailAddress(string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -275,6 +353,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -283,12 +364,10 @@ public function setName(?string $name) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -296,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -309,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -327,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -341,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponse.php b/sdks/php/src/Model/SignatureRequestResponse.php index 9a49a3cc3..14386d427 100644 --- a/sdks/php/src/Model/SignatureRequestResponse.php +++ b/sdks/php/src/Model/SignatureRequestResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Contains information about a signature request. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class SignatureRequestResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -124,6 +120,46 @@ class SignatureRequestResponse implements ModelInterface, ArrayAccess, JsonSeria 'bulk_send_job_id' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'test_mode' => true, + 'signature_request_id' => false, + 'requester_email_address' => false, + 'title' => false, + 'original_title' => false, + 'subject' => true, + 'message' => true, + 'metadata' => false, + 'created_at' => false, + 'expires_at' => false, + 'is_complete' => false, + 'is_declined' => false, + 'has_error' => false, + 'files_url' => false, + 'signing_url' => true, + 'details_url' => false, + 'cc_email_addresses' => false, + 'signing_redirect_url' => true, + 'final_copy_uri' => true, + 'template_ids' => true, + 'custom_fields' => true, + 'attachments' => true, + 'response_data' => true, + 'signatures' => false, + 'bulk_send_job_id' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -144,6 +180,50 @@ 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 @@ -288,61 +368,79 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['signature_request_id'] = $data['signature_request_id'] ?? null; - $this->container['requester_email_address'] = $data['requester_email_address'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['original_title'] = $data['original_title'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['expires_at'] = $data['expires_at'] ?? null; - $this->container['is_complete'] = $data['is_complete'] ?? null; - $this->container['is_declined'] = $data['is_declined'] ?? null; - $this->container['has_error'] = $data['has_error'] ?? null; - $this->container['files_url'] = $data['files_url'] ?? null; - $this->container['signing_url'] = $data['signing_url'] ?? null; - $this->container['details_url'] = $data['details_url'] ?? null; - $this->container['cc_email_addresses'] = $data['cc_email_addresses'] ?? null; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['final_copy_uri'] = $data['final_copy_uri'] ?? null; - $this->container['template_ids'] = $data['template_ids'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['attachments'] = $data['attachments'] ?? null; - $this->container['response_data'] = $data['response_data'] ?? null; - $this->container['signatures'] = $data['signatures'] ?? null; - $this->container['bulk_send_job_id'] = $data['bulk_send_job_id'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('signature_request_id', $data ?? [], null); + $this->setIfExists('requester_email_address', $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('expires_at', $data ?? [], null); + $this->setIfExists('is_complete', $data ?? [], null); + $this->setIfExists('is_declined', $data ?? [], null); + $this->setIfExists('has_error', $data ?? [], null); + $this->setIfExists('files_url', $data ?? [], null); + $this->setIfExists('signing_url', $data ?? [], null); + $this->setIfExists('details_url', $data ?? [], null); + $this->setIfExists('cc_email_addresses', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('final_copy_uri', $data ?? [], null); + $this->setIfExists('template_ids', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('response_data', $data ?? [], null); + $this->setIfExists('signatures', $data ?? [], null); + $this->setIfExists('bulk_send_job_id', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponse { - /** @var SignatureRequestResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponse */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -352,9 +450,7 @@ public static function init(array $data): SignatureRequestResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -387,6 +483,16 @@ public function getTestMode() */ public function setTestMode(?bool $test_mode) { + if (is_null($test_mode)) { + array_push($this->openAPINullablesSetToNull, 'test_mode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('test_mode', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['test_mode'] = $test_mode; return $this; @@ -411,6 +517,9 @@ public function getSignatureRequestId() */ public function setSignatureRequestId(?string $signature_request_id) { + if (is_null($signature_request_id)) { + throw new InvalidArgumentException('non-nullable signature_request_id cannot be null'); + } $this->container['signature_request_id'] = $signature_request_id; return $this; @@ -435,6 +544,9 @@ public function getRequesterEmailAddress() */ public function setRequesterEmailAddress(?string $requester_email_address) { + if (is_null($requester_email_address)) { + throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); + } $this->container['requester_email_address'] = $requester_email_address; return $this; @@ -459,6 +571,9 @@ public function getTitle() */ public function setTitle(?string $title) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } $this->container['title'] = $title; return $this; @@ -483,6 +598,9 @@ public function getOriginalTitle() */ 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; @@ -507,6 +625,16 @@ public function getSubject() */ public function setSubject(?string $subject) { + if (is_null($subject)) { + array_push($this->openAPINullablesSetToNull, 'subject'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subject', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['subject'] = $subject; return $this; @@ -531,6 +659,16 @@ public function getMessage() */ public function setMessage(?string $message) { + if (is_null($message)) { + array_push($this->openAPINullablesSetToNull, 'message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('message', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['message'] = $message; return $this; @@ -555,6 +693,9 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } $this->container['metadata'] = $metadata; return $this; @@ -579,6 +720,9 @@ public function getCreatedAt() */ 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; @@ -603,6 +747,9 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + } $this->container['expires_at'] = $expires_at; return $this; @@ -627,6 +774,9 @@ public function getIsComplete() */ public function setIsComplete(?bool $is_complete) { + if (is_null($is_complete)) { + throw new InvalidArgumentException('non-nullable is_complete cannot be null'); + } $this->container['is_complete'] = $is_complete; return $this; @@ -651,6 +801,9 @@ public function getIsDeclined() */ public function setIsDeclined(?bool $is_declined) { + if (is_null($is_declined)) { + throw new InvalidArgumentException('non-nullable is_declined cannot be null'); + } $this->container['is_declined'] = $is_declined; return $this; @@ -675,6 +828,9 @@ public function getHasError() */ public function setHasError(?bool $has_error) { + if (is_null($has_error)) { + throw new InvalidArgumentException('non-nullable has_error cannot be null'); + } $this->container['has_error'] = $has_error; return $this; @@ -699,6 +855,9 @@ public function getFilesUrl() */ 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; @@ -723,6 +882,16 @@ public function getSigningUrl() */ public function setSigningUrl(?string $signing_url) { + if (is_null($signing_url)) { + array_push($this->openAPINullablesSetToNull, 'signing_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signing_url', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signing_url'] = $signing_url; return $this; @@ -747,6 +916,9 @@ public function getDetailsUrl() */ public function setDetailsUrl(?string $details_url) { + if (is_null($details_url)) { + throw new InvalidArgumentException('non-nullable details_url cannot be null'); + } $this->container['details_url'] = $details_url; return $this; @@ -771,6 +943,9 @@ public function getCcEmailAddresses() */ public function setCcEmailAddresses(?array $cc_email_addresses) { + if (is_null($cc_email_addresses)) { + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + } $this->container['cc_email_addresses'] = $cc_email_addresses; return $this; @@ -795,6 +970,16 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + array_push($this->openAPINullablesSetToNull, 'signing_redirect_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signing_redirect_url', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -819,6 +1004,16 @@ public function getFinalCopyUri() */ public function setFinalCopyUri(?string $final_copy_uri) { + if (is_null($final_copy_uri)) { + array_push($this->openAPINullablesSetToNull, 'final_copy_uri'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('final_copy_uri', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['final_copy_uri'] = $final_copy_uri; return $this; @@ -843,6 +1038,16 @@ public function getTemplateIds() */ public function setTemplateIds(?array $template_ids) { + if (is_null($template_ids)) { + array_push($this->openAPINullablesSetToNull, 'template_ids'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('template_ids', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['template_ids'] = $template_ids; return $this; @@ -867,6 +1072,16 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + array_push($this->openAPINullablesSetToNull, 'custom_fields'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_fields', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -891,6 +1106,16 @@ public function getAttachments() */ public function setAttachments(?array $attachments) { + if (is_null($attachments)) { + array_push($this->openAPINullablesSetToNull, 'attachments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('attachments', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['attachments'] = $attachments; return $this; @@ -915,6 +1140,16 @@ public function getResponseData() */ public function setResponseData(?array $response_data) { + if (is_null($response_data)) { + array_push($this->openAPINullablesSetToNull, 'response_data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('response_data', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['response_data'] = $response_data; return $this; @@ -939,6 +1174,9 @@ public function getSignatures() */ public function setSignatures(?array $signatures) { + if (is_null($signatures)) { + throw new InvalidArgumentException('non-nullable signatures cannot be null'); + } $this->container['signatures'] = $signatures; return $this; @@ -963,6 +1201,16 @@ public function getBulkSendJobId() */ public function setBulkSendJobId(?string $bulk_send_job_id) { + if (is_null($bulk_send_job_id)) { + array_push($this->openAPINullablesSetToNull, 'bulk_send_job_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('bulk_send_job_id', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['bulk_send_job_id'] = $bulk_send_job_id; return $this; @@ -971,12 +1219,10 @@ public function setBulkSendJobId(?string $bulk_send_job_id) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -984,7 +1230,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -997,13 +1243,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1015,12 +1259,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1029,8 +1271,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseAttachment.php b/sdks/php/src/Model/SignatureRequestResponseAttachment.php index c8d34976d..245930a52 100644 --- a/sdks/php/src/Model/SignatureRequestResponseAttachment.php +++ b/sdks/php/src/Model/SignatureRequestResponseAttachment.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Signer attachments. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class SignatureRequestResponseAttachment implements ModelInterface, ArrayAccess, JsonSerializable { @@ -86,6 +82,27 @@ class SignatureRequestResponseAttachment implements ModelInterface, ArrayAccess, 'uploaded_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'signer' => false, + 'name' => false, + 'required' => false, + 'instructions' => true, + 'uploaded_at' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +123,50 @@ 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 @@ -193,42 +254,60 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['signer'] = $data['signer'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['required'] = $data['required'] ?? null; - $this->container['instructions'] = $data['instructions'] ?? null; - $this->container['uploaded_at'] = $data['uploaded_at'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('signer', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('required', $data ?? [], null); + $this->setIfExists('instructions', $data ?? [], null); + $this->setIfExists('uploaded_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseAttachment { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseAttachment { - /** @var SignatureRequestResponseAttachment $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseAttachment */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseAttachment::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -252,7 +331,6 @@ public function listInvalidProperties() if ($this->container['required'] === null) { $invalidProperties[] = "'required' can't be null"; } - return $invalidProperties; } @@ -286,6 +364,9 @@ public function getId() */ public function setId(string $id) { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -310,6 +391,9 @@ public function getSigner() */ public function setSigner(string $signer) { + if (is_null($signer)) { + throw new InvalidArgumentException('non-nullable signer cannot be null'); + } $this->container['signer'] = $signer; return $this; @@ -334,6 +418,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -358,6 +445,9 @@ public function getRequired() */ public function setRequired(bool $required) { + if (is_null($required)) { + throw new InvalidArgumentException('non-nullable required cannot be null'); + } $this->container['required'] = $required; return $this; @@ -382,6 +472,16 @@ public function getInstructions() */ public function setInstructions(?string $instructions) { + if (is_null($instructions)) { + array_push($this->openAPINullablesSetToNull, 'instructions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('instructions', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['instructions'] = $instructions; return $this; @@ -406,6 +506,16 @@ public function getUploadedAt() */ public function setUploadedAt(?int $uploaded_at) { + if (is_null($uploaded_at)) { + array_push($this->openAPINullablesSetToNull, 'uploaded_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('uploaded_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['uploaded_at'] = $uploaded_at; return $this; @@ -414,12 +524,10 @@ public function setUploadedAt(?int $uploaded_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -427,7 +535,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -440,13 +548,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -458,12 +564,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -472,8 +576,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php index d54d31050..7c1d3a815 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldBase.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,14 +38,10 @@ * * @category Class * @description An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ -abstract class SignatureRequestResponseCustomFieldBase implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestResponseCustomFieldBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; @@ -84,6 +80,26 @@ abstract class SignatureRequestResponseCustomFieldBase implements ModelInterface 'editor' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'name' => false, + 'required' => false, + 'api_id' => false, + 'editor' => 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 * @@ -104,6 +120,50 @@ 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 @@ -188,23 +248,23 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['type'] = $data['type'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['required'] = $data['required'] ?? null; - $this->container['api_id'] = $data['api_id'] ?? null; - $this->container['editor'] = $data['editor'] ?? null; + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('required', $data ?? [], null); + $this->setIfExists('api_id', $data ?? [], null); + $this->setIfExists('editor', $data ?? [], null); // Initialize discriminator property with the model name. $this->container['type'] = static::$openAPIModelName; @@ -226,6 +286,22 @@ public static function discriminatorClassName(array $data): ?string return null; } + /** + * 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. * @@ -241,7 +317,6 @@ public function listInvalidProperties() if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } - return $invalidProperties; } @@ -275,6 +350,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -299,6 +377,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -323,6 +404,9 @@ public function getRequired() */ public function setRequired(?bool $required) { + if (is_null($required)) { + throw new InvalidArgumentException('non-nullable required cannot be null'); + } $this->container['required'] = $required; return $this; @@ -347,6 +431,9 @@ public function getApiId() */ public function setApiId(?string $api_id) { + if (is_null($api_id)) { + throw new InvalidArgumentException('non-nullable api_id cannot be null'); + } $this->container['api_id'] = $api_id; return $this; @@ -371,6 +458,9 @@ public function getEditor() */ public function setEditor(?string $editor) { + if (is_null($editor)) { + throw new InvalidArgumentException('non-nullable editor cannot be null'); + } $this->container['editor'] = $editor; return $this; @@ -379,12 +469,10 @@ public function setEditor(?string $editor) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -392,7 +480,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -405,13 +493,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -423,12 +509,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -437,8 +521,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php index d6b9a0b16..d16c804e7 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldCheckbox.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `SignatureRequestResponseCustomFieldBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestResponseCustomFieldBase { @@ -75,6 +72,23 @@ class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestRespon 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -95,6 +109,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -170,33 +228,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'checkbox'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'checkbox'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseCustomFieldCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseCustomFieldCheckbox { - /** @var SignatureRequestResponseCustomFieldCheckbox $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseCustomFieldCheckbox */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseCustomFieldCheckbox::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -211,7 +287,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -245,6 +320,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -269,6 +347,9 @@ public function getValue() */ public function setValue(?bool $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -277,12 +358,10 @@ public function setValue(?bool $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -290,7 +369,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -303,13 +382,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -321,12 +398,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -335,8 +410,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php index ac1300a8e..4115fc171 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldText.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `SignatureRequestResponseCustomFieldBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCustomFieldBase { @@ -75,6 +72,23 @@ class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCu 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -95,6 +109,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -170,33 +228,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'text'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'text'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseCustomFieldText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseCustomFieldText { - /** @var SignatureRequestResponseCustomFieldText $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseCustomFieldText */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseCustomFieldText::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -211,7 +287,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -245,6 +320,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -269,6 +347,9 @@ public function getValue() */ public function setValue(?string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -277,12 +358,10 @@ public function setValue(?string $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -290,7 +369,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -303,13 +382,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -321,12 +398,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -335,8 +410,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php b/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php index d5a610466..c9f4ea0a2 100644 --- a/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php +++ b/sdks/php/src/Model/SignatureRequestResponseCustomFieldTypeEnum.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -32,7 +31,6 @@ * SignatureRequestResponseCustomFieldTypeEnum Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class SignatureRequestResponseCustomFieldTypeEnum diff --git a/sdks/php/src/Model/SignatureRequestResponseDataBase.php b/sdks/php/src/Model/SignatureRequestResponseDataBase.php index 5b564fec5..5f473fe7f 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataBase.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataBase.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,14 +38,10 @@ * * @category Class * @description An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ -abstract class SignatureRequestResponseDataBase implements ModelInterface, ArrayAccess, JsonSerializable +class SignatureRequestResponseDataBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; @@ -84,6 +80,26 @@ abstract class SignatureRequestResponseDataBase implements ModelInterface, Array 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'api_id' => false, + 'signature_id' => false, + 'name' => false, + 'required' => false, + 'type' => 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 * @@ -104,6 +120,50 @@ 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 @@ -188,23 +248,23 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['api_id'] = $data['api_id'] ?? null; - $this->container['signature_id'] = $data['signature_id'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['required'] = $data['required'] ?? null; - $this->container['type'] = $data['type'] ?? null; + $this->setIfExists('api_id', $data ?? [], null); + $this->setIfExists('signature_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('required', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); // Initialize discriminator property with the model name. $this->container['type'] = static::$openAPIModelName; @@ -247,6 +307,22 @@ public static function discriminatorClassName(array $data): ?string return null; } + /** + * 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. * @@ -254,9 +330,7 @@ public static function discriminatorClassName(array $data): ?string */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -289,6 +363,9 @@ public function getApiId() */ public function setApiId(?string $api_id) { + if (is_null($api_id)) { + throw new InvalidArgumentException('non-nullable api_id cannot be null'); + } $this->container['api_id'] = $api_id; return $this; @@ -313,6 +390,9 @@ public function getSignatureId() */ public function setSignatureId(?string $signature_id) { + if (is_null($signature_id)) { + throw new InvalidArgumentException('non-nullable signature_id cannot be null'); + } $this->container['signature_id'] = $signature_id; return $this; @@ -337,6 +417,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -361,6 +444,9 @@ public function getRequired() */ public function setRequired(?bool $required) { + if (is_null($required)) { + throw new InvalidArgumentException('non-nullable required cannot be null'); + } $this->container['required'] = $required; return $this; @@ -385,6 +471,9 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -393,12 +482,10 @@ public function setType(?string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -406,7 +493,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -419,13 +506,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -437,12 +522,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -451,8 +534,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php b/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php index bb4ea4b1c..fd4b6e268 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataTypeEnum.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -32,7 +31,6 @@ * SignatureRequestResponseDataTypeEnum Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class SignatureRequestResponseDataTypeEnum diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueCheckbox.php b/sdks/php/src/Model/SignatureRequestResponseDataValueCheckbox.php index 45bf82397..c64a1fbc7 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueCheckbox.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueCheckbox.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,17 +28,15 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** * SignatureRequestResponseDataValueCheckbox Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponseDataBase { @@ -74,6 +71,23 @@ class SignatureRequestResponseDataValueCheckbox extends SignatureRequestResponse 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -94,6 +108,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -169,33 +227,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'checkbox'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'checkbox'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueCheckbox { - /** @var SignatureRequestResponseDataValueCheckbox $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseDataValueCheckbox */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueCheckbox::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -205,9 +281,7 @@ public static function init(array $data): SignatureRequestResponseDataValueCheck */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -240,6 +314,9 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -264,6 +341,9 @@ public function getValue() */ public function setValue(?bool $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -272,12 +352,10 @@ public function setValue(?bool $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,7 +363,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -298,13 +376,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -316,12 +392,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -330,8 +404,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php b/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php index db8fb4819..96ac1dd3e 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueCheckboxMerge.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,17 +28,15 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** * SignatureRequestResponseDataValueCheckboxMerge Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase { @@ -74,6 +71,23 @@ class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestRes 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -94,6 +108,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -169,33 +227,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'checkbox-merge'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'checkbox-merge'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueCheckboxMerge { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueCheckboxMerge { - /** @var SignatureRequestResponseDataValueCheckboxMerge $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseDataValueCheckboxMerge */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueCheckboxMerge::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -205,9 +281,7 @@ public static function init(array $data): SignatureRequestResponseDataValueCheck */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -240,6 +314,9 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -264,6 +341,9 @@ public function getValue() */ public function setValue(?string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -272,12 +352,10 @@ public function setValue(?string $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,7 +363,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -298,13 +376,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -316,12 +392,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -330,8 +404,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php b/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php index 792407548..78c8794e0 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueDateSigned.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,17 +28,15 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** * SignatureRequestResponseDataValueDateSigned Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseDataValueDateSigned extends SignatureRequestResponseDataBase { @@ -74,6 +71,23 @@ class SignatureRequestResponseDataValueDateSigned extends SignatureRequestRespon 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -94,6 +108,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -169,33 +227,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'date_signed'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'date_signed'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueDateSigned { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueDateSigned { - /** @var SignatureRequestResponseDataValueDateSigned $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseDataValueDateSigned */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueDateSigned::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -205,9 +281,7 @@ public static function init(array $data): SignatureRequestResponseDataValueDateS */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -240,6 +314,9 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -264,6 +341,9 @@ public function getValue() */ public function setValue(?string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -272,12 +352,10 @@ public function setValue(?string $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,7 +363,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -298,13 +376,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -316,12 +392,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -330,8 +404,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php b/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php index f4ac50109..4171a5860 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueDropdown.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,17 +28,15 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** * SignatureRequestResponseDataValueDropdown Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponseDataBase { @@ -74,6 +71,23 @@ class SignatureRequestResponseDataValueDropdown extends SignatureRequestResponse 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -94,6 +108,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -169,33 +227,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'dropdown'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'dropdown'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueDropdown { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueDropdown { - /** @var SignatureRequestResponseDataValueDropdown $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseDataValueDropdown */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueDropdown::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -205,9 +281,7 @@ public static function init(array $data): SignatureRequestResponseDataValueDropd */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -240,6 +314,9 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -264,6 +341,9 @@ public function getValue() */ public function setValue(?string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -272,12 +352,10 @@ public function setValue(?string $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,7 +363,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -298,13 +376,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -316,12 +392,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -330,8 +404,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php b/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php index 4276a4e78..30ab1f375 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueInitials.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,17 +28,15 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** * SignatureRequestResponseDataValueInitials Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseDataValueInitials extends SignatureRequestResponseDataBase { @@ -74,6 +71,23 @@ class SignatureRequestResponseDataValueInitials extends SignatureRequestResponse 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -94,6 +108,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -169,33 +227,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'initials'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'initials'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueInitials { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueInitials { - /** @var SignatureRequestResponseDataValueInitials $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseDataValueInitials */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueInitials::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -205,9 +281,7 @@ public static function init(array $data): SignatureRequestResponseDataValueIniti */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -240,6 +314,9 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -264,6 +341,9 @@ public function getValue() */ public function setValue(?string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -272,12 +352,10 @@ public function setValue(?string $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,7 +363,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -298,13 +376,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -316,12 +392,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -330,8 +404,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php b/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php index 7d502feca..0c05b0bc9 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueRadio.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,17 +28,15 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** * SignatureRequestResponseDataValueRadio Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDataBase { @@ -74,6 +71,23 @@ class SignatureRequestResponseDataValueRadio extends SignatureRequestResponseDat 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -94,6 +108,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -169,33 +227,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'radio'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'radio'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueRadio { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueRadio { - /** @var SignatureRequestResponseDataValueRadio $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseDataValueRadio */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueRadio::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -205,9 +281,7 @@ public static function init(array $data): SignatureRequestResponseDataValueRadio */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -240,6 +314,9 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -264,6 +341,9 @@ public function getValue() */ public function setValue(?bool $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -272,12 +352,10 @@ public function setValue(?bool $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,7 +363,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -298,13 +376,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -316,12 +392,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -330,8 +404,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php b/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php index bbdcfb16a..458a052a7 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueSignature.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,17 +28,15 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** * SignatureRequestResponseDataValueSignature Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseDataValueSignature extends SignatureRequestResponseDataBase { @@ -74,6 +71,23 @@ class SignatureRequestResponseDataValueSignature extends SignatureRequestRespons 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -94,6 +108,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -169,33 +227,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'signature'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'signature'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueSignature { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueSignature { - /** @var SignatureRequestResponseDataValueSignature $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseDataValueSignature */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueSignature::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -205,9 +281,7 @@ public static function init(array $data): SignatureRequestResponseDataValueSigna */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -240,6 +314,9 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -264,6 +341,9 @@ public function getValue() */ public function setValue(?string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -272,12 +352,10 @@ public function setValue(?string $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,7 +363,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -298,13 +376,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -316,12 +392,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -330,8 +404,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueText.php b/sdks/php/src/Model/SignatureRequestResponseDataValueText.php index d67e26738..f4ddd0ff3 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueText.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueText.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,17 +28,15 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** * SignatureRequestResponseDataValueText Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseDataValueText extends SignatureRequestResponseDataBase { @@ -74,6 +71,23 @@ class SignatureRequestResponseDataValueText extends SignatureRequestResponseData 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -94,6 +108,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -169,33 +227,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'text'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'text'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueText { - /** @var SignatureRequestResponseDataValueText $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseDataValueText */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueText::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -205,9 +281,7 @@ public static function init(array $data): SignatureRequestResponseDataValueText */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -240,6 +314,9 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -264,6 +341,9 @@ public function getValue() */ public function setValue(?string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -272,12 +352,10 @@ public function setValue(?string $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,7 +363,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -298,13 +376,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -316,12 +392,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -330,8 +404,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php b/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php index 4dce57c71..ef64d4b8e 100644 --- a/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php +++ b/sdks/php/src/Model/SignatureRequestResponseDataValueTextMerge.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,17 +28,15 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** * SignatureRequestResponseDataValueTextMerge Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestResponseDataValueTextMerge extends SignatureRequestResponseDataBase { @@ -74,6 +71,23 @@ class SignatureRequestResponseDataValueTextMerge extends SignatureRequestRespons 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => 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 * @@ -94,6 +108,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -169,33 +227,51 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'text-merge'; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('type', $data ?? [], 'text-merge'); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseDataValueTextMerge { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseDataValueTextMerge { - /** @var SignatureRequestResponseDataValueTextMerge $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseDataValueTextMerge */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseDataValueTextMerge::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -205,9 +281,7 @@ public static function init(array $data): SignatureRequestResponseDataValueTextM */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); - - return $invalidProperties; + return parent::listInvalidProperties(); } /** @@ -240,6 +314,9 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -264,6 +341,9 @@ public function getValue() */ public function setValue(?string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -272,12 +352,10 @@ public function setValue(?string $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,7 +363,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -298,13 +376,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -316,12 +392,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -330,8 +404,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestResponseSignatures.php b/sdks/php/src/Model/SignatureRequestResponseSignatures.php index 87fb09f3d..081ebb6d3 100644 --- a/sdks/php/src/Model/SignatureRequestResponseSignatures.php +++ b/sdks/php/src/Model/SignatureRequestResponseSignatures.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description An array of signature objects, 1 for each signer. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, JsonSerializable { @@ -112,6 +108,40 @@ class SignatureRequestResponseSignatures implements ModelInterface, ArrayAccess, 'error' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'signature_id' => false, + 'signer_group_guid' => true, + 'signer_email_address' => false, + 'signer_name' => true, + 'signer_role' => true, + 'order' => true, + 'status_code' => false, + 'decline_reason' => true, + 'signed_at' => true, + 'last_viewed_at' => true, + 'last_reminded_at' => true, + 'has_pin' => false, + 'has_sms_auth' => true, + 'has_sms_delivery' => true, + 'sms_phone_number' => true, + 'reassigned_by' => true, + 'reassignment_reason' => true, + 'reassigned_from' => true, + 'error' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -132,6 +162,50 @@ 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 @@ -258,55 +332,73 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['signature_id'] = $data['signature_id'] ?? null; - $this->container['signer_group_guid'] = $data['signer_group_guid'] ?? null; - $this->container['signer_email_address'] = $data['signer_email_address'] ?? null; - $this->container['signer_name'] = $data['signer_name'] ?? null; - $this->container['signer_role'] = $data['signer_role'] ?? null; - $this->container['order'] = $data['order'] ?? null; - $this->container['status_code'] = $data['status_code'] ?? null; - $this->container['decline_reason'] = $data['decline_reason'] ?? null; - $this->container['signed_at'] = $data['signed_at'] ?? null; - $this->container['last_viewed_at'] = $data['last_viewed_at'] ?? null; - $this->container['last_reminded_at'] = $data['last_reminded_at'] ?? null; - $this->container['has_pin'] = $data['has_pin'] ?? null; - $this->container['has_sms_auth'] = $data['has_sms_auth'] ?? null; - $this->container['has_sms_delivery'] = $data['has_sms_delivery'] ?? null; - $this->container['sms_phone_number'] = $data['sms_phone_number'] ?? null; - $this->container['reassigned_by'] = $data['reassigned_by'] ?? null; - $this->container['reassignment_reason'] = $data['reassignment_reason'] ?? null; - $this->container['reassigned_from'] = $data['reassigned_from'] ?? null; - $this->container['error'] = $data['error'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('signature_id', $data ?? [], null); + $this->setIfExists('signer_group_guid', $data ?? [], null); + $this->setIfExists('signer_email_address', $data ?? [], null); + $this->setIfExists('signer_name', $data ?? [], null); + $this->setIfExists('signer_role', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('status_code', $data ?? [], null); + $this->setIfExists('decline_reason', $data ?? [], null); + $this->setIfExists('signed_at', $data ?? [], null); + $this->setIfExists('last_viewed_at', $data ?? [], null); + $this->setIfExists('last_reminded_at', $data ?? [], null); + $this->setIfExists('has_pin', $data ?? [], null); + $this->setIfExists('has_sms_auth', $data ?? [], null); + $this->setIfExists('has_sms_delivery', $data ?? [], null); + $this->setIfExists('sms_phone_number', $data ?? [], null); + $this->setIfExists('reassigned_by', $data ?? [], null); + $this->setIfExists('reassignment_reason', $data ?? [], null); + $this->setIfExists('reassigned_from', $data ?? [], null); + $this->setIfExists('error', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestResponseSignatures { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestResponseSignatures { - /** @var SignatureRequestResponseSignatures $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestResponseSignatures */ + return ObjectSerializer::deserialize( $data, SignatureRequestResponseSignatures::class, ); + } - return $obj; + /** + * 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; } /** @@ -316,9 +408,7 @@ public static function init(array $data): SignatureRequestResponseSignatures */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -351,6 +441,9 @@ public function getSignatureId() */ public function setSignatureId(?string $signature_id) { + if (is_null($signature_id)) { + throw new InvalidArgumentException('non-nullable signature_id cannot be null'); + } $this->container['signature_id'] = $signature_id; return $this; @@ -375,6 +468,16 @@ public function getSignerGroupGuid() */ public function setSignerGroupGuid(?string $signer_group_guid) { + if (is_null($signer_group_guid)) { + array_push($this->openAPINullablesSetToNull, 'signer_group_guid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signer_group_guid', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signer_group_guid'] = $signer_group_guid; return $this; @@ -399,6 +502,9 @@ public function getSignerEmailAddress() */ public function setSignerEmailAddress(?string $signer_email_address) { + if (is_null($signer_email_address)) { + throw new InvalidArgumentException('non-nullable signer_email_address cannot be null'); + } $this->container['signer_email_address'] = $signer_email_address; return $this; @@ -423,6 +529,16 @@ public function getSignerName() */ public function setSignerName(?string $signer_name) { + if (is_null($signer_name)) { + array_push($this->openAPINullablesSetToNull, 'signer_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signer_name', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signer_name'] = $signer_name; return $this; @@ -447,6 +563,16 @@ public function getSignerRole() */ public function setSignerRole(?string $signer_role) { + if (is_null($signer_role)) { + array_push($this->openAPINullablesSetToNull, 'signer_role'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signer_role', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signer_role'] = $signer_role; return $this; @@ -471,6 +597,16 @@ public function getOrder() */ public function setOrder(?int $order) { + if (is_null($order)) { + array_push($this->openAPINullablesSetToNull, 'order'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('order', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['order'] = $order; return $this; @@ -495,6 +631,9 @@ public function getStatusCode() */ public function setStatusCode(?string $status_code) { + if (is_null($status_code)) { + throw new InvalidArgumentException('non-nullable status_code cannot be null'); + } $this->container['status_code'] = $status_code; return $this; @@ -519,6 +658,16 @@ public function getDeclineReason() */ public function setDeclineReason(?string $decline_reason) { + if (is_null($decline_reason)) { + array_push($this->openAPINullablesSetToNull, 'decline_reason'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('decline_reason', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['decline_reason'] = $decline_reason; return $this; @@ -543,6 +692,16 @@ public function getSignedAt() */ public function setSignedAt(?int $signed_at) { + if (is_null($signed_at)) { + array_push($this->openAPINullablesSetToNull, 'signed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signed_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signed_at'] = $signed_at; return $this; @@ -567,6 +726,16 @@ public function getLastViewedAt() */ public function setLastViewedAt(?int $last_viewed_at) { + if (is_null($last_viewed_at)) { + array_push($this->openAPINullablesSetToNull, 'last_viewed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_viewed_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['last_viewed_at'] = $last_viewed_at; return $this; @@ -591,6 +760,16 @@ public function getLastRemindedAt() */ public function setLastRemindedAt(?int $last_reminded_at) { + if (is_null($last_reminded_at)) { + array_push($this->openAPINullablesSetToNull, 'last_reminded_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_reminded_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['last_reminded_at'] = $last_reminded_at; return $this; @@ -615,6 +794,9 @@ public function getHasPin() */ public function setHasPin(?bool $has_pin) { + if (is_null($has_pin)) { + throw new InvalidArgumentException('non-nullable has_pin cannot be null'); + } $this->container['has_pin'] = $has_pin; return $this; @@ -639,6 +821,16 @@ public function getHasSmsAuth() */ public function setHasSmsAuth(?bool $has_sms_auth) { + if (is_null($has_sms_auth)) { + array_push($this->openAPINullablesSetToNull, 'has_sms_auth'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('has_sms_auth', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['has_sms_auth'] = $has_sms_auth; return $this; @@ -663,6 +855,16 @@ public function getHasSmsDelivery() */ public function setHasSmsDelivery(?bool $has_sms_delivery) { + if (is_null($has_sms_delivery)) { + array_push($this->openAPINullablesSetToNull, 'has_sms_delivery'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('has_sms_delivery', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['has_sms_delivery'] = $has_sms_delivery; return $this; @@ -687,6 +889,16 @@ public function getSmsPhoneNumber() */ public function setSmsPhoneNumber(?string $sms_phone_number) { + if (is_null($sms_phone_number)) { + array_push($this->openAPINullablesSetToNull, 'sms_phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('sms_phone_number', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['sms_phone_number'] = $sms_phone_number; return $this; @@ -711,6 +923,16 @@ public function getReassignedBy() */ public function setReassignedBy(?string $reassigned_by) { + if (is_null($reassigned_by)) { + array_push($this->openAPINullablesSetToNull, 'reassigned_by'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reassigned_by', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['reassigned_by'] = $reassigned_by; return $this; @@ -735,6 +957,16 @@ public function getReassignmentReason() */ public function setReassignmentReason(?string $reassignment_reason) { + if (is_null($reassignment_reason)) { + array_push($this->openAPINullablesSetToNull, 'reassignment_reason'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reassignment_reason', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['reassignment_reason'] = $reassignment_reason; return $this; @@ -759,6 +991,16 @@ public function getReassignedFrom() */ public function setReassignedFrom(?string $reassigned_from) { + if (is_null($reassigned_from)) { + array_push($this->openAPINullablesSetToNull, 'reassigned_from'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reassigned_from', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['reassigned_from'] = $reassigned_from; return $this; @@ -783,6 +1025,16 @@ public function getError() */ public function setError(?string $error) { + if (is_null($error)) { + array_push($this->openAPINullablesSetToNull, 'error'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('error', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['error'] = $error; return $this; @@ -791,12 +1043,10 @@ public function setError(?string $error) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -804,7 +1054,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -817,13 +1067,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -835,12 +1083,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -849,8 +1095,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestSendRequest.php b/sdks/php/src/Model/SignatureRequestSendRequest.php index c68fb8f49..600ee133e 100644 --- a/sdks/php/src/Model/SignatureRequestSendRequest.php +++ b/sdks/php/src/Model/SignatureRequestSendRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * SignatureRequestSendRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -126,6 +122,47 @@ class SignatureRequestSendRequest implements ModelInterface, ArrayAccess, JsonSe 'expires_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'files' => false, + 'file_urls' => false, + 'signers' => false, + 'grouped_signers' => false, + 'allow_decline' => false, + 'allow_reassign' => false, + 'attachments' => false, + 'cc_email_addresses' => false, + 'client_id' => false, + 'custom_fields' => false, + 'field_options' => false, + 'form_field_groups' => false, + 'form_field_rules' => false, + 'form_fields_per_document' => false, + 'hide_text_tags' => false, + 'is_qualified_signature' => false, + 'is_eid' => false, + 'message' => false, + 'metadata' => false, + 'signing_options' => false, + 'signing_redirect_url' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + 'use_text_tags' => false, + 'expires_at' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -146,6 +183,50 @@ 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 @@ -293,62 +374,80 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['files'] = $data['files'] ?? null; - $this->container['file_urls'] = $data['file_urls'] ?? null; - $this->container['signers'] = $data['signers'] ?? null; - $this->container['grouped_signers'] = $data['grouped_signers'] ?? null; - $this->container['allow_decline'] = $data['allow_decline'] ?? false; - $this->container['allow_reassign'] = $data['allow_reassign'] ?? false; - $this->container['attachments'] = $data['attachments'] ?? null; - $this->container['cc_email_addresses'] = $data['cc_email_addresses'] ?? null; - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['field_options'] = $data['field_options'] ?? null; - $this->container['form_field_groups'] = $data['form_field_groups'] ?? null; - $this->container['form_field_rules'] = $data['form_field_rules'] ?? null; - $this->container['form_fields_per_document'] = $data['form_fields_per_document'] ?? null; - $this->container['hide_text_tags'] = $data['hide_text_tags'] ?? false; - $this->container['is_qualified_signature'] = $data['is_qualified_signature'] ?? false; - $this->container['is_eid'] = $data['is_eid'] ?? false; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['signing_options'] = $data['signing_options'] ?? null; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['title'] = $data['title'] ?? null; - $this->container['use_text_tags'] = $data['use_text_tags'] ?? false; - $this->container['expires_at'] = $data['expires_at'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('grouped_signers', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('allow_reassign', $data ?? [], false); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('cc_email_addresses', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('field_options', $data ?? [], null); + $this->setIfExists('form_field_groups', $data ?? [], null); + $this->setIfExists('form_field_rules', $data ?? [], null); + $this->setIfExists('form_fields_per_document', $data ?? [], null); + $this->setIfExists('hide_text_tags', $data ?? [], false); + $this->setIfExists('is_qualified_signature', $data ?? [], false); + $this->setIfExists('is_eid', $data ?? [], false); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('use_text_tags', $data ?? [], false); + $this->setIfExists('expires_at', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestSendRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestSendRequest { - /** @var SignatureRequestSendRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestSendRequest */ + return ObjectSerializer::deserialize( $data, SignatureRequestSendRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -405,6 +504,9 @@ public function getFiles() */ public function setFiles(?array $files) { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } $this->container['files'] = $files; return $this; @@ -429,6 +531,9 @@ public function getFileUrls() */ 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; @@ -453,6 +558,9 @@ public function getSigners() */ public function setSigners(?array $signers) { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } $this->container['signers'] = $signers; return $this; @@ -477,6 +585,9 @@ public function getGroupedSigners() */ public function setGroupedSigners(?array $grouped_signers) { + if (is_null($grouped_signers)) { + throw new InvalidArgumentException('non-nullable grouped_signers cannot be null'); + } $this->container['grouped_signers'] = $grouped_signers; return $this; @@ -501,6 +612,9 @@ public function getAllowDecline() */ public function setAllowDecline(?bool $allow_decline) { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } $this->container['allow_decline'] = $allow_decline; return $this; @@ -525,6 +639,9 @@ public function getAllowReassign() */ public function setAllowReassign(?bool $allow_reassign) { + if (is_null($allow_reassign)) { + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + } $this->container['allow_reassign'] = $allow_reassign; return $this; @@ -549,6 +666,9 @@ public function getAttachments() */ public function setAttachments(?array $attachments) { + if (is_null($attachments)) { + throw new InvalidArgumentException('non-nullable attachments cannot be null'); + } $this->container['attachments'] = $attachments; return $this; @@ -573,6 +693,9 @@ public function getCcEmailAddresses() */ public function setCcEmailAddresses(?array $cc_email_addresses) { + if (is_null($cc_email_addresses)) { + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + } $this->container['cc_email_addresses'] = $cc_email_addresses; return $this; @@ -597,6 +720,9 @@ public function getClientId() */ public function setClientId(?string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -621,6 +747,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -645,6 +774,9 @@ public function getFieldOptions() */ public function setFieldOptions(?SubFieldOptions $field_options) { + if (is_null($field_options)) { + throw new InvalidArgumentException('non-nullable field_options cannot be null'); + } $this->container['field_options'] = $field_options; return $this; @@ -669,6 +801,9 @@ public function getFormFieldGroups() */ public function setFormFieldGroups(?array $form_field_groups) { + if (is_null($form_field_groups)) { + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + } $this->container['form_field_groups'] = $form_field_groups; return $this; @@ -693,6 +828,9 @@ public function getFormFieldRules() */ public function setFormFieldRules(?array $form_field_rules) { + if (is_null($form_field_rules)) { + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + } $this->container['form_field_rules'] = $form_field_rules; return $this; @@ -717,6 +855,9 @@ public function getFormFieldsPerDocument() */ public function setFormFieldsPerDocument(?array $form_fields_per_document) { + if (is_null($form_fields_per_document)) { + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + } $this->container['form_fields_per_document'] = $form_fields_per_document; return $this; @@ -741,6 +882,9 @@ public function getHideTextTags() */ public function setHideTextTags(?bool $hide_text_tags) { + if (is_null($hide_text_tags)) { + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + } $this->container['hide_text_tags'] = $hide_text_tags; return $this; @@ -767,6 +911,9 @@ public function getIsQualifiedSignature() */ public function setIsQualifiedSignature(?bool $is_qualified_signature) { + if (is_null($is_qualified_signature)) { + throw new InvalidArgumentException('non-nullable is_qualified_signature cannot be null'); + } $this->container['is_qualified_signature'] = $is_qualified_signature; return $this; @@ -791,6 +938,9 @@ public function getIsEid() */ public function setIsEid(?bool $is_eid) { + if (is_null($is_eid)) { + throw new InvalidArgumentException('non-nullable is_eid cannot be null'); + } $this->container['is_eid'] = $is_eid; return $this; @@ -815,7 +965,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestSendRequest., must be smaller than or equal to 5000.'); } @@ -843,6 +996,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -867,6 +1024,9 @@ public function getSigningOptions() */ public function setSigningOptions(?SubSigningOptions $signing_options) { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } $this->container['signing_options'] = $signing_options; return $this; @@ -891,6 +1051,9 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -915,7 +1078,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 255)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestSendRequest., must be smaller than or equal to 255.'); } @@ -943,6 +1109,9 @@ public function getTestMode() */ 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; @@ -967,7 +1136,10 @@ public function getTitle() */ public function setTitle(?string $title) { - if (!is_null($title) && (mb_strlen($title) > 255)) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestSendRequest., must be smaller than or equal to 255.'); } @@ -995,6 +1167,9 @@ public function getUseTextTags() */ public function setUseTextTags(?bool $use_text_tags) { + if (is_null($use_text_tags)) { + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + } $this->container['use_text_tags'] = $use_text_tags; return $this; @@ -1019,6 +1194,16 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['expires_at'] = $expires_at; return $this; @@ -1027,12 +1212,10 @@ public function setExpiresAt(?int $expires_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1040,7 +1223,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -1053,13 +1236,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1071,12 +1252,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1085,8 +1264,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php b/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php index c08ce5f24..c58096632 100644 --- a/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php +++ b/sdks/php/src/Model/SignatureRequestSendWithTemplateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,9 @@ * SignatureRequestSendWithTemplateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team + * @description * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -108,6 +105,38 @@ class SignatureRequestSendWithTemplateRequest implements ModelInterface, ArrayAc 'title' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_ids' => false, + 'signers' => false, + 'allow_decline' => false, + 'ccs' => false, + 'client_id' => false, + 'custom_fields' => false, + 'files' => false, + 'file_urls' => false, + 'is_qualified_signature' => false, + 'is_eid' => false, + 'message' => false, + 'metadata' => false, + 'signing_options' => false, + 'signing_redirect_url' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -128,6 +157,50 @@ 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 @@ -248,53 +321,71 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template_ids'] = $data['template_ids'] ?? null; - $this->container['signers'] = $data['signers'] ?? null; - $this->container['allow_decline'] = $data['allow_decline'] ?? false; - $this->container['ccs'] = $data['ccs'] ?? null; - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['files'] = $data['files'] ?? null; - $this->container['file_urls'] = $data['file_urls'] ?? null; - $this->container['is_qualified_signature'] = $data['is_qualified_signature'] ?? false; - $this->container['is_eid'] = $data['is_eid'] ?? false; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['signing_options'] = $data['signing_options'] ?? null; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['title'] = $data['title'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('template_ids', $data ?? [], null); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('ccs', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('is_qualified_signature', $data ?? [], false); + $this->setIfExists('is_eid', $data ?? [], false); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestSendWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestSendWithTemplateRequest { - /** @var SignatureRequestSendWithTemplateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestSendWithTemplateRequest */ + return ObjectSerializer::deserialize( $data, SignatureRequestSendWithTemplateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -357,6 +448,9 @@ public function getTemplateIds() */ public function setTemplateIds(array $template_ids) { + if (is_null($template_ids)) { + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + } $this->container['template_ids'] = $template_ids; return $this; @@ -381,6 +475,9 @@ public function getSigners() */ public function setSigners(array $signers) { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } $this->container['signers'] = $signers; return $this; @@ -405,6 +502,9 @@ public function getAllowDecline() */ public function setAllowDecline(?bool $allow_decline) { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } $this->container['allow_decline'] = $allow_decline; return $this; @@ -429,6 +529,9 @@ public function getCcs() */ public function setCcs(?array $ccs) { + if (is_null($ccs)) { + throw new InvalidArgumentException('non-nullable ccs cannot be null'); + } $this->container['ccs'] = $ccs; return $this; @@ -453,6 +556,9 @@ public function getClientId() */ public function setClientId(?string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -477,6 +583,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -501,6 +610,9 @@ public function getFiles() */ public function setFiles(?array $files) { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } $this->container['files'] = $files; return $this; @@ -525,6 +637,9 @@ public function getFileUrls() */ 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; @@ -551,6 +666,9 @@ public function getIsQualifiedSignature() */ public function setIsQualifiedSignature(?bool $is_qualified_signature) { + if (is_null($is_qualified_signature)) { + throw new InvalidArgumentException('non-nullable is_qualified_signature cannot be null'); + } $this->container['is_qualified_signature'] = $is_qualified_signature; return $this; @@ -575,6 +693,9 @@ public function getIsEid() */ public function setIsEid(?bool $is_eid) { + if (is_null($is_eid)) { + throw new InvalidArgumentException('non-nullable is_eid cannot be null'); + } $this->container['is_eid'] = $is_eid; return $this; @@ -599,7 +720,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 5000.'); } @@ -627,6 +751,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -651,6 +779,9 @@ public function getSigningOptions() */ public function setSigningOptions(?SubSigningOptions $signing_options) { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } $this->container['signing_options'] = $signing_options; return $this; @@ -675,6 +806,9 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -699,7 +833,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 255)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { throw new InvalidArgumentException('invalid length for $subject when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 255.'); } @@ -727,6 +864,9 @@ public function getTestMode() */ 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; @@ -751,7 +891,10 @@ public function getTitle() */ public function setTitle(?string $title) { - if (!is_null($title) && (mb_strlen($title) > 255)) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { throw new InvalidArgumentException('invalid length for $title when calling SignatureRequestSendWithTemplateRequest., must be smaller than or equal to 255.'); } @@ -763,12 +906,10 @@ public function setTitle(?string $title) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -776,7 +917,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -789,13 +930,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -807,12 +946,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -821,8 +958,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SignatureRequestUpdateRequest.php b/sdks/php/src/Model/SignatureRequestUpdateRequest.php index b54c560a2..2a4a33dcf 100644 --- a/sdks/php/src/Model/SignatureRequestUpdateRequest.php +++ b/sdks/php/src/Model/SignatureRequestUpdateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SignatureRequestUpdateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SignatureRequestUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -80,6 +77,25 @@ class SignatureRequestUpdateRequest implements ModelInterface, ArrayAccess, Json 'expires_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'signature_id' => false, + 'email_address' => false, + 'name' => false, + 'expires_at' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +116,50 @@ 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 @@ -181,40 +241,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['signature_id'] = $data['signature_id'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['expires_at'] = $data['expires_at'] ?? null; + $this->setIfExists('signature_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SignatureRequestUpdateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SignatureRequestUpdateRequest { - /** @var SignatureRequestUpdateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SignatureRequestUpdateRequest */ + return ObjectSerializer::deserialize( $data, SignatureRequestUpdateRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -229,7 +307,6 @@ public function listInvalidProperties() if ($this->container['signature_id'] === null) { $invalidProperties[] = "'signature_id' can't be null"; } - return $invalidProperties; } @@ -263,6 +340,9 @@ public function getSignatureId() */ public function setSignatureId(string $signature_id) { + if (is_null($signature_id)) { + throw new InvalidArgumentException('non-nullable signature_id cannot be null'); + } $this->container['signature_id'] = $signature_id; return $this; @@ -287,6 +367,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -311,6 +394,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -335,6 +421,16 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['expires_at'] = $expires_at; return $this; @@ -343,12 +439,10 @@ public function setExpiresAt(?int $expires_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -356,7 +450,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -369,13 +463,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -387,12 +479,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -401,8 +491,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubAttachment.php b/sdks/php/src/Model/SubAttachment.php index 20e960823..d41f3459c 100644 --- a/sdks/php/src/Model/SubAttachment.php +++ b/sdks/php/src/Model/SubAttachment.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SubAttachment Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubAttachment implements ModelInterface, ArrayAccess, JsonSerializable { @@ -80,6 +77,25 @@ class SubAttachment implements ModelInterface, ArrayAccess, JsonSerializable 'required' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'signer_index' => false, + 'instructions' => false, + 'required' => 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 * @@ -100,6 +116,50 @@ 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 @@ -181,40 +241,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['signer_index'] = $data['signer_index'] ?? null; - $this->container['instructions'] = $data['instructions'] ?? null; - $this->container['required'] = $data['required'] ?? false; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('signer_index', $data ?? [], null); + $this->setIfExists('instructions', $data ?? [], null); + $this->setIfExists('required', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubAttachment { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubAttachment { - /** @var SubAttachment $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubAttachment */ + return ObjectSerializer::deserialize( $data, SubAttachment::class, ); + } - return $obj; + /** + * 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; } /** @@ -232,7 +310,6 @@ public function listInvalidProperties() if ($this->container['signer_index'] === null) { $invalidProperties[] = "'signer_index' can't be null"; } - return $invalidProperties; } @@ -266,6 +343,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -290,6 +370,9 @@ public function getSignerIndex() */ public function setSignerIndex(int $signer_index) { + if (is_null($signer_index)) { + throw new InvalidArgumentException('non-nullable signer_index cannot be null'); + } $this->container['signer_index'] = $signer_index; return $this; @@ -314,6 +397,9 @@ public function getInstructions() */ public function setInstructions(?string $instructions) { + if (is_null($instructions)) { + throw new InvalidArgumentException('non-nullable instructions cannot be null'); + } $this->container['instructions'] = $instructions; return $this; @@ -338,6 +424,9 @@ public function getRequired() */ public function setRequired(?bool $required) { + if (is_null($required)) { + throw new InvalidArgumentException('non-nullable required cannot be null'); + } $this->container['required'] = $required; return $this; @@ -346,12 +435,10 @@ public function setRequired(?bool $required) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -359,7 +446,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -372,13 +459,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -390,12 +475,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -404,8 +487,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubBulkSignerList.php b/sdks/php/src/Model/SubBulkSignerList.php index be242b967..d9702bb7d 100644 --- a/sdks/php/src/Model/SubBulkSignerList.php +++ b/sdks/php/src/Model/SubBulkSignerList.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SubBulkSignerList Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubBulkSignerList implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +73,23 @@ class SubBulkSignerList implements ModelInterface, ArrayAccess, JsonSerializable 'signers' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'custom_fields' => false, + 'signers' => 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 * @@ -96,6 +110,50 @@ 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 @@ -171,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['signers'] = $data['signers'] ?? null; + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('signers', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubBulkSignerList { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubBulkSignerList { - /** @var SubBulkSignerList $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubBulkSignerList */ + return ObjectSerializer::deserialize( $data, SubBulkSignerList::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -212,9 +288,7 @@ public static function init(array $data): SubBulkSignerList */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -247,6 +321,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -271,6 +348,9 @@ public function getSigners() */ public function setSigners(?array $signers) { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } $this->container['signers'] = $signers; return $this; @@ -279,12 +359,10 @@ public function setSigners(?array $signers) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -292,7 +370,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -305,13 +383,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -323,12 +399,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -337,8 +411,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubBulkSignerListCustomField.php b/sdks/php/src/Model/SubBulkSignerListCustomField.php index 9afee26cb..17f67ac95 100644 --- a/sdks/php/src/Model/SubBulkSignerListCustomField.php +++ b/sdks/php/src/Model/SubBulkSignerListCustomField.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SubBulkSignerListCustomField Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubBulkSignerListCustomField implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +73,23 @@ class SubBulkSignerListCustomField implements ModelInterface, ArrayAccess, JsonS 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'value' => 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 * @@ -96,6 +110,50 @@ 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 @@ -171,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubBulkSignerListCustomField { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubBulkSignerListCustomField { - /** @var SubBulkSignerListCustomField $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubBulkSignerListCustomField */ + return ObjectSerializer::deserialize( $data, SubBulkSignerListCustomField::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -220,7 +296,6 @@ public function listInvalidProperties() if ($this->container['value'] === null) { $invalidProperties[] = "'value' can't be null"; } - return $invalidProperties; } @@ -254,6 +329,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -278,6 +356,9 @@ public function getValue() */ public function setValue(string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -286,12 +367,10 @@ public function setValue(string $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -299,7 +378,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -312,13 +391,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -330,12 +407,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -344,8 +419,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubCC.php b/sdks/php/src/Model/SubCC.php index c07dcfbe0..0380a3889 100644 --- a/sdks/php/src/Model/SubCC.php +++ b/sdks/php/src/Model/SubCC.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SubCC Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubCC implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +73,23 @@ class SubCC implements ModelInterface, ArrayAccess, JsonSerializable 'email_address' => 'email', ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'role' => false, + 'email_address' => 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 * @@ -96,6 +110,50 @@ 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 @@ -171,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['role'] = $data['role'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubCC { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubCC { - /** @var SubCC $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubCC */ + return ObjectSerializer::deserialize( $data, SubCC::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -220,7 +296,6 @@ public function listInvalidProperties() if ($this->container['email_address'] === null) { $invalidProperties[] = "'email_address' can't be null"; } - return $invalidProperties; } @@ -254,6 +329,9 @@ public function getRole() */ public function setRole(string $role) { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } $this->container['role'] = $role; return $this; @@ -278,6 +356,9 @@ public function getEmailAddress() */ public function setEmailAddress(string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -286,12 +367,10 @@ public function setEmailAddress(string $email_address) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -299,7 +378,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -312,13 +391,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -330,12 +407,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -344,8 +419,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubCustomField.php b/sdks/php/src/Model/SubCustomField.php index 9b0342904..e853f9eb1 100644 --- a/sdks/php/src/Model/SubCustomField.php +++ b/sdks/php/src/Model/SubCustomField.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,11 +38,8 @@ * * @category Class * @description When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubCustomField implements ModelInterface, ArrayAccess, JsonSerializable { @@ -81,6 +78,25 @@ class SubCustomField implements ModelInterface, ArrayAccess, JsonSerializable 'value' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'editor' => false, + 'required' => false, + 'value' => 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 * @@ -101,6 +117,50 @@ 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 @@ -182,40 +242,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['editor'] = $data['editor'] ?? null; - $this->container['required'] = $data['required'] ?? false; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('editor', $data ?? [], null); + $this->setIfExists('required', $data ?? [], false); + $this->setIfExists('value', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubCustomField { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubCustomField { - /** @var SubCustomField $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubCustomField */ + return ObjectSerializer::deserialize( $data, SubCustomField::class, ); + } - return $obj; + /** + * 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; } /** @@ -230,7 +308,6 @@ public function listInvalidProperties() if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } - return $invalidProperties; } @@ -264,6 +341,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -288,6 +368,9 @@ public function getEditor() */ public function setEditor(?string $editor) { + if (is_null($editor)) { + throw new InvalidArgumentException('non-nullable editor cannot be null'); + } $this->container['editor'] = $editor; return $this; @@ -312,6 +395,9 @@ public function getRequired() */ public function setRequired(?bool $required) { + if (is_null($required)) { + throw new InvalidArgumentException('non-nullable required cannot be null'); + } $this->container['required'] = $required; return $this; @@ -336,6 +422,9 @@ public function getValue() */ public function setValue(?string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -344,12 +433,10 @@ public function setValue(?string $value) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -357,7 +444,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -370,13 +457,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -388,12 +473,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -402,8 +485,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubEditorOptions.php b/sdks/php/src/Model/SubEditorOptions.php index b53caa2ad..cd15d5965 100644 --- a/sdks/php/src/Model/SubEditorOptions.php +++ b/sdks/php/src/Model/SubEditorOptions.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,11 +38,8 @@ * * @category Class * @description This allows the requester to specify editor options when a preparing a document - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubEditorOptions implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +74,23 @@ class SubEditorOptions implements ModelInterface, ArrayAccess, JsonSerializable 'allow_edit_documents' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'allow_edit_signers' => false, + 'allow_edit_documents' => 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 * @@ -97,6 +111,50 @@ 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 @@ -172,38 +230,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['allow_edit_signers'] = $data['allow_edit_signers'] ?? false; - $this->container['allow_edit_documents'] = $data['allow_edit_documents'] ?? false; + $this->setIfExists('allow_edit_signers', $data ?? [], false); + $this->setIfExists('allow_edit_documents', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubEditorOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubEditorOptions { - /** @var SubEditorOptions $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubEditorOptions */ + return ObjectSerializer::deserialize( $data, SubEditorOptions::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -213,9 +289,7 @@ public static function init(array $data): SubEditorOptions */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -248,6 +322,9 @@ public function getAllowEditSigners() */ public function setAllowEditSigners(?bool $allow_edit_signers) { + if (is_null($allow_edit_signers)) { + throw new InvalidArgumentException('non-nullable allow_edit_signers cannot be null'); + } $this->container['allow_edit_signers'] = $allow_edit_signers; return $this; @@ -272,6 +349,9 @@ public function getAllowEditDocuments() */ public function setAllowEditDocuments(?bool $allow_edit_documents) { + if (is_null($allow_edit_documents)) { + throw new InvalidArgumentException('non-nullable allow_edit_documents cannot be null'); + } $this->container['allow_edit_documents'] = $allow_edit_documents; return $this; @@ -280,12 +360,10 @@ public function setAllowEditDocuments(?bool $allow_edit_documents) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +371,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +384,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +400,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +412,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFieldOptions.php b/sdks/php/src/Model/SubFieldOptions.php index 3bb948219..974daa4a9 100644 --- a/sdks/php/src/Model/SubFieldOptions.php +++ b/sdks/php/src/Model/SubFieldOptions.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * * @category Class * @description This allows the requester to specify field options for a signature request. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFieldOptions implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +72,22 @@ class SubFieldOptions implements ModelInterface, ArrayAccess, JsonSerializable 'date_format' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'date_format' => 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 * @@ -96,6 +108,50 @@ 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 @@ -192,37 +248,55 @@ public function getDateFormatAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['date_format'] = $data['date_format'] ?? null; + $this->setIfExists('date_format', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFieldOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFieldOptions { - /** @var SubFieldOptions $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFieldOptions */ + return ObjectSerializer::deserialize( $data, SubFieldOptions::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -279,6 +353,9 @@ public function getDateFormat() */ public function setDateFormat(string $date_format) { + if (is_null($date_format)) { + throw new InvalidArgumentException('non-nullable date_format cannot be null'); + } $allowedValues = $this->getDateFormatAllowableValues(); if (!in_array($date_format, $allowedValues, true)) { throw new InvalidArgumentException( @@ -297,12 +374,10 @@ public function setDateFormat(string $date_format) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -310,7 +385,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -323,13 +398,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -341,12 +414,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -355,8 +426,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldGroup.php b/sdks/php/src/Model/SubFormFieldGroup.php index 2982638e8..2ff53e101 100644 --- a/sdks/php/src/Model/SubFormFieldGroup.php +++ b/sdks/php/src/Model/SubFormFieldGroup.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SubFormFieldGroup Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldGroup implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +75,24 @@ class SubFormFieldGroup implements ModelInterface, ArrayAccess, JsonSerializable 'requirement' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'group_id' => false, + 'group_label' => false, + 'requirement' => 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 * @@ -98,6 +113,50 @@ 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 @@ -176,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['group_id'] = $data['group_id'] ?? null; - $this->container['group_label'] = $data['group_label'] ?? null; - $this->container['requirement'] = $data['requirement'] ?? null; + $this->setIfExists('group_id', $data ?? [], null); + $this->setIfExists('group_label', $data ?? [], null); + $this->setIfExists('requirement', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldGroup { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldGroup { - /** @var SubFormFieldGroup $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldGroup */ + return ObjectSerializer::deserialize( $data, SubFormFieldGroup::class, ); + } - return $obj; + /** + * 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; } /** @@ -229,7 +306,6 @@ public function listInvalidProperties() if ($this->container['requirement'] === null) { $invalidProperties[] = "'requirement' can't be null"; } - return $invalidProperties; } @@ -263,6 +339,9 @@ public function getGroupId() */ public function setGroupId(string $group_id) { + if (is_null($group_id)) { + throw new InvalidArgumentException('non-nullable group_id cannot be null'); + } $this->container['group_id'] = $group_id; return $this; @@ -287,6 +366,9 @@ public function getGroupLabel() */ public function setGroupLabel(string $group_label) { + if (is_null($group_label)) { + throw new InvalidArgumentException('non-nullable group_label cannot be null'); + } $this->container['group_label'] = $group_label; return $this; @@ -311,6 +393,9 @@ public function getRequirement() */ public function setRequirement(string $requirement) { + if (is_null($requirement)) { + throw new InvalidArgumentException('non-nullable requirement cannot be null'); + } $this->container['requirement'] = $requirement; return $this; @@ -319,12 +404,10 @@ public function setRequirement(string $requirement) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -332,7 +415,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -345,13 +428,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -363,12 +444,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -377,8 +456,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldRule.php b/sdks/php/src/Model/SubFormFieldRule.php index 06adccf64..094d8217c 100644 --- a/sdks/php/src/Model/SubFormFieldRule.php +++ b/sdks/php/src/Model/SubFormFieldRule.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,11 +37,8 @@ * SubFormFieldRule Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldRule implements ModelInterface, ArrayAccess, JsonSerializable { @@ -81,6 +77,25 @@ class SubFormFieldRule implements ModelInterface, ArrayAccess, JsonSerializable 'actions' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'trigger_operator' => false, + 'triggers' => false, + 'actions' => 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 * @@ -101,6 +116,50 @@ 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 @@ -182,40 +241,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['trigger_operator'] = $data['trigger_operator'] ?? 'AND'; - $this->container['triggers'] = $data['triggers'] ?? null; - $this->container['actions'] = $data['actions'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('trigger_operator', $data ?? [], 'AND'); + $this->setIfExists('triggers', $data ?? [], null); + $this->setIfExists('actions', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldRule { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldRule { - /** @var SubFormFieldRule $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldRule */ + return ObjectSerializer::deserialize( $data, SubFormFieldRule::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -236,18 +313,18 @@ public function listInvalidProperties() if ($this->container['triggers'] === null) { $invalidProperties[] = "'triggers' can't be null"; } - if ((count($this->container['triggers']) > 1)) { + if (count($this->container['triggers']) > 1) { $invalidProperties[] = "invalid value for 'triggers', number of items must be less than or equal to 1."; } - if ((count($this->container['triggers']) < 1)) { + if (count($this->container['triggers']) < 1) { $invalidProperties[] = "invalid value for 'triggers', number of items must be greater than or equal to 1."; } if ($this->container['actions'] === null) { $invalidProperties[] = "'actions' can't be null"; } - if ((count($this->container['actions']) < 1)) { + if (count($this->container['actions']) < 1) { $invalidProperties[] = "invalid value for 'actions', number of items must be greater than or equal to 1."; } @@ -284,6 +361,9 @@ public function getId() */ public function setId(string $id) { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -308,6 +388,9 @@ public function getTriggerOperator() */ public function setTriggerOperator(string $trigger_operator) { + if (is_null($trigger_operator)) { + throw new InvalidArgumentException('non-nullable trigger_operator cannot be null'); + } $this->container['trigger_operator'] = $trigger_operator; return $this; @@ -332,10 +415,14 @@ public function getTriggers() */ public function setTriggers(array $triggers) { - if ((count($triggers) > 1)) { + if (is_null($triggers)) { + throw new InvalidArgumentException('non-nullable triggers cannot be null'); + } + + if (count($triggers) > 1) { throw new InvalidArgumentException('invalid value for $triggers when calling SubFormFieldRule., number of items must be less than or equal to 1.'); } - if ((count($triggers) < 1)) { + if (count($triggers) < 1) { throw new InvalidArgumentException('invalid length for $triggers when calling SubFormFieldRule., number of items must be greater than or equal to 1.'); } $this->container['triggers'] = $triggers; @@ -362,7 +449,11 @@ public function getActions() */ public function setActions(array $actions) { - if ((count($actions) < 1)) { + if (is_null($actions)) { + throw new InvalidArgumentException('non-nullable actions cannot be null'); + } + + if (count($actions) < 1) { throw new InvalidArgumentException('invalid length for $actions when calling SubFormFieldRule., number of items must be greater than or equal to 1.'); } $this->container['actions'] = $actions; @@ -373,12 +464,10 @@ public function setActions(array $actions) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -386,7 +475,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -399,13 +488,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -417,12 +504,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -431,8 +516,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldRuleAction.php b/sdks/php/src/Model/SubFormFieldRuleAction.php index c1802e157..458b5822f 100644 --- a/sdks/php/src/Model/SubFormFieldRuleAction.php +++ b/sdks/php/src/Model/SubFormFieldRuleAction.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,11 +37,8 @@ * SubFormFieldRuleAction Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldRuleAction implements ModelInterface, ArrayAccess, JsonSerializable { @@ -81,6 +77,25 @@ class SubFormFieldRuleAction implements ModelInterface, ArrayAccess, JsonSeriali 'group_id' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'hidden' => false, + 'type' => false, + 'field_id' => false, + 'group_id' => 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 * @@ -101,6 +116,50 @@ 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 @@ -198,40 +257,58 @@ public function getTypeAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['hidden'] = $data['hidden'] ?? null; - $this->container['type'] = $data['type'] ?? null; - $this->container['field_id'] = $data['field_id'] ?? null; - $this->container['group_id'] = $data['group_id'] ?? null; + $this->setIfExists('hidden', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('field_id', $data ?? [], null); + $this->setIfExists('group_id', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldRuleAction { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldRuleAction { - /** @var SubFormFieldRuleAction $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldRuleAction */ + return ObjectSerializer::deserialize( $data, SubFormFieldRuleAction::class, ); + } - return $obj; + /** + * 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; } /** @@ -291,6 +368,9 @@ public function getHidden() */ public function setHidden(bool $hidden) { + if (is_null($hidden)) { + throw new InvalidArgumentException('non-nullable hidden cannot be null'); + } $this->container['hidden'] = $hidden; return $this; @@ -315,6 +395,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { throw new InvalidArgumentException( @@ -349,6 +432,9 @@ public function getFieldId() */ public function setFieldId(?string $field_id) { + if (is_null($field_id)) { + throw new InvalidArgumentException('non-nullable field_id cannot be null'); + } $this->container['field_id'] = $field_id; return $this; @@ -373,6 +459,9 @@ public function getGroupId() */ public function setGroupId(?string $group_id) { + if (is_null($group_id)) { + throw new InvalidArgumentException('non-nullable group_id cannot be null'); + } $this->container['group_id'] = $group_id; return $this; @@ -381,12 +470,10 @@ public function setGroupId(?string $group_id) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -394,7 +481,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -407,13 +494,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -425,12 +510,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -439,8 +522,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldRuleTrigger.php b/sdks/php/src/Model/SubFormFieldRuleTrigger.php index 1fbabd217..0ab5768e0 100644 --- a/sdks/php/src/Model/SubFormFieldRuleTrigger.php +++ b/sdks/php/src/Model/SubFormFieldRuleTrigger.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,11 +37,8 @@ * SubFormFieldRuleTrigger Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldRuleTrigger implements ModelInterface, ArrayAccess, JsonSerializable { @@ -81,6 +77,25 @@ class SubFormFieldRuleTrigger implements ModelInterface, ArrayAccess, JsonSerial 'values' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'operator' => false, + 'value' => false, + 'values' => 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 * @@ -101,6 +116,50 @@ 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 @@ -204,40 +263,58 @@ public function getOperatorAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['operator'] = $data['operator'] ?? null; - $this->container['value'] = $data['value'] ?? null; - $this->container['values'] = $data['values'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldRuleTrigger { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldRuleTrigger { - /** @var SubFormFieldRuleTrigger $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldRuleTrigger */ + return ObjectSerializer::deserialize( $data, SubFormFieldRuleTrigger::class, ); + } - return $obj; + /** + * 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; } /** @@ -297,6 +374,9 @@ public function getId() */ public function setId(string $id) { + if (is_null($id)) { + throw new InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -321,6 +401,9 @@ public function getOperator() */ public function setOperator(string $operator) { + if (is_null($operator)) { + throw new InvalidArgumentException('non-nullable operator cannot be null'); + } $allowedValues = $this->getOperatorAllowableValues(); if (!in_array($operator, $allowedValues, true)) { throw new InvalidArgumentException( @@ -355,6 +438,9 @@ public function getValue() */ public function setValue(?string $value) { + if (is_null($value)) { + throw new InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -379,6 +465,9 @@ public function getValues() */ public function setValues(?array $values) { + if (is_null($values)) { + throw new InvalidArgumentException('non-nullable values cannot be null'); + } $this->container['values'] = $values; return $this; @@ -387,12 +476,10 @@ public function setValues(?array $values) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -400,7 +487,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -413,13 +500,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -431,12 +516,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -445,8 +528,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php b/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php index 273b7e238..68158bf5a 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentBase.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,14 +38,10 @@ * * @category Class * @description The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ -abstract class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, JsonSerializable +class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; @@ -96,6 +92,32 @@ abstract class SubFormFieldsPerDocumentBase implements ModelInterface, ArrayAcce 'page' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'document_index' => false, + 'api_id' => false, + 'height' => false, + 'required' => false, + 'signer' => false, + 'type' => false, + 'width' => false, + 'x' => false, + 'y' => false, + 'name' => false, + 'page' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -116,6 +138,50 @@ 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 @@ -218,29 +284,29 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['document_index'] = $data['document_index'] ?? null; - $this->container['api_id'] = $data['api_id'] ?? null; - $this->container['height'] = $data['height'] ?? null; - $this->container['required'] = $data['required'] ?? null; - $this->container['signer'] = $data['signer'] ?? null; - $this->container['type'] = $data['type'] ?? null; - $this->container['width'] = $data['width'] ?? null; - $this->container['x'] = $data['x'] ?? null; - $this->container['y'] = $data['y'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['page'] = $data['page'] ?? null; + $this->setIfExists('document_index', $data ?? [], null); + $this->setIfExists('api_id', $data ?? [], null); + $this->setIfExists('height', $data ?? [], null); + $this->setIfExists('required', $data ?? [], null); + $this->setIfExists('signer', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('page', $data ?? [], null); // Initialize discriminator property with the model name. $this->container['type'] = static::$openAPIModelName; @@ -286,6 +352,22 @@ public static function discriminatorClassName(array $data): ?string return null; } + /** + * 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. * @@ -322,7 +404,6 @@ public function listInvalidProperties() if ($this->container['y'] === null) { $invalidProperties[] = "'y' can't be null"; } - return $invalidProperties; } @@ -356,6 +437,9 @@ public function getDocumentIndex() */ public function setDocumentIndex(int $document_index) { + if (is_null($document_index)) { + throw new InvalidArgumentException('non-nullable document_index cannot be null'); + } $this->container['document_index'] = $document_index; return $this; @@ -380,6 +464,9 @@ public function getApiId() */ public function setApiId(string $api_id) { + if (is_null($api_id)) { + throw new InvalidArgumentException('non-nullable api_id cannot be null'); + } $this->container['api_id'] = $api_id; return $this; @@ -404,6 +491,9 @@ public function getHeight() */ public function setHeight(int $height) { + if (is_null($height)) { + throw new InvalidArgumentException('non-nullable height cannot be null'); + } $this->container['height'] = $height; return $this; @@ -428,6 +518,9 @@ public function getRequired() */ public function setRequired(bool $required) { + if (is_null($required)) { + throw new InvalidArgumentException('non-nullable required cannot be null'); + } $this->container['required'] = $required; return $this; @@ -436,7 +529,7 @@ public function setRequired(bool $required) /** * Gets signer * - * @return int|string + * @return string */ public function getSigner() { @@ -446,12 +539,15 @@ public function getSigner() /** * Sets signer * - * @param int|string $signer Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. + * @param string $signer Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. * * @return self */ - public function setSigner($signer) + public function setSigner(string $signer) { + if (is_null($signer)) { + throw new InvalidArgumentException('non-nullable signer cannot be null'); + } $this->container['signer'] = $signer; return $this; @@ -476,6 +572,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -500,6 +599,9 @@ public function getWidth() */ public function setWidth(int $width) { + if (is_null($width)) { + throw new InvalidArgumentException('non-nullable width cannot be null'); + } $this->container['width'] = $width; return $this; @@ -524,6 +626,9 @@ public function getX() */ public function setX(int $x) { + if (is_null($x)) { + throw new InvalidArgumentException('non-nullable x cannot be null'); + } $this->container['x'] = $x; return $this; @@ -548,6 +653,9 @@ public function getY() */ public function setY(int $y) { + if (is_null($y)) { + throw new InvalidArgumentException('non-nullable y cannot be null'); + } $this->container['y'] = $y; return $this; @@ -572,6 +680,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -596,6 +707,16 @@ public function getPage() */ public function setPage(?int $page) { + if (is_null($page)) { + array_push($this->openAPINullablesSetToNull, 'page'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('page', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['page'] = $page; return $this; @@ -604,12 +725,10 @@ public function setPage(?int $page) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -617,7 +736,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -630,13 +749,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -648,12 +765,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -662,8 +777,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php index 73b035443..c023916c7 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckbox.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `SubFormFieldsPerDocumentBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase { @@ -77,6 +74,24 @@ class SubFormFieldsPerDocumentCheckbox extends SubFormFieldsPerDocumentBase 'group' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'is_checked' => false, + 'group' => 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 * @@ -97,6 +112,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -175,34 +234,52 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'checkbox'; - $this->container['is_checked'] = $data['is_checked'] ?? null; - $this->container['group'] = $data['group'] ?? null; + $this->setIfExists('type', $data ?? [], 'checkbox'); + $this->setIfExists('is_checked', $data ?? [], null); + $this->setIfExists('group', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentCheckbox { - /** @var SubFormFieldsPerDocumentCheckbox $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldsPerDocumentCheckbox */ + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentCheckbox::class, ); + } - return $obj; + /** + * 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; } /** @@ -220,7 +297,6 @@ public function listInvalidProperties() if ($this->container['is_checked'] === null) { $invalidProperties[] = "'is_checked' can't be null"; } - return $invalidProperties; } @@ -254,6 +330,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -278,6 +357,9 @@ public function getIsChecked() */ public function setIsChecked(bool $is_checked) { + if (is_null($is_checked)) { + throw new InvalidArgumentException('non-nullable is_checked cannot be null'); + } $this->container['is_checked'] = $is_checked; return $this; @@ -302,6 +384,9 @@ public function getGroup() */ public function setGroup(?string $group) { + if (is_null($group)) { + throw new InvalidArgumentException('non-nullable group cannot be null'); + } $this->container['group'] = $group; return $this; @@ -310,12 +395,10 @@ public function setGroup(?string $group) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,7 +406,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -336,13 +419,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -354,12 +435,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -368,8 +447,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php index 7c2add6a2..c3924079b 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentCheckboxMerge.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `SubFormFieldsPerDocumentBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase { @@ -73,6 +70,22 @@ class SubFormFieldsPerDocumentCheckboxMerge extends SubFormFieldsPerDocumentBase 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'checkbox-merge'; + $this->setIfExists('type', $data ?? [], 'checkbox-merge'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentCheckboxMerge { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentCheckboxMerge { - /** @var SubFormFieldsPerDocumentCheckboxMerge $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldsPerDocumentCheckboxMerge */ + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentCheckboxMerge::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php b/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php index 22f989b9d..5902025ad 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentDateSigned.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -37,11 +36,8 @@ * * @category Class * @description This class extends `SubFormFieldsPerDocumentBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase { @@ -78,6 +74,24 @@ class SubFormFieldsPerDocumentDateSigned extends SubFormFieldsPerDocumentBase 'font_size' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'font_family' => false, + 'font_size' => 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 * @@ -98,6 +112,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -220,34 +278,52 @@ public function getFontFamilyAllowableValues() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'date_signed'; - $this->container['font_family'] = $data['font_family'] ?? null; - $this->container['font_size'] = $data['font_size'] ?? 12; + $this->setIfExists('type', $data ?? [], 'date_signed'); + $this->setIfExists('font_family', $data ?? [], null); + $this->setIfExists('font_size', $data ?? [], 12); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentDateSigned { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentDateSigned { - /** @var SubFormFieldsPerDocumentDateSigned $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldsPerDocumentDateSigned */ + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentDateSigned::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -304,6 +380,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -328,8 +407,11 @@ public function getFontFamily() */ public function setFontFamily(?string $font_family) { + if (is_null($font_family)) { + throw new InvalidArgumentException('non-nullable font_family cannot be null'); + } $allowedValues = $this->getFontFamilyAllowableValues(); - if (!is_null($font_family) && !in_array($font_family, $allowedValues, true)) { + if (!in_array($font_family, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", @@ -362,6 +444,9 @@ public function getFontSize() */ public function setFontSize(?int $font_size) { + if (is_null($font_size)) { + throw new InvalidArgumentException('non-nullable font_size cannot be null'); + } $this->container['font_size'] = $font_size; return $this; @@ -370,12 +455,10 @@ public function setFontSize(?int $font_size) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -383,7 +466,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -396,13 +479,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,12 +495,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -428,8 +507,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php b/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php index f4b1cb5bd..121c3eb48 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentDropdown.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -37,11 +36,8 @@ * * @category Class * @description This class extends `SubFormFieldsPerDocumentBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase { @@ -82,6 +78,26 @@ class SubFormFieldsPerDocumentDropdown extends SubFormFieldsPerDocumentBase 'font_size' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'options' => false, + 'content' => false, + 'font_family' => false, + 'font_size' => 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 * @@ -102,6 +118,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -230,36 +290,54 @@ public function getFontFamilyAllowableValues() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'dropdown'; - $this->container['options'] = $data['options'] ?? null; - $this->container['content'] = $data['content'] ?? null; - $this->container['font_family'] = $data['font_family'] ?? null; - $this->container['font_size'] = $data['font_size'] ?? 12; + $this->setIfExists('type', $data ?? [], 'dropdown'); + $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('font_family', $data ?? [], null); + $this->setIfExists('font_size', $data ?? [], 12); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentDropdown { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentDropdown { - /** @var SubFormFieldsPerDocumentDropdown $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldsPerDocumentDropdown */ + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentDropdown::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -277,7 +355,7 @@ public function listInvalidProperties() if ($this->container['options'] === null) { $invalidProperties[] = "'options' can't be null"; } - if ((count($this->container['options']) < 1)) { + if (count($this->container['options']) < 1) { $invalidProperties[] = "invalid value for 'options', number of items must be greater than or equal to 1."; } @@ -323,6 +401,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -347,7 +428,11 @@ public function getOptions() */ public function setOptions(array $options) { - if ((count($options) < 1)) { + if (is_null($options)) { + throw new InvalidArgumentException('non-nullable options cannot be null'); + } + + if (count($options) < 1) { throw new InvalidArgumentException('invalid length for $options when calling SubFormFieldsPerDocumentDropdown., number of items must be greater than or equal to 1.'); } $this->container['options'] = $options; @@ -374,6 +459,9 @@ public function getContent() */ public function setContent(?string $content) { + if (is_null($content)) { + throw new InvalidArgumentException('non-nullable content cannot be null'); + } $this->container['content'] = $content; return $this; @@ -398,8 +486,11 @@ public function getFontFamily() */ public function setFontFamily(?string $font_family) { + if (is_null($font_family)) { + throw new InvalidArgumentException('non-nullable font_family cannot be null'); + } $allowedValues = $this->getFontFamilyAllowableValues(); - if (!is_null($font_family) && !in_array($font_family, $allowedValues, true)) { + if (!in_array($font_family, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", @@ -432,6 +523,9 @@ public function getFontSize() */ public function setFontSize(?int $font_size) { + if (is_null($font_size)) { + throw new InvalidArgumentException('non-nullable font_size cannot be null'); + } $this->container['font_size'] = $font_size; return $this; @@ -440,12 +534,10 @@ public function setFontSize(?int $font_size) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -453,7 +545,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -466,13 +558,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -484,12 +574,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -498,8 +586,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php b/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php index 6880c6dac..bc0eff196 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentFontEnum.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -32,7 +31,6 @@ * SubFormFieldsPerDocumentFontEnum Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class SubFormFieldsPerDocumentFontEnum diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentHyperlink.php b/sdks/php/src/Model/SubFormFieldsPerDocumentHyperlink.php index 7a9b19714..924429f26 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentHyperlink.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentHyperlink.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -37,11 +36,8 @@ * * @category Class * @description This class extends `SubFormFieldsPerDocumentBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase { @@ -82,6 +78,26 @@ class SubFormFieldsPerDocumentHyperlink extends SubFormFieldsPerDocumentBase 'font_size' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'content' => false, + 'content_url' => false, + 'font_family' => false, + 'font_size' => 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 * @@ -102,6 +118,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -230,36 +290,54 @@ public function getFontFamilyAllowableValues() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'hyperlink'; - $this->container['content'] = $data['content'] ?? null; - $this->container['content_url'] = $data['content_url'] ?? null; - $this->container['font_family'] = $data['font_family'] ?? null; - $this->container['font_size'] = $data['font_size'] ?? 12; + $this->setIfExists('type', $data ?? [], 'hyperlink'); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('content_url', $data ?? [], null); + $this->setIfExists('font_family', $data ?? [], null); + $this->setIfExists('font_size', $data ?? [], 12); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentHyperlink { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentHyperlink { - /** @var SubFormFieldsPerDocumentHyperlink $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldsPerDocumentHyperlink */ + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentHyperlink::class, ); + } - return $obj; + /** + * 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; } /** @@ -322,6 +400,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -346,6 +427,9 @@ public function getContent() */ public function setContent(string $content) { + if (is_null($content)) { + throw new InvalidArgumentException('non-nullable content cannot be null'); + } $this->container['content'] = $content; return $this; @@ -370,6 +454,9 @@ public function getContentUrl() */ public function setContentUrl(string $content_url) { + if (is_null($content_url)) { + throw new InvalidArgumentException('non-nullable content_url cannot be null'); + } $this->container['content_url'] = $content_url; return $this; @@ -394,8 +481,11 @@ public function getFontFamily() */ public function setFontFamily(?string $font_family) { + if (is_null($font_family)) { + throw new InvalidArgumentException('non-nullable font_family cannot be null'); + } $allowedValues = $this->getFontFamilyAllowableValues(); - if (!is_null($font_family) && !in_array($font_family, $allowedValues, true)) { + if (!in_array($font_family, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", @@ -428,6 +518,9 @@ public function getFontSize() */ public function setFontSize(?int $font_size) { + if (is_null($font_size)) { + throw new InvalidArgumentException('non-nullable font_size cannot be null'); + } $this->container['font_size'] = $font_size; return $this; @@ -436,12 +529,10 @@ public function setFontSize(?int $font_size) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -449,7 +540,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -462,13 +553,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -480,12 +569,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -494,8 +581,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php b/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php index c13441367..cfddb0495 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentInitials.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `SubFormFieldsPerDocumentBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase { @@ -73,6 +70,22 @@ class SubFormFieldsPerDocumentInitials extends SubFormFieldsPerDocumentBase 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'initials'; + $this->setIfExists('type', $data ?? [], 'initials'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentInitials { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentInitials { - /** @var SubFormFieldsPerDocumentInitials $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldsPerDocumentInitials */ + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentInitials::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php b/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php index 62c9fa4e8..b506baa56 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentRadio.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `SubFormFieldsPerDocumentBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase { @@ -77,6 +74,24 @@ class SubFormFieldsPerDocumentRadio extends SubFormFieldsPerDocumentBase 'is_checked' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'group' => false, + 'is_checked' => 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 * @@ -97,6 +112,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -175,34 +234,52 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'radio'; - $this->container['group'] = $data['group'] ?? null; - $this->container['is_checked'] = $data['is_checked'] ?? null; + $this->setIfExists('type', $data ?? [], 'radio'); + $this->setIfExists('group', $data ?? [], null); + $this->setIfExists('is_checked', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentRadio { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentRadio { - /** @var SubFormFieldsPerDocumentRadio $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldsPerDocumentRadio */ + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentRadio::class, ); + } - return $obj; + /** + * 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; } /** @@ -223,7 +300,6 @@ public function listInvalidProperties() if ($this->container['is_checked'] === null) { $invalidProperties[] = "'is_checked' can't be null"; } - return $invalidProperties; } @@ -257,6 +333,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -281,6 +360,9 @@ public function getGroup() */ public function setGroup(string $group) { + if (is_null($group)) { + throw new InvalidArgumentException('non-nullable group cannot be null'); + } $this->container['group'] = $group; return $this; @@ -305,6 +387,9 @@ public function getIsChecked() */ public function setIsChecked(bool $is_checked) { + if (is_null($is_checked)) { + throw new InvalidArgumentException('non-nullable is_checked cannot be null'); + } $this->container['is_checked'] = $is_checked; return $this; @@ -313,12 +398,10 @@ public function setIsChecked(bool $is_checked) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -326,7 +409,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -339,13 +422,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -357,12 +438,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -371,8 +450,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php b/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php index 08df4c6e3..37c6e7a15 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentSignature.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `SubFormFieldsPerDocumentBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase { @@ -73,6 +70,22 @@ class SubFormFieldsPerDocumentSignature extends SubFormFieldsPerDocumentBase 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'signature'; + $this->setIfExists('type', $data ?? [], 'signature'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentSignature { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentSignature { - /** @var SubFormFieldsPerDocumentSignature $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldsPerDocumentSignature */ + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentSignature::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentText.php b/sdks/php/src/Model/SubFormFieldsPerDocumentText.php index 09ceea997..fa048a12b 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentText.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentText.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -37,11 +36,8 @@ * * @category Class * @description This class extends `SubFormFieldsPerDocumentBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase { @@ -94,6 +90,32 @@ class SubFormFieldsPerDocumentText extends SubFormFieldsPerDocumentBase 'font_size' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'placeholder' => false, + 'auto_fill_type' => false, + 'link_id' => false, + 'masked' => false, + 'validation_type' => false, + 'validation_custom_regex' => false, + 'validation_custom_regex_format_label' => false, + 'content' => false, + 'font_family' => false, + 'font_size' => 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 * @@ -114,6 +136,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -291,42 +357,60 @@ public function getFontFamilyAllowableValues() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'text'; - $this->container['placeholder'] = $data['placeholder'] ?? null; - $this->container['auto_fill_type'] = $data['auto_fill_type'] ?? null; - $this->container['link_id'] = $data['link_id'] ?? null; - $this->container['masked'] = $data['masked'] ?? null; - $this->container['validation_type'] = $data['validation_type'] ?? null; - $this->container['validation_custom_regex'] = $data['validation_custom_regex'] ?? null; - $this->container['validation_custom_regex_format_label'] = $data['validation_custom_regex_format_label'] ?? null; - $this->container['content'] = $data['content'] ?? null; - $this->container['font_family'] = $data['font_family'] ?? null; - $this->container['font_size'] = $data['font_size'] ?? 12; + $this->setIfExists('type', $data ?? [], 'text'); + $this->setIfExists('placeholder', $data ?? [], null); + $this->setIfExists('auto_fill_type', $data ?? [], null); + $this->setIfExists('link_id', $data ?? [], null); + $this->setIfExists('masked', $data ?? [], null); + $this->setIfExists('validation_type', $data ?? [], null); + $this->setIfExists('validation_custom_regex', $data ?? [], null); + $this->setIfExists('validation_custom_regex_format_label', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('font_family', $data ?? [], null); + $this->setIfExists('font_size', $data ?? [], 12); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentText { - /** @var SubFormFieldsPerDocumentText $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldsPerDocumentText */ + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentText::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -392,6 +476,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -416,6 +503,9 @@ public function getPlaceholder() */ public function setPlaceholder(?string $placeholder) { + if (is_null($placeholder)) { + throw new InvalidArgumentException('non-nullable placeholder cannot be null'); + } $this->container['placeholder'] = $placeholder; return $this; @@ -440,6 +530,9 @@ public function getAutoFillType() */ public function setAutoFillType(?string $auto_fill_type) { + if (is_null($auto_fill_type)) { + throw new InvalidArgumentException('non-nullable auto_fill_type cannot be null'); + } $this->container['auto_fill_type'] = $auto_fill_type; return $this; @@ -464,6 +557,9 @@ public function getLinkId() */ public function setLinkId(?string $link_id) { + if (is_null($link_id)) { + throw new InvalidArgumentException('non-nullable link_id cannot be null'); + } $this->container['link_id'] = $link_id; return $this; @@ -488,6 +584,9 @@ public function getMasked() */ public function setMasked(?bool $masked) { + if (is_null($masked)) { + throw new InvalidArgumentException('non-nullable masked cannot be null'); + } $this->container['masked'] = $masked; return $this; @@ -512,8 +611,11 @@ public function getValidationType() */ public function setValidationType(?string $validation_type) { + if (is_null($validation_type)) { + throw new InvalidArgumentException('non-nullable validation_type cannot be null'); + } $allowedValues = $this->getValidationTypeAllowableValues(); - if (!is_null($validation_type) && !in_array($validation_type, $allowedValues, true)) { + if (!in_array($validation_type, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'validation_type', must be one of '%s'", @@ -546,6 +648,9 @@ public function getValidationCustomRegex() */ public function setValidationCustomRegex(?string $validation_custom_regex) { + if (is_null($validation_custom_regex)) { + throw new InvalidArgumentException('non-nullable validation_custom_regex cannot be null'); + } $this->container['validation_custom_regex'] = $validation_custom_regex; return $this; @@ -570,6 +675,9 @@ public function getValidationCustomRegexFormatLabel() */ public function setValidationCustomRegexFormatLabel(?string $validation_custom_regex_format_label) { + if (is_null($validation_custom_regex_format_label)) { + throw new InvalidArgumentException('non-nullable validation_custom_regex_format_label cannot be null'); + } $this->container['validation_custom_regex_format_label'] = $validation_custom_regex_format_label; return $this; @@ -594,6 +702,9 @@ public function getContent() */ public function setContent(?string $content) { + if (is_null($content)) { + throw new InvalidArgumentException('non-nullable content cannot be null'); + } $this->container['content'] = $content; return $this; @@ -618,8 +729,11 @@ public function getFontFamily() */ public function setFontFamily(?string $font_family) { + if (is_null($font_family)) { + throw new InvalidArgumentException('non-nullable font_family cannot be null'); + } $allowedValues = $this->getFontFamilyAllowableValues(); - if (!is_null($font_family) && !in_array($font_family, $allowedValues, true)) { + if (!in_array($font_family, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", @@ -652,6 +766,9 @@ public function getFontSize() */ public function setFontSize(?int $font_size) { + if (is_null($font_size)) { + throw new InvalidArgumentException('non-nullable font_size cannot be null'); + } $this->container['font_size'] = $font_size; return $this; @@ -660,12 +777,10 @@ public function setFontSize(?int $font_size) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -673,7 +788,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -686,13 +801,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -704,12 +817,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -718,8 +829,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php b/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php index 08ceb07ec..bfe22420e 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentTextMerge.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -37,11 +36,8 @@ * * @category Class * @description This class extends `SubFormFieldsPerDocumentBase`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase { @@ -78,6 +74,24 @@ class SubFormFieldsPerDocumentTextMerge extends SubFormFieldsPerDocumentBase 'font_size' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'font_family' => false, + 'font_size' => 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 * @@ -98,6 +112,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -220,34 +278,52 @@ public function getFontFamilyAllowableValues() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'text-merge'; - $this->container['font_family'] = $data['font_family'] ?? null; - $this->container['font_size'] = $data['font_size'] ?? 12; + $this->setIfExists('type', $data ?? [], 'text-merge'); + $this->setIfExists('font_family', $data ?? [], null); + $this->setIfExists('font_size', $data ?? [], 12); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubFormFieldsPerDocumentTextMerge { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubFormFieldsPerDocumentTextMerge { - /** @var SubFormFieldsPerDocumentTextMerge $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubFormFieldsPerDocumentTextMerge */ + return ObjectSerializer::deserialize( $data, SubFormFieldsPerDocumentTextMerge::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -304,6 +380,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -328,8 +407,11 @@ public function getFontFamily() */ public function setFontFamily(?string $font_family) { + if (is_null($font_family)) { + throw new InvalidArgumentException('non-nullable font_family cannot be null'); + } $allowedValues = $this->getFontFamilyAllowableValues(); - if (!is_null($font_family) && !in_array($font_family, $allowedValues, true)) { + if (!in_array($font_family, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'font_family', must be one of '%s'", @@ -362,6 +444,9 @@ public function getFontSize() */ public function setFontSize(?int $font_size) { + if (is_null($font_size)) { + throw new InvalidArgumentException('non-nullable font_size cannot be null'); + } $this->container['font_size'] = $font_size; return $this; @@ -370,12 +455,10 @@ public function setFontSize(?int $font_size) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -383,7 +466,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -396,13 +479,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,12 +495,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -428,8 +507,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php b/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php index efe5595e6..4a4294f5e 100644 --- a/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php +++ b/sdks/php/src/Model/SubFormFieldsPerDocumentTypeEnum.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -32,7 +31,6 @@ * SubFormFieldsPerDocumentTypeEnum Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class SubFormFieldsPerDocumentTypeEnum diff --git a/sdks/php/src/Model/SubMergeField.php b/sdks/php/src/Model/SubMergeField.php index cbc6ffc78..8631a07e4 100644 --- a/sdks/php/src/Model/SubMergeField.php +++ b/sdks/php/src/Model/SubMergeField.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,11 +37,8 @@ * SubMergeField Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubMergeField implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class SubMergeField implements ModelInterface, ArrayAccess, JsonSerializable 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'type' => 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 * @@ -97,6 +110,50 @@ 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 @@ -188,38 +245,56 @@ public function getTypeAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['type'] = $data['type'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubMergeField { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubMergeField { - /** @var SubMergeField $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubMergeField */ + return ObjectSerializer::deserialize( $data, SubMergeField::class, ); + } - return $obj; + /** + * 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; } /** @@ -279,6 +354,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -303,6 +381,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { throw new InvalidArgumentException( @@ -321,12 +402,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -334,7 +413,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -347,13 +426,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -365,12 +442,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -379,8 +454,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubOAuth.php b/sdks/php/src/Model/SubOAuth.php index 488da3405..2bbf85547 100644 --- a/sdks/php/src/Model/SubOAuth.php +++ b/sdks/php/src/Model/SubOAuth.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * * @category Class * @description OAuth related parameters. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubOAuth implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +74,23 @@ class SubOAuth implements ModelInterface, ArrayAccess, JsonSerializable 'scopes' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'callback_url' => false, + 'scopes' => 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 * @@ -98,6 +111,50 @@ 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 @@ -201,38 +258,56 @@ public function getScopesAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['callback_url'] = $data['callback_url'] ?? null; - $this->container['scopes'] = $data['scopes'] ?? null; + $this->setIfExists('callback_url', $data ?? [], null); + $this->setIfExists('scopes', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubOAuth { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubOAuth { - /** @var SubOAuth $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubOAuth */ + return ObjectSerializer::deserialize( $data, SubOAuth::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -242,9 +317,7 @@ public static function init(array $data): SubOAuth */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -277,6 +350,9 @@ public function getCallbackUrl() */ public function setCallbackUrl(?string $callback_url) { + if (is_null($callback_url)) { + throw new InvalidArgumentException('non-nullable callback_url cannot be null'); + } $this->container['callback_url'] = $callback_url; return $this; @@ -301,8 +377,11 @@ public function getScopes() */ public function setScopes(?array $scopes) { + if (is_null($scopes)) { + throw new InvalidArgumentException('non-nullable scopes cannot be null'); + } $allowedValues = $this->getScopesAllowableValues(); - if (!is_null($scopes) && array_diff($scopes, $allowedValues)) { + if (array_diff($scopes, $allowedValues)) { throw new InvalidArgumentException( sprintf( "Invalid value for 'scopes', must be one of '%s'", @@ -318,12 +397,10 @@ public function setScopes(?array $scopes) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -331,7 +408,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -344,13 +421,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -362,12 +437,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -376,8 +449,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubOptions.php b/sdks/php/src/Model/SubOptions.php index 0ac89500c..b86fa5b7f 100644 --- a/sdks/php/src/Model/SubOptions.php +++ b/sdks/php/src/Model/SubOptions.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,11 +38,8 @@ * * @category Class * @description Additional options supported by API App. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubOptions implements ModelInterface, ArrayAccess, JsonSerializable { @@ -75,6 +72,22 @@ class SubOptions implements ModelInterface, ArrayAccess, JsonSerializable 'can_insert_everywhere' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'can_insert_everywhere' => 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 * @@ -95,6 +108,50 @@ 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 @@ -167,37 +224,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['can_insert_everywhere'] = $data['can_insert_everywhere'] ?? false; + $this->setIfExists('can_insert_everywhere', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubOptions { - /** @var SubOptions $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubOptions */ + return ObjectSerializer::deserialize( $data, SubOptions::class, ); + } - return $obj; + /** + * 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; } /** @@ -207,9 +282,7 @@ public static function init(array $data): SubOptions */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -242,6 +315,9 @@ public function getCanInsertEverywhere() */ public function setCanInsertEverywhere(?bool $can_insert_everywhere) { + if (is_null($can_insert_everywhere)) { + throw new InvalidArgumentException('non-nullable can_insert_everywhere cannot be null'); + } $this->container['can_insert_everywhere'] = $can_insert_everywhere; return $this; @@ -250,12 +326,10 @@ public function setCanInsertEverywhere(?bool $can_insert_everywhere) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -263,7 +337,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -276,13 +350,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -294,12 +366,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -308,8 +378,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php b/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php index 950503cd4..2d15bc241 100644 --- a/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php +++ b/sdks/php/src/Model/SubSignatureRequestGroupedSigners.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SubSignatureRequestGroupedSigners Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubSignatureRequestGroupedSigners implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +75,24 @@ class SubSignatureRequestGroupedSigners implements ModelInterface, ArrayAccess, 'order' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'group' => false, + 'signers' => false, + 'order' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +113,50 @@ 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 @@ -176,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['group'] = $data['group'] ?? null; - $this->container['signers'] = $data['signers'] ?? null; - $this->container['order'] = $data['order'] ?? null; + $this->setIfExists('group', $data ?? [], null); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubSignatureRequestGroupedSigners { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubSignatureRequestGroupedSigners { - /** @var SubSignatureRequestGroupedSigners $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubSignatureRequestGroupedSigners */ + return ObjectSerializer::deserialize( $data, SubSignatureRequestGroupedSigners::class, ); + } - return $obj; + /** + * 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; } /** @@ -226,7 +303,6 @@ public function listInvalidProperties() if ($this->container['signers'] === null) { $invalidProperties[] = "'signers' can't be null"; } - return $invalidProperties; } @@ -260,6 +336,9 @@ public function getGroup() */ public function setGroup(string $group) { + if (is_null($group)) { + throw new InvalidArgumentException('non-nullable group cannot be null'); + } $this->container['group'] = $group; return $this; @@ -284,6 +363,9 @@ public function getSigners() */ public function setSigners(array $signers) { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } $this->container['signers'] = $signers; return $this; @@ -308,6 +390,16 @@ public function getOrder() */ public function setOrder(?int $order) { + if (is_null($order)) { + array_push($this->openAPINullablesSetToNull, 'order'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('order', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['order'] = $order; return $this; @@ -316,12 +408,10 @@ public function setOrder(?int $order) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -329,7 +419,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -342,13 +432,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -360,12 +448,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -374,8 +460,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubSignatureRequestSigner.php b/sdks/php/src/Model/SubSignatureRequestSigner.php index eca198308..64133e165 100644 --- a/sdks/php/src/Model/SubSignatureRequestSigner.php +++ b/sdks/php/src/Model/SubSignatureRequestSigner.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,11 +37,8 @@ * SubSignatureRequestSigner Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubSignatureRequestSigner implements ModelInterface, ArrayAccess, JsonSerializable { @@ -85,6 +81,27 @@ class SubSignatureRequestSigner implements ModelInterface, ArrayAccess, JsonSeri 'sms_phone_number_type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'email_address' => false, + 'order' => true, + 'pin' => false, + 'sms_phone_number' => false, + 'sms_phone_number_type' => 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 * @@ -105,6 +122,50 @@ 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 @@ -208,42 +269,60 @@ public function getSmsPhoneNumberTypeAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['order'] = $data['order'] ?? null; - $this->container['pin'] = $data['pin'] ?? null; - $this->container['sms_phone_number'] = $data['sms_phone_number'] ?? null; - $this->container['sms_phone_number_type'] = $data['sms_phone_number_type'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('pin', $data ?? [], null); + $this->setIfExists('sms_phone_number', $data ?? [], null); + $this->setIfExists('sms_phone_number_type', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubSignatureRequestSigner { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubSignatureRequestSigner { - /** @var SubSignatureRequestSigner $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubSignatureRequestSigner */ + return ObjectSerializer::deserialize( $data, SubSignatureRequestSigner::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -311,6 +390,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -335,6 +417,9 @@ public function getEmailAddress() */ public function setEmailAddress(string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -359,6 +444,16 @@ public function getOrder() */ public function setOrder(?int $order) { + if (is_null($order)) { + array_push($this->openAPINullablesSetToNull, 'order'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('order', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['order'] = $order; return $this; @@ -383,10 +478,13 @@ public function getPin() */ public function setPin(?string $pin) { - if (!is_null($pin) && (mb_strlen($pin) > 12)) { + if (is_null($pin)) { + throw new InvalidArgumentException('non-nullable pin cannot be null'); + } + if (mb_strlen($pin) > 12) { throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestSigner., must be smaller than or equal to 12.'); } - if (!is_null($pin) && (mb_strlen($pin) < 4)) { + if (mb_strlen($pin) < 4) { throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestSigner., must be bigger than or equal to 4.'); } @@ -414,6 +512,9 @@ public function getSmsPhoneNumber() */ public function setSmsPhoneNumber(?string $sms_phone_number) { + if (is_null($sms_phone_number)) { + throw new InvalidArgumentException('non-nullable sms_phone_number cannot be null'); + } $this->container['sms_phone_number'] = $sms_phone_number; return $this; @@ -438,8 +539,11 @@ public function getSmsPhoneNumberType() */ public function setSmsPhoneNumberType(?string $sms_phone_number_type) { + if (is_null($sms_phone_number_type)) { + throw new InvalidArgumentException('non-nullable sms_phone_number_type cannot be null'); + } $allowedValues = $this->getSmsPhoneNumberTypeAllowableValues(); - if (!is_null($sms_phone_number_type) && !in_array($sms_phone_number_type, $allowedValues, true)) { + if (!in_array($sms_phone_number_type, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'sms_phone_number_type', must be one of '%s'", @@ -456,12 +560,10 @@ public function setSmsPhoneNumberType(?string $sms_phone_number_type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -469,7 +571,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -482,13 +584,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -500,12 +600,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -514,8 +612,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php b/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php index d0c2f7c9a..15070e31f 100644 --- a/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php +++ b/sdks/php/src/Model/SubSignatureRequestTemplateSigner.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,11 +37,8 @@ * SubSignatureRequestTemplateSigner Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubSignatureRequestTemplateSigner implements ModelInterface, ArrayAccess, JsonSerializable { @@ -85,6 +81,27 @@ class SubSignatureRequestTemplateSigner implements ModelInterface, ArrayAccess, 'sms_phone_number_type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'role' => false, + 'name' => false, + 'email_address' => false, + 'pin' => false, + 'sms_phone_number' => false, + 'sms_phone_number_type' => 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 * @@ -105,6 +122,50 @@ 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 @@ -208,42 +269,60 @@ public function getSmsPhoneNumberTypeAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['role'] = $data['role'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['pin'] = $data['pin'] ?? null; - $this->container['sms_phone_number'] = $data['sms_phone_number'] ?? null; - $this->container['sms_phone_number_type'] = $data['sms_phone_number_type'] ?? null; + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('pin', $data ?? [], null); + $this->setIfExists('sms_phone_number', $data ?? [], null); + $this->setIfExists('sms_phone_number_type', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubSignatureRequestTemplateSigner { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubSignatureRequestTemplateSigner { - /** @var SubSignatureRequestTemplateSigner $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubSignatureRequestTemplateSigner */ + return ObjectSerializer::deserialize( $data, SubSignatureRequestTemplateSigner::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -314,6 +393,9 @@ public function getRole() */ public function setRole(string $role) { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } $this->container['role'] = $role; return $this; @@ -338,6 +420,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -362,6 +447,9 @@ public function getEmailAddress() */ public function setEmailAddress(string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -386,10 +474,13 @@ public function getPin() */ public function setPin(?string $pin) { - if (!is_null($pin) && (mb_strlen($pin) > 12)) { + if (is_null($pin)) { + throw new InvalidArgumentException('non-nullable pin cannot be null'); + } + if (mb_strlen($pin) > 12) { throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestTemplateSigner., must be smaller than or equal to 12.'); } - if (!is_null($pin) && (mb_strlen($pin) < 4)) { + if (mb_strlen($pin) < 4) { throw new InvalidArgumentException('invalid length for $pin when calling SubSignatureRequestTemplateSigner., must be bigger than or equal to 4.'); } @@ -417,6 +508,9 @@ public function getSmsPhoneNumber() */ public function setSmsPhoneNumber(?string $sms_phone_number) { + if (is_null($sms_phone_number)) { + throw new InvalidArgumentException('non-nullable sms_phone_number cannot be null'); + } $this->container['sms_phone_number'] = $sms_phone_number; return $this; @@ -441,8 +535,11 @@ public function getSmsPhoneNumberType() */ public function setSmsPhoneNumberType(?string $sms_phone_number_type) { + if (is_null($sms_phone_number_type)) { + throw new InvalidArgumentException('non-nullable sms_phone_number_type cannot be null'); + } $allowedValues = $this->getSmsPhoneNumberTypeAllowableValues(); - if (!is_null($sms_phone_number_type) && !in_array($sms_phone_number_type, $allowedValues, true)) { + if (!in_array($sms_phone_number_type, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'sms_phone_number_type', must be one of '%s'", @@ -459,12 +556,10 @@ public function setSmsPhoneNumberType(?string $sms_phone_number_type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -472,7 +567,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -485,13 +580,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -503,12 +596,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -517,8 +608,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubSigningOptions.php b/sdks/php/src/Model/SubSigningOptions.php index d6151831f..8cbaff0f0 100644 --- a/sdks/php/src/Model/SubSigningOptions.php +++ b/sdks/php/src/Model/SubSigningOptions.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * * @category Class * @description This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubSigningOptions implements ModelInterface, ArrayAccess, JsonSerializable { @@ -84,6 +80,26 @@ class SubSigningOptions implements ModelInterface, ArrayAccess, JsonSerializable 'upload' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'default_type' => false, + 'draw' => false, + 'phone' => false, + 'type' => false, + 'upload' => 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 * @@ -104,6 +120,50 @@ 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 @@ -208,41 +268,59 @@ public function getDefaultTypeAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['default_type'] = $data['default_type'] ?? null; - $this->container['draw'] = $data['draw'] ?? false; - $this->container['phone'] = $data['phone'] ?? false; - $this->container['type'] = $data['type'] ?? false; - $this->container['upload'] = $data['upload'] ?? false; + $this->setIfExists('default_type', $data ?? [], null); + $this->setIfExists('draw', $data ?? [], false); + $this->setIfExists('phone', $data ?? [], false); + $this->setIfExists('type', $data ?? [], false); + $this->setIfExists('upload', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubSigningOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubSigningOptions { - /** @var SubSigningOptions $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubSigningOptions */ + return ObjectSerializer::deserialize( $data, SubSigningOptions::class, ); + } - return $obj; + /** + * 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; } /** @@ -299,6 +377,9 @@ public function getDefaultType() */ public function setDefaultType(string $default_type) { + if (is_null($default_type)) { + throw new InvalidArgumentException('non-nullable default_type cannot be null'); + } $allowedValues = $this->getDefaultTypeAllowableValues(); if (!in_array($default_type, $allowedValues, true)) { throw new InvalidArgumentException( @@ -333,6 +414,9 @@ public function getDraw() */ public function setDraw(?bool $draw) { + if (is_null($draw)) { + throw new InvalidArgumentException('non-nullable draw cannot be null'); + } $this->container['draw'] = $draw; return $this; @@ -357,6 +441,9 @@ public function getPhone() */ public function setPhone(?bool $phone) { + if (is_null($phone)) { + throw new InvalidArgumentException('non-nullable phone cannot be null'); + } $this->container['phone'] = $phone; return $this; @@ -381,6 +468,9 @@ public function getType() */ public function setType(?bool $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -405,6 +495,9 @@ public function getUpload() */ public function setUpload(?bool $upload) { + if (is_null($upload)) { + throw new InvalidArgumentException('non-nullable upload cannot be null'); + } $this->container['upload'] = $upload; return $this; @@ -413,12 +506,10 @@ public function setUpload(?bool $upload) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -426,7 +517,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -439,13 +530,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -457,12 +546,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -471,8 +558,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubTeamResponse.php b/sdks/php/src/Model/SubTeamResponse.php index da57cfff9..60ecc442a 100644 --- a/sdks/php/src/Model/SubTeamResponse.php +++ b/sdks/php/src/Model/SubTeamResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * SubTeamResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class SubTeamResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class SubTeamResponse implements ModelInterface, ArrayAccess, JsonSerializable 'name' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'team_id' => false, + 'name' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['team_id'] = $data['team_id'] ?? null; - $this->container['name'] = $data['name'] ?? null; + $this->setIfExists('team_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubTeamResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubTeamResponse { - /** @var SubTeamResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubTeamResponse */ + return ObjectSerializer::deserialize( $data, SubTeamResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -213,9 +288,7 @@ public static function init(array $data): SubTeamResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -248,6 +321,9 @@ public function getTeamId() */ public function setTeamId(?string $team_id) { + if (is_null($team_id)) { + throw new InvalidArgumentException('non-nullable team_id cannot be null'); + } $this->container['team_id'] = $team_id; return $this; @@ -272,6 +348,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -280,12 +359,10 @@ public function setName(?string $name) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +370,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +383,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +399,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +411,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubTemplateRole.php b/sdks/php/src/Model/SubTemplateRole.php index 399c64b2b..2678da93a 100644 --- a/sdks/php/src/Model/SubTemplateRole.php +++ b/sdks/php/src/Model/SubTemplateRole.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SubTemplateRole Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubTemplateRole implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +73,23 @@ class SubTemplateRole implements ModelInterface, ArrayAccess, JsonSerializable 'order' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'order' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +110,50 @@ 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 @@ -171,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['order'] = $data['order'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubTemplateRole { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubTemplateRole { - /** @var SubTemplateRole $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubTemplateRole */ + return ObjectSerializer::deserialize( $data, SubTemplateRole::class, ); + } - return $obj; + /** + * 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; } /** @@ -212,9 +288,7 @@ public static function init(array $data): SubTemplateRole */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -247,6 +321,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -271,6 +348,16 @@ public function getOrder() */ public function setOrder(?int $order) { + if (is_null($order)) { + array_push($this->openAPINullablesSetToNull, 'order'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('order', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['order'] = $order; return $this; @@ -279,12 +366,10 @@ public function setOrder(?int $order) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -292,7 +377,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -305,13 +390,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -323,12 +406,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -337,8 +418,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubUnclaimedDraftSigner.php b/sdks/php/src/Model/SubUnclaimedDraftSigner.php index 646a6454f..acc466356 100644 --- a/sdks/php/src/Model/SubUnclaimedDraftSigner.php +++ b/sdks/php/src/Model/SubUnclaimedDraftSigner.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SubUnclaimedDraftSigner Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubUnclaimedDraftSigner implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +75,24 @@ class SubUnclaimedDraftSigner implements ModelInterface, ArrayAccess, JsonSerial 'order' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'email_address' => false, + 'name' => false, + 'order' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +113,50 @@ 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 @@ -176,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['order'] = $data['order'] ?? null; + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubUnclaimedDraftSigner { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubUnclaimedDraftSigner { - /** @var SubUnclaimedDraftSigner $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubUnclaimedDraftSigner */ + return ObjectSerializer::deserialize( $data, SubUnclaimedDraftSigner::class, ); + } - return $obj; + /** + * 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; } /** @@ -226,7 +303,6 @@ public function listInvalidProperties() if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } - return $invalidProperties; } @@ -260,6 +336,9 @@ public function getEmailAddress() */ public function setEmailAddress(string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -284,6 +363,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -308,6 +390,16 @@ public function getOrder() */ public function setOrder(?int $order) { + if (is_null($order)) { + array_push($this->openAPINullablesSetToNull, 'order'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('order', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['order'] = $order; return $this; @@ -316,12 +408,10 @@ public function setOrder(?int $order) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -329,7 +419,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -342,13 +432,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -360,12 +448,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -374,8 +460,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php b/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php index f55a46edf..9daffb1e4 100644 --- a/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php +++ b/sdks/php/src/Model/SubUnclaimedDraftTemplateSigner.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * SubUnclaimedDraftTemplateSigner Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubUnclaimedDraftTemplateSigner implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +75,24 @@ class SubUnclaimedDraftTemplateSigner implements ModelInterface, ArrayAccess, Js 'email_address' => 'email', ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'role' => false, + 'name' => false, + 'email_address' => 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 * @@ -98,6 +113,50 @@ 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 @@ -176,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['role'] = $data['role'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubUnclaimedDraftTemplateSigner { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubUnclaimedDraftTemplateSigner { - /** @var SubUnclaimedDraftTemplateSigner $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubUnclaimedDraftTemplateSigner */ + return ObjectSerializer::deserialize( $data, SubUnclaimedDraftTemplateSigner::class, ); + } - return $obj; + /** + * 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; } /** @@ -229,7 +306,6 @@ public function listInvalidProperties() if ($this->container['email_address'] === null) { $invalidProperties[] = "'email_address' can't be null"; } - return $invalidProperties; } @@ -263,6 +339,9 @@ public function getRole() */ public function setRole(string $role) { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } $this->container['role'] = $role; return $this; @@ -287,6 +366,9 @@ public function getName() */ public function setName(string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -311,6 +393,9 @@ public function getEmailAddress() */ public function setEmailAddress(string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -319,12 +404,10 @@ public function setEmailAddress(string $email_address) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -332,7 +415,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -345,13 +428,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -363,12 +444,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -377,8 +456,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/SubWhiteLabelingOptions.php b/sdks/php/src/Model/SubWhiteLabelingOptions.php index abed8147c..4f16b4928 100644 --- a/sdks/php/src/Model/SubWhiteLabelingOptions.php +++ b/sdks/php/src/Model/SubWhiteLabelingOptions.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * * @category Class * @description An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, JsonSerializable { @@ -104,6 +100,36 @@ class SubWhiteLabelingOptions implements ModelInterface, ArrayAccess, JsonSerial 'reset_to_default' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'header_background_color' => false, + 'legal_version' => false, + 'link_color' => false, + 'page_background_color' => false, + 'primary_button_color' => false, + 'primary_button_color_hover' => false, + 'primary_button_text_color' => false, + 'primary_button_text_color_hover' => false, + 'secondary_button_color' => false, + 'secondary_button_color_hover' => false, + 'secondary_button_text_color' => false, + 'secondary_button_text_color_hover' => false, + 'text_color1' => false, + 'text_color2' => false, + 'reset_to_default' => 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 * @@ -124,6 +150,50 @@ 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 @@ -254,51 +324,69 @@ public function getLegalVersionAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['header_background_color'] = $data['header_background_color'] ?? '#1A1A1A'; - $this->container['legal_version'] = $data['legal_version'] ?? 'terms1'; - $this->container['link_color'] = $data['link_color'] ?? '#00B3E6'; - $this->container['page_background_color'] = $data['page_background_color'] ?? '#F7F8F9'; - $this->container['primary_button_color'] = $data['primary_button_color'] ?? '#00B3E6'; - $this->container['primary_button_color_hover'] = $data['primary_button_color_hover'] ?? '#00B3E6'; - $this->container['primary_button_text_color'] = $data['primary_button_text_color'] ?? '#FFFFFF'; - $this->container['primary_button_text_color_hover'] = $data['primary_button_text_color_hover'] ?? '#FFFFFF'; - $this->container['secondary_button_color'] = $data['secondary_button_color'] ?? '#FFFFFF'; - $this->container['secondary_button_color_hover'] = $data['secondary_button_color_hover'] ?? '#FFFFFF'; - $this->container['secondary_button_text_color'] = $data['secondary_button_text_color'] ?? '#00B3E6'; - $this->container['secondary_button_text_color_hover'] = $data['secondary_button_text_color_hover'] ?? '#00B3E6'; - $this->container['text_color1'] = $data['text_color1'] ?? '#808080'; - $this->container['text_color2'] = $data['text_color2'] ?? '#FFFFFF'; - $this->container['reset_to_default'] = $data['reset_to_default'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('header_background_color', $data ?? [], '#1A1A1A'); + $this->setIfExists('legal_version', $data ?? [], 'terms1'); + $this->setIfExists('link_color', $data ?? [], '#00B3E6'); + $this->setIfExists('page_background_color', $data ?? [], '#F7F8F9'); + $this->setIfExists('primary_button_color', $data ?? [], '#00B3E6'); + $this->setIfExists('primary_button_color_hover', $data ?? [], '#00B3E6'); + $this->setIfExists('primary_button_text_color', $data ?? [], '#FFFFFF'); + $this->setIfExists('primary_button_text_color_hover', $data ?? [], '#FFFFFF'); + $this->setIfExists('secondary_button_color', $data ?? [], '#FFFFFF'); + $this->setIfExists('secondary_button_color_hover', $data ?? [], '#FFFFFF'); + $this->setIfExists('secondary_button_text_color', $data ?? [], '#00B3E6'); + $this->setIfExists('secondary_button_text_color_hover', $data ?? [], '#00B3E6'); + $this->setIfExists('text_color1', $data ?? [], '#808080'); + $this->setIfExists('text_color2', $data ?? [], '#FFFFFF'); + $this->setIfExists('reset_to_default', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): SubWhiteLabelingOptions { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): SubWhiteLabelingOptions { - /** @var SubWhiteLabelingOptions $obj */ - $obj = ObjectSerializer::deserialize( + /** @var SubWhiteLabelingOptions */ + return ObjectSerializer::deserialize( $data, SubWhiteLabelingOptions::class, ); + } - return $obj; + /** + * 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; } /** @@ -352,6 +440,9 @@ public function getHeaderBackgroundColor() */ public function setHeaderBackgroundColor(?string $header_background_color) { + if (is_null($header_background_color)) { + throw new InvalidArgumentException('non-nullable header_background_color cannot be null'); + } $this->container['header_background_color'] = $header_background_color; return $this; @@ -376,8 +467,11 @@ public function getLegalVersion() */ public function setLegalVersion(?string $legal_version) { + if (is_null($legal_version)) { + throw new InvalidArgumentException('non-nullable legal_version cannot be null'); + } $allowedValues = $this->getLegalVersionAllowableValues(); - if (!is_null($legal_version) && !in_array($legal_version, $allowedValues, true)) { + if (!in_array($legal_version, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'legal_version', must be one of '%s'", @@ -410,6 +504,9 @@ public function getLinkColor() */ public function setLinkColor(?string $link_color) { + if (is_null($link_color)) { + throw new InvalidArgumentException('non-nullable link_color cannot be null'); + } $this->container['link_color'] = $link_color; return $this; @@ -434,6 +531,9 @@ public function getPageBackgroundColor() */ public function setPageBackgroundColor(?string $page_background_color) { + if (is_null($page_background_color)) { + throw new InvalidArgumentException('non-nullable page_background_color cannot be null'); + } $this->container['page_background_color'] = $page_background_color; return $this; @@ -458,6 +558,9 @@ public function getPrimaryButtonColor() */ public function setPrimaryButtonColor(?string $primary_button_color) { + if (is_null($primary_button_color)) { + throw new InvalidArgumentException('non-nullable primary_button_color cannot be null'); + } $this->container['primary_button_color'] = $primary_button_color; return $this; @@ -482,6 +585,9 @@ public function getPrimaryButtonColorHover() */ public function setPrimaryButtonColorHover(?string $primary_button_color_hover) { + if (is_null($primary_button_color_hover)) { + throw new InvalidArgumentException('non-nullable primary_button_color_hover cannot be null'); + } $this->container['primary_button_color_hover'] = $primary_button_color_hover; return $this; @@ -506,6 +612,9 @@ public function getPrimaryButtonTextColor() */ public function setPrimaryButtonTextColor(?string $primary_button_text_color) { + if (is_null($primary_button_text_color)) { + throw new InvalidArgumentException('non-nullable primary_button_text_color cannot be null'); + } $this->container['primary_button_text_color'] = $primary_button_text_color; return $this; @@ -530,6 +639,9 @@ public function getPrimaryButtonTextColorHover() */ public function setPrimaryButtonTextColorHover(?string $primary_button_text_color_hover) { + if (is_null($primary_button_text_color_hover)) { + throw new InvalidArgumentException('non-nullable primary_button_text_color_hover cannot be null'); + } $this->container['primary_button_text_color_hover'] = $primary_button_text_color_hover; return $this; @@ -554,6 +666,9 @@ public function getSecondaryButtonColor() */ public function setSecondaryButtonColor(?string $secondary_button_color) { + if (is_null($secondary_button_color)) { + throw new InvalidArgumentException('non-nullable secondary_button_color cannot be null'); + } $this->container['secondary_button_color'] = $secondary_button_color; return $this; @@ -578,6 +693,9 @@ public function getSecondaryButtonColorHover() */ public function setSecondaryButtonColorHover(?string $secondary_button_color_hover) { + if (is_null($secondary_button_color_hover)) { + throw new InvalidArgumentException('non-nullable secondary_button_color_hover cannot be null'); + } $this->container['secondary_button_color_hover'] = $secondary_button_color_hover; return $this; @@ -602,6 +720,9 @@ public function getSecondaryButtonTextColor() */ public function setSecondaryButtonTextColor(?string $secondary_button_text_color) { + if (is_null($secondary_button_text_color)) { + throw new InvalidArgumentException('non-nullable secondary_button_text_color cannot be null'); + } $this->container['secondary_button_text_color'] = $secondary_button_text_color; return $this; @@ -626,6 +747,9 @@ public function getSecondaryButtonTextColorHover() */ public function setSecondaryButtonTextColorHover(?string $secondary_button_text_color_hover) { + if (is_null($secondary_button_text_color_hover)) { + throw new InvalidArgumentException('non-nullable secondary_button_text_color_hover cannot be null'); + } $this->container['secondary_button_text_color_hover'] = $secondary_button_text_color_hover; return $this; @@ -650,6 +774,9 @@ public function getTextColor1() */ public function setTextColor1(?string $text_color1) { + if (is_null($text_color1)) { + throw new InvalidArgumentException('non-nullable text_color1 cannot be null'); + } $this->container['text_color1'] = $text_color1; return $this; @@ -674,6 +801,9 @@ public function getTextColor2() */ public function setTextColor2(?string $text_color2) { + if (is_null($text_color2)) { + throw new InvalidArgumentException('non-nullable text_color2 cannot be null'); + } $this->container['text_color2'] = $text_color2; return $this; @@ -698,6 +828,9 @@ public function getResetToDefault() */ public function setResetToDefault(?bool $reset_to_default) { + if (is_null($reset_to_default)) { + throw new InvalidArgumentException('non-nullable reset_to_default cannot be null'); + } $this->container['reset_to_default'] = $reset_to_default; return $this; @@ -706,12 +839,10 @@ public function setResetToDefault(?bool $reset_to_default) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -719,7 +850,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -732,13 +863,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -750,12 +879,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -764,8 +891,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamAddMemberRequest.php b/sdks/php/src/Model/TeamAddMemberRequest.php index 1caf129bf..e38abb02f 100644 --- a/sdks/php/src/Model/TeamAddMemberRequest.php +++ b/sdks/php/src/Model/TeamAddMemberRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,11 +37,8 @@ * TeamAddMemberRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TeamAddMemberRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +75,24 @@ class TeamAddMemberRequest implements ModelInterface, ArrayAccess, JsonSerializa 'role' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account_id' => false, + 'email_address' => false, + 'role' => 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 * @@ -99,6 +113,50 @@ 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 @@ -197,39 +255,57 @@ public function getRoleAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account_id'] = $data['account_id'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['role'] = $data['role'] ?? null; + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamAddMemberRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamAddMemberRequest { - /** @var TeamAddMemberRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamAddMemberRequest */ + return ObjectSerializer::deserialize( $data, TeamAddMemberRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -283,6 +359,9 @@ public function getAccountId() */ public function setAccountId(?string $account_id) { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } $this->container['account_id'] = $account_id; return $this; @@ -307,6 +386,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -331,8 +413,11 @@ public function getRole() */ public function setRole(?string $role) { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } $allowedValues = $this->getRoleAllowableValues(); - if (!is_null($role) && !in_array($role, $allowedValues, true)) { + if (!in_array($role, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'role', must be one of '%s'", @@ -349,12 +434,10 @@ public function setRole(?string $role) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -362,7 +445,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -375,13 +458,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -393,12 +474,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -407,8 +486,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamCreateRequest.php b/sdks/php/src/Model/TeamCreateRequest.php index ad51504c4..6ba37cc71 100644 --- a/sdks/php/src/Model/TeamCreateRequest.php +++ b/sdks/php/src/Model/TeamCreateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * TeamCreateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TeamCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -74,6 +71,22 @@ class TeamCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable 'name' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +107,50 @@ 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 @@ -166,37 +223,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? 'Untitled Team'; + $this->setIfExists('name', $data ?? [], 'Untitled Team'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamCreateRequest { - /** @var TeamCreateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamCreateRequest */ + return ObjectSerializer::deserialize( $data, TeamCreateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -206,9 +281,7 @@ public static function init(array $data): TeamCreateRequest */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -241,6 +314,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -249,12 +325,10 @@ public function setName(?string $name) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -262,7 +336,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -275,13 +349,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -293,12 +365,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -307,8 +377,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamGetInfoResponse.php b/sdks/php/src/Model/TeamGetInfoResponse.php index d46fb6e9c..cfac0efbb 100644 --- a/sdks/php/src/Model/TeamGetInfoResponse.php +++ b/sdks/php/src/Model/TeamGetInfoResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TeamGetInfoResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TeamGetInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class TeamGetInfoResponse implements ModelInterface, ArrayAccess, JsonSerializab 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'team' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['team'] = $data['team'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('team', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamGetInfoResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamGetInfoResponse { - /** @var TeamGetInfoResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamGetInfoResponse */ + return ObjectSerializer::deserialize( $data, TeamGetInfoResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['team'] === null) { + $invalidProperties[] = "'team' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets team * - * @return TeamInfoResponse|null + * @return TeamInfoResponse */ public function getTeam() { @@ -242,12 +320,15 @@ public function getTeam() /** * Sets team * - * @param TeamInfoResponse|null $team team + * @param TeamInfoResponse $team team * * @return self */ - public function setTeam(?TeamInfoResponse $team) + public function setTeam(TeamInfoResponse $team) { + if (is_null($team)) { + throw new InvalidArgumentException('non-nullable team cannot be null'); + } $this->container['team'] = $team; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamGetResponse.php b/sdks/php/src/Model/TeamGetResponse.php index 0ff83b21a..6d23ddc3b 100644 --- a/sdks/php/src/Model/TeamGetResponse.php +++ b/sdks/php/src/Model/TeamGetResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TeamGetResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TeamGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class TeamGetResponse implements ModelInterface, ArrayAccess, JsonSerializable 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'team' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['team'] = $data['team'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('team', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamGetResponse { - /** @var TeamGetResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamGetResponse */ + return ObjectSerializer::deserialize( $data, TeamGetResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['team'] === null) { + $invalidProperties[] = "'team' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets team * - * @return TeamResponse|null + * @return TeamResponse */ public function getTeam() { @@ -242,12 +320,15 @@ public function getTeam() /** * Sets team * - * @param TeamResponse|null $team team + * @param TeamResponse $team team * * @return self */ - public function setTeam(?TeamResponse $team) + public function setTeam(TeamResponse $team) { + if (is_null($team)) { + throw new InvalidArgumentException('non-nullable team cannot be null'); + } $this->container['team'] = $team; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamInfoResponse.php b/sdks/php/src/Model/TeamInfoResponse.php index 782008377..3d5ad124a 100644 --- a/sdks/php/src/Model/TeamInfoResponse.php +++ b/sdks/php/src/Model/TeamInfoResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TeamInfoResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TeamInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -83,6 +79,26 @@ class TeamInfoResponse implements ModelInterface, ArrayAccess, JsonSerializable 'num_sub_teams' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'team_id' => false, + 'team_parent' => true, + 'name' => false, + 'num_members' => false, + 'num_sub_teams' => 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 * @@ -103,6 +119,50 @@ 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 @@ -187,41 +247,59 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['team_id'] = $data['team_id'] ?? null; - $this->container['team_parent'] = $data['team_parent'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['num_members'] = $data['num_members'] ?? null; - $this->container['num_sub_teams'] = $data['num_sub_teams'] ?? null; + $this->setIfExists('team_id', $data ?? [], null); + $this->setIfExists('team_parent', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('num_members', $data ?? [], null); + $this->setIfExists('num_sub_teams', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamInfoResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamInfoResponse { - /** @var TeamInfoResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamInfoResponse */ + return ObjectSerializer::deserialize( $data, TeamInfoResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -231,9 +309,7 @@ public static function init(array $data): TeamInfoResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -266,6 +342,9 @@ public function getTeamId() */ public function setTeamId(?string $team_id) { + if (is_null($team_id)) { + throw new InvalidArgumentException('non-nullable team_id cannot be null'); + } $this->container['team_id'] = $team_id; return $this; @@ -290,6 +369,16 @@ public function getTeamParent() */ public function setTeamParent(?TeamParentResponse $team_parent) { + if (is_null($team_parent)) { + array_push($this->openAPINullablesSetToNull, 'team_parent'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('team_parent', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['team_parent'] = $team_parent; return $this; @@ -314,6 +403,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -338,6 +430,9 @@ public function getNumMembers() */ public function setNumMembers(?int $num_members) { + if (is_null($num_members)) { + throw new InvalidArgumentException('non-nullable num_members cannot be null'); + } $this->container['num_members'] = $num_members; return $this; @@ -362,6 +457,9 @@ public function getNumSubTeams() */ public function setNumSubTeams(?int $num_sub_teams) { + if (is_null($num_sub_teams)) { + throw new InvalidArgumentException('non-nullable num_sub_teams cannot be null'); + } $this->container['num_sub_teams'] = $num_sub_teams; return $this; @@ -370,12 +468,10 @@ public function setNumSubTeams(?int $num_sub_teams) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -383,7 +479,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -396,13 +492,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -414,12 +508,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -428,8 +520,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamInviteResponse.php b/sdks/php/src/Model/TeamInviteResponse.php index 40a9b7a11..d37dae050 100644 --- a/sdks/php/src/Model/TeamInviteResponse.php +++ b/sdks/php/src/Model/TeamInviteResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TeamInviteResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TeamInviteResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -85,6 +81,27 @@ class TeamInviteResponse implements ModelInterface, ArrayAccess, JsonSerializabl 'expires_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'email_address' => false, + 'team_id' => false, + 'role' => false, + 'sent_at' => false, + 'redeemed_at' => false, + 'expires_at' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -105,6 +122,50 @@ 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 @@ -192,42 +253,60 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['team_id'] = $data['team_id'] ?? null; - $this->container['role'] = $data['role'] ?? null; - $this->container['sent_at'] = $data['sent_at'] ?? null; - $this->container['redeemed_at'] = $data['redeemed_at'] ?? null; - $this->container['expires_at'] = $data['expires_at'] ?? null; + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('team_id', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('sent_at', $data ?? [], null); + $this->setIfExists('redeemed_at', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamInviteResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamInviteResponse { - /** @var TeamInviteResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamInviteResponse */ + return ObjectSerializer::deserialize( $data, TeamInviteResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -237,9 +316,7 @@ public static function init(array $data): TeamInviteResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -272,6 +349,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -296,6 +376,9 @@ public function getTeamId() */ public function setTeamId(?string $team_id) { + if (is_null($team_id)) { + throw new InvalidArgumentException('non-nullable team_id cannot be null'); + } $this->container['team_id'] = $team_id; return $this; @@ -320,6 +403,9 @@ public function getRole() */ public function setRole(?string $role) { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } $this->container['role'] = $role; return $this; @@ -344,6 +430,9 @@ public function getSentAt() */ 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; @@ -368,6 +457,9 @@ public function getRedeemedAt() */ public function setRedeemedAt(?int $redeemed_at) { + if (is_null($redeemed_at)) { + throw new InvalidArgumentException('non-nullable redeemed_at cannot be null'); + } $this->container['redeemed_at'] = $redeemed_at; return $this; @@ -392,6 +484,9 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + } $this->container['expires_at'] = $expires_at; return $this; @@ -400,12 +495,10 @@ public function setExpiresAt(?int $expires_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -413,7 +506,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -426,13 +519,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -444,12 +535,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -458,8 +547,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamInvitesResponse.php b/sdks/php/src/Model/TeamInvitesResponse.php index 5dc9d0247..31b58b939 100644 --- a/sdks/php/src/Model/TeamInvitesResponse.php +++ b/sdks/php/src/Model/TeamInvitesResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TeamInvitesResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TeamInvitesResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class TeamInvitesResponse implements ModelInterface, ArrayAccess, JsonSerializab 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'team_invites' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['team_invites'] = $data['team_invites'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('team_invites', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamInvitesResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamInvitesResponse { - /** @var TeamInvitesResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamInvitesResponse */ + return ObjectSerializer::deserialize( $data, TeamInvitesResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['team_invites'] === null) { + $invalidProperties[] = "'team_invites' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets team_invites * - * @return TeamInviteResponse[]|null + * @return TeamInviteResponse[] */ public function getTeamInvites() { @@ -242,12 +320,15 @@ public function getTeamInvites() /** * Sets team_invites * - * @param TeamInviteResponse[]|null $team_invites contains a list of team invites and their roles + * @param TeamInviteResponse[] $team_invites contains a list of team invites and their roles * * @return self */ - public function setTeamInvites(?array $team_invites) + public function setTeamInvites(array $team_invites) { + if (is_null($team_invites)) { + throw new InvalidArgumentException('non-nullable team_invites cannot be null'); + } $this->container['team_invites'] = $team_invites; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamMemberResponse.php b/sdks/php/src/Model/TeamMemberResponse.php index db3be66f3..ee61fbdd3 100644 --- a/sdks/php/src/Model/TeamMemberResponse.php +++ b/sdks/php/src/Model/TeamMemberResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TeamMemberResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TeamMemberResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +75,24 @@ class TeamMemberResponse implements ModelInterface, ArrayAccess, JsonSerializabl 'role' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account_id' => false, + 'email_address' => false, + 'role' => 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 * @@ -99,6 +113,50 @@ 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 @@ -177,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account_id'] = $data['account_id'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['role'] = $data['role'] ?? null; + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamMemberResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamMemberResponse { - /** @var TeamMemberResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamMemberResponse */ + return ObjectSerializer::deserialize( $data, TeamMemberResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -219,9 +295,7 @@ public static function init(array $data): TeamMemberResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -254,6 +328,9 @@ public function getAccountId() */ public function setAccountId(?string $account_id) { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } $this->container['account_id'] = $account_id; return $this; @@ -278,6 +355,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -302,6 +382,9 @@ public function getRole() */ public function setRole(?string $role) { + if (is_null($role)) { + throw new InvalidArgumentException('non-nullable role cannot be null'); + } $this->container['role'] = $role; return $this; @@ -310,12 +393,10 @@ public function setRole(?string $role) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,7 +404,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -336,13 +417,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -354,12 +433,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -368,8 +445,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamMembersResponse.php b/sdks/php/src/Model/TeamMembersResponse.php index 0c2d6f2f8..681ad9af1 100644 --- a/sdks/php/src/Model/TeamMembersResponse.php +++ b/sdks/php/src/Model/TeamMembersResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TeamMembersResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TeamMembersResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +75,24 @@ class TeamMembersResponse implements ModelInterface, ArrayAccess, JsonSerializab 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'team_members' => false, + 'list_info' => 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 * @@ -99,6 +113,50 @@ 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 @@ -177,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['team_members'] = $data['team_members'] ?? null; - $this->container['list_info'] = $data['list_info'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('team_members', $data ?? [], null); + $this->setIfExists('list_info', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamMembersResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamMembersResponse { - /** @var TeamMembersResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamMembersResponse */ + return ObjectSerializer::deserialize( $data, TeamMembersResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -221,6 +297,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['team_members'] === null) { + $invalidProperties[] = "'team_members' can't be null"; + } + if ($this->container['list_info'] === null) { + $invalidProperties[] = "'list_info' can't be null"; + } return $invalidProperties; } @@ -238,7 +320,7 @@ public function valid() /** * Gets team_members * - * @return TeamMemberResponse[]|null + * @return TeamMemberResponse[] */ public function getTeamMembers() { @@ -248,12 +330,15 @@ public function getTeamMembers() /** * Sets team_members * - * @param TeamMemberResponse[]|null $team_members contains a list of team members and their roles for a specific team + * @param TeamMemberResponse[] $team_members contains a list of team members and their roles for a specific team * * @return self */ - public function setTeamMembers(?array $team_members) + public function setTeamMembers(array $team_members) { + if (is_null($team_members)) { + throw new InvalidArgumentException('non-nullable team_members cannot be null'); + } $this->container['team_members'] = $team_members; return $this; @@ -262,7 +347,7 @@ public function setTeamMembers(?array $team_members) /** * Gets list_info * - * @return ListInfoResponse|null + * @return ListInfoResponse */ public function getListInfo() { @@ -272,12 +357,15 @@ public function getListInfo() /** * Sets list_info * - * @param ListInfoResponse|null $list_info list_info + * @param ListInfoResponse $list_info list_info * * @return self */ - public function setListInfo(?ListInfoResponse $list_info) + 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; @@ -302,6 +390,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -310,12 +401,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,7 +412,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -336,13 +425,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -354,12 +441,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -368,8 +453,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamParentResponse.php b/sdks/php/src/Model/TeamParentResponse.php index 36a50d9a8..d0d447285 100644 --- a/sdks/php/src/Model/TeamParentResponse.php +++ b/sdks/php/src/Model/TeamParentResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Information about the parent team if a team has one, set to `null` otherwise. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TeamParentResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +74,23 @@ class TeamParentResponse implements ModelInterface, ArrayAccess, JsonSerializabl 'name' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'team_id' => false, + 'name' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +111,50 @@ 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 @@ -173,38 +230,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['team_id'] = $data['team_id'] ?? null; - $this->container['name'] = $data['name'] ?? null; + $this->setIfExists('team_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamParentResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamParentResponse { - /** @var TeamParentResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamParentResponse */ + return ObjectSerializer::deserialize( $data, TeamParentResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,9 +289,7 @@ public static function init(array $data): TeamParentResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -249,6 +322,9 @@ public function getTeamId() */ public function setTeamId(?string $team_id) { + if (is_null($team_id)) { + throw new InvalidArgumentException('non-nullable team_id cannot be null'); + } $this->container['team_id'] = $team_id; return $this; @@ -273,6 +349,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -281,12 +360,10 @@ public function setName(?string $name) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -294,7 +371,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -307,13 +384,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -325,12 +400,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -339,8 +412,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamRemoveMemberRequest.php b/sdks/php/src/Model/TeamRemoveMemberRequest.php index bb8bc2d34..6d7413255 100644 --- a/sdks/php/src/Model/TeamRemoveMemberRequest.php +++ b/sdks/php/src/Model/TeamRemoveMemberRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -38,11 +37,8 @@ * TeamRemoveMemberRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TeamRemoveMemberRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -83,6 +79,26 @@ class TeamRemoveMemberRequest implements ModelInterface, ArrayAccess, JsonSerial 'new_role' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account_id' => false, + 'email_address' => false, + 'new_owner_email_address' => false, + 'new_team_id' => false, + 'new_role' => 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 * @@ -103,6 +119,50 @@ 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 @@ -207,41 +267,59 @@ public function getNewRoleAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account_id'] = $data['account_id'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['new_owner_email_address'] = $data['new_owner_email_address'] ?? null; - $this->container['new_team_id'] = $data['new_team_id'] ?? null; - $this->container['new_role'] = $data['new_role'] ?? null; + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('new_owner_email_address', $data ?? [], null); + $this->setIfExists('new_team_id', $data ?? [], null); + $this->setIfExists('new_role', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamRemoveMemberRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamRemoveMemberRequest { - /** @var TeamRemoveMemberRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamRemoveMemberRequest */ + return ObjectSerializer::deserialize( $data, TeamRemoveMemberRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -295,6 +373,9 @@ public function getAccountId() */ public function setAccountId(?string $account_id) { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } $this->container['account_id'] = $account_id; return $this; @@ -319,6 +400,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -343,6 +427,9 @@ public function getNewOwnerEmailAddress() */ public function setNewOwnerEmailAddress(?string $new_owner_email_address) { + if (is_null($new_owner_email_address)) { + throw new InvalidArgumentException('non-nullable new_owner_email_address cannot be null'); + } $this->container['new_owner_email_address'] = $new_owner_email_address; return $this; @@ -367,6 +454,9 @@ public function getNewTeamId() */ public function setNewTeamId(?string $new_team_id) { + if (is_null($new_team_id)) { + throw new InvalidArgumentException('non-nullable new_team_id cannot be null'); + } $this->container['new_team_id'] = $new_team_id; return $this; @@ -391,8 +481,11 @@ public function getNewRole() */ public function setNewRole(?string $new_role) { + if (is_null($new_role)) { + throw new InvalidArgumentException('non-nullable new_role cannot be null'); + } $allowedValues = $this->getNewRoleAllowableValues(); - if (!is_null($new_role) && !in_array($new_role, $allowedValues, true)) { + if (!in_array($new_role, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'new_role', must be one of '%s'", @@ -409,12 +502,10 @@ public function setNewRole(?string $new_role) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -422,7 +513,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -435,13 +526,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -453,12 +542,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -467,8 +554,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamResponse.php b/sdks/php/src/Model/TeamResponse.php index 5287609f0..402916a49 100644 --- a/sdks/php/src/Model/TeamResponse.php +++ b/sdks/php/src/Model/TeamResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Contains information about your team and its members - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TeamResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -82,6 +78,25 @@ class TeamResponse implements ModelInterface, ArrayAccess, JsonSerializable 'invited_emails' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'accounts' => false, + 'invited_accounts' => false, + 'invited_emails' => 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 * @@ -102,6 +117,50 @@ 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 @@ -183,40 +242,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['accounts'] = $data['accounts'] ?? null; - $this->container['invited_accounts'] = $data['invited_accounts'] ?? null; - $this->container['invited_emails'] = $data['invited_emails'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('accounts', $data ?? [], null); + $this->setIfExists('invited_accounts', $data ?? [], null); + $this->setIfExists('invited_emails', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamResponse { - /** @var TeamResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamResponse */ + return ObjectSerializer::deserialize( $data, TeamResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -226,9 +303,7 @@ public static function init(array $data): TeamResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -261,6 +336,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -285,6 +363,9 @@ public function getAccounts() */ public function setAccounts(?array $accounts) { + if (is_null($accounts)) { + throw new InvalidArgumentException('non-nullable accounts cannot be null'); + } $this->container['accounts'] = $accounts; return $this; @@ -309,6 +390,9 @@ public function getInvitedAccounts() */ public function setInvitedAccounts(?array $invited_accounts) { + if (is_null($invited_accounts)) { + throw new InvalidArgumentException('non-nullable invited_accounts cannot be null'); + } $this->container['invited_accounts'] = $invited_accounts; return $this; @@ -333,6 +417,9 @@ public function getInvitedEmails() */ public function setInvitedEmails(?array $invited_emails) { + if (is_null($invited_emails)) { + throw new InvalidArgumentException('non-nullable invited_emails cannot be null'); + } $this->container['invited_emails'] = $invited_emails; return $this; @@ -341,12 +428,10 @@ public function setInvitedEmails(?array $invited_emails) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -354,7 +439,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -367,13 +452,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -385,12 +468,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -399,8 +480,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamSubTeamsResponse.php b/sdks/php/src/Model/TeamSubTeamsResponse.php index 3e9a646be..e3e9206c2 100644 --- a/sdks/php/src/Model/TeamSubTeamsResponse.php +++ b/sdks/php/src/Model/TeamSubTeamsResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TeamSubTeamsResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TeamSubTeamsResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +75,24 @@ class TeamSubTeamsResponse implements ModelInterface, ArrayAccess, JsonSerializa 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'sub_teams' => false, + 'list_info' => 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 * @@ -99,6 +113,50 @@ 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 @@ -177,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['sub_teams'] = $data['sub_teams'] ?? null; - $this->container['list_info'] = $data['list_info'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('sub_teams', $data ?? [], null); + $this->setIfExists('list_info', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamSubTeamsResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamSubTeamsResponse { - /** @var TeamSubTeamsResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamSubTeamsResponse */ + return ObjectSerializer::deserialize( $data, TeamSubTeamsResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -221,6 +297,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['sub_teams'] === null) { + $invalidProperties[] = "'sub_teams' can't be null"; + } + if ($this->container['list_info'] === null) { + $invalidProperties[] = "'list_info' can't be null"; + } return $invalidProperties; } @@ -238,7 +320,7 @@ public function valid() /** * Gets sub_teams * - * @return SubTeamResponse[]|null + * @return SubTeamResponse[] */ public function getSubTeams() { @@ -248,12 +330,15 @@ public function getSubTeams() /** * Sets sub_teams * - * @param SubTeamResponse[]|null $sub_teams contains a list with sub teams + * @param SubTeamResponse[] $sub_teams contains a list with sub teams * * @return self */ - public function setSubTeams(?array $sub_teams) + public function setSubTeams(array $sub_teams) { + if (is_null($sub_teams)) { + throw new InvalidArgumentException('non-nullable sub_teams cannot be null'); + } $this->container['sub_teams'] = $sub_teams; return $this; @@ -262,7 +347,7 @@ public function setSubTeams(?array $sub_teams) /** * Gets list_info * - * @return ListInfoResponse|null + * @return ListInfoResponse */ public function getListInfo() { @@ -272,12 +357,15 @@ public function getListInfo() /** * Sets list_info * - * @param ListInfoResponse|null $list_info list_info + * @param ListInfoResponse $list_info list_info * * @return self */ - public function setListInfo(?ListInfoResponse $list_info) + 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; @@ -302,6 +390,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -310,12 +401,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,7 +412,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -336,13 +425,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -354,12 +441,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -368,8 +453,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TeamUpdateRequest.php b/sdks/php/src/Model/TeamUpdateRequest.php index 08f5760dc..6606b7676 100644 --- a/sdks/php/src/Model/TeamUpdateRequest.php +++ b/sdks/php/src/Model/TeamUpdateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * TeamUpdateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TeamUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -74,6 +71,22 @@ class TeamUpdateRequest implements ModelInterface, ArrayAccess, JsonSerializable 'name' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +107,50 @@ 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 @@ -166,37 +223,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; + $this->setIfExists('name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TeamUpdateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TeamUpdateRequest { - /** @var TeamUpdateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TeamUpdateRequest */ + return ObjectSerializer::deserialize( $data, TeamUpdateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -206,9 +281,7 @@ public static function init(array $data): TeamUpdateRequest */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -241,6 +314,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -249,12 +325,10 @@ public function setName(?string $name) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -262,7 +336,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -275,13 +349,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -293,12 +365,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -307,8 +377,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateAddUserRequest.php b/sdks/php/src/Model/TemplateAddUserRequest.php index eb131d57b..ea87103ad 100644 --- a/sdks/php/src/Model/TemplateAddUserRequest.php +++ b/sdks/php/src/Model/TemplateAddUserRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * TemplateAddUserRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateAddUserRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +75,24 @@ class TemplateAddUserRequest implements ModelInterface, ArrayAccess, JsonSeriali 'skip_notification' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account_id' => false, + 'email_address' => false, + 'skip_notification' => 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 * @@ -98,6 +113,50 @@ 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 @@ -176,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account_id'] = $data['account_id'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['skip_notification'] = $data['skip_notification'] ?? false; + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('skip_notification', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateAddUserRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateAddUserRequest { - /** @var TemplateAddUserRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateAddUserRequest */ + return ObjectSerializer::deserialize( $data, TemplateAddUserRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -218,9 +295,7 @@ public static function init(array $data): TemplateAddUserRequest */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -253,6 +328,9 @@ public function getAccountId() */ public function setAccountId(?string $account_id) { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } $this->container['account_id'] = $account_id; return $this; @@ -277,6 +355,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -301,6 +382,9 @@ public function getSkipNotification() */ public function setSkipNotification(?bool $skip_notification) { + if (is_null($skip_notification)) { + throw new InvalidArgumentException('non-nullable skip_notification cannot be null'); + } $this->container['skip_notification'] = $skip_notification; return $this; @@ -309,12 +393,10 @@ public function setSkipNotification(?bool $skip_notification) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -322,7 +404,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -335,13 +417,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -353,12 +433,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -367,8 +445,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php b/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php index 83b3dcd3a..fe626a83a 100644 --- a/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php +++ b/sdks/php/src/Model/TemplateCreateEmbeddedDraftRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * TemplateCreateEmbeddedDraftRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -124,6 +120,46 @@ class TemplateCreateEmbeddedDraftRequest implements ModelInterface, ArrayAccess, 'use_preexisting_fields' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'client_id' => false, + 'files' => false, + 'file_urls' => false, + 'allow_ccs' => false, + 'allow_reassign' => false, + 'attachments' => false, + 'cc_roles' => false, + 'editor_options' => false, + 'field_options' => false, + 'force_signer_roles' => false, + 'force_subject_message' => false, + 'form_field_groups' => false, + 'form_field_rules' => false, + 'form_fields_per_document' => false, + 'merge_fields' => false, + 'message' => false, + 'metadata' => false, + 'show_preview' => false, + 'show_progress_stepper' => false, + 'signer_roles' => false, + 'skip_me_now' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + 'use_preexisting_fields' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -144,6 +180,50 @@ 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 @@ -288,61 +368,79 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['files'] = $data['files'] ?? null; - $this->container['file_urls'] = $data['file_urls'] ?? null; - $this->container['allow_ccs'] = $data['allow_ccs'] ?? true; - $this->container['allow_reassign'] = $data['allow_reassign'] ?? false; - $this->container['attachments'] = $data['attachments'] ?? null; - $this->container['cc_roles'] = $data['cc_roles'] ?? null; - $this->container['editor_options'] = $data['editor_options'] ?? null; - $this->container['field_options'] = $data['field_options'] ?? null; - $this->container['force_signer_roles'] = $data['force_signer_roles'] ?? false; - $this->container['force_subject_message'] = $data['force_subject_message'] ?? false; - $this->container['form_field_groups'] = $data['form_field_groups'] ?? null; - $this->container['form_field_rules'] = $data['form_field_rules'] ?? null; - $this->container['form_fields_per_document'] = $data['form_fields_per_document'] ?? null; - $this->container['merge_fields'] = $data['merge_fields'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['show_preview'] = $data['show_preview'] ?? false; - $this->container['show_progress_stepper'] = $data['show_progress_stepper'] ?? true; - $this->container['signer_roles'] = $data['signer_roles'] ?? null; - $this->container['skip_me_now'] = $data['skip_me_now'] ?? false; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['title'] = $data['title'] ?? null; - $this->container['use_preexisting_fields'] = $data['use_preexisting_fields'] ?? false; - } - - /** @deprecated use ::init() */ + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('allow_ccs', $data ?? [], true); + $this->setIfExists('allow_reassign', $data ?? [], false); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('cc_roles', $data ?? [], null); + $this->setIfExists('editor_options', $data ?? [], null); + $this->setIfExists('field_options', $data ?? [], null); + $this->setIfExists('force_signer_roles', $data ?? [], false); + $this->setIfExists('force_subject_message', $data ?? [], false); + $this->setIfExists('form_field_groups', $data ?? [], null); + $this->setIfExists('form_field_rules', $data ?? [], null); + $this->setIfExists('form_fields_per_document', $data ?? [], null); + $this->setIfExists('merge_fields', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('show_preview', $data ?? [], false); + $this->setIfExists('show_progress_stepper', $data ?? [], true); + $this->setIfExists('signer_roles', $data ?? [], null); + $this->setIfExists('skip_me_now', $data ?? [], false); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('use_preexisting_fields', $data ?? [], false); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateEmbeddedDraftRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateEmbeddedDraftRequest { - /** @var TemplateCreateEmbeddedDraftRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateCreateEmbeddedDraftRequest */ + return ObjectSerializer::deserialize( $data, TemplateCreateEmbeddedDraftRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -398,6 +496,9 @@ public function getClientId() */ public function setClientId(string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -422,6 +523,9 @@ public function getFiles() */ public function setFiles(?array $files) { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } $this->container['files'] = $files; return $this; @@ -446,6 +550,9 @@ public function getFileUrls() */ 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; @@ -470,6 +577,9 @@ public function getAllowCcs() */ public function setAllowCcs(?bool $allow_ccs) { + if (is_null($allow_ccs)) { + throw new InvalidArgumentException('non-nullable allow_ccs cannot be null'); + } $this->container['allow_ccs'] = $allow_ccs; return $this; @@ -494,6 +604,9 @@ public function getAllowReassign() */ public function setAllowReassign(?bool $allow_reassign) { + if (is_null($allow_reassign)) { + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + } $this->container['allow_reassign'] = $allow_reassign; return $this; @@ -518,6 +631,9 @@ public function getAttachments() */ public function setAttachments(?array $attachments) { + if (is_null($attachments)) { + throw new InvalidArgumentException('non-nullable attachments cannot be null'); + } $this->container['attachments'] = $attachments; return $this; @@ -542,6 +658,9 @@ public function getCcRoles() */ public function setCcRoles(?array $cc_roles) { + if (is_null($cc_roles)) { + throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); + } $this->container['cc_roles'] = $cc_roles; return $this; @@ -566,6 +685,9 @@ public function getEditorOptions() */ public function setEditorOptions(?SubEditorOptions $editor_options) { + if (is_null($editor_options)) { + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + } $this->container['editor_options'] = $editor_options; return $this; @@ -590,6 +712,9 @@ public function getFieldOptions() */ public function setFieldOptions(?SubFieldOptions $field_options) { + if (is_null($field_options)) { + throw new InvalidArgumentException('non-nullable field_options cannot be null'); + } $this->container['field_options'] = $field_options; return $this; @@ -614,6 +739,9 @@ public function getForceSignerRoles() */ public function setForceSignerRoles(?bool $force_signer_roles) { + if (is_null($force_signer_roles)) { + throw new InvalidArgumentException('non-nullable force_signer_roles cannot be null'); + } $this->container['force_signer_roles'] = $force_signer_roles; return $this; @@ -638,6 +766,9 @@ public function getForceSubjectMessage() */ public function setForceSubjectMessage(?bool $force_subject_message) { + if (is_null($force_subject_message)) { + throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); + } $this->container['force_subject_message'] = $force_subject_message; return $this; @@ -662,6 +793,9 @@ public function getFormFieldGroups() */ public function setFormFieldGroups(?array $form_field_groups) { + if (is_null($form_field_groups)) { + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + } $this->container['form_field_groups'] = $form_field_groups; return $this; @@ -686,6 +820,9 @@ public function getFormFieldRules() */ public function setFormFieldRules(?array $form_field_rules) { + if (is_null($form_field_rules)) { + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + } $this->container['form_field_rules'] = $form_field_rules; return $this; @@ -710,6 +847,9 @@ public function getFormFieldsPerDocument() */ public function setFormFieldsPerDocument(?array $form_fields_per_document) { + if (is_null($form_fields_per_document)) { + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + } $this->container['form_fields_per_document'] = $form_fields_per_document; return $this; @@ -734,6 +874,9 @@ public function getMergeFields() */ public function setMergeFields(?array $merge_fields) { + if (is_null($merge_fields)) { + throw new InvalidArgumentException('non-nullable merge_fields cannot be null'); + } $this->container['merge_fields'] = $merge_fields; return $this; @@ -758,7 +901,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling TemplateCreateEmbeddedDraftRequest., must be smaller than or equal to 5000.'); } @@ -786,6 +932,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -810,6 +960,9 @@ public function getShowPreview() */ public function setShowPreview(?bool $show_preview) { + if (is_null($show_preview)) { + throw new InvalidArgumentException('non-nullable show_preview cannot be null'); + } $this->container['show_preview'] = $show_preview; return $this; @@ -834,6 +987,9 @@ public function getShowProgressStepper() */ public function setShowProgressStepper(?bool $show_progress_stepper) { + if (is_null($show_progress_stepper)) { + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + } $this->container['show_progress_stepper'] = $show_progress_stepper; return $this; @@ -858,6 +1014,9 @@ public function getSignerRoles() */ public function setSignerRoles(?array $signer_roles) { + if (is_null($signer_roles)) { + throw new InvalidArgumentException('non-nullable signer_roles cannot be null'); + } $this->container['signer_roles'] = $signer_roles; return $this; @@ -882,6 +1041,9 @@ public function getSkipMeNow() */ public function setSkipMeNow(?bool $skip_me_now) { + if (is_null($skip_me_now)) { + throw new InvalidArgumentException('non-nullable skip_me_now cannot be null'); + } $this->container['skip_me_now'] = $skip_me_now; return $this; @@ -906,7 +1068,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 200)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 200) { throw new InvalidArgumentException('invalid length for $subject when calling TemplateCreateEmbeddedDraftRequest., must be smaller than or equal to 200.'); } @@ -934,6 +1099,9 @@ public function getTestMode() */ 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; @@ -958,6 +1126,9 @@ public function getTitle() */ public function setTitle(?string $title) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } $this->container['title'] = $title; return $this; @@ -982,6 +1153,9 @@ public function getUsePreexistingFields() */ public function setUsePreexistingFields(?bool $use_preexisting_fields) { + if (is_null($use_preexisting_fields)) { + throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + } $this->container['use_preexisting_fields'] = $use_preexisting_fields; return $this; @@ -990,12 +1164,10 @@ public function setUsePreexistingFields(?bool $use_preexisting_fields) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1003,7 +1175,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -1016,13 +1188,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1034,12 +1204,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1048,8 +1216,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php index beec359d5..49266a669 100644 --- a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php +++ b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TemplateCreateEmbeddedDraftResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateCreateEmbeddedDraftResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class TemplateCreateEmbeddedDraftResponse implements ModelInterface, ArrayAccess 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template'] = $data['template'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('template', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateEmbeddedDraftResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateEmbeddedDraftResponse { - /** @var TemplateCreateEmbeddedDraftResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateCreateEmbeddedDraftResponse */ + return ObjectSerializer::deserialize( $data, TemplateCreateEmbeddedDraftResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['template'] === null) { + $invalidProperties[] = "'template' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets template * - * @return TemplateCreateEmbeddedDraftResponseTemplate|null + * @return TemplateCreateEmbeddedDraftResponseTemplate */ public function getTemplate() { @@ -242,12 +320,15 @@ public function getTemplate() /** * Sets template * - * @param TemplateCreateEmbeddedDraftResponseTemplate|null $template template + * @param TemplateCreateEmbeddedDraftResponseTemplate $template template * * @return self */ - public function setTemplate(?TemplateCreateEmbeddedDraftResponseTemplate $template) + public function setTemplate(TemplateCreateEmbeddedDraftResponseTemplate $template) { + if (is_null($template)) { + throw new InvalidArgumentException('non-nullable template cannot be null'); + } $this->container['template'] = $template; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php index b8ab59bc6..44031ce16 100644 --- a/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php +++ b/sdks/php/src/Model/TemplateCreateEmbeddedDraftResponseTemplate.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Template object with parameters: `template_id`, `edit_url`, `expires_at`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateCreateEmbeddedDraftResponseTemplate implements ModelInterface, ArrayAccess, JsonSerializable { @@ -82,6 +78,25 @@ class TemplateCreateEmbeddedDraftResponseTemplate implements ModelInterface, Arr 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_id' => false, + 'edit_url' => false, + 'expires_at' => 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 * @@ -102,6 +117,50 @@ 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 @@ -183,40 +242,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template_id'] = $data['template_id'] ?? null; - $this->container['edit_url'] = $data['edit_url'] ?? null; - $this->container['expires_at'] = $data['expires_at'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('template_id', $data ?? [], null); + $this->setIfExists('edit_url', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateEmbeddedDraftResponseTemplate { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateEmbeddedDraftResponseTemplate { - /** @var TemplateCreateEmbeddedDraftResponseTemplate $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateCreateEmbeddedDraftResponseTemplate */ + return ObjectSerializer::deserialize( $data, TemplateCreateEmbeddedDraftResponseTemplate::class, ); + } - return $obj; + /** + * 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; } /** @@ -226,9 +303,7 @@ public static function init(array $data): TemplateCreateEmbeddedDraftResponseTem */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -261,6 +336,9 @@ public function getTemplateId() */ public function setTemplateId(?string $template_id) { + if (is_null($template_id)) { + throw new InvalidArgumentException('non-nullable template_id cannot be null'); + } $this->container['template_id'] = $template_id; return $this; @@ -285,6 +363,9 @@ public function getEditUrl() */ public function setEditUrl(?string $edit_url) { + if (is_null($edit_url)) { + throw new InvalidArgumentException('non-nullable edit_url cannot be null'); + } $this->container['edit_url'] = $edit_url; return $this; @@ -309,6 +390,9 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + throw new InvalidArgumentException('non-nullable expires_at cannot be null'); + } $this->container['expires_at'] = $expires_at; return $this; @@ -335,6 +419,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -343,12 +430,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -356,7 +441,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -369,13 +454,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -387,12 +470,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -401,8 +482,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateCreateRequest.php b/sdks/php/src/Model/TemplateCreateRequest.php index 2e9fe0901..ec6890622 100644 --- a/sdks/php/src/Model/TemplateCreateRequest.php +++ b/sdks/php/src/Model/TemplateCreateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * TemplateCreateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -110,6 +106,39 @@ class TemplateCreateRequest implements ModelInterface, ArrayAccess, JsonSerializ 'use_preexisting_fields' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'form_fields_per_document' => false, + 'signer_roles' => false, + 'files' => false, + 'file_urls' => false, + 'allow_reassign' => false, + 'attachments' => false, + 'cc_roles' => false, + 'client_id' => false, + 'field_options' => false, + 'form_field_groups' => false, + 'form_field_rules' => false, + 'merge_fields' => false, + 'message' => false, + 'metadata' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + 'use_preexisting_fields' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -130,6 +159,50 @@ 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 @@ -253,54 +326,72 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['form_fields_per_document'] = $data['form_fields_per_document'] ?? null; - $this->container['signer_roles'] = $data['signer_roles'] ?? null; - $this->container['files'] = $data['files'] ?? null; - $this->container['file_urls'] = $data['file_urls'] ?? null; - $this->container['allow_reassign'] = $data['allow_reassign'] ?? false; - $this->container['attachments'] = $data['attachments'] ?? null; - $this->container['cc_roles'] = $data['cc_roles'] ?? null; - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['field_options'] = $data['field_options'] ?? null; - $this->container['form_field_groups'] = $data['form_field_groups'] ?? null; - $this->container['form_field_rules'] = $data['form_field_rules'] ?? null; - $this->container['merge_fields'] = $data['merge_fields'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['title'] = $data['title'] ?? null; - $this->container['use_preexisting_fields'] = $data['use_preexisting_fields'] ?? false; - } - - /** @deprecated use ::init() */ + $this->setIfExists('form_fields_per_document', $data ?? [], null); + $this->setIfExists('signer_roles', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('allow_reassign', $data ?? [], false); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('cc_roles', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('field_options', $data ?? [], null); + $this->setIfExists('form_field_groups', $data ?? [], null); + $this->setIfExists('form_field_rules', $data ?? [], null); + $this->setIfExists('merge_fields', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('use_preexisting_fields', $data ?? [], false); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateRequest { - /** @var TemplateCreateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateCreateRequest */ + return ObjectSerializer::deserialize( $data, TemplateCreateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -359,6 +450,9 @@ public function getFormFieldsPerDocument() */ public function setFormFieldsPerDocument(array $form_fields_per_document) { + if (is_null($form_fields_per_document)) { + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + } $this->container['form_fields_per_document'] = $form_fields_per_document; return $this; @@ -383,6 +477,9 @@ public function getSignerRoles() */ public function setSignerRoles(array $signer_roles) { + if (is_null($signer_roles)) { + throw new InvalidArgumentException('non-nullable signer_roles cannot be null'); + } $this->container['signer_roles'] = $signer_roles; return $this; @@ -407,6 +504,9 @@ public function getFiles() */ public function setFiles(?array $files) { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } $this->container['files'] = $files; return $this; @@ -431,6 +531,9 @@ public function getFileUrls() */ 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; @@ -455,6 +558,9 @@ public function getAllowReassign() */ public function setAllowReassign(?bool $allow_reassign) { + if (is_null($allow_reassign)) { + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + } $this->container['allow_reassign'] = $allow_reassign; return $this; @@ -479,6 +585,9 @@ public function getAttachments() */ public function setAttachments(?array $attachments) { + if (is_null($attachments)) { + throw new InvalidArgumentException('non-nullable attachments cannot be null'); + } $this->container['attachments'] = $attachments; return $this; @@ -503,6 +612,9 @@ public function getCcRoles() */ public function setCcRoles(?array $cc_roles) { + if (is_null($cc_roles)) { + throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); + } $this->container['cc_roles'] = $cc_roles; return $this; @@ -527,6 +639,9 @@ public function getClientId() */ public function setClientId(?string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -551,6 +666,9 @@ public function getFieldOptions() */ public function setFieldOptions(?SubFieldOptions $field_options) { + if (is_null($field_options)) { + throw new InvalidArgumentException('non-nullable field_options cannot be null'); + } $this->container['field_options'] = $field_options; return $this; @@ -575,6 +693,9 @@ public function getFormFieldGroups() */ public function setFormFieldGroups(?array $form_field_groups) { + if (is_null($form_field_groups)) { + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + } $this->container['form_field_groups'] = $form_field_groups; return $this; @@ -599,6 +720,9 @@ public function getFormFieldRules() */ public function setFormFieldRules(?array $form_field_rules) { + if (is_null($form_field_rules)) { + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + } $this->container['form_field_rules'] = $form_field_rules; return $this; @@ -623,6 +747,9 @@ public function getMergeFields() */ public function setMergeFields(?array $merge_fields) { + if (is_null($merge_fields)) { + throw new InvalidArgumentException('non-nullable merge_fields cannot be null'); + } $this->container['merge_fields'] = $merge_fields; return $this; @@ -647,7 +774,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling TemplateCreateRequest., must be smaller than or equal to 5000.'); } @@ -675,6 +805,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -699,7 +833,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 200)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 200) { throw new InvalidArgumentException('invalid length for $subject when calling TemplateCreateRequest., must be smaller than or equal to 200.'); } @@ -727,6 +864,9 @@ public function getTestMode() */ 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; @@ -751,6 +891,9 @@ public function getTitle() */ public function setTitle(?string $title) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } $this->container['title'] = $title; return $this; @@ -775,6 +918,9 @@ public function getUsePreexistingFields() */ public function setUsePreexistingFields(?bool $use_preexisting_fields) { + if (is_null($use_preexisting_fields)) { + throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + } $this->container['use_preexisting_fields'] = $use_preexisting_fields; return $this; @@ -783,12 +929,10 @@ public function setUsePreexistingFields(?bool $use_preexisting_fields) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -796,7 +940,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -809,13 +953,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -827,12 +969,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -841,8 +981,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateCreateResponse.php b/sdks/php/src/Model/TemplateCreateResponse.php index 2d4a1f236..e17ce910a 100644 --- a/sdks/php/src/Model/TemplateCreateResponse.php +++ b/sdks/php/src/Model/TemplateCreateResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TemplateCreateResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class TemplateCreateResponse implements ModelInterface, ArrayAccess, JsonSeriali 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template'] = $data['template'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('template', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateResponse { - /** @var TemplateCreateResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateCreateResponse */ + return ObjectSerializer::deserialize( $data, TemplateCreateResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['template'] === null) { + $invalidProperties[] = "'template' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets template * - * @return TemplateCreateResponseTemplate|null + * @return TemplateCreateResponseTemplate */ public function getTemplate() { @@ -242,12 +320,15 @@ public function getTemplate() /** * Sets template * - * @param TemplateCreateResponseTemplate|null $template template + * @param TemplateCreateResponseTemplate $template template * * @return self */ - public function setTemplate(?TemplateCreateResponseTemplate $template) + public function setTemplate(TemplateCreateResponseTemplate $template) { + if (is_null($template)) { + throw new InvalidArgumentException('non-nullable template cannot be null'); + } $this->container['template'] = $template; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateCreateResponseTemplate.php b/sdks/php/src/Model/TemplateCreateResponseTemplate.php index 1c98865dc..199aa3f74 100644 --- a/sdks/php/src/Model/TemplateCreateResponseTemplate.php +++ b/sdks/php/src/Model/TemplateCreateResponseTemplate.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Template object with parameters: `template_id`. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateCreateResponseTemplate implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +72,22 @@ class TemplateCreateResponseTemplate implements ModelInterface, ArrayAccess, Jso 'template_id' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_id' => 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 * @@ -96,6 +108,50 @@ 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 @@ -168,37 +224,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template_id'] = $data['template_id'] ?? null; + $this->setIfExists('template_id', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateCreateResponseTemplate { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateCreateResponseTemplate { - /** @var TemplateCreateResponseTemplate $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateCreateResponseTemplate */ + return ObjectSerializer::deserialize( $data, TemplateCreateResponseTemplate::class, ); + } - return $obj; + /** + * 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; } /** @@ -208,9 +282,7 @@ public static function init(array $data): TemplateCreateResponseTemplate */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -243,6 +315,9 @@ public function getTemplateId() */ public function setTemplateId(?string $template_id) { + if (is_null($template_id)) { + throw new InvalidArgumentException('non-nullable template_id cannot be null'); + } $this->container['template_id'] = $template_id; return $this; @@ -251,12 +326,10 @@ public function setTemplateId(?string $template_id) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -264,7 +337,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -277,13 +350,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -295,12 +366,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -309,8 +378,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateEditResponse.php b/sdks/php/src/Model/TemplateEditResponse.php index 455533dd7..0ef5462cf 100644 --- a/sdks/php/src/Model/TemplateEditResponse.php +++ b/sdks/php/src/Model/TemplateEditResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * TemplateEditResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -74,6 +71,22 @@ class TemplateEditResponse implements ModelInterface, ArrayAccess, JsonSerializa 'template_id' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_id' => 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 * @@ -94,6 +107,50 @@ 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 @@ -166,37 +223,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template_id'] = $data['template_id'] ?? null; + $this->setIfExists('template_id', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateEditResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateEditResponse { - /** @var TemplateEditResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateEditResponse */ + return ObjectSerializer::deserialize( $data, TemplateEditResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -208,6 +283,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['template_id'] === null) { + $invalidProperties[] = "'template_id' can't be null"; + } return $invalidProperties; } @@ -225,7 +303,7 @@ public function valid() /** * Gets template_id * - * @return string|null + * @return string */ public function getTemplateId() { @@ -235,12 +313,15 @@ public function getTemplateId() /** * Sets template_id * - * @param string|null $template_id the id of the Template + * @param string $template_id the id of the Template * * @return self */ - public function setTemplateId(?string $template_id) + public function setTemplateId(string $template_id) { + if (is_null($template_id)) { + throw new InvalidArgumentException('non-nullable template_id cannot be null'); + } $this->container['template_id'] = $template_id; return $this; @@ -249,12 +330,10 @@ public function setTemplateId(?string $template_id) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -262,7 +341,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -275,13 +354,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -293,12 +370,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -307,8 +382,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateGetResponse.php b/sdks/php/src/Model/TemplateGetResponse.php index 340a002f2..45b89ba15 100644 --- a/sdks/php/src/Model/TemplateGetResponse.php +++ b/sdks/php/src/Model/TemplateGetResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TemplateGetResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateGetResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class TemplateGetResponse implements ModelInterface, ArrayAccess, JsonSerializab 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template'] = $data['template'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('template', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateGetResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateGetResponse { - /** @var TemplateGetResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateGetResponse */ + return ObjectSerializer::deserialize( $data, TemplateGetResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['template'] === null) { + $invalidProperties[] = "'template' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets template * - * @return TemplateResponse|null + * @return TemplateResponse */ public function getTemplate() { @@ -242,12 +320,15 @@ public function getTemplate() /** * Sets template * - * @param TemplateResponse|null $template template + * @param TemplateResponse $template template * * @return self */ - public function setTemplate(?TemplateResponse $template) + public function setTemplate(TemplateResponse $template) { + if (is_null($template)) { + throw new InvalidArgumentException('non-nullable template cannot be null'); + } $this->container['template'] = $template; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateListResponse.php b/sdks/php/src/Model/TemplateListResponse.php index 3ff89da3c..49974663e 100644 --- a/sdks/php/src/Model/TemplateListResponse.php +++ b/sdks/php/src/Model/TemplateListResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TemplateListResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateListResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -79,6 +75,24 @@ class TemplateListResponse implements ModelInterface, ArrayAccess, JsonSerializa 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'templates' => false, + 'list_info' => 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 * @@ -99,6 +113,50 @@ 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 @@ -177,39 +235,57 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['templates'] = $data['templates'] ?? null; - $this->container['list_info'] = $data['list_info'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('templates', $data ?? [], null); + $this->setIfExists('list_info', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateListResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateListResponse { - /** @var TemplateListResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateListResponse */ + return ObjectSerializer::deserialize( $data, TemplateListResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -221,6 +297,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['templates'] === null) { + $invalidProperties[] = "'templates' can't be null"; + } + if ($this->container['list_info'] === null) { + $invalidProperties[] = "'list_info' can't be null"; + } return $invalidProperties; } @@ -238,7 +320,7 @@ public function valid() /** * Gets templates * - * @return TemplateResponse[]|null + * @return TemplateResponse[] */ public function getTemplates() { @@ -248,12 +330,15 @@ public function getTemplates() /** * Sets templates * - * @param TemplateResponse[]|null $templates list of templates that the API caller has access to + * @param TemplateResponse[] $templates list of templates that the API caller has access to * * @return self */ - public function setTemplates(?array $templates) + public function setTemplates(array $templates) { + if (is_null($templates)) { + throw new InvalidArgumentException('non-nullable templates cannot be null'); + } $this->container['templates'] = $templates; return $this; @@ -262,7 +347,7 @@ public function setTemplates(?array $templates) /** * Gets list_info * - * @return ListInfoResponse|null + * @return ListInfoResponse */ public function getListInfo() { @@ -272,12 +357,15 @@ public function getListInfo() /** * Sets list_info * - * @param ListInfoResponse|null $list_info list_info + * @param ListInfoResponse $list_info list_info * * @return self */ - public function setListInfo(?ListInfoResponse $list_info) + 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; @@ -302,6 +390,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -310,12 +401,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,7 +412,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -336,13 +425,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -354,12 +441,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -368,8 +453,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateRemoveUserRequest.php b/sdks/php/src/Model/TemplateRemoveUserRequest.php index 417af15ef..d7a8582f9 100644 --- a/sdks/php/src/Model/TemplateRemoveUserRequest.php +++ b/sdks/php/src/Model/TemplateRemoveUserRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * TemplateRemoveUserRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateRemoveUserRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -76,6 +73,23 @@ class TemplateRemoveUserRequest implements ModelInterface, ArrayAccess, JsonSeri 'email_address' => 'email', ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account_id' => false, + 'email_address' => 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 * @@ -96,6 +110,50 @@ 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 @@ -171,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account_id'] = $data['account_id'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateRemoveUserRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateRemoveUserRequest { - /** @var TemplateRemoveUserRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateRemoveUserRequest */ + return ObjectSerializer::deserialize( $data, TemplateRemoveUserRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -212,9 +288,7 @@ public static function init(array $data): TemplateRemoveUserRequest */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -247,6 +321,9 @@ public function getAccountId() */ public function setAccountId(?string $account_id) { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } $this->container['account_id'] = $account_id; return $this; @@ -271,6 +348,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -279,12 +359,10 @@ public function setEmailAddress(?string $email_address) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -292,7 +370,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -305,13 +383,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -323,12 +399,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -337,8 +411,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponse.php b/sdks/php/src/Model/TemplateResponse.php index 3501301b1..4041f1856 100644 --- a/sdks/php/src/Model/TemplateResponse.php +++ b/sdks/php/src/Model/TemplateResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Contains information about the templates you and your team have created. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -104,6 +100,36 @@ class TemplateResponse implements ModelInterface, ArrayAccess, JsonSerializable 'accounts' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_id' => false, + 'title' => false, + 'message' => false, + 'updated_at' => false, + 'is_embedded' => true, + 'is_creator' => true, + 'can_edit' => true, + 'is_locked' => true, + 'metadata' => false, + 'signer_roles' => false, + 'cc_roles' => false, + 'documents' => false, + 'custom_fields' => true, + 'named_form_fields' => true, + 'accounts' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -124,6 +150,50 @@ 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 @@ -238,51 +308,69 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template_id'] = $data['template_id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_embedded'] = $data['is_embedded'] ?? null; - $this->container['is_creator'] = $data['is_creator'] ?? null; - $this->container['can_edit'] = $data['can_edit'] ?? null; - $this->container['is_locked'] = $data['is_locked'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['signer_roles'] = $data['signer_roles'] ?? null; - $this->container['cc_roles'] = $data['cc_roles'] ?? null; - $this->container['documents'] = $data['documents'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['named_form_fields'] = $data['named_form_fields'] ?? null; - $this->container['accounts'] = $data['accounts'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('template_id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_embedded', $data ?? [], null); + $this->setIfExists('is_creator', $data ?? [], null); + $this->setIfExists('can_edit', $data ?? [], null); + $this->setIfExists('is_locked', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('signer_roles', $data ?? [], null); + $this->setIfExists('cc_roles', $data ?? [], null); + $this->setIfExists('documents', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('named_form_fields', $data ?? [], null); + $this->setIfExists('accounts', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponse { - /** @var TemplateResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponse */ + return ObjectSerializer::deserialize( $data, TemplateResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -292,9 +380,7 @@ public static function init(array $data): TemplateResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -327,6 +413,9 @@ public function getTemplateId() */ public function setTemplateId(?string $template_id) { + if (is_null($template_id)) { + throw new InvalidArgumentException('non-nullable template_id cannot be null'); + } $this->container['template_id'] = $template_id; return $this; @@ -351,6 +440,9 @@ public function getTitle() */ public function setTitle(?string $title) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } $this->container['title'] = $title; return $this; @@ -375,6 +467,9 @@ public function getMessage() */ public function setMessage(?string $message) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -399,6 +494,9 @@ public function getUpdatedAt() */ public function setUpdatedAt(?int $updated_at) { + if (is_null($updated_at)) { + throw new InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -423,6 +521,16 @@ public function getIsEmbedded() */ public function setIsEmbedded(?bool $is_embedded) { + if (is_null($is_embedded)) { + array_push($this->openAPINullablesSetToNull, 'is_embedded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_embedded', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['is_embedded'] = $is_embedded; return $this; @@ -447,6 +555,16 @@ public function getIsCreator() */ public function setIsCreator(?bool $is_creator) { + if (is_null($is_creator)) { + array_push($this->openAPINullablesSetToNull, 'is_creator'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_creator', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['is_creator'] = $is_creator; return $this; @@ -471,6 +589,16 @@ public function getCanEdit() */ public function setCanEdit(?bool $can_edit) { + if (is_null($can_edit)) { + array_push($this->openAPINullablesSetToNull, 'can_edit'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('can_edit', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['can_edit'] = $can_edit; return $this; @@ -495,6 +623,16 @@ public function getIsLocked() */ public function setIsLocked(?bool $is_locked) { + if (is_null($is_locked)) { + array_push($this->openAPINullablesSetToNull, 'is_locked'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('is_locked', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['is_locked'] = $is_locked; return $this; @@ -519,6 +657,9 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } $this->container['metadata'] = $metadata; return $this; @@ -543,6 +684,9 @@ public function getSignerRoles() */ public function setSignerRoles(?array $signer_roles) { + if (is_null($signer_roles)) { + throw new InvalidArgumentException('non-nullable signer_roles cannot be null'); + } $this->container['signer_roles'] = $signer_roles; return $this; @@ -567,6 +711,9 @@ public function getCcRoles() */ public function setCcRoles(?array $cc_roles) { + if (is_null($cc_roles)) { + throw new InvalidArgumentException('non-nullable cc_roles cannot be null'); + } $this->container['cc_roles'] = $cc_roles; return $this; @@ -591,6 +738,9 @@ public function getDocuments() */ public function setDocuments(?array $documents) { + if (is_null($documents)) { + throw new InvalidArgumentException('non-nullable documents cannot be null'); + } $this->container['documents'] = $documents; return $this; @@ -617,6 +767,16 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + array_push($this->openAPINullablesSetToNull, 'custom_fields'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('custom_fields', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -643,6 +803,16 @@ public function getNamedFormFields() */ public function setNamedFormFields(?array $named_form_fields) { + if (is_null($named_form_fields)) { + array_push($this->openAPINullablesSetToNull, 'named_form_fields'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('named_form_fields', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['named_form_fields'] = $named_form_fields; return $this; @@ -667,6 +837,16 @@ public function getAccounts() */ public function setAccounts(?array $accounts) { + if (is_null($accounts)) { + array_push($this->openAPINullablesSetToNull, 'accounts'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accounts', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['accounts'] = $accounts; return $this; @@ -675,12 +855,10 @@ public function setAccounts(?array $accounts) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -688,7 +866,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -701,13 +879,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -719,12 +895,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -733,8 +907,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseAccount.php b/sdks/php/src/Model/TemplateResponseAccount.php index c20c2ee59..47ddefabe 100644 --- a/sdks/php/src/Model/TemplateResponseAccount.php +++ b/sdks/php/src/Model/TemplateResponseAccount.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TemplateResponseAccount Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateResponseAccount implements ModelInterface, ArrayAccess, JsonSerializable { @@ -85,6 +81,27 @@ class TemplateResponseAccount implements ModelInterface, ArrayAccess, JsonSerial 'quotas' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'account_id' => false, + 'email_address' => false, + 'is_locked' => false, + 'is_paid_hs' => false, + 'is_paid_hf' => false, + 'quotas' => 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 * @@ -105,6 +122,50 @@ 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 @@ -192,42 +253,60 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['account_id'] = $data['account_id'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['is_locked'] = $data['is_locked'] ?? null; - $this->container['is_paid_hs'] = $data['is_paid_hs'] ?? null; - $this->container['is_paid_hf'] = $data['is_paid_hf'] ?? null; - $this->container['quotas'] = $data['quotas'] ?? null; + $this->setIfExists('account_id', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('is_locked', $data ?? [], null); + $this->setIfExists('is_paid_hs', $data ?? [], null); + $this->setIfExists('is_paid_hf', $data ?? [], null); + $this->setIfExists('quotas', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseAccount { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseAccount { - /** @var TemplateResponseAccount $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseAccount */ + return ObjectSerializer::deserialize( $data, TemplateResponseAccount::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -237,9 +316,7 @@ public static function init(array $data): TemplateResponseAccount */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -272,6 +349,9 @@ public function getAccountId() */ public function setAccountId(?string $account_id) { + if (is_null($account_id)) { + throw new InvalidArgumentException('non-nullable account_id cannot be null'); + } $this->container['account_id'] = $account_id; return $this; @@ -296,6 +376,9 @@ public function getEmailAddress() */ public function setEmailAddress(?string $email_address) { + if (is_null($email_address)) { + throw new InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -320,6 +403,9 @@ public function getIsLocked() */ public function setIsLocked(?bool $is_locked) { + if (is_null($is_locked)) { + throw new InvalidArgumentException('non-nullable is_locked cannot be null'); + } $this->container['is_locked'] = $is_locked; return $this; @@ -344,6 +430,9 @@ public function getIsPaidHs() */ public function setIsPaidHs(?bool $is_paid_hs) { + if (is_null($is_paid_hs)) { + throw new InvalidArgumentException('non-nullable is_paid_hs cannot be null'); + } $this->container['is_paid_hs'] = $is_paid_hs; return $this; @@ -368,6 +457,9 @@ public function getIsPaidHf() */ public function setIsPaidHf(?bool $is_paid_hf) { + if (is_null($is_paid_hf)) { + throw new InvalidArgumentException('non-nullable is_paid_hf cannot be null'); + } $this->container['is_paid_hf'] = $is_paid_hf; return $this; @@ -392,6 +484,9 @@ public function getQuotas() */ public function setQuotas(?TemplateResponseAccountQuota $quotas) { + if (is_null($quotas)) { + throw new InvalidArgumentException('non-nullable quotas cannot be null'); + } $this->container['quotas'] = $quotas; return $this; @@ -400,12 +495,10 @@ public function setQuotas(?TemplateResponseAccountQuota $quotas) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -413,7 +506,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -426,13 +519,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -444,12 +535,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -458,8 +547,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseAccountQuota.php b/sdks/php/src/Model/TemplateResponseAccountQuota.php index 85ef3448d..46386d6ec 100644 --- a/sdks/php/src/Model/TemplateResponseAccountQuota.php +++ b/sdks/php/src/Model/TemplateResponseAccountQuota.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateResponseAccountQuota implements ModelInterface, ArrayAccess, JsonSerializable { @@ -82,6 +78,25 @@ class TemplateResponseAccountQuota implements ModelInterface, ArrayAccess, JsonS 'sms_verifications_left' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'templates_left' => false, + 'api_signature_requests_left' => false, + 'documents_left' => false, + 'sms_verifications_left' => 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 * @@ -102,6 +117,50 @@ 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 @@ -183,40 +242,58 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['templates_left'] = $data['templates_left'] ?? null; - $this->container['api_signature_requests_left'] = $data['api_signature_requests_left'] ?? null; - $this->container['documents_left'] = $data['documents_left'] ?? null; - $this->container['sms_verifications_left'] = $data['sms_verifications_left'] ?? null; + $this->setIfExists('templates_left', $data ?? [], null); + $this->setIfExists('api_signature_requests_left', $data ?? [], null); + $this->setIfExists('documents_left', $data ?? [], null); + $this->setIfExists('sms_verifications_left', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseAccountQuota { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseAccountQuota { - /** @var TemplateResponseAccountQuota $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseAccountQuota */ + return ObjectSerializer::deserialize( $data, TemplateResponseAccountQuota::class, ); + } - return $obj; + /** + * 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; } /** @@ -226,9 +303,7 @@ public static function init(array $data): TemplateResponseAccountQuota */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -261,6 +336,9 @@ public function getTemplatesLeft() */ public function setTemplatesLeft(?int $templates_left) { + if (is_null($templates_left)) { + throw new InvalidArgumentException('non-nullable templates_left cannot be null'); + } $this->container['templates_left'] = $templates_left; return $this; @@ -285,6 +363,9 @@ public function getApiSignatureRequestsLeft() */ public function setApiSignatureRequestsLeft(?int $api_signature_requests_left) { + if (is_null($api_signature_requests_left)) { + throw new InvalidArgumentException('non-nullable api_signature_requests_left cannot be null'); + } $this->container['api_signature_requests_left'] = $api_signature_requests_left; return $this; @@ -309,6 +390,9 @@ public function getDocumentsLeft() */ public function setDocumentsLeft(?int $documents_left) { + if (is_null($documents_left)) { + throw new InvalidArgumentException('non-nullable documents_left cannot be null'); + } $this->container['documents_left'] = $documents_left; return $this; @@ -333,6 +417,9 @@ public function getSmsVerificationsLeft() */ public function setSmsVerificationsLeft(?int $sms_verifications_left) { + if (is_null($sms_verifications_left)) { + throw new InvalidArgumentException('non-nullable sms_verifications_left cannot be null'); + } $this->container['sms_verifications_left'] = $sms_verifications_left; return $this; @@ -341,12 +428,10 @@ public function setSmsVerificationsLeft(?int $sms_verifications_left) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -354,7 +439,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -367,13 +452,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -385,12 +468,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -399,8 +480,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseCCRole.php b/sdks/php/src/Model/TemplateResponseCCRole.php index 5f37a020e..06ee33219 100644 --- a/sdks/php/src/Model/TemplateResponseCCRole.php +++ b/sdks/php/src/Model/TemplateResponseCCRole.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TemplateResponseCCRole Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateResponseCCRole implements ModelInterface, ArrayAccess, JsonSerializable { @@ -75,6 +71,22 @@ class TemplateResponseCCRole implements ModelInterface, ArrayAccess, JsonSeriali 'name' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -95,6 +107,50 @@ 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 @@ -167,37 +223,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; + $this->setIfExists('name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseCCRole { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseCCRole { - /** @var TemplateResponseCCRole $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseCCRole */ + return ObjectSerializer::deserialize( $data, TemplateResponseCCRole::class, ); + } - return $obj; + /** + * 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; } /** @@ -207,9 +281,7 @@ public static function init(array $data): TemplateResponseCCRole */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -242,6 +314,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -250,12 +325,10 @@ public function setName(?string $name) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -263,7 +336,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -276,13 +349,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -294,12 +365,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -308,8 +377,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocument.php b/sdks/php/src/Model/TemplateResponseDocument.php index d7a45b36f..5377d4ba9 100644 --- a/sdks/php/src/Model/TemplateResponseDocument.php +++ b/sdks/php/src/Model/TemplateResponseDocument.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TemplateResponseDocument Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateResponseDocument implements ModelInterface, ArrayAccess, JsonSerializable { @@ -85,6 +81,27 @@ class TemplateResponseDocument implements ModelInterface, ArrayAccess, JsonSeria 'static_fields' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'index' => false, + 'field_groups' => false, + 'form_fields' => false, + 'custom_fields' => false, + 'static_fields' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -105,6 +122,50 @@ 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 @@ -192,42 +253,60 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['index'] = $data['index'] ?? null; - $this->container['field_groups'] = $data['field_groups'] ?? null; - $this->container['form_fields'] = $data['form_fields'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['static_fields'] = $data['static_fields'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('index', $data ?? [], null); + $this->setIfExists('field_groups', $data ?? [], null); + $this->setIfExists('form_fields', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('static_fields', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocument { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocument { - /** @var TemplateResponseDocument $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocument */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocument::class, ); + } - return $obj; + /** + * 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; } /** @@ -237,9 +316,7 @@ public static function init(array $data): TemplateResponseDocument */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -272,6 +349,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -296,6 +376,9 @@ public function getIndex() */ public function setIndex(?int $index) { + if (is_null($index)) { + throw new InvalidArgumentException('non-nullable index cannot be null'); + } $this->container['index'] = $index; return $this; @@ -320,6 +403,9 @@ public function getFieldGroups() */ public function setFieldGroups(?array $field_groups) { + if (is_null($field_groups)) { + throw new InvalidArgumentException('non-nullable field_groups cannot be null'); + } $this->container['field_groups'] = $field_groups; return $this; @@ -344,6 +430,9 @@ public function getFormFields() */ public function setFormFields(?array $form_fields) { + if (is_null($form_fields)) { + throw new InvalidArgumentException('non-nullable form_fields cannot be null'); + } $this->container['form_fields'] = $form_fields; return $this; @@ -368,6 +457,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -392,6 +484,16 @@ public function getStaticFields() */ public function setStaticFields(?array $static_fields) { + if (is_null($static_fields)) { + array_push($this->openAPINullablesSetToNull, 'static_fields'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('static_fields', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['static_fields'] = $static_fields; return $this; @@ -400,12 +502,10 @@ public function setStaticFields(?array $static_fields) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -413,7 +513,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -426,13 +526,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -444,12 +542,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -458,8 +554,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php index a7637f84c..011502522 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php +++ b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldBase.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,14 +38,10 @@ * * @category Class * @description An array of Form Field objects containing the name and type of each named field. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ -abstract class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseDocumentCustomFieldBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; @@ -94,6 +90,31 @@ abstract class TemplateResponseDocumentCustomFieldBase implements ModelInterface 'group' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'api_id' => false, + 'name' => false, + 'signer' => true, + 'x' => false, + 'y' => false, + 'width' => false, + 'height' => false, + 'required' => false, + 'group' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +135,50 @@ 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 @@ -213,28 +278,28 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['type'] = $data['type'] ?? null; - $this->container['api_id'] = $data['api_id'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['signer'] = $data['signer'] ?? null; - $this->container['x'] = $data['x'] ?? null; - $this->container['y'] = $data['y'] ?? null; - $this->container['width'] = $data['width'] ?? null; - $this->container['height'] = $data['height'] ?? null; - $this->container['required'] = $data['required'] ?? null; - $this->container['group'] = $data['group'] ?? null; + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('api_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('signer', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('height', $data ?? [], null); + $this->setIfExists('required', $data ?? [], null); + $this->setIfExists('group', $data ?? [], null); // Initialize discriminator property with the model name. $this->container['type'] = static::$openAPIModelName; @@ -256,6 +321,22 @@ public static function discriminatorClassName(array $data): ?string return null; } + /** + * 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. * @@ -268,7 +349,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -302,6 +382,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -326,6 +409,9 @@ public function getApiId() */ public function setApiId(?string $api_id) { + if (is_null($api_id)) { + throw new InvalidArgumentException('non-nullable api_id cannot be null'); + } $this->container['api_id'] = $api_id; return $this; @@ -350,6 +436,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -374,6 +463,16 @@ public function getSigner() */ public function setSigner(?string $signer) { + if (is_null($signer)) { + array_push($this->openAPINullablesSetToNull, 'signer'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signer', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signer'] = $signer; return $this; @@ -398,6 +497,9 @@ public function getX() */ public function setX(?int $x) { + if (is_null($x)) { + throw new InvalidArgumentException('non-nullable x cannot be null'); + } $this->container['x'] = $x; return $this; @@ -422,6 +524,9 @@ public function getY() */ public function setY(?int $y) { + if (is_null($y)) { + throw new InvalidArgumentException('non-nullable y cannot be null'); + } $this->container['y'] = $y; return $this; @@ -446,6 +551,9 @@ public function getWidth() */ public function setWidth(?int $width) { + if (is_null($width)) { + throw new InvalidArgumentException('non-nullable width cannot be null'); + } $this->container['width'] = $width; return $this; @@ -470,6 +578,9 @@ public function getHeight() */ public function setHeight(?int $height) { + if (is_null($height)) { + throw new InvalidArgumentException('non-nullable height cannot be null'); + } $this->container['height'] = $height; return $this; @@ -494,6 +605,9 @@ public function getRequired() */ public function setRequired(?bool $required) { + if (is_null($required)) { + throw new InvalidArgumentException('non-nullable required cannot be null'); + } $this->container['required'] = $required; return $this; @@ -518,6 +632,16 @@ public function getGroup() */ public function setGroup(?string $group) { + if (is_null($group)) { + array_push($this->openAPINullablesSetToNull, 'group'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('group', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['group'] = $group; return $this; @@ -526,12 +650,10 @@ public function setGroup(?string $group) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -539,7 +661,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -552,13 +674,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -570,12 +690,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -584,8 +702,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php index dca0f6bfa..7ec8dc018 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php +++ b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldCheckbox.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentCustomFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocumentCustomFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocume 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'checkbox'; + $this->setIfExists('type', $data ?? [], 'checkbox'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentCustomFieldCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentCustomFieldCheckbox { - /** @var TemplateResponseDocumentCustomFieldCheckbox $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentCustomFieldCheckbox */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentCustomFieldCheckbox::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php index 50a0dd42b..e63a73978 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php +++ b/sdks/php/src/Model/TemplateResponseDocumentCustomFieldText.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentCustomFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCustomFieldBase { @@ -81,6 +78,26 @@ class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCu 'font_family' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'avg_text_length' => false, + 'is_multiline' => false, + 'original_font_size' => false, + 'font_family' => 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 * @@ -101,6 +118,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -185,36 +246,54 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'text'; - $this->container['avg_text_length'] = $data['avg_text_length'] ?? null; - $this->container['is_multiline'] = $data['is_multiline'] ?? null; - $this->container['original_font_size'] = $data['original_font_size'] ?? null; - $this->container['font_family'] = $data['font_family'] ?? null; + $this->setIfExists('type', $data ?? [], 'text'); + $this->setIfExists('avg_text_length', $data ?? [], null); + $this->setIfExists('is_multiline', $data ?? [], null); + $this->setIfExists('original_font_size', $data ?? [], null); + $this->setIfExists('font_family', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentCustomFieldText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentCustomFieldText { - /** @var TemplateResponseDocumentCustomFieldText $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentCustomFieldText */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentCustomFieldText::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -229,7 +308,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -263,6 +341,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -287,6 +368,9 @@ public function getAvgTextLength() */ public function setAvgTextLength(?TemplateResponseFieldAvgTextLength $avg_text_length) { + if (is_null($avg_text_length)) { + throw new InvalidArgumentException('non-nullable avg_text_length cannot be null'); + } $this->container['avg_text_length'] = $avg_text_length; return $this; @@ -311,6 +395,9 @@ public function getIsMultiline() */ public function setIsMultiline(?bool $is_multiline) { + if (is_null($is_multiline)) { + throw new InvalidArgumentException('non-nullable is_multiline cannot be null'); + } $this->container['is_multiline'] = $is_multiline; return $this; @@ -335,6 +422,9 @@ public function getOriginalFontSize() */ public function setOriginalFontSize(?int $original_font_size) { + if (is_null($original_font_size)) { + throw new InvalidArgumentException('non-nullable original_font_size cannot be null'); + } $this->container['original_font_size'] = $original_font_size; return $this; @@ -359,6 +449,9 @@ public function getFontFamily() */ public function setFontFamily(?string $font_family) { + if (is_null($font_family)) { + throw new InvalidArgumentException('non-nullable font_family cannot be null'); + } $this->container['font_family'] = $font_family; return $this; @@ -367,12 +460,10 @@ public function setFontFamily(?string $font_family) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -380,7 +471,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -393,13 +484,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -411,12 +500,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -425,8 +512,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php b/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php index 6f8b57907..541714841 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFieldGroup.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TemplateResponseDocumentFieldGroup Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateResponseDocumentFieldGroup implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class TemplateResponseDocumentFieldGroup implements ModelInterface, ArrayAccess, 'rule' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'rule' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['rule'] = $data['rule'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('rule', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFieldGroup { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFieldGroup { - /** @var TemplateResponseDocumentFieldGroup $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentFieldGroup */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFieldGroup::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -213,9 +288,7 @@ public static function init(array $data): TemplateResponseDocumentFieldGroup */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -248,6 +321,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -272,6 +348,9 @@ public function getRule() */ public function setRule(?TemplateResponseDocumentFieldGroupRule $rule) { + if (is_null($rule)) { + throw new InvalidArgumentException('non-nullable rule cannot be null'); + } $this->container['rule'] = $rule; return $this; @@ -280,12 +359,10 @@ public function setRule(?TemplateResponseDocumentFieldGroupRule $rule) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +370,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +383,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +399,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +411,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php b/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php index 953fd6561..1bd31bde9 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFieldGroupRule.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping). - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateResponseDocumentFieldGroupRule implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +74,23 @@ class TemplateResponseDocumentFieldGroupRule implements ModelInterface, ArrayAcc 'group_label' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'requirement' => false, + 'group_label' => 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 * @@ -98,6 +111,50 @@ 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 @@ -173,38 +230,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['requirement'] = $data['requirement'] ?? null; - $this->container['group_label'] = $data['group_label'] ?? null; + $this->setIfExists('requirement', $data ?? [], null); + $this->setIfExists('group_label', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFieldGroupRule { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFieldGroupRule { - /** @var TemplateResponseDocumentFieldGroupRule $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentFieldGroupRule */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFieldGroupRule::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,9 +289,7 @@ public static function init(array $data): TemplateResponseDocumentFieldGroupRule */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -249,6 +322,9 @@ public function getRequirement() */ public function setRequirement(?string $requirement) { + if (is_null($requirement)) { + throw new InvalidArgumentException('non-nullable requirement cannot be null'); + } $this->container['requirement'] = $requirement; return $this; @@ -273,6 +349,9 @@ public function getGroupLabel() */ public function setGroupLabel(?string $group_label) { + if (is_null($group_label)) { + throw new InvalidArgumentException('non-nullable group_label cannot be null'); + } $this->container['group_label'] = $group_label; return $this; @@ -281,12 +360,10 @@ public function setGroupLabel(?string $group_label) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -294,7 +371,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -307,13 +384,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -325,12 +400,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -339,8 +412,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php index 9d9cfae4e..33cc52c58 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldBase.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,14 +38,10 @@ * * @category Class * @description An array of Form Field objects containing the name and type of each named field. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ -abstract class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseDocumentFormFieldBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; @@ -94,6 +90,31 @@ abstract class TemplateResponseDocumentFormFieldBase implements ModelInterface, 'group' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'api_id' => false, + 'name' => false, + 'signer' => false, + 'x' => false, + 'y' => false, + 'width' => false, + 'height' => false, + 'required' => false, + 'group' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +135,50 @@ 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 @@ -213,28 +278,28 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['type'] = $data['type'] ?? null; - $this->container['api_id'] = $data['api_id'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['signer'] = $data['signer'] ?? null; - $this->container['x'] = $data['x'] ?? null; - $this->container['y'] = $data['y'] ?? null; - $this->container['width'] = $data['width'] ?? null; - $this->container['height'] = $data['height'] ?? null; - $this->container['required'] = $data['required'] ?? null; - $this->container['group'] = $data['group'] ?? null; + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('api_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('signer', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('height', $data ?? [], null); + $this->setIfExists('required', $data ?? [], null); + $this->setIfExists('group', $data ?? [], null); // Initialize discriminator property with the model name. $this->container['type'] = static::$openAPIModelName; @@ -274,6 +339,22 @@ public static function discriminatorClassName(array $data): ?string return null; } + /** + * 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. * @@ -286,7 +367,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -320,6 +400,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -344,6 +427,9 @@ public function getApiId() */ public function setApiId(?string $api_id) { + if (is_null($api_id)) { + throw new InvalidArgumentException('non-nullable api_id cannot be null'); + } $this->container['api_id'] = $api_id; return $this; @@ -368,6 +454,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -392,6 +481,9 @@ public function getSigner() */ public function setSigner(?string $signer) { + if (is_null($signer)) { + throw new InvalidArgumentException('non-nullable signer cannot be null'); + } $this->container['signer'] = $signer; return $this; @@ -416,6 +508,9 @@ public function getX() */ public function setX(?int $x) { + if (is_null($x)) { + throw new InvalidArgumentException('non-nullable x cannot be null'); + } $this->container['x'] = $x; return $this; @@ -440,6 +535,9 @@ public function getY() */ public function setY(?int $y) { + if (is_null($y)) { + throw new InvalidArgumentException('non-nullable y cannot be null'); + } $this->container['y'] = $y; return $this; @@ -464,6 +562,9 @@ public function getWidth() */ public function setWidth(?int $width) { + if (is_null($width)) { + throw new InvalidArgumentException('non-nullable width cannot be null'); + } $this->container['width'] = $width; return $this; @@ -488,6 +589,9 @@ public function getHeight() */ public function setHeight(?int $height) { + if (is_null($height)) { + throw new InvalidArgumentException('non-nullable height cannot be null'); + } $this->container['height'] = $height; return $this; @@ -512,6 +616,9 @@ public function getRequired() */ public function setRequired(?bool $required) { + if (is_null($required)) { + throw new InvalidArgumentException('non-nullable required cannot be null'); + } $this->container['required'] = $required; return $this; @@ -536,6 +643,16 @@ public function getGroup() */ public function setGroup(?string $group) { + if (is_null($group)) { + array_push($this->openAPINullablesSetToNull, 'group'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('group', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['group'] = $group; return $this; @@ -544,12 +661,10 @@ public function setGroup(?string $group) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -557,7 +672,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -570,13 +685,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -588,12 +701,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -602,8 +713,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php index 6aafd23cd..bd03254c4 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldCheckbox.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentFormFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocumentFormFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocument 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'checkbox'; + $this->setIfExists('type', $data ?? [], 'checkbox'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldCheckbox { - /** @var TemplateResponseDocumentFormFieldCheckbox $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentFormFieldCheckbox */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldCheckbox::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php index 0b8dcf3dd..158d8159c 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDateSigned.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentFormFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocumentFormFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocume 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'date_signed'; + $this->setIfExists('type', $data ?? [], 'date_signed'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldDateSigned { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldDateSigned { - /** @var TemplateResponseDocumentFormFieldDateSigned $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentFormFieldDateSigned */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldDateSigned::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php index f43e89b0b..057b5d84d 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldDropdown.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentFormFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocumentFormFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocument 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'dropdown'; + $this->setIfExists('type', $data ?? [], 'dropdown'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldDropdown { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldDropdown { - /** @var TemplateResponseDocumentFormFieldDropdown $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentFormFieldDropdown */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldDropdown::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php index eb4b4fb88..81ffda0ce 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldHyperlink.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentFormFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumentFormFieldBase { @@ -81,6 +78,26 @@ class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumen 'font_family' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'avg_text_length' => false, + 'is_multiline' => false, + 'original_font_size' => false, + 'font_family' => 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 * @@ -101,6 +118,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -185,36 +246,54 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'hyperlink'; - $this->container['avg_text_length'] = $data['avg_text_length'] ?? null; - $this->container['is_multiline'] = $data['is_multiline'] ?? null; - $this->container['original_font_size'] = $data['original_font_size'] ?? null; - $this->container['font_family'] = $data['font_family'] ?? null; + $this->setIfExists('type', $data ?? [], 'hyperlink'); + $this->setIfExists('avg_text_length', $data ?? [], null); + $this->setIfExists('is_multiline', $data ?? [], null); + $this->setIfExists('original_font_size', $data ?? [], null); + $this->setIfExists('font_family', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldHyperlink { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldHyperlink { - /** @var TemplateResponseDocumentFormFieldHyperlink $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentFormFieldHyperlink */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldHyperlink::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -229,7 +308,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -263,6 +341,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -287,6 +368,9 @@ public function getAvgTextLength() */ public function setAvgTextLength(?TemplateResponseFieldAvgTextLength $avg_text_length) { + if (is_null($avg_text_length)) { + throw new InvalidArgumentException('non-nullable avg_text_length cannot be null'); + } $this->container['avg_text_length'] = $avg_text_length; return $this; @@ -311,6 +395,9 @@ public function getIsMultiline() */ public function setIsMultiline(?bool $is_multiline) { + if (is_null($is_multiline)) { + throw new InvalidArgumentException('non-nullable is_multiline cannot be null'); + } $this->container['is_multiline'] = $is_multiline; return $this; @@ -335,6 +422,9 @@ public function getOriginalFontSize() */ public function setOriginalFontSize(?int $original_font_size) { + if (is_null($original_font_size)) { + throw new InvalidArgumentException('non-nullable original_font_size cannot be null'); + } $this->container['original_font_size'] = $original_font_size; return $this; @@ -359,6 +449,9 @@ public function getFontFamily() */ public function setFontFamily(?string $font_family) { + if (is_null($font_family)) { + throw new InvalidArgumentException('non-nullable font_family cannot be null'); + } $this->container['font_family'] = $font_family; return $this; @@ -367,12 +460,10 @@ public function setFontFamily(?string $font_family) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -380,7 +471,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -393,13 +484,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -411,12 +500,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -425,8 +512,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php index 33dee5480..976a27fba 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldInitials.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentFormFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocumentFormFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocument 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'initials'; + $this->setIfExists('type', $data ?? [], 'initials'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldInitials { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldInitials { - /** @var TemplateResponseDocumentFormFieldInitials $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentFormFieldInitials */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldInitials::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php index de530b588..bd0d28e85 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldRadio.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentFormFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFormFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentFormFieldRadio extends TemplateResponseDocumentFor 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'radio'; + $this->setIfExists('type', $data ?? [], 'radio'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldRadio { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldRadio { - /** @var TemplateResponseDocumentFormFieldRadio $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentFormFieldRadio */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldRadio::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php index 7a2951213..9effb72b7 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldSignature.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentFormFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumentFormFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumen 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'signature'; + $this->setIfExists('type', $data ?? [], 'signature'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldSignature { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldSignature { - /** @var TemplateResponseDocumentFormFieldSignature $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentFormFieldSignature */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldSignature::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php b/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php index a7fa915a2..0684e1d67 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php +++ b/sdks/php/src/Model/TemplateResponseDocumentFormFieldText.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -37,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentFormFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentFormFieldBase { @@ -84,6 +80,27 @@ class TemplateResponseDocumentFormFieldText extends TemplateResponseDocumentForm 'validation_type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'avg_text_length' => false, + 'is_multiline' => false, + 'original_font_size' => false, + 'font_family' => false, + 'validation_type' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +121,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -223,37 +284,55 @@ public function getValidationTypeAllowableValues() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'text'; - $this->container['avg_text_length'] = $data['avg_text_length'] ?? null; - $this->container['is_multiline'] = $data['is_multiline'] ?? null; - $this->container['original_font_size'] = $data['original_font_size'] ?? null; - $this->container['font_family'] = $data['font_family'] ?? null; - $this->container['validation_type'] = $data['validation_type'] ?? null; + $this->setIfExists('type', $data ?? [], 'text'); + $this->setIfExists('avg_text_length', $data ?? [], null); + $this->setIfExists('is_multiline', $data ?? [], null); + $this->setIfExists('original_font_size', $data ?? [], null); + $this->setIfExists('font_family', $data ?? [], null); + $this->setIfExists('validation_type', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentFormFieldText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentFormFieldText { - /** @var TemplateResponseDocumentFormFieldText $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentFormFieldText */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentFormFieldText::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -310,6 +389,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -334,6 +416,9 @@ public function getAvgTextLength() */ public function setAvgTextLength(?TemplateResponseFieldAvgTextLength $avg_text_length) { + if (is_null($avg_text_length)) { + throw new InvalidArgumentException('non-nullable avg_text_length cannot be null'); + } $this->container['avg_text_length'] = $avg_text_length; return $this; @@ -358,6 +443,9 @@ public function getIsMultiline() */ public function setIsMultiline(?bool $is_multiline) { + if (is_null($is_multiline)) { + throw new InvalidArgumentException('non-nullable is_multiline cannot be null'); + } $this->container['is_multiline'] = $is_multiline; return $this; @@ -382,6 +470,9 @@ public function getOriginalFontSize() */ public function setOriginalFontSize(?int $original_font_size) { + if (is_null($original_font_size)) { + throw new InvalidArgumentException('non-nullable original_font_size cannot be null'); + } $this->container['original_font_size'] = $original_font_size; return $this; @@ -406,6 +497,9 @@ public function getFontFamily() */ public function setFontFamily(?string $font_family) { + if (is_null($font_family)) { + throw new InvalidArgumentException('non-nullable font_family cannot be null'); + } $this->container['font_family'] = $font_family; return $this; @@ -430,6 +524,16 @@ public function getValidationType() */ public function setValidationType(?string $validation_type) { + if (is_null($validation_type)) { + array_push($this->openAPINullablesSetToNull, 'validation_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('validation_type', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $allowedValues = $this->getValidationTypeAllowableValues(); if (!is_null($validation_type) && !in_array($validation_type, $allowedValues, true)) { throw new InvalidArgumentException( @@ -448,12 +552,10 @@ public function setValidationType(?string $validation_type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -461,7 +563,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -474,13 +576,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -492,12 +592,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -506,8 +604,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php index 5e52961af..bd18e1847 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldBase.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,14 +38,10 @@ * * @category Class * @description An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ -abstract class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAccess, JsonSerializable +class TemplateResponseDocumentStaticFieldBase implements ModelInterface, ArrayAccess, JsonSerializable { public const DISCRIMINATOR = 'type'; @@ -94,6 +90,31 @@ abstract class TemplateResponseDocumentStaticFieldBase implements ModelInterface 'group' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'api_id' => false, + 'name' => false, + 'signer' => false, + 'x' => false, + 'y' => false, + 'width' => false, + 'height' => false, + 'required' => false, + 'group' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +135,50 @@ 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 @@ -213,28 +278,28 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['type'] = $data['type'] ?? null; - $this->container['api_id'] = $data['api_id'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['signer'] = $data['signer'] ?? 'me_now'; - $this->container['x'] = $data['x'] ?? null; - $this->container['y'] = $data['y'] ?? null; - $this->container['width'] = $data['width'] ?? null; - $this->container['height'] = $data['height'] ?? null; - $this->container['required'] = $data['required'] ?? null; - $this->container['group'] = $data['group'] ?? null; + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('api_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('signer', $data ?? [], 'me_now'); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); + $this->setIfExists('height', $data ?? [], null); + $this->setIfExists('required', $data ?? [], null); + $this->setIfExists('group', $data ?? [], null); // Initialize discriminator property with the model name. $this->container['type'] = static::$openAPIModelName; @@ -274,6 +339,22 @@ public static function discriminatorClassName(array $data): ?string return null; } + /** + * 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. * @@ -286,7 +367,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -320,6 +400,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -344,6 +427,9 @@ public function getApiId() */ public function setApiId(?string $api_id) { + if (is_null($api_id)) { + throw new InvalidArgumentException('non-nullable api_id cannot be null'); + } $this->container['api_id'] = $api_id; return $this; @@ -368,6 +454,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -392,6 +481,9 @@ public function getSigner() */ public function setSigner(?string $signer) { + if (is_null($signer)) { + throw new InvalidArgumentException('non-nullable signer cannot be null'); + } $this->container['signer'] = $signer; return $this; @@ -416,6 +508,9 @@ public function getX() */ public function setX(?int $x) { + if (is_null($x)) { + throw new InvalidArgumentException('non-nullable x cannot be null'); + } $this->container['x'] = $x; return $this; @@ -440,6 +535,9 @@ public function getY() */ public function setY(?int $y) { + if (is_null($y)) { + throw new InvalidArgumentException('non-nullable y cannot be null'); + } $this->container['y'] = $y; return $this; @@ -464,6 +562,9 @@ public function getWidth() */ public function setWidth(?int $width) { + if (is_null($width)) { + throw new InvalidArgumentException('non-nullable width cannot be null'); + } $this->container['width'] = $width; return $this; @@ -488,6 +589,9 @@ public function getHeight() */ public function setHeight(?int $height) { + if (is_null($height)) { + throw new InvalidArgumentException('non-nullable height cannot be null'); + } $this->container['height'] = $height; return $this; @@ -512,6 +616,9 @@ public function getRequired() */ public function setRequired(?bool $required) { + if (is_null($required)) { + throw new InvalidArgumentException('non-nullable required cannot be null'); + } $this->container['required'] = $required; return $this; @@ -536,6 +643,16 @@ public function getGroup() */ public function setGroup(?string $group) { + if (is_null($group)) { + array_push($this->openAPINullablesSetToNull, 'group'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('group', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['group'] = $group; return $this; @@ -544,12 +661,10 @@ public function setGroup(?string $group) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -557,7 +672,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -570,13 +685,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -588,12 +701,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -602,8 +713,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php index 06bc51ede..9739d2e05 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldCheckbox.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentStaticFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocumentStaticFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocume 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'checkbox'; + $this->setIfExists('type', $data ?? [], 'checkbox'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldCheckbox { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldCheckbox { - /** @var TemplateResponseDocumentStaticFieldCheckbox $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentStaticFieldCheckbox */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldCheckbox::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php index 42c79cd09..911febf8d 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDateSigned.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentStaticFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocumentStaticFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocu 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'date_signed'; + $this->setIfExists('type', $data ?? [], 'date_signed'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldDateSigned { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldDateSigned { - /** @var TemplateResponseDocumentStaticFieldDateSigned $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentStaticFieldDateSigned */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldDateSigned::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php index 299898fbf..6022f9289 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldDropdown.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentStaticFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocumentStaticFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocume 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'dropdown'; + $this->setIfExists('type', $data ?? [], 'dropdown'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldDropdown { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldDropdown { - /** @var TemplateResponseDocumentStaticFieldDropdown $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentStaticFieldDropdown */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldDropdown::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php index 9cb8555af..246bea450 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldHyperlink.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentStaticFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocumentStaticFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocum 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'hyperlink'; + $this->setIfExists('type', $data ?? [], 'hyperlink'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldHyperlink { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldHyperlink { - /** @var TemplateResponseDocumentStaticFieldHyperlink $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentStaticFieldHyperlink */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldHyperlink::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php index df100948b..339b3a2a5 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldInitials.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentStaticFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocumentStaticFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocume 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'initials'; + $this->setIfExists('type', $data ?? [], 'initials'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldInitials { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldInitials { - /** @var TemplateResponseDocumentStaticFieldInitials $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentStaticFieldInitials */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldInitials::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php index 72dfaf30b..8dc139712 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldRadio.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentStaticFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentStaticFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentS 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'radio'; + $this->setIfExists('type', $data ?? [], 'radio'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldRadio { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldRadio { - /** @var TemplateResponseDocumentStaticFieldRadio $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentStaticFieldRadio */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldRadio::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php index c98ba38ed..c86d1c9a3 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldSignature.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentStaticFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocumentStaticFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocum 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'signature'; + $this->setIfExists('type', $data ?? [], 'signature'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldSignature { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldSignature { - /** @var TemplateResponseDocumentStaticFieldSignature $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentStaticFieldSignature */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldSignature::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php index 8b2bf3f23..ec89541e3 100644 --- a/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php +++ b/sdks/php/src/Model/TemplateResponseDocumentStaticFieldText.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,6 +28,7 @@ namespace Dropbox\Sign\Model; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use ReturnTypeWillChange; /** @@ -36,11 +36,8 @@ * * @category Class * @description This class extends `TemplateResponseDocumentStaticFieldBase` - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentStaticFieldBase { @@ -73,6 +70,22 @@ class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentSt 'type' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => 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 * @@ -93,6 +106,50 @@ public static function openAPIFormats() return self::$openAPIFormats + parent::openAPIFormats(); } + /** + * Array of nullable properties + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 @@ -165,32 +222,50 @@ public function getModelName() /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { parent::__construct($data); - $this->container['type'] = $data['type'] ?? 'text'; + $this->setIfExists('type', $data ?? [], 'text'); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseDocumentStaticFieldText { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseDocumentStaticFieldText { - /** @var TemplateResponseDocumentStaticFieldText $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseDocumentStaticFieldText */ + return ObjectSerializer::deserialize( $data, TemplateResponseDocumentStaticFieldText::class, ); + } - return $obj; + /** + * 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; } /** @@ -205,7 +280,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - return $invalidProperties; } @@ -239,6 +313,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -247,12 +324,10 @@ public function setType(string $type) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -273,13 +348,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -291,12 +364,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -305,8 +376,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php b/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php index 02e025d6b..9277db26a 100644 --- a/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php +++ b/sdks/php/src/Model/TemplateResponseFieldAvgTextLength.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Average text length in this field. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateResponseFieldAvgTextLength implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +74,23 @@ class TemplateResponseFieldAvgTextLength implements ModelInterface, ArrayAccess, 'num_chars_per_line' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'num_lines' => false, + 'num_chars_per_line' => 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 * @@ -98,6 +111,50 @@ 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 @@ -173,38 +230,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['num_lines'] = $data['num_lines'] ?? null; - $this->container['num_chars_per_line'] = $data['num_chars_per_line'] ?? null; + $this->setIfExists('num_lines', $data ?? [], null); + $this->setIfExists('num_chars_per_line', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseFieldAvgTextLength { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseFieldAvgTextLength { - /** @var TemplateResponseFieldAvgTextLength $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseFieldAvgTextLength */ + return ObjectSerializer::deserialize( $data, TemplateResponseFieldAvgTextLength::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,9 +289,7 @@ public static function init(array $data): TemplateResponseFieldAvgTextLength */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -249,6 +322,9 @@ public function getNumLines() */ public function setNumLines(?int $num_lines) { + if (is_null($num_lines)) { + throw new InvalidArgumentException('non-nullable num_lines cannot be null'); + } $this->container['num_lines'] = $num_lines; return $this; @@ -273,6 +349,9 @@ public function getNumCharsPerLine() */ public function setNumCharsPerLine(?int $num_chars_per_line) { + if (is_null($num_chars_per_line)) { + throw new InvalidArgumentException('non-nullable num_chars_per_line cannot be null'); + } $this->container['num_chars_per_line'] = $num_chars_per_line; return $this; @@ -281,12 +360,10 @@ public function setNumCharsPerLine(?int $num_chars_per_line) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -294,7 +371,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -307,13 +384,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -325,12 +400,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -339,8 +412,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateResponseSignerRole.php b/sdks/php/src/Model/TemplateResponseSignerRole.php index 1f2e9d9d4..98a80c6e0 100644 --- a/sdks/php/src/Model/TemplateResponseSignerRole.php +++ b/sdks/php/src/Model/TemplateResponseSignerRole.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TemplateResponseSignerRole Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateResponseSignerRole implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class TemplateResponseSignerRole implements ModelInterface, ArrayAccess, JsonSer 'order' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'order' => 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 * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['order'] = $data['order'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateResponseSignerRole { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateResponseSignerRole { - /** @var TemplateResponseSignerRole $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateResponseSignerRole */ + return ObjectSerializer::deserialize( $data, TemplateResponseSignerRole::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -213,9 +288,7 @@ public static function init(array $data): TemplateResponseSignerRole */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -248,6 +321,9 @@ public function getName() */ public function setName(?string $name) { + if (is_null($name)) { + throw new InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -272,6 +348,9 @@ public function getOrder() */ public function setOrder(?int $order) { + if (is_null($order)) { + throw new InvalidArgumentException('non-nullable order cannot be null'); + } $this->container['order'] = $order; return $this; @@ -280,12 +359,10 @@ public function setOrder(?int $order) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +370,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +383,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +399,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +411,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateUpdateFilesRequest.php b/sdks/php/src/Model/TemplateUpdateFilesRequest.php index 29ec13356..7c165ff7d 100644 --- a/sdks/php/src/Model/TemplateUpdateFilesRequest.php +++ b/sdks/php/src/Model/TemplateUpdateFilesRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * TemplateUpdateFilesRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class TemplateUpdateFilesRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -86,6 +82,27 @@ class TemplateUpdateFilesRequest implements ModelInterface, ArrayAccess, JsonSer 'test_mode' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'client_id' => false, + 'files' => false, + 'file_urls' => false, + 'message' => false, + 'subject' => false, + 'test_mode' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +123,50 @@ 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 @@ -193,42 +254,60 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['files'] = $data['files'] ?? null; - $this->container['file_urls'] = $data['file_urls'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateUpdateFilesRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateUpdateFilesRequest { - /** @var TemplateUpdateFilesRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateUpdateFilesRequest */ + return ObjectSerializer::deserialize( $data, TemplateUpdateFilesRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -281,6 +360,9 @@ public function getClientId() */ public function setClientId(?string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -305,6 +387,9 @@ public function getFiles() */ public function setFiles(?array $files) { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } $this->container['files'] = $files; return $this; @@ -329,6 +414,9 @@ public function getFileUrls() */ 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; @@ -353,7 +441,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling TemplateUpdateFilesRequest., must be smaller than or equal to 5000.'); } @@ -381,7 +472,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 100)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 100) { throw new InvalidArgumentException('invalid length for $subject when calling TemplateUpdateFilesRequest., must be smaller than or equal to 100.'); } @@ -409,6 +503,9 @@ public function getTestMode() */ 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; @@ -417,12 +514,10 @@ public function setTestMode(?bool $test_mode) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -430,7 +525,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -443,13 +538,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -461,12 +554,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,8 +566,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateUpdateFilesResponse.php b/sdks/php/src/Model/TemplateUpdateFilesResponse.php index b634cfbb2..d8080fb74 100644 --- a/sdks/php/src/Model/TemplateUpdateFilesResponse.php +++ b/sdks/php/src/Model/TemplateUpdateFilesResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * TemplateUpdateFilesResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateUpdateFilesResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -75,6 +71,22 @@ class TemplateUpdateFilesResponse implements ModelInterface, ArrayAccess, JsonSe 'template' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template' => 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 * @@ -95,6 +107,50 @@ 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 @@ -167,37 +223,55 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template'] = $data['template'] ?? null; + $this->setIfExists('template', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateUpdateFilesResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateUpdateFilesResponse { - /** @var TemplateUpdateFilesResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateUpdateFilesResponse */ + return ObjectSerializer::deserialize( $data, TemplateUpdateFilesResponse::class, ); + } - return $obj; + /** + * 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; } /** @@ -209,6 +283,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['template'] === null) { + $invalidProperties[] = "'template' can't be null"; + } return $invalidProperties; } @@ -226,7 +303,7 @@ public function valid() /** * Gets template * - * @return TemplateUpdateFilesResponseTemplate|null + * @return TemplateUpdateFilesResponseTemplate */ public function getTemplate() { @@ -236,12 +313,15 @@ public function getTemplate() /** * Sets template * - * @param TemplateUpdateFilesResponseTemplate|null $template template + * @param TemplateUpdateFilesResponseTemplate $template template * * @return self */ - public function setTemplate(?TemplateUpdateFilesResponseTemplate $template) + public function setTemplate(TemplateUpdateFilesResponseTemplate $template) { + if (is_null($template)) { + throw new InvalidArgumentException('non-nullable template cannot be null'); + } $this->container['template'] = $template; return $this; @@ -250,12 +330,10 @@ public function setTemplate(?TemplateUpdateFilesResponseTemplate $template) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -263,7 +341,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -276,13 +354,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -294,12 +370,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -308,8 +382,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php b/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php index 4fb057faa..70d2e87dc 100644 --- a/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php +++ b/sdks/php/src/Model/TemplateUpdateFilesResponseTemplate.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description Contains template id - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class TemplateUpdateFilesResponseTemplate implements ModelInterface, ArrayAccess, JsonSerializable { @@ -78,6 +74,23 @@ class TemplateUpdateFilesResponseTemplate implements ModelInterface, ArrayAccess 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'template_id' => 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 * @@ -98,6 +111,50 @@ 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 @@ -173,38 +230,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['template_id'] = $data['template_id'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('template_id', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): TemplateUpdateFilesResponseTemplate { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): TemplateUpdateFilesResponseTemplate { - /** @var TemplateUpdateFilesResponseTemplate $obj */ - $obj = ObjectSerializer::deserialize( + /** @var TemplateUpdateFilesResponseTemplate */ + return ObjectSerializer::deserialize( $data, TemplateUpdateFilesResponseTemplate::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,9 +289,7 @@ public static function init(array $data): TemplateUpdateFilesResponseTemplate */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -249,6 +322,9 @@ public function getTemplateId() */ public function setTemplateId(?string $template_id) { + if (is_null($template_id)) { + throw new InvalidArgumentException('non-nullable template_id cannot be null'); + } $this->container['template_id'] = $template_id; return $this; @@ -275,6 +351,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -283,12 +362,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -296,7 +373,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -309,13 +386,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -327,12 +402,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -341,8 +414,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php index 74a0a185b..8d4a7e3e2 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,9 @@ * UnclaimedDraftCreateEmbeddedRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team + * @description * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -146,6 +143,57 @@ class UnclaimedDraftCreateEmbeddedRequest implements ModelInterface, ArrayAccess 'expires_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'client_id' => false, + 'requester_email_address' => false, + 'files' => false, + 'file_urls' => false, + 'allow_ccs' => false, + 'allow_decline' => false, + 'allow_reassign' => false, + 'attachments' => false, + 'cc_email_addresses' => false, + 'custom_fields' => false, + 'editor_options' => false, + 'field_options' => false, + 'force_signer_page' => false, + 'force_subject_message' => false, + 'form_field_groups' => false, + 'form_field_rules' => false, + 'form_fields_per_document' => false, + 'hide_text_tags' => false, + 'hold_request' => false, + 'is_for_embedded_signing' => false, + 'message' => false, + 'metadata' => false, + 'requesting_redirect_url' => false, + 'show_preview' => false, + 'show_progress_stepper' => false, + 'signers' => false, + 'signing_options' => false, + 'signing_redirect_url' => false, + 'skip_me_now' => false, + 'subject' => false, + 'test_mode' => false, + 'type' => false, + 'use_preexisting_fields' => false, + 'use_text_tags' => false, + 'populate_auto_fill_fields' => false, + 'expires_at' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -166,6 +214,50 @@ 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 @@ -359,72 +451,90 @@ public function getTypeAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['requester_email_address'] = $data['requester_email_address'] ?? null; - $this->container['files'] = $data['files'] ?? null; - $this->container['file_urls'] = $data['file_urls'] ?? null; - $this->container['allow_ccs'] = $data['allow_ccs'] ?? true; - $this->container['allow_decline'] = $data['allow_decline'] ?? false; - $this->container['allow_reassign'] = $data['allow_reassign'] ?? false; - $this->container['attachments'] = $data['attachments'] ?? null; - $this->container['cc_email_addresses'] = $data['cc_email_addresses'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['editor_options'] = $data['editor_options'] ?? null; - $this->container['field_options'] = $data['field_options'] ?? null; - $this->container['force_signer_page'] = $data['force_signer_page'] ?? false; - $this->container['force_subject_message'] = $data['force_subject_message'] ?? false; - $this->container['form_field_groups'] = $data['form_field_groups'] ?? null; - $this->container['form_field_rules'] = $data['form_field_rules'] ?? null; - $this->container['form_fields_per_document'] = $data['form_fields_per_document'] ?? null; - $this->container['hide_text_tags'] = $data['hide_text_tags'] ?? false; - $this->container['hold_request'] = $data['hold_request'] ?? false; - $this->container['is_for_embedded_signing'] = $data['is_for_embedded_signing'] ?? false; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['requesting_redirect_url'] = $data['requesting_redirect_url'] ?? null; - $this->container['show_preview'] = $data['show_preview'] ?? null; - $this->container['show_progress_stepper'] = $data['show_progress_stepper'] ?? true; - $this->container['signers'] = $data['signers'] ?? null; - $this->container['signing_options'] = $data['signing_options'] ?? null; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['skip_me_now'] = $data['skip_me_now'] ?? false; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['type'] = $data['type'] ?? 'request_signature'; - $this->container['use_preexisting_fields'] = $data['use_preexisting_fields'] ?? false; - $this->container['use_text_tags'] = $data['use_text_tags'] ?? false; - $this->container['populate_auto_fill_fields'] = $data['populate_auto_fill_fields'] ?? false; - $this->container['expires_at'] = $data['expires_at'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('requester_email_address', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('allow_ccs', $data ?? [], true); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('allow_reassign', $data ?? [], false); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('cc_email_addresses', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('editor_options', $data ?? [], null); + $this->setIfExists('field_options', $data ?? [], null); + $this->setIfExists('force_signer_page', $data ?? [], false); + $this->setIfExists('force_subject_message', $data ?? [], false); + $this->setIfExists('form_field_groups', $data ?? [], null); + $this->setIfExists('form_field_rules', $data ?? [], null); + $this->setIfExists('form_fields_per_document', $data ?? [], null); + $this->setIfExists('hide_text_tags', $data ?? [], false); + $this->setIfExists('hold_request', $data ?? [], false); + $this->setIfExists('is_for_embedded_signing', $data ?? [], false); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('requesting_redirect_url', $data ?? [], null); + $this->setIfExists('show_preview', $data ?? [], null); + $this->setIfExists('show_progress_stepper', $data ?? [], true); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('skip_me_now', $data ?? [], false); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('type', $data ?? [], 'request_signature'); + $this->setIfExists('use_preexisting_fields', $data ?? [], false); + $this->setIfExists('use_text_tags', $data ?? [], false); + $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); + $this->setIfExists('expires_at', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftCreateEmbeddedRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftCreateEmbeddedRequest { - /** @var UnclaimedDraftCreateEmbeddedRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var UnclaimedDraftCreateEmbeddedRequest */ + return ObjectSerializer::deserialize( $data, UnclaimedDraftCreateEmbeddedRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -492,6 +602,9 @@ public function getClientId() */ public function setClientId(string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -516,6 +629,9 @@ public function getRequesterEmailAddress() */ public function setRequesterEmailAddress(string $requester_email_address) { + if (is_null($requester_email_address)) { + throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); + } $this->container['requester_email_address'] = $requester_email_address; return $this; @@ -540,6 +656,9 @@ public function getFiles() */ public function setFiles(?array $files) { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } $this->container['files'] = $files; return $this; @@ -564,6 +683,9 @@ public function getFileUrls() */ 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; @@ -588,6 +710,9 @@ public function getAllowCcs() */ public function setAllowCcs(?bool $allow_ccs) { + if (is_null($allow_ccs)) { + throw new InvalidArgumentException('non-nullable allow_ccs cannot be null'); + } $this->container['allow_ccs'] = $allow_ccs; return $this; @@ -612,6 +737,9 @@ public function getAllowDecline() */ public function setAllowDecline(?bool $allow_decline) { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } $this->container['allow_decline'] = $allow_decline; return $this; @@ -636,6 +764,9 @@ public function getAllowReassign() */ public function setAllowReassign(?bool $allow_reassign) { + if (is_null($allow_reassign)) { + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + } $this->container['allow_reassign'] = $allow_reassign; return $this; @@ -660,6 +791,9 @@ public function getAttachments() */ public function setAttachments(?array $attachments) { + if (is_null($attachments)) { + throw new InvalidArgumentException('non-nullable attachments cannot be null'); + } $this->container['attachments'] = $attachments; return $this; @@ -684,6 +818,9 @@ public function getCcEmailAddresses() */ public function setCcEmailAddresses(?array $cc_email_addresses) { + if (is_null($cc_email_addresses)) { + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + } $this->container['cc_email_addresses'] = $cc_email_addresses; return $this; @@ -708,6 +845,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -732,6 +872,9 @@ public function getEditorOptions() */ public function setEditorOptions(?SubEditorOptions $editor_options) { + if (is_null($editor_options)) { + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + } $this->container['editor_options'] = $editor_options; return $this; @@ -756,6 +899,9 @@ public function getFieldOptions() */ public function setFieldOptions(?SubFieldOptions $field_options) { + if (is_null($field_options)) { + throw new InvalidArgumentException('non-nullable field_options cannot be null'); + } $this->container['field_options'] = $field_options; return $this; @@ -780,6 +926,9 @@ public function getForceSignerPage() */ public function setForceSignerPage(?bool $force_signer_page) { + if (is_null($force_signer_page)) { + throw new InvalidArgumentException('non-nullable force_signer_page cannot be null'); + } $this->container['force_signer_page'] = $force_signer_page; return $this; @@ -804,6 +953,9 @@ public function getForceSubjectMessage() */ public function setForceSubjectMessage(?bool $force_subject_message) { + if (is_null($force_subject_message)) { + throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); + } $this->container['force_subject_message'] = $force_subject_message; return $this; @@ -828,6 +980,9 @@ public function getFormFieldGroups() */ public function setFormFieldGroups(?array $form_field_groups) { + if (is_null($form_field_groups)) { + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + } $this->container['form_field_groups'] = $form_field_groups; return $this; @@ -852,6 +1007,9 @@ public function getFormFieldRules() */ public function setFormFieldRules(?array $form_field_rules) { + if (is_null($form_field_rules)) { + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + } $this->container['form_field_rules'] = $form_field_rules; return $this; @@ -876,6 +1034,9 @@ public function getFormFieldsPerDocument() */ public function setFormFieldsPerDocument(?array $form_fields_per_document) { + if (is_null($form_fields_per_document)) { + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + } $this->container['form_fields_per_document'] = $form_fields_per_document; return $this; @@ -900,6 +1061,9 @@ public function getHideTextTags() */ public function setHideTextTags(?bool $hide_text_tags) { + if (is_null($hide_text_tags)) { + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + } $this->container['hide_text_tags'] = $hide_text_tags; return $this; @@ -924,6 +1088,9 @@ public function getHoldRequest() */ public function setHoldRequest(?bool $hold_request) { + if (is_null($hold_request)) { + throw new InvalidArgumentException('non-nullable hold_request cannot be null'); + } $this->container['hold_request'] = $hold_request; return $this; @@ -948,6 +1115,9 @@ public function getIsForEmbeddedSigning() */ public function setIsForEmbeddedSigning(?bool $is_for_embedded_signing) { + if (is_null($is_for_embedded_signing)) { + throw new InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); + } $this->container['is_for_embedded_signing'] = $is_for_embedded_signing; return $this; @@ -972,7 +1142,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateEmbeddedRequest., must be smaller than or equal to 5000.'); } @@ -1000,6 +1173,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -1024,6 +1201,9 @@ public function getRequestingRedirectUrl() */ public function setRequestingRedirectUrl(?string $requesting_redirect_url) { + if (is_null($requesting_redirect_url)) { + throw new InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); + } $this->container['requesting_redirect_url'] = $requesting_redirect_url; return $this; @@ -1048,6 +1228,9 @@ public function getShowPreview() */ public function setShowPreview(?bool $show_preview) { + if (is_null($show_preview)) { + throw new InvalidArgumentException('non-nullable show_preview cannot be null'); + } $this->container['show_preview'] = $show_preview; return $this; @@ -1072,6 +1255,9 @@ public function getShowProgressStepper() */ public function setShowProgressStepper(?bool $show_progress_stepper) { + if (is_null($show_progress_stepper)) { + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + } $this->container['show_progress_stepper'] = $show_progress_stepper; return $this; @@ -1096,6 +1282,9 @@ public function getSigners() */ public function setSigners(?array $signers) { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } $this->container['signers'] = $signers; return $this; @@ -1120,6 +1309,9 @@ public function getSigningOptions() */ public function setSigningOptions(?SubSigningOptions $signing_options) { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } $this->container['signing_options'] = $signing_options; return $this; @@ -1144,6 +1336,9 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -1168,6 +1363,9 @@ public function getSkipMeNow() */ public function setSkipMeNow(?bool $skip_me_now) { + if (is_null($skip_me_now)) { + throw new InvalidArgumentException('non-nullable skip_me_now cannot be null'); + } $this->container['skip_me_now'] = $skip_me_now; return $this; @@ -1192,7 +1390,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 200)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 200) { throw new InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateEmbeddedRequest., must be smaller than or equal to 200.'); } @@ -1220,6 +1421,9 @@ public function getTestMode() */ 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; @@ -1244,8 +1448,11 @@ public function getType() */ public function setType(?string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($type) && !in_array($type, $allowedValues, true)) { + if (!in_array($type, $allowedValues, true)) { throw new InvalidArgumentException( sprintf( "Invalid value '%s' for 'type', must be one of '%s'", @@ -1278,6 +1485,9 @@ public function getUsePreexistingFields() */ public function setUsePreexistingFields(?bool $use_preexisting_fields) { + if (is_null($use_preexisting_fields)) { + throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + } $this->container['use_preexisting_fields'] = $use_preexisting_fields; return $this; @@ -1302,6 +1512,9 @@ public function getUseTextTags() */ public function setUseTextTags(?bool $use_text_tags) { + if (is_null($use_text_tags)) { + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + } $this->container['use_text_tags'] = $use_text_tags; return $this; @@ -1326,6 +1539,9 @@ public function getPopulateAutoFillFields() */ public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) { + if (is_null($populate_auto_fill_fields)) { + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; return $this; @@ -1350,6 +1566,16 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['expires_at'] = $expires_at; return $this; @@ -1358,12 +1584,10 @@ public function setExpiresAt(?int $expires_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1371,7 +1595,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -1384,13 +1608,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1402,12 +1624,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1416,8 +1636,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php index d3cffebce..df0b1df69 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,8 @@ * UnclaimedDraftCreateEmbeddedWithTemplateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -134,6 +130,51 @@ class UnclaimedDraftCreateEmbeddedWithTemplateRequest implements ModelInterface, 'allow_ccs' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'client_id' => false, + 'requester_email_address' => false, + 'template_ids' => false, + 'allow_decline' => false, + 'allow_reassign' => false, + 'ccs' => false, + 'custom_fields' => false, + 'editor_options' => false, + 'field_options' => false, + 'files' => false, + 'file_urls' => false, + 'force_signer_roles' => false, + 'force_subject_message' => false, + 'hold_request' => false, + 'is_for_embedded_signing' => false, + 'message' => false, + 'metadata' => false, + 'preview_only' => false, + 'requesting_redirect_url' => false, + 'show_preview' => false, + 'show_progress_stepper' => false, + 'signers' => false, + 'signing_options' => false, + 'signing_redirect_url' => false, + 'skip_me_now' => false, + 'subject' => false, + 'test_mode' => false, + 'title' => false, + 'populate_auto_fill_fields' => false, + 'allow_ccs' => 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 * @@ -154,6 +195,50 @@ 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 @@ -313,66 +398,84 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['requester_email_address'] = $data['requester_email_address'] ?? null; - $this->container['template_ids'] = $data['template_ids'] ?? null; - $this->container['allow_decline'] = $data['allow_decline'] ?? false; - $this->container['allow_reassign'] = $data['allow_reassign'] ?? false; - $this->container['ccs'] = $data['ccs'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['editor_options'] = $data['editor_options'] ?? null; - $this->container['field_options'] = $data['field_options'] ?? null; - $this->container['files'] = $data['files'] ?? null; - $this->container['file_urls'] = $data['file_urls'] ?? null; - $this->container['force_signer_roles'] = $data['force_signer_roles'] ?? false; - $this->container['force_subject_message'] = $data['force_subject_message'] ?? false; - $this->container['hold_request'] = $data['hold_request'] ?? false; - $this->container['is_for_embedded_signing'] = $data['is_for_embedded_signing'] ?? false; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['preview_only'] = $data['preview_only'] ?? false; - $this->container['requesting_redirect_url'] = $data['requesting_redirect_url'] ?? null; - $this->container['show_preview'] = $data['show_preview'] ?? false; - $this->container['show_progress_stepper'] = $data['show_progress_stepper'] ?? true; - $this->container['signers'] = $data['signers'] ?? null; - $this->container['signing_options'] = $data['signing_options'] ?? null; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['skip_me_now'] = $data['skip_me_now'] ?? false; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['title'] = $data['title'] ?? null; - $this->container['populate_auto_fill_fields'] = $data['populate_auto_fill_fields'] ?? false; - $this->container['allow_ccs'] = $data['allow_ccs'] ?? false; - } - - /** @deprecated use ::init() */ + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('requester_email_address', $data ?? [], null); + $this->setIfExists('template_ids', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('allow_reassign', $data ?? [], false); + $this->setIfExists('ccs', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('editor_options', $data ?? [], null); + $this->setIfExists('field_options', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('force_signer_roles', $data ?? [], false); + $this->setIfExists('force_subject_message', $data ?? [], false); + $this->setIfExists('hold_request', $data ?? [], false); + $this->setIfExists('is_for_embedded_signing', $data ?? [], false); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('preview_only', $data ?? [], false); + $this->setIfExists('requesting_redirect_url', $data ?? [], null); + $this->setIfExists('show_preview', $data ?? [], false); + $this->setIfExists('show_progress_stepper', $data ?? [], true); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('skip_me_now', $data ?? [], false); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('populate_auto_fill_fields', $data ?? [], false); + $this->setIfExists('allow_ccs', $data ?? [], false); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftCreateEmbeddedWithTemplateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftCreateEmbeddedWithTemplateRequest { - /** @var UnclaimedDraftCreateEmbeddedWithTemplateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var UnclaimedDraftCreateEmbeddedWithTemplateRequest */ + return ObjectSerializer::deserialize( $data, UnclaimedDraftCreateEmbeddedWithTemplateRequest::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -438,6 +541,9 @@ public function getClientId() */ public function setClientId(string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -462,6 +568,9 @@ public function getRequesterEmailAddress() */ public function setRequesterEmailAddress(string $requester_email_address) { + if (is_null($requester_email_address)) { + throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); + } $this->container['requester_email_address'] = $requester_email_address; return $this; @@ -486,6 +595,9 @@ public function getTemplateIds() */ public function setTemplateIds(array $template_ids) { + if (is_null($template_ids)) { + throw new InvalidArgumentException('non-nullable template_ids cannot be null'); + } $this->container['template_ids'] = $template_ids; return $this; @@ -510,6 +622,9 @@ public function getAllowDecline() */ public function setAllowDecline(?bool $allow_decline) { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } $this->container['allow_decline'] = $allow_decline; return $this; @@ -534,6 +649,9 @@ public function getAllowReassign() */ public function setAllowReassign(?bool $allow_reassign) { + if (is_null($allow_reassign)) { + throw new InvalidArgumentException('non-nullable allow_reassign cannot be null'); + } $this->container['allow_reassign'] = $allow_reassign; return $this; @@ -558,6 +676,9 @@ public function getCcs() */ public function setCcs(?array $ccs) { + if (is_null($ccs)) { + throw new InvalidArgumentException('non-nullable ccs cannot be null'); + } $this->container['ccs'] = $ccs; return $this; @@ -582,6 +703,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -606,6 +730,9 @@ public function getEditorOptions() */ public function setEditorOptions(?SubEditorOptions $editor_options) { + if (is_null($editor_options)) { + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + } $this->container['editor_options'] = $editor_options; return $this; @@ -630,6 +757,9 @@ public function getFieldOptions() */ public function setFieldOptions(?SubFieldOptions $field_options) { + if (is_null($field_options)) { + throw new InvalidArgumentException('non-nullable field_options cannot be null'); + } $this->container['field_options'] = $field_options; return $this; @@ -654,6 +784,9 @@ public function getFiles() */ public function setFiles(?array $files) { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } $this->container['files'] = $files; return $this; @@ -678,6 +811,9 @@ public function getFileUrls() */ 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; @@ -702,6 +838,9 @@ public function getForceSignerRoles() */ public function setForceSignerRoles(?bool $force_signer_roles) { + if (is_null($force_signer_roles)) { + throw new InvalidArgumentException('non-nullable force_signer_roles cannot be null'); + } $this->container['force_signer_roles'] = $force_signer_roles; return $this; @@ -726,6 +865,9 @@ public function getForceSubjectMessage() */ public function setForceSubjectMessage(?bool $force_subject_message) { + if (is_null($force_subject_message)) { + throw new InvalidArgumentException('non-nullable force_subject_message cannot be null'); + } $this->container['force_subject_message'] = $force_subject_message; return $this; @@ -750,6 +892,9 @@ public function getHoldRequest() */ public function setHoldRequest(?bool $hold_request) { + if (is_null($hold_request)) { + throw new InvalidArgumentException('non-nullable hold_request cannot be null'); + } $this->container['hold_request'] = $hold_request; return $this; @@ -774,6 +919,9 @@ public function getIsForEmbeddedSigning() */ public function setIsForEmbeddedSigning(?bool $is_for_embedded_signing) { + if (is_null($is_for_embedded_signing)) { + throw new InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); + } $this->container['is_for_embedded_signing'] = $is_for_embedded_signing; return $this; @@ -798,7 +946,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 5000.'); } @@ -826,6 +977,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -850,6 +1005,9 @@ public function getPreviewOnly() */ public function setPreviewOnly(?bool $preview_only) { + if (is_null($preview_only)) { + throw new InvalidArgumentException('non-nullable preview_only cannot be null'); + } $this->container['preview_only'] = $preview_only; return $this; @@ -874,6 +1032,9 @@ public function getRequestingRedirectUrl() */ public function setRequestingRedirectUrl(?string $requesting_redirect_url) { + if (is_null($requesting_redirect_url)) { + throw new InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); + } $this->container['requesting_redirect_url'] = $requesting_redirect_url; return $this; @@ -898,6 +1059,9 @@ public function getShowPreview() */ public function setShowPreview(?bool $show_preview) { + if (is_null($show_preview)) { + throw new InvalidArgumentException('non-nullable show_preview cannot be null'); + } $this->container['show_preview'] = $show_preview; return $this; @@ -922,6 +1086,9 @@ public function getShowProgressStepper() */ public function setShowProgressStepper(?bool $show_progress_stepper) { + if (is_null($show_progress_stepper)) { + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + } $this->container['show_progress_stepper'] = $show_progress_stepper; return $this; @@ -946,6 +1113,9 @@ public function getSigners() */ public function setSigners(?array $signers) { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } $this->container['signers'] = $signers; return $this; @@ -970,6 +1140,9 @@ public function getSigningOptions() */ public function setSigningOptions(?SubSigningOptions $signing_options) { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } $this->container['signing_options'] = $signing_options; return $this; @@ -994,6 +1167,9 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -1018,6 +1194,9 @@ public function getSkipMeNow() */ public function setSkipMeNow(?bool $skip_me_now) { + if (is_null($skip_me_now)) { + throw new InvalidArgumentException('non-nullable skip_me_now cannot be null'); + } $this->container['skip_me_now'] = $skip_me_now; return $this; @@ -1042,7 +1221,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 255)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 255) { throw new InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } @@ -1070,6 +1252,9 @@ public function getTestMode() */ 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; @@ -1094,7 +1279,10 @@ public function getTitle() */ public function setTitle(?string $title) { - if (!is_null($title) && (mb_strlen($title) > 255)) { + if (is_null($title)) { + throw new InvalidArgumentException('non-nullable title cannot be null'); + } + if (mb_strlen($title) > 255) { throw new InvalidArgumentException('invalid length for $title when calling UnclaimedDraftCreateEmbeddedWithTemplateRequest., must be smaller than or equal to 255.'); } @@ -1122,6 +1310,9 @@ public function getPopulateAutoFillFields() */ public function setPopulateAutoFillFields(?bool $populate_auto_fill_fields) { + if (is_null($populate_auto_fill_fields)) { + throw new InvalidArgumentException('non-nullable populate_auto_fill_fields cannot be null'); + } $this->container['populate_auto_fill_fields'] = $populate_auto_fill_fields; return $this; @@ -1146,6 +1337,9 @@ public function getAllowCcs() */ public function setAllowCcs(?bool $allow_ccs) { + if (is_null($allow_ccs)) { + throw new InvalidArgumentException('non-nullable allow_ccs cannot be null'); + } $this->container['allow_ccs'] = $allow_ccs; return $this; @@ -1154,12 +1348,10 @@ public function setAllowCcs(?bool $allow_ccs) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1167,7 +1359,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -1180,13 +1372,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1198,12 +1388,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1212,8 +1400,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/UnclaimedDraftCreateRequest.php b/sdks/php/src/Model/UnclaimedDraftCreateRequest.php index 3eaaa3840..1d55c2c1b 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -39,11 +38,9 @@ * UnclaimedDraftCreateRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team + * @description * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -122,6 +119,45 @@ class UnclaimedDraftCreateRequest implements ModelInterface, ArrayAccess, JsonSe 'expires_at' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'files' => false, + 'file_urls' => false, + 'allow_decline' => false, + 'attachments' => false, + 'cc_email_addresses' => false, + 'client_id' => false, + 'custom_fields' => false, + 'field_options' => false, + 'form_field_groups' => false, + 'form_field_rules' => false, + 'form_fields_per_document' => false, + 'hide_text_tags' => false, + 'message' => false, + 'metadata' => false, + 'show_progress_stepper' => false, + 'signers' => false, + 'signing_options' => false, + 'signing_redirect_url' => false, + 'subject' => false, + 'test_mode' => false, + 'use_preexisting_fields' => false, + 'use_text_tags' => false, + 'expires_at' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -142,6 +178,50 @@ 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 @@ -299,60 +379,78 @@ public function getTypeAllowableValues() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['type'] = $data['type'] ?? null; - $this->container['files'] = $data['files'] ?? null; - $this->container['file_urls'] = $data['file_urls'] ?? null; - $this->container['allow_decline'] = $data['allow_decline'] ?? false; - $this->container['attachments'] = $data['attachments'] ?? null; - $this->container['cc_email_addresses'] = $data['cc_email_addresses'] ?? null; - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['custom_fields'] = $data['custom_fields'] ?? null; - $this->container['field_options'] = $data['field_options'] ?? null; - $this->container['form_field_groups'] = $data['form_field_groups'] ?? null; - $this->container['form_field_rules'] = $data['form_field_rules'] ?? null; - $this->container['form_fields_per_document'] = $data['form_fields_per_document'] ?? null; - $this->container['hide_text_tags'] = $data['hide_text_tags'] ?? false; - $this->container['message'] = $data['message'] ?? null; - $this->container['metadata'] = $data['metadata'] ?? null; - $this->container['show_progress_stepper'] = $data['show_progress_stepper'] ?? true; - $this->container['signers'] = $data['signers'] ?? null; - $this->container['signing_options'] = $data['signing_options'] ?? null; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; - $this->container['use_preexisting_fields'] = $data['use_preexisting_fields'] ?? false; - $this->container['use_text_tags'] = $data['use_text_tags'] ?? false; - $this->container['expires_at'] = $data['expires_at'] ?? null; - } - - /** @deprecated use ::init() */ + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('files', $data ?? [], null); + $this->setIfExists('file_urls', $data ?? [], null); + $this->setIfExists('allow_decline', $data ?? [], false); + $this->setIfExists('attachments', $data ?? [], null); + $this->setIfExists('cc_email_addresses', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('custom_fields', $data ?? [], null); + $this->setIfExists('field_options', $data ?? [], null); + $this->setIfExists('form_field_groups', $data ?? [], null); + $this->setIfExists('form_field_rules', $data ?? [], null); + $this->setIfExists('form_fields_per_document', $data ?? [], null); + $this->setIfExists('hide_text_tags', $data ?? [], false); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('show_progress_stepper', $data ?? [], true); + $this->setIfExists('signers', $data ?? [], null); + $this->setIfExists('signing_options', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); + $this->setIfExists('use_preexisting_fields', $data ?? [], false); + $this->setIfExists('use_text_tags', $data ?? [], false); + $this->setIfExists('expires_at', $data ?? [], null); + } + + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftCreateRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftCreateRequest { - /** @var UnclaimedDraftCreateRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var UnclaimedDraftCreateRequest */ + return ObjectSerializer::deserialize( $data, UnclaimedDraftCreateRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -417,6 +515,9 @@ public function getType() */ public function setType(string $type) { + if (is_null($type)) { + throw new InvalidArgumentException('non-nullable type cannot be null'); + } $allowedValues = $this->getTypeAllowableValues(); if (!in_array($type, $allowedValues, true)) { throw new InvalidArgumentException( @@ -451,6 +552,9 @@ public function getFiles() */ public function setFiles(?array $files) { + if (is_null($files)) { + throw new InvalidArgumentException('non-nullable files cannot be null'); + } $this->container['files'] = $files; return $this; @@ -475,6 +579,9 @@ public function getFileUrls() */ 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; @@ -499,6 +606,9 @@ public function getAllowDecline() */ public function setAllowDecline(?bool $allow_decline) { + if (is_null($allow_decline)) { + throw new InvalidArgumentException('non-nullable allow_decline cannot be null'); + } $this->container['allow_decline'] = $allow_decline; return $this; @@ -523,6 +633,9 @@ public function getAttachments() */ public function setAttachments(?array $attachments) { + if (is_null($attachments)) { + throw new InvalidArgumentException('non-nullable attachments cannot be null'); + } $this->container['attachments'] = $attachments; return $this; @@ -547,6 +660,9 @@ public function getCcEmailAddresses() */ public function setCcEmailAddresses(?array $cc_email_addresses) { + if (is_null($cc_email_addresses)) { + throw new InvalidArgumentException('non-nullable cc_email_addresses cannot be null'); + } $this->container['cc_email_addresses'] = $cc_email_addresses; return $this; @@ -571,6 +687,9 @@ public function getClientId() */ public function setClientId(?string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -595,6 +714,9 @@ public function getCustomFields() */ public function setCustomFields(?array $custom_fields) { + if (is_null($custom_fields)) { + throw new InvalidArgumentException('non-nullable custom_fields cannot be null'); + } $this->container['custom_fields'] = $custom_fields; return $this; @@ -619,6 +741,9 @@ public function getFieldOptions() */ public function setFieldOptions(?SubFieldOptions $field_options) { + if (is_null($field_options)) { + throw new InvalidArgumentException('non-nullable field_options cannot be null'); + } $this->container['field_options'] = $field_options; return $this; @@ -643,6 +768,9 @@ public function getFormFieldGroups() */ public function setFormFieldGroups(?array $form_field_groups) { + if (is_null($form_field_groups)) { + throw new InvalidArgumentException('non-nullable form_field_groups cannot be null'); + } $this->container['form_field_groups'] = $form_field_groups; return $this; @@ -667,6 +795,9 @@ public function getFormFieldRules() */ public function setFormFieldRules(?array $form_field_rules) { + if (is_null($form_field_rules)) { + throw new InvalidArgumentException('non-nullable form_field_rules cannot be null'); + } $this->container['form_field_rules'] = $form_field_rules; return $this; @@ -691,6 +822,9 @@ public function getFormFieldsPerDocument() */ public function setFormFieldsPerDocument(?array $form_fields_per_document) { + if (is_null($form_fields_per_document)) { + throw new InvalidArgumentException('non-nullable form_fields_per_document cannot be null'); + } $this->container['form_fields_per_document'] = $form_fields_per_document; return $this; @@ -715,6 +849,9 @@ public function getHideTextTags() */ public function setHideTextTags(?bool $hide_text_tags) { + if (is_null($hide_text_tags)) { + throw new InvalidArgumentException('non-nullable hide_text_tags cannot be null'); + } $this->container['hide_text_tags'] = $hide_text_tags; return $this; @@ -739,7 +876,10 @@ public function getMessage() */ public function setMessage(?string $message) { - if (!is_null($message) && (mb_strlen($message) > 5000)) { + if (is_null($message)) { + throw new InvalidArgumentException('non-nullable message cannot be null'); + } + if (mb_strlen($message) > 5000) { throw new InvalidArgumentException('invalid length for $message when calling UnclaimedDraftCreateRequest., must be smaller than or equal to 5000.'); } @@ -767,6 +907,10 @@ public function getMetadata() */ public function setMetadata(?array $metadata) { + if (is_null($metadata)) { + throw new InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; @@ -791,6 +935,9 @@ public function getShowProgressStepper() */ public function setShowProgressStepper(?bool $show_progress_stepper) { + if (is_null($show_progress_stepper)) { + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + } $this->container['show_progress_stepper'] = $show_progress_stepper; return $this; @@ -815,6 +962,9 @@ public function getSigners() */ public function setSigners(?array $signers) { + if (is_null($signers)) { + throw new InvalidArgumentException('non-nullable signers cannot be null'); + } $this->container['signers'] = $signers; return $this; @@ -839,6 +989,9 @@ public function getSigningOptions() */ public function setSigningOptions(?SubSigningOptions $signing_options) { + if (is_null($signing_options)) { + throw new InvalidArgumentException('non-nullable signing_options cannot be null'); + } $this->container['signing_options'] = $signing_options; return $this; @@ -863,6 +1016,9 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -887,7 +1043,10 @@ public function getSubject() */ public function setSubject(?string $subject) { - if (!is_null($subject) && (mb_strlen($subject) > 200)) { + if (is_null($subject)) { + throw new InvalidArgumentException('non-nullable subject cannot be null'); + } + if (mb_strlen($subject) > 200) { throw new InvalidArgumentException('invalid length for $subject when calling UnclaimedDraftCreateRequest., must be smaller than or equal to 200.'); } @@ -915,6 +1074,9 @@ public function getTestMode() */ 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; @@ -939,6 +1101,9 @@ public function getUsePreexistingFields() */ public function setUsePreexistingFields(?bool $use_preexisting_fields) { + if (is_null($use_preexisting_fields)) { + throw new InvalidArgumentException('non-nullable use_preexisting_fields cannot be null'); + } $this->container['use_preexisting_fields'] = $use_preexisting_fields; return $this; @@ -963,6 +1128,9 @@ public function getUseTextTags() */ public function setUseTextTags(?bool $use_text_tags) { + if (is_null($use_text_tags)) { + throw new InvalidArgumentException('non-nullable use_text_tags cannot be null'); + } $this->container['use_text_tags'] = $use_text_tags; return $this; @@ -987,6 +1155,16 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['expires_at'] = $expires_at; return $this; @@ -995,12 +1173,10 @@ public function setExpiresAt(?int $expires_at) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1008,7 +1184,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -1021,13 +1197,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1039,12 +1213,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1053,8 +1225,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/UnclaimedDraftCreateResponse.php b/sdks/php/src/Model/UnclaimedDraftCreateResponse.php index a055a5c4c..fb93528ef 100644 --- a/sdks/php/src/Model/UnclaimedDraftCreateResponse.php +++ b/sdks/php/src/Model/UnclaimedDraftCreateResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,12 +37,8 @@ * UnclaimedDraftCreateResponse Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class UnclaimedDraftCreateResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +73,23 @@ class UnclaimedDraftCreateResponse implements ModelInterface, ArrayAccess, JsonS 'warnings' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'unclaimed_draft' => false, + 'warnings' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +110,50 @@ 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 @@ -172,38 +229,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['unclaimed_draft'] = $data['unclaimed_draft'] ?? null; - $this->container['warnings'] = $data['warnings'] ?? null; + $this->setIfExists('unclaimed_draft', $data ?? [], null); + $this->setIfExists('warnings', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftCreateResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftCreateResponse { - /** @var UnclaimedDraftCreateResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var UnclaimedDraftCreateResponse */ + return ObjectSerializer::deserialize( $data, UnclaimedDraftCreateResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -215,6 +290,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['unclaimed_draft'] === null) { + $invalidProperties[] = "'unclaimed_draft' can't be null"; + } return $invalidProperties; } @@ -232,7 +310,7 @@ public function valid() /** * Gets unclaimed_draft * - * @return UnclaimedDraftResponse|null + * @return UnclaimedDraftResponse */ public function getUnclaimedDraft() { @@ -242,12 +320,15 @@ public function getUnclaimedDraft() /** * Sets unclaimed_draft * - * @param UnclaimedDraftResponse|null $unclaimed_draft unclaimed_draft + * @param UnclaimedDraftResponse $unclaimed_draft unclaimed_draft * * @return self */ - public function setUnclaimedDraft(?UnclaimedDraftResponse $unclaimed_draft) + public function setUnclaimedDraft(UnclaimedDraftResponse $unclaimed_draft) { + if (is_null($unclaimed_draft)) { + throw new InvalidArgumentException('non-nullable unclaimed_draft cannot be null'); + } $this->container['unclaimed_draft'] = $unclaimed_draft; return $this; @@ -272,6 +353,9 @@ public function getWarnings() */ public function setWarnings(?array $warnings) { + if (is_null($warnings)) { + throw new InvalidArgumentException('non-nullable warnings cannot be null'); + } $this->container['warnings'] = $warnings; return $this; @@ -280,12 +364,10 @@ public function setWarnings(?array $warnings) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,7 +375,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -306,13 +388,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -324,12 +404,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -338,8 +416,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php b/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php index 3e15395f8..5669e4848 100644 --- a/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php +++ b/sdks/php/src/Model/UnclaimedDraftEditAndResendRequest.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -37,11 +37,8 @@ * UnclaimedDraftEditAndResendRequest Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, JsonSerializable { @@ -88,6 +85,29 @@ class UnclaimedDraftEditAndResendRequest implements ModelInterface, ArrayAccess, 'test_mode' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'client_id' => false, + 'editor_options' => false, + 'is_for_embedded_signing' => false, + 'requester_email_address' => false, + 'requesting_redirect_url' => false, + 'show_progress_stepper' => false, + 'signing_redirect_url' => false, + 'test_mode' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +128,50 @@ 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 @@ -201,44 +265,62 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['editor_options'] = $data['editor_options'] ?? null; - $this->container['is_for_embedded_signing'] = $data['is_for_embedded_signing'] ?? null; - $this->container['requester_email_address'] = $data['requester_email_address'] ?? null; - $this->container['requesting_redirect_url'] = $data['requesting_redirect_url'] ?? null; - $this->container['show_progress_stepper'] = $data['show_progress_stepper'] ?? true; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? false; + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('editor_options', $data ?? [], null); + $this->setIfExists('is_for_embedded_signing', $data ?? [], null); + $this->setIfExists('requester_email_address', $data ?? [], null); + $this->setIfExists('requesting_redirect_url', $data ?? [], null); + $this->setIfExists('show_progress_stepper', $data ?? [], true); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], false); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftEditAndResendRequest { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftEditAndResendRequest { - /** @var UnclaimedDraftEditAndResendRequest $obj */ - $obj = ObjectSerializer::deserialize( + /** @var UnclaimedDraftEditAndResendRequest */ + return ObjectSerializer::deserialize( $data, UnclaimedDraftEditAndResendRequest::class, ); + } - return $obj; + /** + * 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; } /** @@ -253,7 +335,6 @@ public function listInvalidProperties() if ($this->container['client_id'] === null) { $invalidProperties[] = "'client_id' can't be null"; } - return $invalidProperties; } @@ -287,6 +368,9 @@ public function getClientId() */ public function setClientId(string $client_id) { + if (is_null($client_id)) { + throw new InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -311,6 +395,9 @@ public function getEditorOptions() */ public function setEditorOptions(?SubEditorOptions $editor_options) { + if (is_null($editor_options)) { + throw new InvalidArgumentException('non-nullable editor_options cannot be null'); + } $this->container['editor_options'] = $editor_options; return $this; @@ -335,6 +422,9 @@ public function getIsForEmbeddedSigning() */ public function setIsForEmbeddedSigning(?bool $is_for_embedded_signing) { + if (is_null($is_for_embedded_signing)) { + throw new InvalidArgumentException('non-nullable is_for_embedded_signing cannot be null'); + } $this->container['is_for_embedded_signing'] = $is_for_embedded_signing; return $this; @@ -359,6 +449,9 @@ public function getRequesterEmailAddress() */ public function setRequesterEmailAddress(?string $requester_email_address) { + if (is_null($requester_email_address)) { + throw new InvalidArgumentException('non-nullable requester_email_address cannot be null'); + } $this->container['requester_email_address'] = $requester_email_address; return $this; @@ -383,6 +476,9 @@ public function getRequestingRedirectUrl() */ public function setRequestingRedirectUrl(?string $requesting_redirect_url) { + if (is_null($requesting_redirect_url)) { + throw new InvalidArgumentException('non-nullable requesting_redirect_url cannot be null'); + } $this->container['requesting_redirect_url'] = $requesting_redirect_url; return $this; @@ -407,6 +503,9 @@ public function getShowProgressStepper() */ public function setShowProgressStepper(?bool $show_progress_stepper) { + if (is_null($show_progress_stepper)) { + throw new InvalidArgumentException('non-nullable show_progress_stepper cannot be null'); + } $this->container['show_progress_stepper'] = $show_progress_stepper; return $this; @@ -431,6 +530,9 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + throw new InvalidArgumentException('non-nullable signing_redirect_url cannot be null'); + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -455,6 +557,9 @@ public function getTestMode() */ 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; @@ -463,12 +568,10 @@ public function setTestMode(?bool $test_mode) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -476,7 +579,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -489,13 +592,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -507,12 +608,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -521,8 +620,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/UnclaimedDraftResponse.php b/sdks/php/src/Model/UnclaimedDraftResponse.php index 8586ad99b..da1c26359 100644 --- a/sdks/php/src/Model/UnclaimedDraftResponse.php +++ b/sdks/php/src/Model/UnclaimedDraftResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,12 +38,8 @@ * * @category Class * @description A group of documents that a user can take ownership of via the claim URL. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - * @internal This class should not be instantiated directly + * @implements \ArrayAccess */ class UnclaimedDraftResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -86,6 +82,27 @@ class UnclaimedDraftResponse implements ModelInterface, ArrayAccess, JsonSeriali 'test_mode' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'signature_request_id' => true, + 'claim_url' => false, + 'signing_redirect_url' => true, + 'requesting_redirect_url' => true, + 'expires_at' => true, + 'test_mode' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +123,50 @@ 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 @@ -193,42 +254,60 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['signature_request_id'] = $data['signature_request_id'] ?? null; - $this->container['claim_url'] = $data['claim_url'] ?? null; - $this->container['signing_redirect_url'] = $data['signing_redirect_url'] ?? null; - $this->container['requesting_redirect_url'] = $data['requesting_redirect_url'] ?? null; - $this->container['expires_at'] = $data['expires_at'] ?? null; - $this->container['test_mode'] = $data['test_mode'] ?? null; + $this->setIfExists('signature_request_id', $data ?? [], null); + $this->setIfExists('claim_url', $data ?? [], null); + $this->setIfExists('signing_redirect_url', $data ?? [], null); + $this->setIfExists('requesting_redirect_url', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('test_mode', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): UnclaimedDraftResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): UnclaimedDraftResponse { - /** @var UnclaimedDraftResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var UnclaimedDraftResponse */ + return ObjectSerializer::deserialize( $data, UnclaimedDraftResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -238,9 +317,7 @@ public static function init(array $data): UnclaimedDraftResponse */ public function listInvalidProperties() { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** @@ -273,6 +350,16 @@ public function getSignatureRequestId() */ public function setSignatureRequestId(?string $signature_request_id) { + if (is_null($signature_request_id)) { + array_push($this->openAPINullablesSetToNull, 'signature_request_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signature_request_id', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signature_request_id'] = $signature_request_id; return $this; @@ -297,6 +384,9 @@ public function getClaimUrl() */ public function setClaimUrl(?string $claim_url) { + if (is_null($claim_url)) { + throw new InvalidArgumentException('non-nullable claim_url cannot be null'); + } $this->container['claim_url'] = $claim_url; return $this; @@ -321,6 +411,16 @@ public function getSigningRedirectUrl() */ public function setSigningRedirectUrl(?string $signing_redirect_url) { + if (is_null($signing_redirect_url)) { + array_push($this->openAPINullablesSetToNull, 'signing_redirect_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('signing_redirect_url', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['signing_redirect_url'] = $signing_redirect_url; return $this; @@ -345,6 +445,16 @@ public function getRequestingRedirectUrl() */ public function setRequestingRedirectUrl(?string $requesting_redirect_url) { + if (is_null($requesting_redirect_url)) { + array_push($this->openAPINullablesSetToNull, 'requesting_redirect_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('requesting_redirect_url', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['requesting_redirect_url'] = $requesting_redirect_url; return $this; @@ -369,6 +479,16 @@ public function getExpiresAt() */ public function setExpiresAt(?int $expires_at) { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['expires_at'] = $expires_at; return $this; @@ -393,6 +513,9 @@ public function getTestMode() */ 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; @@ -401,12 +524,10 @@ public function setTestMode(?bool $test_mode) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -414,7 +535,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -427,13 +548,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -445,12 +564,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -459,8 +576,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/Model/WarningResponse.php b/sdks/php/src/Model/WarningResponse.php index 08efacdc0..4c37010a0 100644 --- a/sdks/php/src/Model/WarningResponse.php +++ b/sdks/php/src/Model/WarningResponse.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -30,6 +29,7 @@ use ArrayAccess; use Dropbox\Sign\ObjectSerializer; +use InvalidArgumentException; use JsonSerializable; use ReturnTypeWillChange; @@ -38,11 +38,8 @@ * * @category Class * @description A list of warnings. - * @author OpenAPI Generator team * @see https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WarningResponse implements ModelInterface, ArrayAccess, JsonSerializable { @@ -77,6 +74,23 @@ class WarningResponse implements ModelInterface, ArrayAccess, JsonSerializable 'warning_name' => null, ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'warning_msg' => false, + 'warning_name' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +111,50 @@ 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 @@ -172,38 +230,56 @@ public function getModelName() /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; /** * Constructor * - * @param array|null $data Associated array of property values - * initializing the model + * @param mixed[] $data Associated array of property values + * initializing the model */ public function __construct(array $data = null) { - $this->container['warning_msg'] = $data['warning_msg'] ?? null; - $this->container['warning_name'] = $data['warning_name'] ?? null; + $this->setIfExists('warning_msg', $data ?? [], null); + $this->setIfExists('warning_name', $data ?? [], null); } - /** @deprecated use ::init() */ + /** + * @deprecated use ::init() + */ public static function fromArray(array $data): WarningResponse { return self::init($data); } - /** Attempt to instantiate and hydrate a new instance of this class */ + /** + * Attempt to instantiate and hydrate a new instance of this class + */ public static function init(array $data): WarningResponse { - /** @var WarningResponse $obj */ - $obj = ObjectSerializer::deserialize( + /** @var WarningResponse */ + return ObjectSerializer::deserialize( $data, WarningResponse::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; + } - return $obj; + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -221,7 +297,6 @@ public function listInvalidProperties() if ($this->container['warning_name'] === null) { $invalidProperties[] = "'warning_name' can't be null"; } - return $invalidProperties; } @@ -255,6 +330,9 @@ public function getWarningMsg() */ public function setWarningMsg(string $warning_msg) { + if (is_null($warning_msg)) { + throw new InvalidArgumentException('non-nullable warning_msg cannot be null'); + } $this->container['warning_msg'] = $warning_msg; return $this; @@ -279,6 +357,9 @@ public function getWarningName() */ public function setWarningName(string $warning_name) { + if (is_null($warning_name)) { + throw new InvalidArgumentException('non-nullable warning_name cannot be null'); + } $this->container['warning_name'] = $warning_name; return $this; @@ -287,12 +368,10 @@ public function setWarningName(string $warning_name) /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset - * - * @return bool + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -300,7 +379,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param mixed $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -313,13 +392,11 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param mixed $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int|null $offset Offset + * @param mixed $value Value to be set */ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -331,12 +408,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param mixed $offset Offset - * - * @return void + * @param int $offset Offset */ #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -345,8 +420,8 @@ public function offsetUnset($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 scalar|object|array|null returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource + * @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() diff --git a/sdks/php/src/ObjectSerializer.php b/sdks/php/src/ObjectSerializer.php index 1d8fba8a2..958cd8e04 100644 --- a/sdks/php/src/ObjectSerializer.php +++ b/sdks/php/src/ObjectSerializer.php @@ -5,7 +5,6 @@ * PHP version 7.4 * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ @@ -17,7 +16,7 @@ * The version of the OpenAPI document: 3.0.0 * Contact: apisupport@hellosign.com * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.0 + * Generator version: 7.8.0 */ /** @@ -29,26 +28,23 @@ namespace Dropbox\Sign; use DateTime; -use DateTimeInterface; use Dropbox\Sign\Model\ModelInterface; use Exception; -use GuzzleHttp\Psr7; -use GuzzleHttp\Utils; +use GuzzleHttp; +use GuzzleHttp\Psr7\Utils; use InvalidArgumentException; -use Psr\Http\Message; use SplFileObject; /** * ObjectSerializer Class Doc Comment * * @category Class - * @author OpenAPI Generator team * @see https://openapi-generator.tech */ class ObjectSerializer { /** @var string */ - private static $dateTimeFormat = DateTimeInterface::ATOM; + private static $dateTimeFormat = DateTime::ATOM; /** * Change the date format @@ -63,9 +59,9 @@ public static function setDateTimeFormat(string $format) /** * Serialize data * - * @param mixed $data the data to serialize - * @param string $type|null the OpenAPIToolsType of the data - * @param string $format|null the format of the OpenAPITools type of the data + * @param string|int|object|array|mixed $data the data to serialize + * @param string $type the OpenAPIToolsType of the data + * @param string $format the format of the OpenAPITools type of the data * * @return scalar|object|array|null serialized form of $data */ @@ -83,7 +79,6 @@ public static function sanitizeForSerialization($data, string $type = null, stri foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } - return $data; } @@ -93,15 +88,15 @@ public static function sanitizeForSerialization($data, string $type = null, stri $formats = $data::openAPIFormats(); foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; - $value = $data->$getter(); - if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $value = $data->{$getter}(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { $callable = [$openAPIType, 'getAllowableEnumValues']; if (is_callable($callable)) { /** array $callable */ $allowedEnumTypes = $callable(); if (!in_array($value, $allowedEnumTypes, true)) { $imploded = implode("', '", $allowedEnumTypes); - throw new InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + throw new InvalidArgumentException("Invalid value for enum '{$openAPIType}', must be one of: '{$imploded}'"); } } } @@ -110,17 +105,15 @@ public static function sanitizeForSerialization($data, string $type = null, stri } } } elseif ($data instanceof SplFileObject) { - return (string) $data; + return (string)$data; } else { foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } - - return (object) $values; - } else { - return (string) $data; + return (object)$values; } + return (string)$data; } /** @@ -133,11 +126,10 @@ public static function sanitizeForSerialization($data, string $type = null, stri */ public static function sanitizeFilename(string $filename) { - if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + if (preg_match('/.*[\\/\\\\](.*)$/', $filename, $match)) { return $match[1]; - } else { - return $filename; } + return $filename; } /** @@ -170,22 +162,143 @@ public static function toPathValue(string $value) } /** - * Take value and turn it into a string suitable for inclusion in - * the query, by imploding comma-separated if it's an object. - * If it's a string, pass through unchanged. It will be url-encoded - * later. + * Checks if a value is empty, based on its OpenAPI type. * - * @param string[]|string|DateTime $object an object to be serialized to a string + * @param string|int|object|array|mixed $value * - * @return string the serialized object + * @return bool true if $value is empty */ - public static function toQueryValue($object) + private static function isEmptyValue($value, string $openApiType): bool { - if (is_array($object)) { - return implode(',', $object); - } else { - return self::toString($object); + // If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + // Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + switch ($openApiType) { + // For numeric values, false and '' are considered empty. + // This comparison is safe for floating point values, since the previous call to empty() will + // filter out values that don't match 0. + case 'int': + case 'integer': + return $value !== 0; + + case 'number': + case 'float': + return $value !== 0 && $value !== 0.0; + + // For boolean values, '' is considered empty + case 'bool': + case 'boolean': + return !in_array($value, [false, 0], true); + + // For all the other types, any value at this point can be considered empty. + default: + return true; + } + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * + * @param string|int|object|array|mixed $value Parameter value + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType eg. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + */ + public static function toQueryValue( + $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + // Check if we should omit this parameter from the query. This should only happen when: + // - Parameter is NOT required; AND + // - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + // example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } + return []; + } + + // Handle DateTime objects in query + if ($openApiType === '\\DateTime' && $value instanceof DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) { + return $arr; + } + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values + if ($openApiType === 'array' && $style === 'deepObject' && $explode) { + return $value; } + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value) + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; + } + + return (int)$value; } /** @@ -220,9 +333,8 @@ public static function toFormValue($value) { if ($value instanceof SplFileObject) { return $value->getRealPath(); - } else { - return self::toString($value); } + return self::toString($value); } /** @@ -231,7 +343,7 @@ public static function toFormValue($value) * If it's a datetime object, format it in ISO8601 * If it's a boolean, convert it to "true" or "false". * - * @param string|bool|DateTime $value the value of the parameter + * @param string|int|object|array|mixed $value the value of the parameter * * @return string the header string */ @@ -239,20 +351,20 @@ public static function toString($value) { if ($value instanceof DateTime) { // datetime in ISO8601 format return $value->format(self::$dateTimeFormat); - } elseif (is_bool($value)) { + } + if (is_bool($value)) { return $value ? 'true' : 'false'; - } else { - return $value; } + return (string)$value; } /** * Serialize an array to a string. * - * @param array $collection collection to serialize to a string - * @param string $style the format use for serialization (csv, - * ssv, tsv, pipes, multi) - * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array * * @return string */ @@ -286,9 +398,9 @@ public static function serializeCollection(array $collection, string $style, boo /** * Deserialize a JSON string into an object * - * @param mixed $data object or primitive to be deserialized - * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers + * @param string|int|object|array|mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers * * @return object|array|null a single or an array of $class instances */ @@ -299,10 +411,10 @@ public static function deserialize($data, string $class, array $httpHeaders = nu } if (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data, true) : $data; + $data = is_string($data) ? json_decode($data) : $data; if (!is_array($data)) { - throw new InvalidArgumentException("Invalid array '$class'"); + throw new InvalidArgumentException("Invalid array '{$class}'"); } $subClass = substr($class, 0, -2); @@ -310,12 +422,11 @@ public static function deserialize($data, string $class, array $httpHeaders = nu foreach ($data as $key => $value) { $values[$key] = self::deserialize($value, $subClass, null); } - return $values; } if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array - $data = is_string($data) ? json_decode($data, true) : $data; + $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); $inner = substr($class, 4, -1); $deserialized = []; @@ -326,22 +437,20 @@ public static function deserialize($data, string $class, array $httpHeaders = nu $deserialized[$key] = self::deserialize($value, $subClass, null); } } - return $deserialized; } if ($class === 'object') { settype($data, 'array'); - return $data; - } elseif ($class === 'mixed') { + } + if ($class === 'mixed') { settype($data, gettype($data)); - return $data; } - if ($class === 'DateTime') { - // Some API's return an invalid, empty string as a + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not // what is meant. The invalid empty string is probably to @@ -351,7 +460,7 @@ public static function deserialize($data, string $class, array $httpHeaders = nu try { return new DateTime($data); } catch (Exception $exception) { - // Some API's return a date-time with too high nanosecond + // Some APIs return a date-time with too high nanosecond // precision for php's DateTime to handle. // With provided regexp 6 digits of microseconds saved return new DateTime(self::sanitizeTimestamp($data)); @@ -366,9 +475,9 @@ public static function deserialize($data, string $class, array $httpHeaders = nu return $data; } - $data = Psr7\Utils::streamFor($data); + $data = Utils::streamFor($data); - /* @var Message\StreamInterface $data */ + /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name if ( @@ -390,92 +499,153 @@ public static function deserialize($data, string $class, array $httpHeaders = nu return new SplFileObject($filename, 'r'); } - /* @psalm-suppress ParadoxicalCondition */ - if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); - - return $data; - } - - // handles unsupported union types like "bool|int|string" - if (!class_exists($class)) { return $data; } if (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); - throw new InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + throw new InvalidArgumentException("Invalid value for enum '{$class}', must be one of: '{$imploded}'"); } - return $data; - } else { - $data = is_string($data) ? json_decode($data) : $data; - // If a discriminator is defined and points to a valid subclass, use it. - $discriminator = $class::DISCRIMINATOR; - - $discriminatorValue = null; - if (is_object($data)) { - $discriminatorValue = $data->{$discriminator} ?? null; - } elseif (is_array($data)) { - $discriminatorValue = $data[$discriminator] ?? null; + } + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + $discriminatorValue = null; + if (is_object($data)) { + $discriminatorValue = $data->{$discriminator} ?? null; + } elseif (is_array($data)) { + $discriminatorValue = $data[$discriminator] ?? null; + } + + $discrimnatorSubclassFound = false; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Dropbox\Sign\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + $discrimnatorSubclassFound = true; } + } - $discrimnatorSubclassFound = false; - if (!empty($discriminator) && is_string($discriminatorValue)) { - $subclass = '\Dropbox\Sign\Model\\' . $discriminatorValue; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - $discrimnatorSubclassFound = true; - } + if ( + !$discrimnatorSubclassFound + && !empty($discriminator) + && method_exists($class, 'discriminatorClassName') + ) { + $subclass = call_user_func( + "{$class}::discriminatorClassName", + (array)$data, + ); + + if (empty($subclass)) { + return null; } - if ( - !$discrimnatorSubclassFound - && !empty($discriminator) - && method_exists($class, 'discriminatorClassName') - ) { - $subclass = call_user_func( - "{$class}::discriminatorClassName", - (array) $data, - ); + $class = $subclass; + $discrimnatorSubclassFound = true; + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } - if (empty($subclass)) { - return null; + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->{$propertySetter}(null); } - $class = $subclass; - $discrimnatorSubclassFound = true; + continue; } - /** @var ModelInterface $instance */ - $instance = new $class(); - foreach ($instance::openAPITypes() as $property => $type) { - $propertySetter = $instance::setters()[$property]; + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->{$propertySetter}(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } - if (!isset($propertySetter)) { - continue; - } + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params query string parameters + * @param int|false $encoding set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738 + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new InvalidArgumentException('Invalid type'); + } - // Support object notation and array access - if (is_object($data) && isset($data->{$instance::attributeMap()[$property]})) { - $propertyValue = $data->{$instance::attributeMap()[$property]}; - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); - } elseif (is_array($data) && isset($data[$instance::attributeMap()[$property]])) { - $propertyValue = $data[$instance::attributeMap()[$property]]; - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int)$v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string)$k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '=' . $encoder((string)$v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '=' . $encoder((string)$vv); + } + $qs .= '&'; } } - - return $instance; } + + return $qs ? (string)substr($qs, 0, -1) : ''; } /** * Allows a multipart/form-data request to grab data from the typed * class created by OpenAPI. */ - public static function getFormParams(Model\ModelInterface $model): array + public static function getFormParams(ModelInterface $model): array { $apiTypes = $model::openAPITypes(); $formParams = []; @@ -513,7 +683,7 @@ public static function getFormParams(Model\ModelInterface $model): array $keyCount[$key]++; - $formParams[$true_key] = Psr7\Utils::tryFopen( + $formParams[$true_key] = Utils::tryFopen( ObjectSerializer::toFormValue($file), 'rb' ); @@ -522,7 +692,7 @@ public static function getFormParams(Model\ModelInterface $model): array continue; } - $formParams[$true_key] = Psr7\Utils::tryFopen( + $formParams[$true_key] = Utils::tryFopen( ObjectSerializer::toFormValue($value), 'rb' ); @@ -532,7 +702,7 @@ public static function getFormParams(Model\ModelInterface $model): array $formParams[$true_key] = is_scalar($value) ? ObjectSerializer::toFormValue($value) - : Utils::jsonEncode( + : GuzzleHttp\Utils::jsonEncode( ObjectSerializer::sanitizeForSerialization( $value ) diff --git a/sdks/php/templates/.php-cs-fixer.dist.php b/sdks/php/templates/.php-cs-fixer.dist.php new file mode 100644 index 000000000..a8ff32efd --- /dev/null +++ b/sdks/php/templates/.php-cs-fixer.dist.php @@ -0,0 +1,105 @@ +in(__DIR__) + ->exclude('vendor') + ->exclude('test') + ->exclude('tests') + ->exclude('bin') + ->exclude('docs') + ->exclude('examples') + ->exclude('templates') + ->exclude('test_fixtures') +; + +$config = new PhpCsFixer\Config(); +$config->setParallelConfig( + PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect() +); +return $config->setRules([ + '@PhpCsFixer' => true, + '@Symfony' => true, + '@DoctrineAnnotation' => true, + 'binary_operator_spaces' => [ + 'operators' => [ + '=>' => null, + ], + ], + 'blank_line_before_statement' => [ + 'statements' => [], + ], + 'blank_line_after_opening_tag' => false, + 'cast_spaces' => [ + 'space' => 'none', + ], + 'class_definition' => [ + 'inline_constructor_arguments' => false, + 'space_before_parenthesis' => true, + ], + 'concat_space' => [ + 'spacing' => 'one', + ], + 'nullable_type_declaration_for_default_null_value' => false, + 'declare_parentheses' => true, + 'echo_tag_syntax' => [ + 'format' => 'short', + 'shorten_simple_statements_only' => true, + ], + 'fully_qualified_strict_types' => true, + 'global_namespace_import' => true, + 'general_phpdoc_annotation_remove' => [ + 'annotations' => [ + 'author', 'package', 'subpackage', 'version', + ], + ], + 'increment_style' => false, + 'multiline_whitespace_before_semicolons' => [ + 'strategy' => 'no_multi_line', + ], + 'ordered_imports' => [ + 'imports_order' => [ + 'class', 'function', 'const', + ], + 'sort_algorithm' => 'alpha', + ], + 'no_superfluous_phpdoc_tags' => [ + 'allow_mixed' => true, + 'allow_unused_params' => true, + 'remove_inheritdoc' => true, + ], + 'phpdoc_align' => [ + 'tags' => [ + 'method', 'param', 'property', 'return', 'type', 'var', + ], + ], + 'phpdoc_line_span' => [ + 'property' => 'single', + ], + 'phpdoc_separation' => false, + 'phpdoc_summary' => false, + 'phpdoc_to_comment' => false, + 'phpdoc_to_param_type' => [ + 'scalar_types' => true, + 'union_types' => false, + ], + 'php_unit_internal_class' => false, + 'php_unit_test_class_requires_covers' => false, + 'single_line_throw' => false, + 'statement_indentation' => [ + 'stick_comment_to_next_continuous_control_statement' => false, + ], + 'visibility_required' => [ + 'elements' => ['method', 'property'], + ], + 'yoda_style' => false, + 'trailing_comma_in_multiline' => [ + 'after_heredoc' => true, + ], +]) + ->setFinder($finder) + ->setRiskyAllowed(true) +; diff --git a/sdks/php/templates/ApiException.mustache b/sdks/php/templates/ApiException.mustache index 847a6d57f..944d3c8a6 100644 --- a/sdks/php/templates/ApiException.mustache +++ b/sdks/php/templates/ApiException.mustache @@ -1,7 +1,7 @@ tempFolderPath = sys_get_temp_dir(); } + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ +{{^useCustomTemplateCode}} + public function setApiKey($apiKeyIdentifier, $key) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + protected function setApiKey($apiKeyIdentifier, $key) +{{/useCustomTemplateCode}} + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ +{{^useCustomTemplateCode}} + public function getApiKey($apiKeyIdentifier) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + protected function getApiKey($apiKeyIdentifier) +{{/useCustomTemplateCode}} + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ +{{^useCustomTemplateCode}} + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + protected function setApiKeyPrefix($apiKeyIdentifier, $prefix) +{{/useCustomTemplateCode}} + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ +{{^useCustomTemplateCode}} + public function getApiKeyPrefix($apiKeyIdentifier) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + protected function getApiKeyPrefix($apiKeyIdentifier) +{{/useCustomTemplateCode}} + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + /** * Sets the access token for OAuth * * @param string $accessToken Token for OAuth * - * @return self + * @return $this */ public function setAccessToken($accessToken) { @@ -127,15 +230,44 @@ class Configuration } /** - * Sets the API key + * Sets boolean format for query string. + * + * @param string $booleanFormat Boolean format for query string + * + * @return $this + */ +{{^useCustomTemplateCode}} + public function setBooleanFormatForQueryString(string $booleanFormat) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + protected function setBooleanFormatForQueryString(string $booleanFormat) +{{/useCustomTemplateCode}} + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. + * + * @return string Boolean format for query string + */ + public function getBooleanFormatForQueryString(): string + { + return $this->booleanFormatForQueryString; + } + + /** + * Sets the username for HTTP basic authentication * - * @param string $key API key or token + * @param string $username Username for HTTP basic authentication * - * @return self + * @return $this */ - public function setUsername(string $key): self + public function setUsername($username) { - $this->username = $key; + $this->username = $username; return $this; } @@ -149,12 +281,45 @@ class Configuration return $this->username; } + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ +{{^useCustomTemplateCode}} + public function setPassword($password) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + protected function setPassword($password) +{{/useCustomTemplateCode}} + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ +{{^useCustomTemplateCode}} + public function getPassword() +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + protected function getPassword() +{{/useCustomTemplateCode}} + { + return $this->password; + } + /** * Sets the host * * @param string $host Host * - * @return self + * @return $this */ public function setHost($host) { @@ -177,8 +342,8 @@ class Configuration * * @param string $userAgent the user agent of the api client * - * @throws InvalidArgumentException - * @return self + * @throws \InvalidArgumentException + * @return $this */ public function setUserAgent($userAgent) { @@ -205,7 +370,7 @@ class Configuration * * @param bool $debug Debug flag * - * @return self + * @return $this */ public function setDebug($debug) { @@ -228,7 +393,7 @@ class Configuration * * @param string $debugFile Debug file * - * @return self + * @return $this */ public function setDebugFile($debugFile) { @@ -251,7 +416,7 @@ class Configuration * * @param string $tempFolderPath Temp folder path * - * @return self + * @return $this */ public function setTempFolderPath($tempFolderPath) { @@ -314,6 +479,36 @@ class Configuration return $report; } + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ +{{^useCustomTemplateCode}} + public function getApiKeyWithPrefix($apiKeyIdentifier) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + protected function getApiKeyWithPrefix($apiKeyIdentifier) +{{/useCustomTemplateCode}} + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + /** * Returns an array of host settings * @@ -353,35 +548,34 @@ class Configuration } /** - * Returns URL based on the index and variables - * - * @param int $index index of the host settings - * @param array|null $variables hash of variable and the corresponding value (optional) - * @return string URL based on host settings - */ - public function getHostFromSettings($index, $variables = null) + * Returns URL based on host settings, index and variables + * + * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients + * @param int $hostIndex index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) { if (null === $variables) { $variables = []; } - $hosts = $this->getHostSettings(); - // check array index out of bound - if ($index < 0 || $index >= sizeof($hosts)) { - throw new InvalidArgumentException("Invalid index $index when selecting the host. Must be less than ".sizeof($hosts)); + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings)); } - $host = $hosts[$index]; + $host = $hostSettings[$hostIndex]; $url = $host["url"]; // go through variable and assign a value foreach ($host["variables"] ?? [] as $name => $variable) { if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum $url = str_replace("{".$name."}", $variables[$name], $url); } else { - throw new InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); } } else { // use default value @@ -393,14 +587,22 @@ class Configuration } /** - * Set extra request options + * Returns URL based on the index and variables * - * @param array $options - * @return self + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings */ + public function getHostFromSettings($index, $variables = null) + { + return self::getHostString($this->getHostSettings(), $index, $variables); + } +{{#useCustomTemplateCode}} + public function setOptions(array $options): self { $this->options = $options; + return $this; } @@ -425,4 +627,5 @@ class Configuration { return $this->payloadHook; } +{{/useCustomTemplateCode}} } diff --git a/sdks/php/templates/HeaderSelector.mustache b/sdks/php/templates/HeaderSelector.mustache index 06f2a4a3f..1921b0610 100644 --- a/sdks/php/templates/HeaderSelector.mustache +++ b/sdks/php/templates/HeaderSelector.mustache @@ -1,7 +1,7 @@ selectContentTypeHeader($contentTypes); - return $headers; - } + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } - /** - * @param string[] $accept - * @return array - */ - public function selectHeadersForMultipart($accept) - { - $headers = $this->selectHeaders($accept, []); + $headers['Content-Type'] = $contentType; + } - unset($headers['Content-Type']); return $headers; } /** - * Return the header 'Accept' based on an array of Accept provided + * Return the header 'Accept' based on an array of Accept provided. * * @param string[] $accept Array of header * * @return null|string Accept (e.g. application/json) */ - private function selectAcceptHeader($accept) + private function selectAcceptHeader(array $accept): ?string { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + # filter out empty entries + $accept = array_filter($accept); + + if (count($accept) === 0) { return null; - } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { - return implode(',', $jsonAccept); - } else { + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + if (count($headersWithJson) === 0) { return implode(',', $accept); } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); } /** - * Return the content type based on an array of content-type provided + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string + { + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } + } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); + } + + /** + * Given an Accept header, returns an associative array splitting the header and its weight * - * @param string[] $contentType Array fo content-type + * @param string $header "Accept" Header * - * @return string Content-Type (e.g. application/json) + * @return array with the header and its weight */ - private function selectContentTypeHeader($contentType) + private function getHeaderAndWeight(string $header): array { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { - return 'application/json'; + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; } else { - return implode(',', $contentType); + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; + } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); } } diff --git a/sdks/php/templates/ModelInterface.mustache b/sdks/php/templates/ModelInterface.mustache index f37dd32ad..805db43f0 100644 --- a/sdks/php/templates/ModelInterface.mustache +++ b/sdks/php/templates/ModelInterface.mustache @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version {{phpVersion}} + * PHP version 7.4 * * @category Class * @package {{modelPackage}} @@ -83,4 +83,20 @@ interface ModelInterface * @return bool */ public function valid(); + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool; + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool; } diff --git a/sdks/php/templates/ObjectSerializer.mustache b/sdks/php/templates/ObjectSerializer.mustache index 636d517b1..281ed61db 100644 --- a/sdks/php/templates/ObjectSerializer.mustache +++ b/sdks/php/templates/ObjectSerializer.mustache @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version {{phpVersion}} + * PHP version 7.4 * * @category Class * @package {{invokerPackage}} @@ -19,14 +19,11 @@ namespace {{invokerPackage}}; +use GuzzleHttp\Psr7\Utils; use {{modelPackage}}\ModelInterface; -use Psr\Http\Message; -use DateTime; -use DateTimeInterface; -use InvalidArgumentException; -use SplFileObject; -use GuzzleHttp\Psr7; -use GuzzleHttp\Utils; +{{#useCustomTemplateCode}} +use GuzzleHttp; +{{/useCustomTemplateCode}} /** * ObjectSerializer Class Doc Comment @@ -39,7 +36,7 @@ use GuzzleHttp\Utils; class ObjectSerializer { /** @var string */ - private static $dateTimeFormat = DateTimeInterface::ATOM; + private static $dateTimeFormat = \DateTime::ATOM; /** * Change the date format @@ -54,13 +51,18 @@ class ObjectSerializer /** * Serialize data * +{{^useCustomTemplateCode}} * @param mixed $data the data to serialize - * @param string $type|null the OpenAPIToolsType of the data - * @param string $format|null the format of the OpenAPITools type of the data +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + * @param string|int|object|array|mixed $data the data to serialize +{{/useCustomTemplateCode}} + * @param string $type the OpenAPIToolsType of the data + * @param string $format the format of the OpenAPITools type of the data * * @return scalar|object|array|null serialized form of $data */ - public static function sanitizeForSerialization($data, string $type = null, string $format = null) + public static function sanitizeForSerialization($data, $type = null, $format = null) { if (is_scalar($data) || null === $data) { return $data; @@ -95,12 +97,19 @@ class ObjectSerializer } } } +{{^useCustomTemplateCode}} + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if ($value !== null) { +{{/useCustomTemplateCode}} $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); } } - } else if ($data instanceof SplFileObject) { +{{#useCustomTemplateCode}} + } else if ($data instanceof \SplFileObject) { return (string) $data; +{{/useCustomTemplateCode}} } else { foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); @@ -157,22 +166,156 @@ class ObjectSerializer } /** - * Take value and turn it into a string suitable for inclusion in - * the query, by imploding comma-separated if it's an object. - * If it's a string, pass through unchanged. It will be url-encoded - * later. + * Checks if a value is empty, based on its OpenAPI type. * - * @param string[]|string|\DateTime $object an object to be serialized to a string +{{^useCustomTemplateCode}} + * @param mixed $value +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + * @param string|int|object|array|mixed $value +{{/useCustomTemplateCode}} + * @param string $openApiType * - * @return string the serialized object + * @return bool true if $value is empty */ - public static function toQueryValue($object) + private static function isEmptyValue($value, string $openApiType): bool { - if (is_array($object)) { - return implode(',', $object); - } else { - return self::toString($object); + # If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + # Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + switch ($openApiType) { + # For numeric values, false and '' are considered empty. + # This comparison is safe for floating point values, since the previous call to empty() will + # filter out values that don't match 0. + case 'int': + case 'integer': + return $value !== 0; + + case 'number': + case 'float': + return $value !== 0 && $value !== 0.0; + + # For boolean values, '' is considered empty + case 'bool': + case 'boolean': + return !in_array($value, [false, 0], true); + + # For all the other types, any value at this point can be considered empty. + default: + return true; + } + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * +{{^useCustomTemplateCode}} + * @param mixed $value Parameter value +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + * @param string|int|object|array|mixed $value Parameter value +{{/useCustomTemplateCode}} + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType eg. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + * + * @return array + */ + public static function toQueryValue( + $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + + # Check if we should omit this parameter from the query. This should only happen when: + # - Parameter is NOT required; AND + # - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + # example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } else { + return []; + } + } + + # Handle DateTime objects in query + if($openApiType === "\\DateTime" && $value instanceof \DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values + if ($openApiType === 'array' && $style === 'deepObject' && $explode) { + return $value; + } + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value) + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; } + + return (int) $value; } /** @@ -218,7 +361,12 @@ class ObjectSerializer * If it's a datetime object, format it in ISO8601 * If it's a boolean, convert it to "true" or "false". * - * @param string|bool|DateTime $value the value of the parameter +{{^useCustomTemplateCode}} + * @param float|int|bool|\DateTime $value the value of the parameter +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + * @param string|int|object|array|mixed $value the value of the parameter +{{/useCustomTemplateCode}} * * @return string the header string */ @@ -229,7 +377,7 @@ class ObjectSerializer } elseif (is_bool($value)) { return $value ? 'true' : 'false'; } else { - return $value; + return (string) $value; } } @@ -273,7 +421,12 @@ class ObjectSerializer /** * Deserialize a JSON string into an object * +{{^useCustomTemplateCode}} * @param mixed $data object or primitive to be deserialized +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + * @param string|int|object|array|mixed $data object or primitive to be deserialized +{{/useCustomTemplateCode}} * @param string $class class name is passed as a string * @param string[] $httpHeaders HTTP headers * @@ -286,7 +439,7 @@ class ObjectSerializer } if (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data, true) : $data; + $data = is_string($data) ? json_decode($data) : $data; if (!is_array($data)) { throw new \InvalidArgumentException("Invalid array '$class'"); @@ -295,13 +448,18 @@ class ObjectSerializer $subClass = substr($class, 0, -2); $values = []; foreach ($data as $key => $value) { +{{^useCustomTemplateCode}} + $values[] = self::deserialize($value, $subClass, null); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} $values[$key] = self::deserialize($value, $subClass, null); +{{/useCustomTemplateCode}} } return $values; } if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array - $data = is_string($data) ? json_decode($data, true) : $data; + $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); $inner = substr($class, 4, -1); $deserialized = []; @@ -318,13 +476,13 @@ class ObjectSerializer if ($class === 'object') { settype($data, 'array'); return $data; - } else if ($class === 'mixed') { + } elseif ($class === 'mixed') { settype($data, gettype($data)); return $data; } - if ($class === 'DateTime') { - // Some API's return an invalid, empty string as a + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not // what is meant. The invalid empty string is probably to @@ -334,7 +492,7 @@ class ObjectSerializer try { return new \DateTime($data); } catch (\Exception $exception) { - // Some API's return a date-time with too high nanosecond + // Some APIs return a date-time with too high nanosecond // precision for php's DateTime to handle. // With provided regexp 6 digits of microseconds saved return new \DateTime(self::sanitizeTimestamp($data)); @@ -345,13 +503,15 @@ class ObjectSerializer } if ($class === '\SplFileObject') { - if (is_a($data, SplFileObject::class)) { +{{#useCustomTemplateCode}} + if (is_a($data, \SplFileObject::class)) { return $data; } - $data = Psr7\Utils::streamFor($data); +{{/useCustomTemplateCode}} + $data = Utils::streamFor($data); - /** @var Message\StreamInterface $data */ + /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name if ( @@ -379,11 +539,6 @@ class ObjectSerializer return $data; } - // handles unsupported union types like "bool|int|string" - if (!class_exists($class)) { - return $data; - } - if (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues(), true)) { @@ -393,9 +548,14 @@ class ObjectSerializer return $data; } else { $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; - +{{#useCustomTemplateCode}} $discriminatorValue = null; if (is_object($data)) { $discriminatorValue = $data->{$discriminator} ?? null; @@ -404,13 +564,17 @@ class ObjectSerializer } $discrimnatorSubclassFound = false; - if (!empty($discriminator) && is_string($discriminatorValue)) { - $subclass = '\Dropbox\Sign\Model\\' . $discriminatorValue; +{{/useCustomTemplateCode}} + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\{{invokerPackage}}\Model\\' . $data->{$discriminator}; if (is_subclass_of($subclass, $class)) { $class = $subclass; +{{#useCustomTemplateCode}} $discrimnatorSubclassFound = true; +{{/useCustomTemplateCode}} } } +{{#useCustomTemplateCode}} if ( !$discrimnatorSubclassFound @@ -429,6 +593,7 @@ class ObjectSerializer $class = $subclass; $discrimnatorSubclassFound = true; } +{{/useCustomTemplateCode}} /** @var ModelInterface $instance */ $instance = new $class(); @@ -439,24 +604,91 @@ class ObjectSerializer continue; } - // Support object notation and array access - if (is_object($data) && isset($data->{$instance::attributeMap()[$property]})) { + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { $propertyValue = $data->{$instance::attributeMap()[$property]}; $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); - } elseif (is_array($data) && isset($data[$instance::attributeMap()[$property]])) { - $propertyValue = $data[$instance::attributeMap()[$property]]; - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } } return $instance; } } + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +{{#useCustomTemplateCode}} + /** * Allows a multipart/form-data request to grab data from the typed * class created by OpenAPI. */ - public static function getFormParams(Model\ModelInterface $model): array + public static function getFormParams(ModelInterface $model): array { $apiTypes = $model::openAPITypes(); $formParams = []; @@ -494,7 +726,7 @@ class ObjectSerializer $keyCount[$key]++; - $formParams[$true_key] = Psr7\Utils::tryFopen( + $formParams[$true_key] = Utils::tryFopen( ObjectSerializer::toFormValue($file), 'rb' ); @@ -503,7 +735,7 @@ class ObjectSerializer continue; } - $formParams[$true_key] = Psr7\Utils::tryFopen( + $formParams[$true_key] = Utils::tryFopen( ObjectSerializer::toFormValue($value), 'rb' ); @@ -513,7 +745,7 @@ class ObjectSerializer $formParams[$true_key] = is_scalar($value) ? ObjectSerializer::toFormValue($value) - : Utils::jsonEncode( + : GuzzleHttp\Utils::jsonEncode( ObjectSerializer::sanitizeForSerialization( $value ) @@ -522,4 +754,5 @@ class ObjectSerializer return $hasFile ? $formParams : []; } +{{/useCustomTemplateCode}} } diff --git a/sdks/php/templates/README.mustache b/sdks/php/templates/README.mustache index a22941039..a0f14993d 100644 --- a/sdks/php/templates/README.mustache +++ b/sdks/php/templates/README.mustache @@ -8,6 +8,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}). {{/infoUrl}} +{{#useCustomTemplateCode}} ## Migrating from legacy SDK This SDK is generated from our officially maintained [OpenAPI spec](https://github.com/hellosign/hellosign-openapi/blob/main/openapi.yaml). @@ -45,37 +46,97 @@ Run the following and everything is done for you: to the OAS file and/or the mustache template files _will be lost_ when you run this command. +{{/useCustomTemplateCode}} ## Installation & Usage ### Requirements +{{^useCustomTemplateCode}} +PHP 7.4 and later. +Should also work with PHP 8.0. +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} PHP {{phpVersion}} and later. +{{/useCustomTemplateCode}} ### Composer To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: ```json +{{^useCustomTemplateCode}} +{ + "repositories": [ + { + "type": "vcs", + "url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git" + } + ], + "require": { + "{{gitUserId}}/{{gitRepoId}}": "*@dev" + } +} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} { "require": { "{{packageName}}": "{{packageVersion}}" }, "minimum-stability": "dev" } +{{/useCustomTemplateCode}} ``` -Then run `composer install`. +Then run `composer install` + +{{^useCustomTemplateCode}} +### Manual Installation +Download the files and include `autoload.php`: + +```php + php_doc_auth_partial}} +$apiInstance = new {{invokerPackage}}\Api\{{classname}}( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(){{#hasAuthMethods}}, + $config{{/hasAuthMethods}} +); +{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{.}}}{{/description}} +{{/allParams}} + +try { + {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + print_r($result);{{/returnType}} +} catch (Exception $e) { + echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} ```php REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_PHP_CODE @@ -120,26 +181,42 @@ try { . $e->getMessage() . PHP_EOL; } ``` +{{/useCustomTemplateCode}} ## API Endpoints All URIs are relative to *{{basePath}}* +{{^useCustomTemplateCode}} +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} | Class | Method | HTTP request | Description | | ---------- | ------------- | ------------- | ------------- | {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}| *{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +{{/useCustomTemplateCode}} ## Models {{#models}}{{#model}}- [{{{classname}}}]({{modelDocPath}}/{{{classname}}}.md){{/model}} {{/models}} ## Authorization -{{^authMethods}} -All endpoints do not require authorization. -{{/authMethods}} +{{^useCustomTemplateCode}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +{{^authMethods}}All endpoints do not require authorization.{{/authMethods}} +{{/useCustomTemplateCode}} {{#authMethods}} +{{#useCustomTemplateCode}} {{#last}} Authentication schemes defined for the API:{{/last}} +{{/useCustomTemplateCode}} ### {{{name}}} {{#isApiKey}} @@ -157,6 +234,12 @@ All endpoints do not require authorization. - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} {{/isBasicBearer}} +{{^useCustomTemplateCode}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{/useCustomTemplateCode}} {{/isBasic}} {{#isOAuth}} @@ -194,4 +277,5 @@ This PHP package is automatically generated by the [OpenAPI Generator](https://o {{^hideGenerationTimestamp}} - Build date: `{{generatedDate}}` {{/hideGenerationTimestamp}} + - Generator version: `{{generatorVersion}}` - Build package: `{{generatorClass}}` diff --git a/sdks/php/templates/api.mustache b/sdks/php/templates/api.mustache index 15568f55d..927ce19e3 100644 --- a/sdks/php/templates/api.mustache +++ b/sdks/php/templates/api.mustache @@ -1,7 +1,7 @@ [{{#consumes}} + '{{{mediaType}}}',{{/consumes}} + {{^consumes}} + 'application/json', +{{/consumes}} ],{{/operation}} + ]; + +{{#useCustomTemplateCode}} + /** @var ResponseInterface|null */ protected $response; +{{/useCustomTemplateCode}} +{{^useCustomTemplateCode}} + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} /** - * @param Configuration|null $config - * @param ClientInterface|null $client - * @param HeaderSelector|null $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config + * @param ClientInterface $client + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( Configuration $config = null, @@ -82,6 +105,7 @@ use {{invokerPackage}}\ObjectSerializer; HeaderSelector $selector = null, $hostIndex = 0 ) { +{{/useCustomTemplateCode}} $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); @@ -92,6 +116,9 @@ use {{invokerPackage}}\ObjectSerializer; * Set the host index * * @param int $hostIndex Host index (required) +{{#useCustomTemplateCode}} + * @deprecated To be made private in the future +{{/useCustomTemplateCode}} */ public function setHostIndex($hostIndex): void { @@ -102,6 +129,9 @@ use {{invokerPackage}}\ObjectSerializer; * Get the host index * * @return int Host index +{{#useCustomTemplateCode}} + * @deprecated To be made private in the future +{{/useCustomTemplateCode}} */ public function getHostIndex() { @@ -116,6 +146,7 @@ use {{invokerPackage}}\ObjectSerializer; return $this->config; } +{{#useCustomTemplateCode}} /** * @return ResponseInterface|null */ @@ -124,6 +155,7 @@ use {{invokerPackage}}\ObjectSerializer; return $this->response; } +{{/useCustomTemplateCode}} {{#operation}} /** * Operation {{{operationId}}} @@ -142,9 +174,20 @@ use {{invokerPackage}}\ObjectSerializer; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. {{/-first}} * URL: {{{url}}} +{{#variables}} +{{#-first}} + * Variables: +{{/-first}} + * - {{{name}}}: {{{description}}}{{^description}} No description provided{{/description}}{{#enumValues}} +{{#-first}} + * Allowed values: +{{/-first}} + * - {{{.}}}{{/enumValues}} +{{/variables}} {{#-last}} * {{/-last}} @@ -152,18 +195,35 @@ use {{invokerPackage}}\ObjectSerializer; {{#allParams}} * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} +{{^useCustomTemplateCode}} +{{#servers}} +{{#-first}} + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. +{{/-first}} +{{/servers}} + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation +{{/useCustomTemplateCode}} * - * @throws \{{invokerPackage}}\ApiException on non-2xx response - * @throws InvalidArgumentException + * @throws \{{invokerPackage}}\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException * @return {{#returnType}}{{#responses}}{{#dataType}}{{^-first}}|{{/-first}}{{/dataType}}{{{dataType}}}{{/responses}}{{/returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} * @deprecated {{/isDeprecated}} */ +{{^useCustomTemplateCode}} + public function {{operationId}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + {{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} + return $response;{{/returnType}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public function {{operationId}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { - {{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} + {{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} return $response;{{/returnType}} +{{/useCustomTemplateCode}} } /** @@ -183,9 +243,20 @@ use {{invokerPackage}}\ObjectSerializer; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. {{/-first}} * URL: {{{url}}} +{{#variables}} +{{#-first}} + * Variables: +{{/-first}} + * - {{{name}}}: {{{description}}}{{^description}} No description provided{{/description}}{{#enumValues}} +{{#-first}} + * Allowed values: +{{/-first}} + * - {{{.}}}{{/enumValues}} +{{/variables}} {{#-last}} * {{/-last}} @@ -193,23 +264,35 @@ use {{invokerPackage}}\ObjectSerializer; {{#allParams}} * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} +{{#servers}} +{{#-first}} + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. +{{/-first}} +{{/servers}} + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation * - * @throws \{{invokerPackage}}\ApiException on non-2xx response - * @throws InvalidArgumentException + * @throws \{{invokerPackage}}\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException * @return array of {{#returnType}}{{#responses}}{{#dataType}}{{^-first}}|{{/-first}}{{/dataType}}{{{dataType}}}{{/responses}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) +{{#useCustomTemplateCode}} + * @deprecated Prefer to use ::{{operationId}}. This method will eventually become unavailable +{{/useCustomTemplateCode}} {{#isDeprecated}} * @deprecated {{/isDeprecated}} */ - public function {{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + public function {{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { - $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); + $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); +{{#useCustomTemplateCode}} $this->response = $response; +{{/useCustomTemplateCode}} } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", @@ -240,76 +323,78 @@ use {{invokerPackage}}\ObjectSerializer; (string) $response->getBody() ); } - {{#returnType}} - $statusCode = $response->getStatusCode(); - - {{#responses}} - {{#dataType}} - {{^isWildcard}} - {{^isRange}} - if ($statusCode === {{code}}) { - if ('{{{dataType}}}' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '{{{dataType}}}', []), - $response->getStatusCode(), - $response->getHeaders() - ]; +{{#useCustomTemplateCode}} + {{#responses}}{{#dataType}}{{#isRange}} + $result = $this->handleRangeCodeResponse( + $response, + '{{code}}', + '{{{dataType}}}' + ); + if ($result) { + return $result; } - {{/isRange}} - {{/isWildcard}} - {{/dataType}} - {{/responses}} - + {{/isRange}}{{/dataType}}{{/responses}} +{{/useCustomTemplateCode}} {{#responses}} - {{#dataType}} - {{#isRange}} - $rangeCodeLeft = (int) (substr('{{code}}', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('{{code}}', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - if ('{{{dataType}}}' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + {{#-first}} - return [ - ObjectSerializer::deserialize($content, '{{{dataType}}}', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - {{/isRange}} - {{/dataType}} - {{/responses}} - - {{#responses}} + switch($statusCode) { + {{/-first}} {{#dataType}} - {{#isWildcard}} - if ('{{{dataType}}}' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } + {{^isRange}}{{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + if ('{{{dataType}}}' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('{{{dataType}}}' !== '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, '{{{dataType}}}', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - {{/isWildcard}} + return [ + ObjectSerializer::deserialize($content, '{{{dataType}}}', []), + $response->getStatusCode(), + $response->getHeaders() + ];{{/isRange}} {{/dataType}} + {{#-last}} + } + {{/-last}} {{/responses}} + $returnType = '{{{returnType}}}'; 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 [ @@ -324,58 +409,26 @@ use {{invokerPackage}}\ObjectSerializer; {{/returnType}} } catch (ApiException $e) { - $statusCode = $e->getCode(); - - {{#responses}} +{{#useCustomTemplateCode}} + {{#responses}}{{#dataType}}{{#isRange}} + if ($this->handleRangeCodeException($e, '{{code}}', '{{{dataType}}}')) { + throw $e; + }{{/isRange}}{{/dataType}}{{/responses}} +{{/useCustomTemplateCode}} + switch ($e->getCode()) { + {{#responses}} {{#dataType}} - {{^isWildcard}} - {{^isRange}} - if ($statusCode === {{code}}) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '{{{dataType}}}', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - {{/isRange}} - {{/isWildcard}} - {{/dataType}} - {{/responses}} - - {{#responses}} - {{#dataType}} - {{#isRange}} - $rangeCodeLeft = (int) (substr('{{code}}', 0, 1) . '00'); - $rangeCodeRight = (int) (substr('{{code}}', 0, 1) . '99'); - if ($statusCode >= $rangeCodeLeft && $statusCode <= $rangeCodeRight) { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '{{{dataType}}}', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - } - {{/isRange}} + {{^isRange}}{{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '{{{dataType}}}', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break;{{/isRange}} {{/dataType}} - {{/responses}} - - {{#responses}} - {{#dataType}} - {{#isWildcard}} - $rangeCode = substr('{{code}}', 1); - if ($statusCode >= (int) "{$rangeCode}00" && $statusCode <= (int) "{$rangeCode}99") { - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '{{{dataType}}}', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + {{/responses}} } - {{/isWildcard}} - {{/dataType}} - {{/responses}} - throw $e; } } @@ -397,9 +450,20 @@ use {{invokerPackage}}\ObjectSerializer; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. {{/-first}} * URL: {{{url}}} +{{#variables}} +{{#-first}} + * Variables: +{{/-first}} + * - {{{name}}}: {{{description}}}{{^description}} No description provided{{/description}}{{#enumValues}} +{{#-first}} + * Allowed values: +{{/-first}} + * - {{{.}}}{{/enumValues}} +{{/variables}} {{#-last}} * {{/-last}} @@ -407,16 +471,26 @@ use {{invokerPackage}}\ObjectSerializer; {{#allParams}} * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} +{{#servers}} +{{#-first}} + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. +{{/-first}} +{{/servers}} + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation * - * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface +{{#useCustomTemplateCode}} + * @deprecated Prefer to use ::{{operationId}}. This method will eventually become unavailable +{{/useCustomTemplateCode}} {{#isDeprecated}} * @deprecated {{/isDeprecated}} */ - public function {{operationId}}Async({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + public function {{operationId}}Async({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { - return $this->{{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + return $this->{{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) ->then( function ($response) { return $response[0]; @@ -441,9 +515,20 @@ use {{invokerPackage}}\ObjectSerializer; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. {{/-first}} * URL: {{{url}}} +{{#variables}} +{{#-first}} + * Variables: +{{/-first}} + * - {{{name}}}: {{{description}}}{{^description}} No description provided{{/description}}{{#enumValues}} +{{#-first}} + * Allowed values: +{{/-first}} + * - {{{.}}}{{/enumValues}} +{{/variables}} {{#-last}} * {{/-last}} @@ -451,17 +536,27 @@ use {{invokerPackage}}\ObjectSerializer; {{#allParams}} * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} +{{#servers}} +{{#-first}} + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. +{{/-first}} +{{/servers}} + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation * - * @throws InvalidArgumentException - * @return Promise\PromiseInterface + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface +{{#useCustomTemplateCode}} + * @deprecated Prefer to use ::{{operationId}}. This method will eventually become unavailable +{{/useCustomTemplateCode}} {{#isDeprecated}} * @deprecated {{/isDeprecated}} */ - public function {{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + public function {{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { $returnType = '{{{returnType}}}'; - $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); + $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -472,6 +567,9 @@ use {{invokerPackage}}\ObjectSerializer; $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -510,9 +608,20 @@ use {{invokerPackage}}\ObjectSerializer; {{/vendorExtensions.x-group-parameters}} {{#servers}} {{#-first}} - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. + * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. + * if needed, use the 'variables' parameter to pass variables to the host. {{/-first}} * URL: {{{url}}} +{{#variables}} +{{#-first}} + * Variables: +{{/-first}} + * - {{{name}}}: {{{description}}}{{^description}} No description provided{{/description}}{{#enumValues}} +{{#-first}} + * Allowed values: +{{/-first}} + * - {{{.}}}{{/enumValues}} +{{/variables}} {{#-last}} * {{/-last}} @@ -520,23 +629,35 @@ use {{invokerPackage}}\ObjectSerializer; {{#allParams}} * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} +{{#servers}} +{{#-first}} + * @param null|int $hostIndex Host index. Defaults to null. If null, then the library will use $this->hostIndex instead + * @param array $variables Associative array of variables to pass to the host. Defaults to empty array. +{{/-first}} +{{/servers}} + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['{{{operationId}}}'] to see the possible values for this operation * - * @throws InvalidArgumentException - * @return Psr7\Request + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request +{{#useCustomTemplateCode}} + * @deprecated Prefer to use ::{{operationId}}. This method will eventually become unavailable +{{/useCustomTemplateCode}} {{#isDeprecated}} * @deprecated {{/isDeprecated}} */ - public function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + public function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}}{{#servers}}{{#-first}}?int $hostIndex = null, array $variables = [], {{/-first}}{{/servers}}string $contentType = self::contentTypes['{{{operationId}}}'][0]{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { {{#vendorExtensions.x-group-parameters}} // unbox the parameters from the associative array - {{#allParams}} +{{#allParams}} ${{paramName}} = array_key_exists('{{paramName}}', $associative_array) ? $associative_array['{{paramName}}'] : {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}; - {{/allParams}} - - {{/vendorExtensions.x-group-parameters}} - {{#allParams}} +{{/allParams}}{{#servers.0}} + $hostIndex = $associative_array['hostIndex']; + $variables = array_key_exists('variables', $associative_array) ? $associative_array['variables'] : []; +{{/servers.0}} + $contentType = $associative_array['contentType'] ?? self::contentTypes['{{{operationId}}}'][0]; + {{/vendorExtensions.x-group-parameters}}{{#allParams}} {{#required}} // verify the required parameter '{{paramName}}' is set if (${{paramName}} === null || (is_array(${{paramName}}) && count(${{paramName}}) === 0)) { @@ -581,15 +702,16 @@ use {{invokerPackage}}\ObjectSerializer; throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); } {{/minItems}} - - {{/hasValidation}} - {{/allParams}} + {{/hasValidation}}{{/allParams}} $resourcePath = '{{{path}}}'; + $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; + $multipart = false; +{{#useCustomTemplateCode}} {{#bodyParam}} $formParams = ObjectSerializer::getFormParams( ${{paramName}} @@ -597,38 +719,17 @@ use {{invokerPackage}}\ObjectSerializer; $multipart = !empty($formParams); {{/bodyParam}} - {{^bodyParam}} - $formParams = []; - $multipart = false; - {{/bodyParam}} - +{{/useCustomTemplateCode}} {{#queryParams}} // query params - {{#isExplode}} - if (${{paramName}} !== null) { - {{#style}} - if('form' === '{{style}}' && is_array(${{paramName}})) { - foreach(${{paramName}} as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['{{baseName}}'] = ${{paramName}}; - } - {{/style}} - {{^style}} - $queryParams['{{baseName}}'] = ${{paramName}}; - {{/style}} - } - {{/isExplode}} - {{^isExplode}} - if (is_array(${{paramName}})) { - ${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{style}}{{^style}}{{collectionFormat}}{{/style}}', true); - } - if (${{paramName}} !== null) { - $queryParams['{{baseName}}'] = ${{paramName}}; - } - {{/isExplode}} + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + ${{paramName}}, + '{{baseName}}', // param base name + '{{#schema}}{{openApiType}}{{/schema}}', // openApiType + '{{style}}', // style + {{#isExplode}}true{{/isExplode}}{{^isExplode}}false{{/isExplode}}, // explode + {{required}} // required + ) ?? []); {{/queryParams}} {{#headerParams}} @@ -679,22 +780,28 @@ use {{invokerPackage}}\ObjectSerializer; } {{/formParams}} - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['multipart/form-data'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}], - [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}] - ); - } + $headers = $this->headerSelector->selectHeaders( +{{^useCustomTemplateCode}} + [{{#produces}}'{{{mediaType}}}', {{/produces}}], +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + $multipart ? ['multipart/form-data'] : [{{#produces}}'{{{mediaType}}}', {{/produces}}], +{{/useCustomTemplateCode}} + $contentType, + $multipart + ); // for model (json/xml) {{#bodyParams}} +{{^useCustomTemplateCode}} + if (isset(${{paramName}})) { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if (count($formParams) === 0) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization(${{paramName}})); +{{/useCustomTemplateCode}} + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization(${{paramName}})); } else { $httpBody = ${{paramName}}; } @@ -715,6 +822,7 @@ use {{invokerPackage}}\ObjectSerializer; } } // for HTTP post (form) +{{#useCustomTemplateCode}} if (!empty($body)) { $multipartContents[] = [ 'name' => 'body', @@ -728,24 +836,37 @@ use {{invokerPackage}}\ObjectSerializer; $payloadHook('multipart', $multipartContents, ${{paramName}}); } {{/bodyParam}} +{{/useCustomTemplateCode}} + $httpBody = new MultipartStream($multipartContents); - $httpBody = new Psr7\MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = Utils::jsonEncode($formParams); - + } 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 = Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } {{#authMethods}} + {{#isApiKey}} + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('{{keyParamName}}'); + if ($apiKey !== null) { + {{#isKeyInHeader}}$headers['{{keyParamName}}'] = $apiKey;{{/isKeyInHeader}}{{#isKeyInQuery}}$queryParams['{{keyParamName}}'] = $apiKey;{{/isKeyInQuery}} + } + {{/isApiKey}} {{#isBasic}} {{#isBasicBasic}} // this endpoint requires HTTP basic authentication +{{^useCustomTemplateCode}} + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if (!empty($this->config->getUsername())) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ':'); +{{/useCustomTemplateCode}} } {{/isBasicBasic}} {{#isBasicBearer}} @@ -775,33 +896,85 @@ use {{invokerPackage}}\ObjectSerializer; ); {{#servers.0}} - $operationHosts = [{{#servers}}"{{{url}}}"{{^-last}}, {{/-last}}{{/servers}}]; - if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { - throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + # Preserve the original behavior of server indexing. + if ($hostIndex === null) { + $hostIndex = $this->hostIndex; } - $operationHost = $operationHosts[$this->hostIndex]; + $hostSettings = $this->getHostSettingsFor{{operationId}}(); + + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index {$hostIndex} when selecting the host. Must be less than ".count($hostSettings)); + } + $operationHost = Configuration::getHostString($hostSettings, $hostIndex, $variables); {{/servers.0}} - $query = Psr7\Query::build($queryParams); - return new Psr7\Request( + {{^servers.0}} + $operationHost = $this->config->getHost(); + {{/servers.0}} + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( '{{httpMethod}}', - {{^servers.0}}$this->config->getHost(){{/servers.0}}{{#servers.0}}$operationHost{{/servers.0}} . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } - {{/operation}} + {{#servers.0}} + /** + * Returns an array of host settings for Operation {{operationId}} + * + * @return array an array of host settings + */ + protected function getHostSettingsFor{{operationId}}(): array + { + return [ + {{#servers}} + [ + "url" => "{{{url}}}", + "description" => "{{{description}}}{{^description}}No description provided{{/description}}", + {{#variables}} + {{#-first}} + "variables" => [ + {{/-first}} + "{{{name}}}" => [ + "description" => "{{{description}}}{{^description}}No description provided{{/description}}", + "default_value" => "{{{defaultValue}}}", + {{#enumValues}} + {{#-first}} + "enum_values" => [ + {{/-first}} + "{{{.}}}", + {{#-last}} + ] + {{/-last}} + {{/enumValues}} + ]{{^-last}},{{/-last}} + {{#-last}} + ] + {{/-last}} + {{/variables}} + ]{{^-last}},{{/-last}} + {{/servers}} + ]; + } + {{/servers.0}} + {{/operation}} /** * Create http client option * - * @throws RuntimeException on file opening failure + * @throws \RuntimeException on file opening failure * @return array of http client options */ protected function createHttpClientOption() { +{{^useCustomTemplateCode}} + $options = []; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} $options = $this->config->getOptions(); +{{/useCustomTemplateCode}} if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { @@ -811,5 +984,69 @@ use {{invokerPackage}}\ObjectSerializer; return $options; } +{{#useCustomTemplateCode}} + + /** + * @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; + } +{{/useCustomTemplateCode}} } {{/operations}} diff --git a/sdks/php/templates/api_doc.mustache b/sdks/php/templates/api_doc.mustache index f42a29a8a..6a0b0fc04 100644 --- a/sdks/php/templates/api_doc.mustache +++ b/sdks/php/templates/api_doc.mustache @@ -2,7 +2,12 @@ {{.}}{{/description}} +{{^useCustomTemplateCode}} +All URIs are relative to {{basePath}}, except if the operation defines another base path. +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} All URIs are relative to {{basePath}}. +{{/useCustomTemplateCode}} | Method | HTTP request | Description | | ------------- | ------------- | ------------- | @@ -14,7 +19,23 @@ All URIs are relative to {{basePath}}. ```php {{{operationId}}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}: {{{.}}}{{/returnType}} ``` - +{{^useCustomTemplateCode}} +{{#servers}} +{{#-first}} +### URI(s): +{{/-first}} +- {{{url}}} {{#description}}{{.}}{{/description}}{{#variables}} +{{#-first}} + - Variables: +{{/-first}} + - {{{name}}}: {{{description}}}{{^description}} No description provided{{/description}}{{#enumValues}} +{{#-first}} + - Allowed values: +{{/-first}} + - {{{.}}}{{/enumValues}}{{#defaultValue}} + - Default value: {{{.}}} +{{/defaultValue}}{{/variables}}{{/servers}} +{{/useCustomTemplateCode}} {{{summary}}}{{#notes}} {{{.}}}{{/notes}} @@ -22,19 +43,73 @@ All URIs are relative to {{basePath}}. ### Example ```php +{{^useCustomTemplateCode}} + php_doc_auth_partial}} +$apiInstance = new {{invokerPackage}}\Api\{{classname}}( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(){{#hasAuthMethods}}, + $config{{/hasAuthMethods}} +); +{{^vendorExtensions.x-group-parameters}} +{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{.}}}{{/description}} +{{/allParams}}{{#servers}}{{#-first}} +$hostIndex = 0; +$variables = [{{#variables}} + '{{{name}}}' => '{{{default}}}{{^default}}YOUR_VALUE{{/default}}',{{/variables}} +]; +{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} +$associative_array = [ +{{#allParams}} '{{paramName}}' => {{{example}}}, // {{{dataType}}}{{#description}} | {{{.}}}{{/description}} +{{/allParams}} +{{#servers}}{{#-first}} + 'hostIndex' => 0, + $variables = [{{#variables}} + '{{{name}}}' => '{{{default}}}{{^default}}YOUR_VALUE{{/default}}',{{/variables}} + ], +{{/-first}}{{/servers}}]; +{{/vendorExtensions.x-group-parameters}} + +try { + {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}$hostIndex, $variables{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associate_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} + print_r($result);{{/returnType}} +} catch (Exception $e) { + echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; +} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_PHP_CODE +{{/useCustomTemplateCode}} ``` ### Parameters {{#vendorExtensions.x-group-parameters}} +{{^useCustomTemplateCode}} +Note: the input parameter is an associative array with the keys listed as the parameter names below. +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} Note: the input parameter is an associative array with the keys listed as the parameter name below. +{{/useCustomTemplateCode}} {{/vendorExtensions.x-group-parameters}} +{{^useCustomTemplateCode}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- |{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}} | +{{/allParams}}{{#servers}}{{#-first}}| hostIndex | null|int | Host index. Defaults to null. If null, then the library will use $this->hostIndex instead | [optional] | +| variables | array | Associative array of variables to pass to the host. Defaults to empty array. | [optional] |{{/-first}} +{{/servers}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} |{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}Name | Type | Description | Notes | | ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} | {{#allParams}}| **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}} | {{/allParams}} +{{/useCustomTemplateCode}} ### Return type diff --git a/sdks/php/templates/api_test.mustache b/sdks/php/templates/api_test.mustache index dec28599c..0fc99231c 100644 --- a/sdks/php/templates/api_test.mustache +++ b/sdks/php/templates/api_test.mustache @@ -1,7 +1,7 @@ markTestIncomplete('Not implemented'); + self::markTestIncomplete('Not implemented'); } {{/operation}} } diff --git a/sdks/php/templates/composer.mustache b/sdks/php/templates/composer.mustache index 1ce9ad9c2..85807e08c 100644 --- a/sdks/php/templates/composer.mustache +++ b/sdks/php/templates/composer.mustache @@ -1,6 +1,13 @@ { - "name": "dropbox/sign", - "description": "Official Dropbox Sign APIv3 PHP SDK", + {{#composerPackageName}} + "name": "{{{.}}}", + {{/composerPackageName}} +{{^useCustomTemplateCode}} + {{#artifactVersion}} + "version": "{{{.}}}", + {{/artifactVersion}} +{{/useCustomTemplateCode}} + "description": "{{{appDescription}}}", "keywords": [ "openapitools", "openapi-generator", @@ -8,23 +15,27 @@ "php", "sdk", "rest", +{{^useCustomTemplateCode}} + "api" +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} "api", "hellosign", "dropboxsign" +{{/useCustomTemplateCode}} ], - "homepage": "https://hellosign.com", - "license": [ - "MIT" - ], + "homepage": "{{{artifactUrl}}}", + "license": "{{{licenseName}}}", "authors": [ { - "name": "Dropbox Sign", - "homepage": "https://hellosign.com", - "email": "apisupport@hellosign.com" - }, - { - "name": "OpenAPI-Generator contributors", - "homepage": "https://openapi-generator.tech" + "name": "{{{developerOrganization}}}", +{{^useCustomTemplateCode}} + "homepage": "{{{developerOrganizationUrl}}}" +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + "homepage": "{{{developerOrganizationUrl}}}", + "email": "{{{developerOrganizationEmail}}}" +{{/useCustomTemplateCode}} } ], "require": { @@ -37,15 +48,18 @@ }, "require-dev": { "phpunit/phpunit": "^8.0 || ^9.0", - "friendsofphp/php-cs-fixer": "3.4.*", +{{^useCustomTemplateCode}} + "friendsofphp/php-cs-fixer": "^3.5" +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + "friendsofphp/php-cs-fixer": "^3.5", "symfony/yaml": "^5.4" +{{/useCustomTemplateCode}} }, "autoload": { - "psr-4": { - "{{escapedInvokerPackage}}\\": "{{srcBasePath}}/" - } + "psr-4": { "{{{escapedInvokerPackage}}}\\" : "{{{srcBasePath}}}/" } }, "autoload-dev": { - "psr-4": { "{{escapedInvokerPackage}}\\Test\\" : "{{testBasePath}}/" } + "psr-4": { "{{{escapedInvokerPackage}}}\\Test\\" : "{{{testBasePath}}}/" } } } diff --git a/sdks/php/templates/gitignore b/sdks/php/templates/gitignore index 3f10c0389..12f85db8f 100644 --- a/sdks/php/templates/gitignore +++ b/sdks/php/templates/gitignore @@ -14,7 +14,9 @@ composer.phar # PHPUnit cache .phpunit.result.cache +# CUSTOM - BEGIN .composer .openapi-generator git_push.sh composer.lock +# CUSTOM - END diff --git a/sdks/php/templates/libraries/psr-18/ApiException.mustache b/sdks/php/templates/libraries/psr-18/ApiException.mustache new file mode 100644 index 000000000..336d8f7c5 --- /dev/null +++ b/sdks/php/templates/libraries/psr-18/ApiException.mustache @@ -0,0 +1,119 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace {{invokerPackage}}; + +use Exception; +use Http\Client\Exception\RequestException; +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; + +/** + * ApiException Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ApiException extends RequestException +{ + + /** + * The HTTP body of the server response either as Json or string. + * + * @var string|null + */ + protected $responseBody; + + /** + * The HTTP header of the server response. + * + * @var string[][]|null + */ + protected $responseHeaders; + + /** + * The deserialized response object + * + * @var \stdClass|string|null + */ + protected $responseObject; + + public function __construct( + $message, + RequestInterface $request, + ResponseInterface $response = null, + Exception $previous = null + ) { + parent::__construct($message, $request, $previous); + if ($response) { + $this->responseHeaders = $response->getHeaders(); + $this->responseBody = (string) $response->getBody(); + $this->code = $response->getStatusCode(); + } + } + + /** + * Gets the HTTP response header + * + * @return string[][]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deseralized response object (during deserialization) + * +{{^useCustomTemplateCode}} + * @param mixed $obj Deserialized response object +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + * @param string|int|object|array|mixed $obj Deserialized response object +{{/useCustomTemplateCode}} + + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deseralized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/sdks/php/templates/libraries/psr-18/DebugPlugin.mustache b/sdks/php/templates/libraries/psr-18/DebugPlugin.mustache new file mode 100644 index 000000000..cf256a130 --- /dev/null +++ b/sdks/php/templates/libraries/psr-18/DebugPlugin.mustache @@ -0,0 +1,92 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace {{invokerPackage}}; + +use Http\Client\Common\Plugin; +use Http\Promise\Promise; +use Psr\Http\Client\ClientExceptionInterface; +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; +use function is_resource; + +/** + * Configuration Class Doc Comment + * PHP version 7.2 + * + * @category Class + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class DebugPlugin implements Plugin +{ + + /** + * @var resource + */ + private $output; + + /** + * DebuggingPlugin constructor. + * + * @param resource $output + */ + public function __construct($output) + { + if (!is_resource($output)) { + throw new \InvalidArgumentException('debugging resource is not valid'); + } + $this->output = $output; + } + + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + return $next($request)->then( + function (ResponseInterface $response) use ($request) { + $this->logSuccess($request, $response); + + return $response; + }, + function (ClientExceptionInterface $exception) use ($request) { + $this->logError($request, $exception); + + throw $exception; + } + ); + } + + private function logSuccess(RequestInterface $request, ResponseInterface $response): void + { + $methodAndPath = $request->getMethod() . ' ' . $request->getUri()->getPath(); + $protocol = $response->getProtocolVersion(); + $responseCode = $response->getStatusCode(); + \fprintf($this->output, '<%s HTTP/%s> %s', $methodAndPath, $protocol, $responseCode); + \fwrite($this->output, "\n"); + } + + private function logError(RequestInterface $request, ClientExceptionInterface $exception): void + { + $methodAndPath = $request->getMethod() . ' ' . $request->getUri()->getPath(); + $protocol = $request->getProtocolVersion(); + $error = $exception->getMessage(); + $responseCode = $exception->getCode(); + \fprintf($this->output, '<%s HTTP/%s> %s %s', $methodAndPath, $responseCode, $error, $protocol); + \fwrite($this->output, "\n"); + } +} \ No newline at end of file diff --git a/sdks/php/templates/libraries/psr-18/README.mustache b/sdks/php/templates/libraries/psr-18/README.mustache new file mode 100644 index 000000000..40a12d592 --- /dev/null +++ b/sdks/php/templates/libraries/psr-18/README.mustache @@ -0,0 +1,160 @@ +# {{packageName}} + +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} + +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}). +{{/infoUrl}} + +## Installation & Usage + +### Requirements + +PHP 7.2 and later. + +### Composer + +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: + +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git" + } + ], + "require": { + "{{gitUserId}}/{{gitRepoId}}": "*@dev" + } +} +``` + +Then run `composer install` + +Your project is free to choose the http client of your choice +Please require packages that will provide http client functionality: +https://packagist.org/providers/psr/http-client-implementation +https://packagist.org/providers/php-http/async-client-implementation +https://packagist.org/providers/psr/http-factory-implementation + +As an example: + +``` +composer require guzzlehttp/guzzle php-http/guzzle7-adapter http-interop/http-factory-guzzle +``` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php + php_doc_auth_partial}} +$apiInstance = new {{invokerPackage}}\Api\{{classname}}( + // If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`. + // This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface + new GuzzleHttp\Client(){{#hasAuthMethods}}, + $config{{/hasAuthMethods}} +); +{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{description}}}{{/description}} +{{/allParams}} + +try { + {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + print_r($result);{{/returnType}} +} catch (Exception $e) { + echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +## Models + +{{#models}}{{#model}}- [{{{classname}}}]({{modelDocPath}}/{{{classname}}}.md){{/model}} +{{/models}} + +## Authorization +{{^authMethods}} +All endpoints do not require authorization. +{{/authMethods}} +{{#authMethods}} +{{#last}} Authentication schemes defined for the API:{{/last}} +### {{{name}}} +{{#isApiKey}} + +- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} + +{{/isApiKey}} +{{#isBasic}} +{{#isBasicBasic}} + +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{/isBasic}} +{{#isOAuth}} + +- **Type**: `OAuth` +- **Flow**: `{{{flow}}}` +- **Authorization URL**: `{{{authorizationUrl}}}` +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} + - **{{{scope}}}**: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} +## Tests + +To run the tests, use: + +```bash +composer install +vendor/bin/phpunit +``` + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} +{{/-last}}{{/apis}}{{/apiInfo}} +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `{{appVersion}}` +{{#artifactVersion}} + - Package version: `{{artifactVersion}}` +{{/artifactVersion}} +{{^hideGenerationTimestamp}} + - Build date: `{{generatedDate}}` +{{/hideGenerationTimestamp}} + - Generator version: `{{generatorVersion}}` +- Build package: `{{generatorClass}}` diff --git a/sdks/php/templates/libraries/psr-18/api.mustache b/sdks/php/templates/libraries/psr-18/api.mustache new file mode 100644 index 000000000..6138ab176 --- /dev/null +++ b/sdks/php/templates/libraries/psr-18/api.mustache @@ -0,0 +1,773 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace {{apiPackage}}; + +use GuzzleHttp\Psr7\MultipartStream; +use Http\Client\Common\Plugin\ErrorPlugin; +use Http\Client\Common\Plugin\RedirectPlugin; +use Http\Client\Common\PluginClient; +use Http\Client\Common\PluginClientFactory; +use Http\Client\Exception\HttpException; +use Http\Client\HttpAsyncClient; +use Http\Discovery\HttpAsyncClientDiscovery; +use Http\Discovery\Psr17FactoryDiscovery; +use Http\Discovery\Psr18ClientDiscovery; +use Http\Message\RequestFactory; +use Http\Promise\Promise; +use {{invokerPackage}}\ApiException; +use {{invokerPackage}}\Configuration; +use {{invokerPackage}}\DebugPlugin; +use {{invokerPackage}}\HeaderSelector; +use {{invokerPackage}}\ObjectSerializer; +use Psr\Http\Client\ClientExceptionInterface; +use Psr\Http\Client\ClientInterface; +use Psr\Http\Message\RequestFactoryInterface; +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\StreamFactoryInterface; +use Psr\Http\Message\UriFactoryInterface; +use Psr\Http\Message\UriInterface; +use function sprintf; + +/** + * {{classname}} Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +{{#operations}}class {{classname}} +{ + /** + * @var PluginClient + */ + protected $httpClient; + + /** + * @var PluginClient + */ + protected $httpAsyncClient; + + /** + * @var UriFactoryInterface + */ + protected $uriFactory; + + /** + * @var Configuration + */ + protected $config; + + /** + * @var HeaderSelector + */ + protected $headerSelector; + + /** + * @var int Host index + */ + protected $hostIndex; + + /** + * @var RequestFactoryInterface + */ + protected $requestFactory; + + /** + * @var StreamFactoryInterface + */ + protected $streamFactory; + + public function __construct( + ClientInterface $httpClient = null, + Configuration $config = null, + HttpAsyncClient $httpAsyncClient = null, + UriFactoryInterface $uriFactory = null, + RequestFactoryInterface $requestFactory = null, + StreamFactoryInterface $streamFactory = null, + HeaderSelector $selector = null, + ?array $plugins = null, + $hostIndex = 0 + ) { + $this->config = $config ?? (new Configuration())->setHost('{{basePath}}'); + $this->requestFactory = $requestFactory ?? Psr17FactoryDiscovery::findRequestFactory(); + $this->streamFactory = $streamFactory ?? Psr17FactoryDiscovery::findStreamFactory(); + + $plugins = $plugins ?? [ + new RedirectPlugin(['strict' => true]), + new ErrorPlugin(), + ]; + + if ($this->config->getDebug()) { + $plugins[] = new DebugPlugin(fopen($this->config->getDebugFile(), 'ab')); + } + + $this->httpClient = (new PluginClientFactory())->createClient( + $httpClient ?? Psr18ClientDiscovery::find(), + $plugins + ); + + $this->httpAsyncClient = (new PluginClientFactory())->createClient( + $httpAsyncClient ?? HttpAsyncClientDiscovery::find(), + $plugins + ); + + $this->uriFactory = $uriFactory ?? Psr17FactoryDiscovery::findUriFactory(); + + $this->headerSelector = $selector ?? new HeaderSelector(); + + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + +{{#operation}} + /** + * Operation {{{operationId}}} +{{#summary}} + * + * {{.}} +{{/summary}} + * +{{#description}} + * {{.}} + * +{{/description}} +{{#vendorExtensions.x-group-parameters}} + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * +{{/vendorExtensions.x-group-parameters}} +{{#servers}} +{{#-first}} + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. +{{/-first}} + * URL: {{{url}}} +{{#-last}} + * +{{/-last}} +{{/servers}} +{{#allParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{description}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} + * + * @throws \{{invokerPackage}}\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return {{#returnType}}{{#responses}}{{#dataType}}{{^-first}}|{{/-first}}{{/dataType}}{{{dataType}}}{{/responses}}{{/returnType}}{{^returnType}}void{{/returnType}} + */ + public function {{operationId}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + {{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} + return $response;{{/returnType}} + } + + /** + * Operation {{{operationId}}}WithHttpInfo +{{#summary}} + * + * {{.}} +{{/summary}} + * +{{#description}} + * {{.}} + * +{{/description}} +{{#vendorExtensions.x-group-parameters}} + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * +{{/vendorExtensions.x-group-parameters}} +{{#servers}} +{{#-first}} + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. +{{/-first}} + * URL: {{{url}}} +{{#-last}} + * +{{/-last}} +{{/servers}} +{{#allParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} + * + * @throws \{{invokerPackage}}\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of {{#returnType}}{{#responses}}{{#dataType}}{{^-first}}|{{/-first}}{{/dataType}}{{{dataType}}}{{/responses}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) + */ + public function {{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); + + try { + try { + $response = $this->httpClient->sendRequest($request); + } catch (HttpException $e) { + $response = $e->getResponse(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $response->getStatusCode(), + (string) $request->getUri() + ), + $request, + $response, + $e + ); + } catch (ClientExceptionInterface $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $request, + null, + $e + ); + } + + $statusCode = $response->getStatusCode(); + {{#returnType}} + {{#responses}} + {{#-first}} + + switch($statusCode) { + {{/-first}} + {{#dataType}} + {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + if ('{{{dataType}}}' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '{{{dataType}}}', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + {{/dataType}} + {{#-last}} + } + {{/-last}} + {{/responses}} + + $returnType = '{{{returnType}}}'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + {{/returnType}} + {{^returnType}} + + return [null, $statusCode, $response->getHeaders()]; + {{/returnType}} + + } catch (ApiException $e) { + switch ($e->getCode()) { + {{#responses}} + {{#dataType}} + {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '{{{dataType}}}', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + {{/dataType}} + {{/responses}} + } + throw $e; + } + } + + /** + * Operation {{{operationId}}}Async + * +{{#summary}} + * {{.}} + * +{{/summary}} +{{#description}} + * {{.}} + * +{{/description}} +{{#vendorExtensions.x-group-parameters}} + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * +{{/vendorExtensions.x-group-parameters}} +{{#servers}} +{{#-first}} + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. +{{/-first}} + * URL: {{{url}}} +{{#-last}} + * +{{/-last}} +{{/servers}} +{{#allParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} + * + * @throws \InvalidArgumentException + * @return Promise + */ + public function {{operationId}}Async({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + return $this->{{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation {{{operationId}}}AsyncWithHttpInfo + * +{{#summary}} + * {{.}} + * +{{/summary}} +{{#description}} + * {{.}} + * +{{/description}} +{{#vendorExtensions.x-group-parameters}} + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * +{{/vendorExtensions.x-group-parameters}} +{{#servers}} +{{#-first}} + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. +{{/-first}} + * URL: {{{url}}} +{{#-last}} + * +{{/-last}} +{{/servers}} +{{#allParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} + * + * @throws \InvalidArgumentException + * @return Promise + */ + public function {{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + $returnType = '{{{returnType}}}'; + $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); + + return $this->httpAsyncClient->sendAsyncRequest($request) + ->then( + function ($response) use ($returnType) { + {{#returnType}} + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + {{/returnType}} + {{^returnType}} + return [null, $response->getStatusCode(), $response->getHeaders()]; + {{/returnType}} + }, + function (HttpException $exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $exception->getRequest(), + $exception->getResponse(), + $exception + ); + } + ); + } + + /** + * Create request for operation '{{{operationId}}}' + * +{{#vendorExtensions.x-group-parameters}} + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * +{{/vendorExtensions.x-group-parameters}} +{{#servers}} +{{#-first}} + * This oepration contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. +{{/-first}} + * URL: {{{url}}} +{{#-last}} + * +{{/-last}} +{{/servers}} +{{#allParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} +{{/allParams}} + * + * @throws \InvalidArgumentException + * @return RequestInterface + */ + public function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + {{#vendorExtensions.x-group-parameters}} + // unbox the parameters from the associative array + {{#allParams}} + ${{paramName}} = array_key_exists('{{paramName}}', $associative_array) ? $associative_array['{{paramName}}'] : {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}; + {{/allParams}} + + {{/vendorExtensions.x-group-parameters}} + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + if (${{paramName}} === null || (is_array(${{paramName}}) && count(${{paramName}}) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter ${{paramName}} when calling {{operationId}}' + ); + } + {{/required}} + {{#hasValidation}} + {{#maxLength}} + if ({{^required}}${{paramName}} !== null && {{/required}}strlen(${{paramName}}) > {{maxLength}}) { + throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.'); + } + {{/maxLength}} + {{#minLength}} + if ({{^required}}${{paramName}} !== null && {{/required}}strlen(${{paramName}}) < {{minLength}}) { + throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); + } + {{/minLength}} + {{#maximum}} + if ({{^required}}${{paramName}} !== null && {{/required}}${{paramName}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.'); + } + {{/maximum}} + {{#minimum}} + if ({{^required}}${{paramName}} !== null && {{/required}}${{paramName}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.'); + } + {{/minimum}} + {{#pattern}} + if ({{^required}}${{paramName}} !== null && {{/required}}!preg_match("{{{pattern}}}", ${{paramName}})) { + throw new \InvalidArgumentException("invalid value for \"{{paramName}}\" when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."); + } + {{/pattern}} + {{#maxItems}} + if ({{^required}}${{paramName}} !== null && {{/required}}count(${{paramName}}) > {{maxItems}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.'); + } + {{/maxItems}} + {{#minItems}} + if ({{^required}}${{paramName}} !== null && {{/required}}count(${{paramName}}) < {{minItems}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); + } + {{/minItems}} + + {{/hasValidation}} + {{/allParams}} + + $resourcePath = '{{{path}}}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = null; + $multipart = false; + + {{#queryParams}} + // query params + {{#isExplode}} + if (${{paramName}} !== null) { + {{#style}} + if('form' === '{{style}}' && is_array(${{paramName}})) { + foreach(${{paramName}} as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['{{baseName}}'] = ${{paramName}}; + } + {{/style}} + {{^style}} + $queryParams['{{baseName}}'] = ${{paramName}}; + {{/style}} + } + {{/isExplode}} + {{^isExplode}} + if (is_array(${{paramName}})) { + ${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{#style}}{{style}}{{/style}}{{^style}}{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}{{/style}}', true); + } + if (${{paramName}} !== null) { + $queryParams['{{baseName}}'] = ${{paramName}}; + } + {{/isExplode}} + {{/queryParams}} + + {{#headerParams}} + // header params + {{#collectionFormat}} + if (is_array(${{paramName}})) { + ${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{collectionFormat}}'); + } + {{/collectionFormat}} + if (${{paramName}} !== null) { + $headerParams['{{baseName}}'] = ObjectSerializer::toHeaderValue(${{paramName}}); + } + {{/headerParams}} + + {{#pathParams}} + // path params + {{#collectionFormat}} + if (is_array(${{paramName}})) { + ${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{collectionFormat}}'); + } + {{/collectionFormat}} + if (${{paramName}} !== null) { + $resourcePath = str_replace( + '{' . '{{baseName}}' . '}', + ObjectSerializer::toPathValue(${{paramName}}), + $resourcePath + ); + } + {{/pathParams}} + + {{#formParams}} + // form params + if (${{paramName}} !== null) { + {{#isFile}} + $multipart = true; + $formParams['{{baseName}}'] = []; + $paramFiles = is_array(${{paramName}}) ? ${{paramName}} : [${{paramName}}]; + foreach ($paramFiles as $paramFile) { + $formParams['{{baseName}}'][] = \GuzzleHttp\Psr7\try_fopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + {{/isFile}} + {{^isFile}} + $formParams['{{baseName}}'] = ObjectSerializer::toFormValue(${{paramName}}); + {{/isFile}} + } + {{/formParams}} + + $headers = $this->headerSelector->selectHeaders( + [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}], + '{{#consumes}}{{{mediaType}}}{{/consumes}}', + $multipart + ); + + // for model (json/xml) + {{#bodyParams}} + if (isset(${{paramName}})) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization(${{paramName}})); + } else { + $httpBody = ${{paramName}}; + } + } elseif (count($formParams) > 0) { + {{/bodyParams}} + {{^bodyParams}} + if (count($formParams) > 0) { + {{/bodyParams}} + 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) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + {{#authMethods}} + {{#isApiKey}} + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('{{keyParamName}}'); + if ($apiKey !== null) { + {{#isKeyInHeader}}$headers['{{keyParamName}}'] = $apiKey;{{/isKeyInHeader}}{{#isKeyInQuery}}$queryParams['{{keyParamName}}'] = $apiKey;{{/isKeyInQuery}} + } + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // this endpoint requires Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + {{/isOAuth}} + {{/authMethods}} + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + {{^servers.0}} + $operationHost = $this->config->getHost(); + {{/servers.0}} + {{#servers.0}} + $operationHosts = [{{#servers}}"{{{url}}}"{{^-last}}, {{/-last}}{{/servers}}]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + {{/servers.0}} + + $uri = $this->createUri($operationHost, $resourcePath, $queryParams); + + return $this->createRequest('{{httpMethod}}', $uri, $headers, $httpBody); + } + + {{/operation}} + + /** + * @param string $method + * @param string|UriInterface $uri + * @param array $headers + * @param string|StreamInterface|null $body + * + * @return RequestInterface + */ + protected function createRequest(string $method, $uri, array $headers = [], $body = null): RequestInterface + { + if ($this->requestFactory instanceof RequestFactory) { + return $this->requestFactory->createRequest( + $method, + $uri, + $headers, + $body + ); + } + + if (is_string($body) && '' !== $body && null === $this->streamFactory) { + throw new \RuntimeException('Cannot create request: A stream factory is required to create a request with a non-empty string body.'); + } + + $request = $this->requestFactory->createRequest($method, $uri); + + foreach ($headers as $key => $value) { + $request = $request->withHeader($key, $value); + } + + if (null !== $body && '' !== $body) { + $request = $request->withBody( + is_string($body) ? $this->streamFactory->createStream($body) : $body + ); + } + + return $request; + } + + private function createUri( + string $operationHost, + string $resourcePath, + array $queryParams + ): UriInterface { + $parsedUrl = parse_url($operationHost); + + $host = $parsedUrl['host'] ?? null; + $scheme = $parsedUrl['scheme'] ?? null; + $basePath = $parsedUrl['path'] ?? null; + $port = $parsedUrl['port'] ?? null; + $user = $parsedUrl['user'] ?? null; + $password = $parsedUrl['pass'] ?? null; + + $uri = $this->uriFactory->createUri($basePath . $resourcePath) + ->withHost($host) + ->withScheme($scheme) + ->withPort($port) + ->withQuery(ObjectSerializer::buildQuery($queryParams)); + + if ($user) { + $uri = $uri->withUserInfo($user, $password); + } + + return $uri; + } +} +{{/operations}} diff --git a/sdks/php/templates/libraries/psr-18/api_doc.mustache b/sdks/php/templates/libraries/psr-18/api_doc.mustache new file mode 100644 index 000000000..3a794f7e5 --- /dev/null +++ b/sdks/php/templates/libraries/psr-18/api_doc.mustache @@ -0,0 +1,78 @@ +# {{invokerPackage}}\{{classname}}{{#description}} + +{{description}}{{/description}} + +All URIs are relative to {{basePath}}. + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}()**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}}{{#operations}}{{#operation}} + +## `{{{operationId}}}()` + +```php +{{{operationId}}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}: {{{returnType}}}{{/returnType}} +``` + +{{{summary}}}{{#notes}} + +{{{notes}}}{{/notes}} + +### Example + +```php + php_doc_auth_partial}} +$apiInstance = new {{invokerPackage}}\Api\{{classname}}( + // If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`. + // This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface + new GuzzleHttp\Client(){{#hasAuthMethods}}, + $config{{/hasAuthMethods}} +); +{{^vendorExtensions.x-group-parameters}} +{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{description}}}{{/description}} +{{/allParams}} +{{/vendorExtensions.x-group-parameters}} +{{#vendorExtensions.x-group-parameters}} +{{#allParams}}$associate_array['{{paramName}}'] = {{{example}}}; // {{{dataType}}}{{#description}} | {{{description}}}{{/description}} +{{/allParams}} +{{/vendorExtensions.x-group-parameters}} + +try { + {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associate_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} + print_r($result);{{/returnType}} +} catch (Exception $e) { + echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +{{#vendorExtensions.x-group-parameters}} +Note: the input parameter is an associative array with the keys listed as the parameter name below. + +{{/vendorExtensions.x-group-parameters}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**](../Model/{{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + +- **Content-Type**: {{#consumes}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md){{/operation}}{{/operations}} diff --git a/sdks/php/templates/libraries/psr-18/composer.mustache b/sdks/php/templates/libraries/psr-18/composer.mustache new file mode 100644 index 000000000..7ef3e16b0 --- /dev/null +++ b/sdks/php/templates/libraries/psr-18/composer.mustache @@ -0,0 +1,54 @@ +{ + "name": "{{gitUserId}}/{{gitRepoId}}", + {{#artifactVersion}} + "version": "{{artifactVersion}}", + {{/artifactVersion}} + "description": "{{{appDescription}}}", + "keywords": [ + "openapitools", + "openapi-generator", + "openapi", + "php", + "sdk", + "rest", + "api" + ], + "homepage": "https://openapi-generator.tech", + "license": "unlicense", + "authors": [ + { + "name": "OpenAPI-Generator contributors", + "homepage": "https://openapi-generator.tech" + } + ], + "config": { + "sort-packages": true + }, + "require": { + "php": ">=7.2", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/psr7": "^1.8 || ^2.0", + "php-http/async-client-implementation": "^1.0", + "php-http/client-common": "^2.4", + "php-http/discovery": "^1.14", + "php-http/httplug": "^2.2", + "psr/http-client-implementation": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^2.12", + "guzzlehttp/guzzle": "^7.0", + "php-http/guzzle7-adapter": "^1.0" + }, + "autoload": { + "psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" } + }, + "autoload-dev": { + "psr-4": { "{{escapedInvokerPackage}}\\Test\\" : "{{testBasePath}}/" } + } +} diff --git a/sdks/php/templates/model.mustache b/sdks/php/templates/model.mustache index f0f5f1843..fe57ed7e5 100644 --- a/sdks/php/templates/model.mustache +++ b/sdks/php/templates/model.mustache @@ -4,7 +4,7 @@ /** * {{classname}} * - * PHP version {{phpVersion}} + * PHP version 7.4 * * @category Class * @package {{invokerPackage}} @@ -27,7 +27,6 @@ use \ArrayAccess; {{/parentSchema}} {{/isEnum}} use \{{invokerPackage}}\ObjectSerializer; -use ReturnTypeWillChange; /** * {{classname}} Class Doc Comment @@ -40,11 +39,8 @@ use ReturnTypeWillChange; * @author OpenAPI Generator team * @link https://openapi-generator.tech {{^isEnum}} - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess {{/isEnum}} - * {{#vendorExtensions.x-internal-class}}@internal This class should not be instantiated directly{{/vendorExtensions.x-internal-class}} */ {{#isEnum}}{{>model_enum}}{{/isEnum}}{{^isEnum}}{{>model_generic}}{{/isEnum}} {{/model}}{{/models}} diff --git a/sdks/php/templates/model_doc.mustache b/sdks/php/templates/model_doc.mustache index 3f3578894..935522686 100644 --- a/sdks/php/templates/model_doc.mustache +++ b/sdks/php/templates/model_doc.mustache @@ -1,12 +1,20 @@ # {{#models}}{{#model}}# {{classname}} +{{#useCustomTemplateCode}} {{unescapedDescription}} +{{/useCustomTemplateCode}} ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +{{^useCustomTemplateCode}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}}{{#defaultValue}} [default to {{{.}}}]{{/defaultValue}} +{{/vars}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#vars}}| `{{name}}`{{#required}}*_required_{{/required}} | {{#isPrimitiveType}}```{{{dataType}}}```{{/isPrimitiveType}}{{^isPrimitiveType}}[```{{{dataType}}}```]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{#isReadOnly}} [readonly]{{/isReadOnly}}{{#defaultValue}} [default to {{{.}}}]{{/defaultValue}} | {{/vars}} +{{/useCustomTemplateCode}} [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md){{/model}}{{/models}} diff --git a/sdks/php/templates/model_enum.mustache b/sdks/php/templates/model_enum.mustache index 88036f76f..77001f2e6 100644 --- a/sdks/php/templates/model_enum.mustache +++ b/sdks/php/templates/model_enum.mustache @@ -5,7 +5,7 @@ class {{classname}} */ {{#allowableValues}} {{#enumVars}} - const {{^isString}}NUMBER_{{/isString}}{{{name}}} = {{{value}}}; + public const {{^isString}}NUMBER_{{/isString}}{{{name}}} = {{{value}}}; {{/enumVars}} {{/allowableValues}} diff --git a/sdks/php/templates/model_generic.mustache b/sdks/php/templates/model_generic.mustache index 240156c2d..3b213dd3b 100644 --- a/sdks/php/templates/model_generic.mustache +++ b/sdks/php/templates/model_generic.mustache @@ -1,4 +1,4 @@ -{{#vendorExtensions.x-base-class}}abstract {{/vendorExtensions.x-base-class}}class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^parentSchema}}implements ModelInterface, ArrayAccess, \JsonSerializable{{/parentSchema}} +class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^parentSchema}}implements ModelInterface, ArrayAccess, \JsonSerializable{{/parentSchema}} { public const DISCRIMINATOR = {{#discriminator}}'{{discriminatorName}}'{{/discriminator}}{{^discriminator}}null{{/discriminator}}; @@ -31,6 +31,23 @@ {{/-last}}{{/vars}} ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + {{#vars}}'{{name}}' => {{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{^-last}}, + {{/-last}}{{/vars}} + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -51,6 +68,58 @@ return self::$openAPIFormats{{#parentSchema}} + parent::openAPIFormats(){{/parentSchema}}; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables{{#parentSchema}} + parent::openAPINullables(){{/parentSchema}}; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + 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 @@ -127,7 +196,7 @@ {{#isEnum}} {{#allowableValues}} {{#enumVars}} - const {{enumName}}_{{{name}}} = {{{value}}}; + public const {{enumName}}_{{{name}}} = {{{value}}}; {{/enumVars}} {{/allowableValues}} {{/isEnum}} @@ -154,7 +223,7 @@ /** * Associative array for storing property values * - * @var array + * @var mixed[] */ protected $container = []; {{/parentSchema}} @@ -162,7 +231,7 @@ /** * Constructor * - * @param array|null $data Associated array of property values + * @param mixed[] $data Associated array of property values * initializing the model */ public function __construct(array $data = null) @@ -172,7 +241,7 @@ {{/parentSchema}} {{#vars}} - $this->container['{{name}}'] = $data['{{name}}'] ?? {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}; + $this->setIfExists('{{name}}', $data ?? [], {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}); {{/vars}} {{#discriminator}} @@ -181,6 +250,7 @@ {{/discriminator}} } +{{#useCustomTemplateCode}} {{^discriminator}} /** @deprecated use ::init() */ public static function fromArray(array $data): {{classname}} @@ -191,7 +261,7 @@ /** Attempt to instantiate and hydrate a new instance of this class */ public static function init(array $data): {{classname}} { - /** @var {{classname}} $obj */ + /** @var {{classname}} */ $obj = ObjectSerializer::deserialize( $data, {{classname}}::class, @@ -217,7 +287,30 @@ return null; } {{/discriminator}} +{{/useCustomTemplateCode}} + + /** + * 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 $variableName + * @param array $fields +{{^useCustomTemplateCode}} + * @param mixed $defaultValue +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +* @param string|int|object|array|mixed $defaultValue +{{/useCustomTemplateCode}} + */ + 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. @@ -316,7 +409,7 @@ /** * Gets {{name}} * - * @return {{#vendorExtensions.x-int-or-string}}int|string{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}{{^required}}|null{{/required}} + * @return {{{dataType}}}{{^required}}|null{{/required}} {{#deprecated}} * @deprecated {{/deprecated}} @@ -329,7 +422,7 @@ /** * Sets {{name}} * - * @param {{#vendorExtensions.x-int-or-string}}int|string{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}{{^required}}|null{{/required}} ${{name}}{{#description}} {{{.}}}{{/description}}{{^description}} {{{name}}}{{/description}} + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{name}}{{#description}} {{{.}}}{{/description}}{{^description}} {{{name}}}{{/description}} * * @return self {{#deprecated}} @@ -338,10 +431,27 @@ */ public function {{setter}}(${{name}}) { + {{#isNullable}} + if (is_null(${{name}})) { + array_push($this->openAPINullablesSetToNull, '{{name}}'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('{{name}}', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + {{/isNullable}} + {{^isNullable}} + if (is_null(${{name}})) { + throw new \InvalidArgumentException('non-nullable {{name}} cannot be null'); + } + {{/isNullable}} {{#isEnum}} $allowedValues = $this->{{getter}}AllowableValues(); {{^isContainer}} - if ({{^required}}!is_null(${{name}}) && {{/required}}!in_array(${{{name}}}, $allowedValues, true)) { + if ({{#isNullable}}!is_null(${{name}}) && {{/isNullable}}!in_array(${{{name}}}, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for '{{name}}', must be one of '%s'", @@ -352,7 +462,7 @@ } {{/isContainer}} {{#isContainer}} - if ({{^required}}!is_null(${{name}}) && {{/required}}array_diff(${{{name}}}, $allowedValues)) { + if ({{#isNullable}}!is_null(${{name}}) && {{/isNullable}}array_diff(${{{name}}}, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for '{{name}}', must be one of '%s'", @@ -364,35 +474,35 @@ {{/isEnum}} {{#hasValidation}} {{#maxLength}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(mb_strlen(${{name}}) > {{maxLength}})) { + if ({{#isNullable}}!is_null(${{name}}) && {{/isNullable}}(mb_strlen(${{name}}) > {{maxLength}})) { throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.'); }{{/maxLength}} {{#minLength}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(mb_strlen(${{name}}) < {{minLength}})) { + if ({{#isNullable}}!is_null(${{name}}) && {{/isNullable}}(mb_strlen(${{name}}) < {{minLength}})) { throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); } {{/minLength}} {{#maximum}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(${{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) { + if ({{#isNullable}}!is_null(${{name}}) && {{/isNullable}}(${{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) { throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.'); } {{/maximum}} {{#minimum}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(${{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) { + if ({{#isNullable}}!is_null(${{name}}) && {{/isNullable}}(${{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) { throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.'); } {{/minimum}} {{#pattern}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(!preg_match("{{{pattern}}}", ${{name}}))) { - throw new \InvalidArgumentException("invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."); + if ({{#isNullable}}!is_null(${{name}}) && {{/isNullable}}(!preg_match("{{{pattern}}}", ObjectSerializer::toString(${{name}})))) { + throw new \InvalidArgumentException("invalid value for \${{name}} when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."); } {{/pattern}} {{#maxItems}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(count(${{name}}) > {{maxItems}})) { + if ({{#isNullable}}!is_null(${{name}}) && {{/isNullable}}(count(${{name}}) > {{maxItems}})) { throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.'); }{{/maxItems}} {{#minItems}} - if ({{^required}}!is_null(${{name}}) && {{/required}}(count(${{name}}) < {{minItems}})) { + if ({{#isNullable}}!is_null(${{name}}) && {{/isNullable}}(count(${{name}}) < {{minItems}})) { throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); } {{/minItems}} @@ -405,12 +515,14 @@ /** * Returns true if offset exists. False otherwise. * - * @param mixed $offset Offset + * @param integer $offset Offset * * @return boolean */ - #[ReturnTypeWillChange] - public function offsetExists($offset) +{{#useCustomTemplateCode}} + #[\ReturnTypeWillChange] +{{/useCustomTemplateCode}} + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -418,11 +530,11 @@ /** * Gets offset. * - * @param mixed $offset Offset + * @param integer $offset Offset * * @return mixed|null */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -431,13 +543,15 @@ /** * Sets value based on offset. * - * @param mixed $offset Offset + * @param int|null $offset Offset * @param mixed $value Value to be set * * @return void */ - #[ReturnTypeWillChange] - public function offsetSet($offset, $value) +{{#useCustomTemplateCode}} + #[\ReturnTypeWillChange] +{{/useCustomTemplateCode}} + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -449,12 +563,14 @@ /** * Unsets offset. * - * @param mixed $offset Offset + * @param integer $offset Offset * * @return void */ - #[ReturnTypeWillChange] - public function offsetUnset($offset) +{{#useCustomTemplateCode}} + #[\ReturnTypeWillChange] +{{/useCustomTemplateCode}} + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -463,10 +579,10 @@ * Serializes the object to a value that can be serialized natively by json_encode(). * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return scalar|object|array|null Returns data which can be serialized by json_encode(), which is a value + * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); @@ -481,7 +597,12 @@ { return json_encode( ObjectSerializer::sanitizeForSerialization($this), +{{^useCustomTemplateCode}} + JSON_PRETTY_PRINT +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} JSON_UNESCAPED_SLASHES +{{/useCustomTemplateCode}} ); } diff --git a/sdks/php/templates/model_test.mustache b/sdks/php/templates/model_test.mustache index c1b70a6fb..f1c46499b 100644 --- a/sdks/php/templates/model_test.mustache +++ b/sdks/php/templates/model_test.mustache @@ -4,7 +4,7 @@ /** * {{classname}}Test * - * PHP version {{phpVersion}} + * PHP version 7.4 * * @category Class * @package {{invokerPackage}} @@ -69,17 +69,17 @@ class {{classname}}Test extends TestCase public function test{{classname}}() { // TODO: implement - $this->markTestIncomplete('Not implemented'); + self::markTestIncomplete('Not implemented'); } {{#vars}} /** * Test attribute "{{name}}" */ - public function testProperty{{nameInCamelCase}}() + public function testProperty{{nameInPascalCase}}() { // TODO: implement - $this->markTestIncomplete('Not implemented'); + self::markTestIncomplete('Not implemented'); } {{/vars}} } diff --git a/sdks/php/templates/partial_header.mustache b/sdks/php/templates/partial_header.mustache index ef3530aae..bc1b11e29 100644 --- a/sdks/php/templates/partial_header.mustache +++ b/sdks/php/templates/partial_header.mustache @@ -14,5 +14,5 @@ * Contact: {{{.}}} {{/infoEmail}} * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: {{{generatorVersion}}} + * Generator version: {{{generatorVersion}}} */ diff --git a/sdks/php/templates/php_doc_auth_partial.mustache b/sdks/php/templates/php_doc_auth_partial.mustache index 6b03e0d09..5f2d05eaf 100644 --- a/sdks/php/templates/php_doc_auth_partial.mustache +++ b/sdks/php/templates/php_doc_auth_partial.mustache @@ -3,7 +3,13 @@ {{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration() +{{^useCustomTemplateCode}} + ->setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ->setApiKey('YOUR_API_KEY'); +{{/useCustomTemplateCode}} {{/isBasicBasic}} {{#isBasicBearer}} // Configure Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authorization: {{{name}}} @@ -13,6 +19,10 @@ $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAcce {{#isApiKey}} // Configure API key authorization: {{{name}}} $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); +{{^useCustomTemplateCode}} +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'Bearer'); +{{/useCustomTemplateCode}} {{/isApiKey}} {{#isOAuth}} // Configure OAuth2 access token for authorization: {{{name}}} diff --git a/sdks/php/templates/phpunit.xml.mustache b/sdks/php/templates/phpunit.xml.mustache index b72fb7c6e..7f1126c45 100644 --- a/sdks/php/templates/phpunit.xml.mustache +++ b/sdks/php/templates/phpunit.xml.mustache @@ -2,14 +2,19 @@ - {{apiSrcPath}} - {{modelSrcPath}} + {{#lambda.forwardslash}}{{apiSrcPath}}{{/lambda.forwardslash}} + {{#lambda.forwardslash}}{{modelSrcPath}}{{/lambda.forwardslash}} +{{^useCustomTemplateCode}} {{apiTestPath}} {{modelTestPath}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + ./test +{{/useCustomTemplateCode}} diff --git a/sdks/php/test/ObjectSerializerTest.php b/sdks/php/test/ObjectSerializerTest.php index 2b27a769e..3f548863d 100644 --- a/sdks/php/test/ObjectSerializerTest.php +++ b/sdks/php/test/ObjectSerializerTest.php @@ -122,4 +122,73 @@ public function testValuesJsonified() $this->assertEquals($expectedOauth, $result['oauth']); } + + public function testExplicitIndexKeysAreKeptForNestedValues(): void + { + $data = [ + 'type' => 'request_signature', + 'subject' => 'unclaimed draft that should work', + 'message' => 'indeed', + 'metadata' => null, + 'test_mode' => false, + 'signers' => [ + '1' => [ + 'order' => 1, + 'email_address' => 'john@example.com', + 'name' => 'John Q Public', + ], + ], + 'form_fields_per_document' => [ + [ + 'document_index' => 0, + 'name' => null, + 'type' => 'signature', + 'x' => 530, + 'y' => 415, + 'width' => 120, + 'height' => 30, + 'required' => true, + 'signer' => 1, + ], + ], + 'client_id' => '1df877123c9b64884c86530a1c1d309d', + 'requester_email_address' => 'test-1725033846-d0e693477a@example.com', + ]; + + $obj = Model\UnclaimedDraftCreateEmbeddedRequest::init($data); + + $expected_signer_key = '1'; + $this->assertArrayHasKey($expected_signer_key, $obj->getSigners()); + $this->assertEquals( + $data['signers'][$expected_signer_key]['email_address'], + $obj->getSigners()[$expected_signer_key]->getEmailAddress(), + ); + + $expected_ffpd_key = 0; + $this->assertArrayHasKey($expected_ffpd_key, $obj->getFormFieldsPerDocument()); + $this->assertEquals( + $data['form_fields_per_document'][$expected_ffpd_key]['type'], + $obj->getFormFieldsPerDocument()[$expected_ffpd_key]->getType(), + ); + } + + public function testSplFileObjectUntouched(): void + { + $requestClass = Model\SignatureRequestSendRequest::class; + $requestData = TestUtils::getFixtureData($requestClass)['default']; + unset($requestData['file_urls']); + + $filename = 'pdf-sample.pdf'; + $filepath = self::ROOT_FILE_PATH . "/{$filename}"; + + $requestData['files'] = [new SplFileObject($filepath)]; + + $obj = Model\SignatureRequestSendRequest::init($requestData); + + $file = $obj->getFiles()[0]; + + $this->assertInstanceOf(SplFileObject::class, $file); + $this->assertEquals($filename, $file->getFilename()); + $this->assertEquals($filepath, $file->getPathname()); + } } diff --git a/sdks/python/.editorconfig b/sdks/python/.editorconfig index b6637bec8..9eda130bc 100644 --- a/sdks/python/.editorconfig +++ b/sdks/python/.editorconfig @@ -2,4 +2,4 @@ indent_style = space indent_size = 2 [*.py] -indent_size = 4 \ No newline at end of file +indent_size = 4 diff --git a/sdks/python/.github/workflows/python.yml b/sdks/python/.github/workflows/python.yml new file mode 100644 index 000000000..d7d9ec328 --- /dev/null +++ b/sdks/python/.github/workflows/python.yml @@ -0,0 +1,38 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: dropbox_sign Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/sdks/python/.gitignore b/sdks/python/.gitignore index 491b7085b..25f66e000 100644 --- a/sdks/python/.gitignore +++ b/sdks/python/.gitignore @@ -65,4 +65,5 @@ target/ #Ipython Notebook .ipynb_checkpoints +.openapi-generator /vendor diff --git a/sdks/python/.gitlab-ci.yml b/sdks/python/.gitlab-ci.yml index 237ec2230..e038c25db 100644 --- a/sdks/python/.gitlab-ci.yml +++ b/sdks/python/.gitlab-ci.yml @@ -1,24 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# # ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml stages: - test -.tests: +.pytest: stage: test script: - pip install -r requirements.txt - pip install -r test-requirements.txt - pytest --cov=dropbox_sign -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests +pytest-3.7: + extends: .pytest image: python:3.7-alpine -test-3.8: - extends: .tests +pytest-3.8: + extends: .pytest image: python:3.8-alpine -test-3.9: - extends: .tests +pytest-3.9: + extends: .pytest image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine diff --git a/sdks/python/.openapi-generator-ignore b/sdks/python/.openapi-generator-ignore index 600ecaaa8..7484ee590 100644 --- a/sdks/python/.openapi-generator-ignore +++ b/sdks/python/.openapi-generator-ignore @@ -21,6 +21,3 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md -git_push.sh -docs/*AllOf* -**/model/*all_of* diff --git a/sdks/python/.openapi-generator/FILES b/sdks/python/.openapi-generator/FILES deleted file mode 100644 index 22b647339..000000000 --- a/sdks/python/.openapi-generator/FILES +++ /dev/null @@ -1,385 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -VERSION -docs/AccountApi.md -docs/AccountCreateRequest.md -docs/AccountCreateResponse.md -docs/AccountGetResponse.md -docs/AccountResponse.md -docs/AccountResponseQuotas.md -docs/AccountResponseUsage.md -docs/AccountUpdateRequest.md -docs/AccountVerifyRequest.md -docs/AccountVerifyResponse.md -docs/AccountVerifyResponseAccount.md -docs/ApiAppApi.md -docs/ApiAppCreateRequest.md -docs/ApiAppGetResponse.md -docs/ApiAppListResponse.md -docs/ApiAppResponse.md -docs/ApiAppResponseOAuth.md -docs/ApiAppResponseOptions.md -docs/ApiAppResponseOwnerAccount.md -docs/ApiAppResponseWhiteLabelingOptions.md -docs/ApiAppUpdateRequest.md -docs/BulkSendJobApi.md -docs/BulkSendJobGetResponse.md -docs/BulkSendJobGetResponseSignatureRequests.md -docs/BulkSendJobListResponse.md -docs/BulkSendJobResponse.md -docs/BulkSendJobSendResponse.md -docs/EmbeddedApi.md -docs/EmbeddedEditUrlRequest.md -docs/EmbeddedEditUrlResponse.md -docs/EmbeddedEditUrlResponseEmbedded.md -docs/EmbeddedSignUrlResponse.md -docs/EmbeddedSignUrlResponseEmbedded.md -docs/ErrorResponse.md -docs/ErrorResponseError.md -docs/EventCallbackRequest.md -docs/EventCallbackRequestEvent.md -docs/EventCallbackRequestEventMetadata.md -docs/FileResponse.md -docs/FileResponseDataUri.md -docs/ListInfoResponse.md -docs/OAuthApi.md -docs/OAuthTokenGenerateRequest.md -docs/OAuthTokenRefreshRequest.md -docs/OAuthTokenResponse.md -docs/ReportApi.md -docs/ReportCreateRequest.md -docs/ReportCreateResponse.md -docs/ReportResponse.md -docs/SignatureRequestApi.md -docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md -docs/SignatureRequestBulkSendWithTemplateRequest.md -docs/SignatureRequestCreateEmbeddedRequest.md -docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md -docs/SignatureRequestGetResponse.md -docs/SignatureRequestListResponse.md -docs/SignatureRequestRemindRequest.md -docs/SignatureRequestResponse.md -docs/SignatureRequestResponseAttachment.md -docs/SignatureRequestResponseCustomFieldBase.md -docs/SignatureRequestResponseCustomFieldCheckbox.md -docs/SignatureRequestResponseCustomFieldText.md -docs/SignatureRequestResponseCustomFieldTypeEnum.md -docs/SignatureRequestResponseDataBase.md -docs/SignatureRequestResponseDataTypeEnum.md -docs/SignatureRequestResponseDataValueCheckbox.md -docs/SignatureRequestResponseDataValueCheckboxMerge.md -docs/SignatureRequestResponseDataValueDateSigned.md -docs/SignatureRequestResponseDataValueDropdown.md -docs/SignatureRequestResponseDataValueInitials.md -docs/SignatureRequestResponseDataValueRadio.md -docs/SignatureRequestResponseDataValueSignature.md -docs/SignatureRequestResponseDataValueText.md -docs/SignatureRequestResponseDataValueTextMerge.md -docs/SignatureRequestResponseSignatures.md -docs/SignatureRequestSendRequest.md -docs/SignatureRequestSendWithTemplateRequest.md -docs/SignatureRequestUpdateRequest.md -docs/SubAttachment.md -docs/SubBulkSignerList.md -docs/SubBulkSignerListCustomField.md -docs/SubCC.md -docs/SubCustomField.md -docs/SubEditorOptions.md -docs/SubFieldOptions.md -docs/SubFormFieldGroup.md -docs/SubFormFieldRule.md -docs/SubFormFieldRuleAction.md -docs/SubFormFieldRuleTrigger.md -docs/SubFormFieldsPerDocumentBase.md -docs/SubFormFieldsPerDocumentCheckbox.md -docs/SubFormFieldsPerDocumentCheckboxMerge.md -docs/SubFormFieldsPerDocumentDateSigned.md -docs/SubFormFieldsPerDocumentDropdown.md -docs/SubFormFieldsPerDocumentFontEnum.md -docs/SubFormFieldsPerDocumentHyperlink.md -docs/SubFormFieldsPerDocumentInitials.md -docs/SubFormFieldsPerDocumentRadio.md -docs/SubFormFieldsPerDocumentSignature.md -docs/SubFormFieldsPerDocumentText.md -docs/SubFormFieldsPerDocumentTextMerge.md -docs/SubFormFieldsPerDocumentTypeEnum.md -docs/SubMergeField.md -docs/SubOAuth.md -docs/SubOptions.md -docs/SubSignatureRequestGroupedSigners.md -docs/SubSignatureRequestSigner.md -docs/SubSignatureRequestTemplateSigner.md -docs/SubSigningOptions.md -docs/SubTeamResponse.md -docs/SubTemplateRole.md -docs/SubUnclaimedDraftSigner.md -docs/SubUnclaimedDraftTemplateSigner.md -docs/SubWhiteLabelingOptions.md -docs/TeamAddMemberRequest.md -docs/TeamApi.md -docs/TeamCreateRequest.md -docs/TeamGetInfoResponse.md -docs/TeamGetResponse.md -docs/TeamInfoResponse.md -docs/TeamInviteResponse.md -docs/TeamInvitesResponse.md -docs/TeamMemberResponse.md -docs/TeamMembersResponse.md -docs/TeamParentResponse.md -docs/TeamRemoveMemberRequest.md -docs/TeamResponse.md -docs/TeamSubTeamsResponse.md -docs/TeamUpdateRequest.md -docs/TemplateAddUserRequest.md -docs/TemplateApi.md -docs/TemplateCreateEmbeddedDraftRequest.md -docs/TemplateCreateEmbeddedDraftResponse.md -docs/TemplateCreateEmbeddedDraftResponseTemplate.md -docs/TemplateCreateRequest.md -docs/TemplateCreateResponse.md -docs/TemplateCreateResponseTemplate.md -docs/TemplateEditResponse.md -docs/TemplateGetResponse.md -docs/TemplateListResponse.md -docs/TemplateRemoveUserRequest.md -docs/TemplateResponse.md -docs/TemplateResponseAccount.md -docs/TemplateResponseAccountQuota.md -docs/TemplateResponseCCRole.md -docs/TemplateResponseDocument.md -docs/TemplateResponseDocumentCustomFieldBase.md -docs/TemplateResponseDocumentCustomFieldCheckbox.md -docs/TemplateResponseDocumentCustomFieldText.md -docs/TemplateResponseDocumentFieldGroup.md -docs/TemplateResponseDocumentFieldGroupRule.md -docs/TemplateResponseDocumentFormFieldBase.md -docs/TemplateResponseDocumentFormFieldCheckbox.md -docs/TemplateResponseDocumentFormFieldDateSigned.md -docs/TemplateResponseDocumentFormFieldDropdown.md -docs/TemplateResponseDocumentFormFieldHyperlink.md -docs/TemplateResponseDocumentFormFieldInitials.md -docs/TemplateResponseDocumentFormFieldRadio.md -docs/TemplateResponseDocumentFormFieldSignature.md -docs/TemplateResponseDocumentFormFieldText.md -docs/TemplateResponseDocumentStaticFieldBase.md -docs/TemplateResponseDocumentStaticFieldCheckbox.md -docs/TemplateResponseDocumentStaticFieldDateSigned.md -docs/TemplateResponseDocumentStaticFieldDropdown.md -docs/TemplateResponseDocumentStaticFieldHyperlink.md -docs/TemplateResponseDocumentStaticFieldInitials.md -docs/TemplateResponseDocumentStaticFieldRadio.md -docs/TemplateResponseDocumentStaticFieldSignature.md -docs/TemplateResponseDocumentStaticFieldText.md -docs/TemplateResponseFieldAvgTextLength.md -docs/TemplateResponseSignerRole.md -docs/TemplateUpdateFilesRequest.md -docs/TemplateUpdateFilesResponse.md -docs/TemplateUpdateFilesResponseTemplate.md -docs/UnclaimedDraftApi.md -docs/UnclaimedDraftCreateEmbeddedRequest.md -docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md -docs/UnclaimedDraftCreateRequest.md -docs/UnclaimedDraftCreateResponse.md -docs/UnclaimedDraftEditAndResendRequest.md -docs/UnclaimedDraftResponse.md -docs/WarningResponse.md -dropbox_sign/__init__.py -dropbox_sign/api/__init__.py -dropbox_sign/api/account_api.py -dropbox_sign/api/api_app_api.py -dropbox_sign/api/bulk_send_job_api.py -dropbox_sign/api/embedded_api.py -dropbox_sign/api/o_auth_api.py -dropbox_sign/api/report_api.py -dropbox_sign/api/signature_request_api.py -dropbox_sign/api/team_api.py -dropbox_sign/api/template_api.py -dropbox_sign/api/unclaimed_draft_api.py -dropbox_sign/api_client.py -dropbox_sign/apis/__init__.py -dropbox_sign/configuration.py -dropbox_sign/event_callback_helper.py -dropbox_sign/exceptions.py -dropbox_sign/model/__init__.py -dropbox_sign/model/account_create_request.py -dropbox_sign/model/account_create_response.py -dropbox_sign/model/account_get_response.py -dropbox_sign/model/account_response.py -dropbox_sign/model/account_response_quotas.py -dropbox_sign/model/account_response_usage.py -dropbox_sign/model/account_update_request.py -dropbox_sign/model/account_verify_request.py -dropbox_sign/model/account_verify_response.py -dropbox_sign/model/account_verify_response_account.py -dropbox_sign/model/api_app_create_request.py -dropbox_sign/model/api_app_get_response.py -dropbox_sign/model/api_app_list_response.py -dropbox_sign/model/api_app_response.py -dropbox_sign/model/api_app_response_o_auth.py -dropbox_sign/model/api_app_response_options.py -dropbox_sign/model/api_app_response_owner_account.py -dropbox_sign/model/api_app_response_white_labeling_options.py -dropbox_sign/model/api_app_update_request.py -dropbox_sign/model/bulk_send_job_get_response.py -dropbox_sign/model/bulk_send_job_get_response_signature_requests.py -dropbox_sign/model/bulk_send_job_list_response.py -dropbox_sign/model/bulk_send_job_response.py -dropbox_sign/model/bulk_send_job_send_response.py -dropbox_sign/model/embedded_edit_url_request.py -dropbox_sign/model/embedded_edit_url_response.py -dropbox_sign/model/embedded_edit_url_response_embedded.py -dropbox_sign/model/embedded_sign_url_response.py -dropbox_sign/model/embedded_sign_url_response_embedded.py -dropbox_sign/model/error_response.py -dropbox_sign/model/error_response_error.py -dropbox_sign/model/event_callback_request.py -dropbox_sign/model/event_callback_request_event.py -dropbox_sign/model/event_callback_request_event_metadata.py -dropbox_sign/model/file_response.py -dropbox_sign/model/file_response_data_uri.py -dropbox_sign/model/list_info_response.py -dropbox_sign/model/o_auth_token_generate_request.py -dropbox_sign/model/o_auth_token_refresh_request.py -dropbox_sign/model/o_auth_token_response.py -dropbox_sign/model/report_create_request.py -dropbox_sign/model/report_create_response.py -dropbox_sign/model/report_response.py -dropbox_sign/model/signature_request_bulk_create_embedded_with_template_request.py -dropbox_sign/model/signature_request_bulk_send_with_template_request.py -dropbox_sign/model/signature_request_create_embedded_request.py -dropbox_sign/model/signature_request_create_embedded_with_template_request.py -dropbox_sign/model/signature_request_get_response.py -dropbox_sign/model/signature_request_list_response.py -dropbox_sign/model/signature_request_remind_request.py -dropbox_sign/model/signature_request_response.py -dropbox_sign/model/signature_request_response_attachment.py -dropbox_sign/model/signature_request_response_custom_field_base.py -dropbox_sign/model/signature_request_response_custom_field_checkbox.py -dropbox_sign/model/signature_request_response_custom_field_text.py -dropbox_sign/model/signature_request_response_custom_field_type_enum.py -dropbox_sign/model/signature_request_response_data_base.py -dropbox_sign/model/signature_request_response_data_type_enum.py -dropbox_sign/model/signature_request_response_data_value_checkbox.py -dropbox_sign/model/signature_request_response_data_value_checkbox_merge.py -dropbox_sign/model/signature_request_response_data_value_date_signed.py -dropbox_sign/model/signature_request_response_data_value_dropdown.py -dropbox_sign/model/signature_request_response_data_value_initials.py -dropbox_sign/model/signature_request_response_data_value_radio.py -dropbox_sign/model/signature_request_response_data_value_signature.py -dropbox_sign/model/signature_request_response_data_value_text.py -dropbox_sign/model/signature_request_response_data_value_text_merge.py -dropbox_sign/model/signature_request_response_signatures.py -dropbox_sign/model/signature_request_send_request.py -dropbox_sign/model/signature_request_send_with_template_request.py -dropbox_sign/model/signature_request_update_request.py -dropbox_sign/model/sub_attachment.py -dropbox_sign/model/sub_bulk_signer_list.py -dropbox_sign/model/sub_bulk_signer_list_custom_field.py -dropbox_sign/model/sub_cc.py -dropbox_sign/model/sub_custom_field.py -dropbox_sign/model/sub_editor_options.py -dropbox_sign/model/sub_field_options.py -dropbox_sign/model/sub_form_field_group.py -dropbox_sign/model/sub_form_field_rule.py -dropbox_sign/model/sub_form_field_rule_action.py -dropbox_sign/model/sub_form_field_rule_trigger.py -dropbox_sign/model/sub_form_fields_per_document_base.py -dropbox_sign/model/sub_form_fields_per_document_checkbox.py -dropbox_sign/model/sub_form_fields_per_document_checkbox_merge.py -dropbox_sign/model/sub_form_fields_per_document_date_signed.py -dropbox_sign/model/sub_form_fields_per_document_dropdown.py -dropbox_sign/model/sub_form_fields_per_document_font_enum.py -dropbox_sign/model/sub_form_fields_per_document_hyperlink.py -dropbox_sign/model/sub_form_fields_per_document_initials.py -dropbox_sign/model/sub_form_fields_per_document_radio.py -dropbox_sign/model/sub_form_fields_per_document_signature.py -dropbox_sign/model/sub_form_fields_per_document_text.py -dropbox_sign/model/sub_form_fields_per_document_text_merge.py -dropbox_sign/model/sub_form_fields_per_document_type_enum.py -dropbox_sign/model/sub_merge_field.py -dropbox_sign/model/sub_o_auth.py -dropbox_sign/model/sub_options.py -dropbox_sign/model/sub_signature_request_grouped_signers.py -dropbox_sign/model/sub_signature_request_signer.py -dropbox_sign/model/sub_signature_request_template_signer.py -dropbox_sign/model/sub_signing_options.py -dropbox_sign/model/sub_team_response.py -dropbox_sign/model/sub_template_role.py -dropbox_sign/model/sub_unclaimed_draft_signer.py -dropbox_sign/model/sub_unclaimed_draft_template_signer.py -dropbox_sign/model/sub_white_labeling_options.py -dropbox_sign/model/team_add_member_request.py -dropbox_sign/model/team_create_request.py -dropbox_sign/model/team_get_info_response.py -dropbox_sign/model/team_get_response.py -dropbox_sign/model/team_info_response.py -dropbox_sign/model/team_invite_response.py -dropbox_sign/model/team_invites_response.py -dropbox_sign/model/team_member_response.py -dropbox_sign/model/team_members_response.py -dropbox_sign/model/team_parent_response.py -dropbox_sign/model/team_remove_member_request.py -dropbox_sign/model/team_response.py -dropbox_sign/model/team_sub_teams_response.py -dropbox_sign/model/team_update_request.py -dropbox_sign/model/template_add_user_request.py -dropbox_sign/model/template_create_embedded_draft_request.py -dropbox_sign/model/template_create_embedded_draft_response.py -dropbox_sign/model/template_create_embedded_draft_response_template.py -dropbox_sign/model/template_create_request.py -dropbox_sign/model/template_create_response.py -dropbox_sign/model/template_create_response_template.py -dropbox_sign/model/template_edit_response.py -dropbox_sign/model/template_get_response.py -dropbox_sign/model/template_list_response.py -dropbox_sign/model/template_remove_user_request.py -dropbox_sign/model/template_response.py -dropbox_sign/model/template_response_account.py -dropbox_sign/model/template_response_account_quota.py -dropbox_sign/model/template_response_cc_role.py -dropbox_sign/model/template_response_document.py -dropbox_sign/model/template_response_document_custom_field_base.py -dropbox_sign/model/template_response_document_custom_field_checkbox.py -dropbox_sign/model/template_response_document_custom_field_text.py -dropbox_sign/model/template_response_document_field_group.py -dropbox_sign/model/template_response_document_field_group_rule.py -dropbox_sign/model/template_response_document_form_field_base.py -dropbox_sign/model/template_response_document_form_field_checkbox.py -dropbox_sign/model/template_response_document_form_field_date_signed.py -dropbox_sign/model/template_response_document_form_field_dropdown.py -dropbox_sign/model/template_response_document_form_field_hyperlink.py -dropbox_sign/model/template_response_document_form_field_initials.py -dropbox_sign/model/template_response_document_form_field_radio.py -dropbox_sign/model/template_response_document_form_field_signature.py -dropbox_sign/model/template_response_document_form_field_text.py -dropbox_sign/model/template_response_document_static_field_base.py -dropbox_sign/model/template_response_document_static_field_checkbox.py -dropbox_sign/model/template_response_document_static_field_date_signed.py -dropbox_sign/model/template_response_document_static_field_dropdown.py -dropbox_sign/model/template_response_document_static_field_hyperlink.py -dropbox_sign/model/template_response_document_static_field_initials.py -dropbox_sign/model/template_response_document_static_field_radio.py -dropbox_sign/model/template_response_document_static_field_signature.py -dropbox_sign/model/template_response_document_static_field_text.py -dropbox_sign/model/template_response_field_avg_text_length.py -dropbox_sign/model/template_response_signer_role.py -dropbox_sign/model/template_update_files_request.py -dropbox_sign/model/template_update_files_response.py -dropbox_sign/model/template_update_files_response_template.py -dropbox_sign/model/unclaimed_draft_create_embedded_request.py -dropbox_sign/model/unclaimed_draft_create_embedded_with_template_request.py -dropbox_sign/model/unclaimed_draft_create_request.py -dropbox_sign/model/unclaimed_draft_create_response.py -dropbox_sign/model/unclaimed_draft_edit_and_resend_request.py -dropbox_sign/model/unclaimed_draft_response.py -dropbox_sign/model/warning_response.py -dropbox_sign/model_utils.py -dropbox_sign/models/__init__.py -dropbox_sign/rest.py -requirements.txt -setup.cfg -setup.py -test-requirements.txt -tox.ini diff --git a/sdks/python/.openapi-generator/VERSION b/sdks/python/.openapi-generator/VERSION deleted file mode 100644 index e230c8396..000000000 --- a/sdks/python/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.3.0 \ No newline at end of file diff --git a/sdks/python/.travis.yml b/sdks/python/.travis.yml index c40c84527..6b47ff20f 100644 --- a/sdks/python/.travis.yml +++ b/sdks/python/.travis.yml @@ -1,10 +1,14 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.6" - "3.7" - "3.8" - "3.9" + - "3.10" + - "3.11" + # uncomment the following if needed + #- "3.11-dev" # 3.11 development branch + #- "nightly" # nightly build # command to install dependencies install: - "pip install -r requirements.txt" diff --git a/sdks/python/LICENSE b/sdks/python/LICENSE deleted file mode 100644 index 4025343d0..000000000 --- a/sdks/python/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (C) 2023 dropbox.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/sdks/python/README.md b/sdks/python/README.md index b2233372c..8d7552d8c 100644 --- a/sdks/python/README.md +++ b/sdks/python/README.md @@ -1,5 +1,4 @@ # dropbox-sign - Dropbox Sign v3 API ## Migrating from legacy SDK @@ -43,14 +42,14 @@ this command. ### Requirements. -Python >=3.7 +Python 3.7+ ### pip Install using `pip`: ```shell -python3 -m pip install dropbox-sign==1.5-dev +python3 -m pip install dropbox-sign==1.6-dev ``` Alternatively: @@ -103,8 +102,8 @@ with ApiClient(configuration) as api_client: All URIs are relative to *https://api.hellosign.com/v3* -|Class | Method | HTTP request | Description| -|------------ | ------------- | ------------- | -------------| +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- |```AccountApi``` | [```account_create```](docs/AccountApi.md#account_create) | ```POST /account/create``` | Create Account| ```AccountApi``` | [```account_get```](docs/AccountApi.md#account_get) | ```GET /account``` | Get Account| ```AccountApi``` | [```account_update```](docs/AccountApi.md#account_update) | ```PUT /account``` | Update Account| @@ -118,6 +117,13 @@ All URIs are relative to *https://api.hellosign.com/v3* ```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| +|```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| +```FaxLineApi``` | [```fax_line_delete```](docs/FaxLineApi.md#fax_line_delete) | ```DELETE /fax_line``` | Delete Fax Line| +```FaxLineApi``` | [```fax_line_get```](docs/FaxLineApi.md#fax_line_get) | ```GET /fax_line``` | Get Fax Line| +```FaxLineApi``` | [```fax_line_list```](docs/FaxLineApi.md#fax_line_list) | ```GET /fax_line/list``` | List Fax Lines| +```FaxLineApi``` | [```fax_line_remove_user```](docs/FaxLineApi.md#fax_line_remove_user) | ```PUT /fax_line/remove_user``` | Remove Fax Line Access| |```OAuthApi``` | [```oauth_token_generate```](docs/OAuthApi.md#oauth_token_generate) | ```POST /oauth/token``` | OAuth Token Generate| ```OAuthApi``` | [```oauth_token_refresh```](docs/OAuthApi.md#oauth_token_refresh) | ```POST /oauth/token?refresh``` | OAuth Token Refresh| |```ReportApi``` | [```report_create```](docs/ReportApi.md#report_create) | ```POST /report/create``` | Create Report| @@ -200,6 +206,17 @@ All URIs are relative to *https://api.hellosign.com/v3* - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) + - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) + - [FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) + - [FaxLineAreaCodeGetResponse](docs/FaxLineAreaCodeGetResponse.md) + - [FaxLineAreaCodeGetStateEnum](docs/FaxLineAreaCodeGetStateEnum.md) + - [FaxLineCreateRequest](docs/FaxLineCreateRequest.md) + - [FaxLineDeleteRequest](docs/FaxLineDeleteRequest.md) + - [FaxLineListResponse](docs/FaxLineListResponse.md) + - [FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) + - [FaxLineResponse](docs/FaxLineResponse.md) + - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) @@ -340,15 +357,18 @@ All URIs are relative to *https://api.hellosign.com/v3* - [WarningResponse](docs/WarningResponse.md) + ## Documentation For Authorization -## api_key +Authentication schemes defined for the API: + +### api_key - **Type**: HTTP basic authentication - -## oauth2 + +### oauth2 - **Type**: Bearer authentication (JWT) @@ -363,6 +383,6 @@ apisupport@hellosign.com This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 3.0.0 -- Package version: 1.5-dev +- Package version: 1.6-dev - Build package: org.openapitools.codegen.languages.PythonClientCodegen diff --git a/sdks/python/VERSION b/sdks/python/VERSION index 6f3dd2f48..78ca9a102 100644 --- a/sdks/python/VERSION +++ b/sdks/python/VERSION @@ -1 +1 @@ -1.5-dev +1.6-dev diff --git a/sdks/python/bin/replace b/sdks/python/bin/replace index c5886eb11..a9ebab9a7 100755 --- a/sdks/python/bin/replace +++ b/sdks/python/bin/replace @@ -10,7 +10,6 @@ rep () { REPLACE_STRING=$2 SCAN_DIRS=( \ "docs" \ - "dropbox_sign/model" \ "dropbox_sign/models" \ ) @@ -24,42 +23,6 @@ rep () { done } -perl -pi -e 's/(.*)AllOf.md\)\n//g' "${ROOT_DIR}/README.md" +rep 'Union\[StrictBytes, StrictStr\]' 'Union[StrictBytes, StrictStr, io.IOBase]' -rep '([^\\r\n]+?)from (.*)_all_of import (.*)\n' '' -rep 'from (.*)_all_of import (.*)\n' '' -rep "\s+globals\(\)\['[a-zA-Z]+AllOf(.*)\n" '' - -# def bulk_send_job_id(self) -> str, none_type: -# def bulk_send_job_id(self) -> Optional[str]: -rep 'def ([a-zA-Z_]+)\(self\) -> (.*), none_type:' 'def $1(self) -> Optional[$2]:' - -# def bulk_send_job_id(self, value: str, none_type): -# def bulk_send_job_id(self, value: Optional[str]): -rep 'def ([a-zA-Z_]+)\(self, value: (.*), none_type\):' 'def $1(self, value: Optional[$2]):' - -# def bulk_send_jobs(self) -> [BulkSendJobResponse]: -# def bulk_send_jobs(self) -> List[BulkSendJobResponse]: -rep 'def ([a-zA-Z_]+)\(self\) -> \[(.*)\]:' 'def $1(self) -> List[$2]:' - -# def bulk_send_jobs(self, value: [BulkSendJobResponse]): -# def bulk_send_jobs(self, value: List[BulkSendJobResponse]): -rep 'def ([a-zA-Z_]+)\(self, value: \[(.*)\]\):' 'def $1(self, value: List[$2]):' - -# def template_ids(self) -> Optional[[str]]: -# def template_ids(self) -> Optional[List[str]]: -rep 'def ([a-zA-Z_]+)\(self\) -> ([a-zA-Z]+)\[\[(.*)\]\]:' 'def $1(self) -> $2\[List[$3]]:' - -# def template_ids(self, value: Optional[[str]]): -# def template_ids(self, value: Optional[List[str]]): -rep 'def ([a-zA-Z_]+)\(self, value: ([a-zA-Z]+)\[\[(.*)\]\]\):' 'def $1(self, value: $2\[List[$3]]):' - -# def metadata(self) -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)}: -# def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: -rep 'def ([a-zA-Z_]+)\(self\) -> \{([a-zA-Z]+): \((.*)\)\}:' 'def $1(self) -> Dict[$2, Union[$3]]:' - -# def metadata(self, value: {str: (bool, date, datetime, dict, float, int, list, str, none_type)}): -# def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): -rep 'def ([a-zA-Z_]+)\(self\, value: \{([a-zA-Z]+): \((.*)\)\}\):' 'def $1(self, value: Dict[$2, Union[$3]]):' - -printf "\n" \ No newline at end of file +printf "\n" diff --git a/sdks/python/bin/scan_for b/sdks/python/bin/scan_for index d98afe8af..cb16e0a01 100755 --- a/sdks/python/bin/scan_for +++ b/sdks/python/bin/scan_for @@ -9,7 +9,6 @@ scan_for () { SEARCH_STRING=$1 SCAN_TARGETS=( \ "docs" \ - "dropbox_sign/model" \ "dropbox_sign/models" \ "README.md" ) diff --git a/sdks/python/docs/AccountApi.md b/sdks/python/docs/AccountApi.md index 4622cea01..77358441b 100644 --- a/sdks/python/docs/AccountApi.md +++ b/sdks/python/docs/AccountApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```account_create```](AccountApi.md#account_create) | ```POST /account/create``` | Create Account| |[```account_get```](AccountApi.md#account_get) | ```GET /account``` | Get Account| |[```account_update```](AccountApi.md#account_update) | ```PUT /account``` | Update Account| @@ -50,10 +50,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_create_request` | [**AccountCreateRequest**](AccountCreateRequest.md) | | | @@ -71,7 +70,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -117,10 +115,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_id` | **str** | `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. | [optional] | @@ -139,7 +136,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -189,10 +185,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_update_request` | [**AccountUpdateRequest**](AccountUpdateRequest.md) | | | @@ -210,7 +205,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -260,10 +254,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_verify_request` | [**AccountVerifyRequest**](AccountVerifyRequest.md) | | | @@ -281,7 +274,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/docs/AccountCreateRequest.md b/sdks/python/docs/AccountCreateRequest.md index 6a2c3497a..a804661a3 100644 --- a/sdks/python/docs/AccountCreateRequest.md +++ b/sdks/python/docs/AccountCreateRequest.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address`*_required_ | ```str``` | The email address which will be associated with the new Account. | | | `client_id` | ```str``` | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | | | `client_secret` | ```str``` | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | | | `locale` | ```str``` | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | | - [[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/AccountCreateResponse.md b/sdks/python/docs/AccountCreateResponse.md index 7e6fcca4e..9b1be1204 100644 --- a/sdks/python/docs/AccountCreateResponse.md +++ b/sdks/python/docs/AccountCreateResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `account` | [```AccountResponse```](AccountResponse.md) | | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `oauth_data` | [```OAuthTokenResponse```](OAuthTokenResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +| `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/AccountGetResponse.md b/sdks/python/docs/AccountGetResponse.md index 336716629..0c1254038 100644 --- a/sdks/python/docs/AccountGetResponse.md +++ b/sdks/python/docs/AccountGetResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `account` | [```AccountResponse```](AccountResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `account`*_required_ | [```AccountResponse```](AccountResponse.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/AccountResponse.md b/sdks/python/docs/AccountResponse.md index cf5552679..26ce76bd1 100644 --- a/sdks/python/docs/AccountResponse.md +++ b/sdks/python/docs/AccountResponse.md @@ -3,22 +3,19 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | The ID of the Account | | | `email_address` | ```str``` | The email address associated with the Account. | | | `is_locked` | ```bool``` | Returns `true` if the user has been locked out of their account by a team admin. | | | `is_paid_hs` | ```bool``` | Returns `true` if the user has a paid Dropbox Sign account. | | | `is_paid_hf` | ```bool``` | Returns `true` if the user has a paid HelloFax account. | | | `quotas` | [```AccountResponseQuotas```](AccountResponseQuotas.md) | | | -| `callback_url` | ```str, none_type``` | The URL that Dropbox Sign events will `POST` to. | | -| `role_code` | ```str, none_type``` | The membership role for the team. | | -| `team_id` | ```str, none_type``` | The id of the team account belongs to. | | -| `locale` | ```str, none_type``` | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | | +| `callback_url` | ```str``` | The URL that Dropbox Sign events will `POST` to. | | +| `role_code` | ```str``` | The membership role for the team. | | +| `team_id` | ```str``` | The id of the team account belongs to. | | +| `locale` | ```str``` | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | | | `usage` | [```AccountResponseUsage```](AccountResponseUsage.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/AccountResponseQuotas.md b/sdks/python/docs/AccountResponseQuotas.md index bdf6974d4..740ad2357 100644 --- a/sdks/python/docs/AccountResponseQuotas.md +++ b/sdks/python/docs/AccountResponseQuotas.md @@ -3,17 +3,14 @@ Details concerning remaining monthly quotas. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `api_signature_requests_left` | ```int, none_type``` | API signature requests remaining. | | -| `documents_left` | ```int, none_type``` | Signature requests remaining. | | -| `templates_total` | ```int, none_type``` | Total API templates allowed. | | -| `templates_left` | ```int, none_type``` | API templates remaining. | | -| `sms_verifications_left` | ```int, none_type``` | SMS verifications remaining. | | -| `num_fax_pages_left` | ```int, none_type``` | Number of fax pages left | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `api_signature_requests_left` | ```int``` | API signature requests remaining. | | +| `documents_left` | ```int``` | Signature requests remaining. | | +| `templates_total` | ```int``` | Total API templates allowed. | | +| `templates_left` | ```int``` | API templates remaining. | | +| `sms_verifications_left` | ```int``` | SMS verifications remaining. | | +| `num_fax_pages_left` | ```int``` | Number of fax pages left | | [[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/AccountResponseUsage.md b/sdks/python/docs/AccountResponseUsage.md index e6e51d2bc..dd99429af 100644 --- a/sdks/python/docs/AccountResponseUsage.md +++ b/sdks/python/docs/AccountResponseUsage.md @@ -3,12 +3,9 @@ Details concerning monthly usage ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `fax_pages_sent` | ```int, none_type``` | Number of fax pages sent | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_pages_sent` | ```int``` | Number of fax pages sent | | [[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/AccountUpdateRequest.md b/sdks/python/docs/AccountUpdateRequest.md index 0d76f5c75..5ef47ebd9 100644 --- a/sdks/python/docs/AccountUpdateRequest.md +++ b/sdks/python/docs/AccountUpdateRequest.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `account_id` | ```str, none_type``` | The ID of the Account | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `account_id` | ```str``` | The ID of the Account | | | `callback_url` | ```str``` | The URL that Dropbox Sign should POST events to. | | | `locale` | ```str``` | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | | - [[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/AccountVerifyRequest.md b/sdks/python/docs/AccountVerifyRequest.md index 946859eb5..9dc6f46d5 100644 --- a/sdks/python/docs/AccountVerifyRequest.md +++ b/sdks/python/docs/AccountVerifyRequest.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address`*_required_ | ```str``` | Email address to run the verification for. | | - [[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/AccountVerifyResponse.md b/sdks/python/docs/AccountVerifyResponse.md index cde5fdd7e..2f0c5416b 100644 --- a/sdks/python/docs/AccountVerifyResponse.md +++ b/sdks/python/docs/AccountVerifyResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account` | [```AccountVerifyResponseAccount```](AccountVerifyResponseAccount.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +| `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/AccountVerifyResponseAccount.md b/sdks/python/docs/AccountVerifyResponseAccount.md index b9359ab78..9c4abee31 100644 --- a/sdks/python/docs/AccountVerifyResponseAccount.md +++ b/sdks/python/docs/AccountVerifyResponseAccount.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address` | ```str``` | The email address associated with the Account. | | - [[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/ApiAppApi.md b/sdks/python/docs/ApiAppApi.md index 7453340b3..024551288 100644 --- a/sdks/python/docs/ApiAppApi.md +++ b/sdks/python/docs/ApiAppApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```api_app_create```](ApiAppApi.md#api_app_create) | ```POST /api_app``` | Create API App| |[```api_app_delete```](ApiAppApi.md#api_app_delete) | ```DELETE /api_app/{client_id}``` | Delete API App| |[```api_app_get```](ApiAppApi.md#api_app_get) | ```GET /api_app/{client_id}``` | Get API App| @@ -67,10 +67,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `api_app_create_request` | [**ApiAppCreateRequest**](ApiAppCreateRequest.md) | | | @@ -88,7 +87,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -133,10 +131,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `client_id` | **str** | The client id of the API App to delete. | | @@ -154,7 +151,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -202,10 +198,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `client_id` | **str** | The client id of the API App to retrieve. | | @@ -223,7 +218,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -275,10 +269,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `page` | **int** | Which page number of the API App List to return. Defaults to `1`. | [optional][default to 1] | @@ -297,7 +290,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -359,10 +351,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `client_id` | **str** | The client id of the API App to update. | | @@ -381,7 +372,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/docs/ApiAppCreateRequest.md b/sdks/python/docs/ApiAppCreateRequest.md index 4e9fe09f5..9cac62afc 100644 --- a/sdks/python/docs/ApiAppCreateRequest.md +++ b/sdks/python/docs/ApiAppCreateRequest.md @@ -3,18 +3,15 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `domains`*_required_ | ```[str]``` | The domain names the ApiApp will be associated with. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `domains`*_required_ | ```List[str]``` | The domain names the ApiApp will be associated with. | | | `name`*_required_ | ```str``` | The name you want to assign to the ApiApp. | | | `callback_url` | ```str``` | The URL at which the ApiApp should receive event callbacks. | | -| `custom_logo_file` | ```file_type``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | +| `custom_logo_file` | ```io.IOBase``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | | `oauth` | [```SubOAuth```](SubOAuth.md) | | | | `options` | [```SubOptions```](SubOptions.md) | | | | `white_labeling_options` | [```SubWhiteLabelingOptions```](SubWhiteLabelingOptions.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/ApiAppGetResponse.md b/sdks/python/docs/ApiAppGetResponse.md index fabf32fe0..7d45c86fe 100644 --- a/sdks/python/docs/ApiAppGetResponse.md +++ b/sdks/python/docs/ApiAppGetResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `api_app` | [```ApiAppResponse```](ApiAppResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `api_app`*_required_ | [```ApiAppResponse```](ApiAppResponse.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/ApiAppListResponse.md b/sdks/python/docs/ApiAppListResponse.md index 964bcbc22..b41af4e62 100644 --- a/sdks/python/docs/ApiAppListResponse.md +++ b/sdks/python/docs/ApiAppListResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `api_apps` | [```[ApiAppResponse]```](ApiAppResponse.md) | Contains information about API Apps. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `api_apps`*_required_ | [```List[ApiAppResponse]```](ApiAppResponse.md) | Contains information about API Apps. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.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/ApiAppResponse.md b/sdks/python/docs/ApiAppResponse.md index 5a7a14f99..ae25a38c4 100644 --- a/sdks/python/docs/ApiAppResponse.md +++ b/sdks/python/docs/ApiAppResponse.md @@ -3,13 +3,12 @@ Contains information about an API App. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `callback_url` | ```str, none_type``` | The app's callback URL (for events) | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `callback_url` | ```str``` | The app's callback URL (for events) | | | `client_id` | ```str``` | The app's client id | | | `created_at` | ```int``` | The time that the app was created | | -| `domains` | ```[str]``` | The domain name(s) associated with the app | | +| `domains` | ```List[str]``` | The domain name(s) associated with the app | | | `name` | ```str``` | The name of the app | | | `is_approved` | ```bool``` | Boolean to indicate if the app has been approved | | | `oauth` | [```ApiAppResponseOAuth```](ApiAppResponseOAuth.md) | | | @@ -17,7 +16,5 @@ Contains information about an API App. | `owner_account` | [```ApiAppResponseOwnerAccount```](ApiAppResponseOwnerAccount.md) | | | | `white_labeling_options` | [```ApiAppResponseWhiteLabelingOptions```](ApiAppResponseWhiteLabelingOptions.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/ApiAppResponseOAuth.md b/sdks/python/docs/ApiAppResponseOAuth.md index 2f3f281be..0c18e5f1e 100644 --- a/sdks/python/docs/ApiAppResponseOAuth.md +++ b/sdks/python/docs/ApiAppResponseOAuth.md @@ -3,15 +3,12 @@ An object describing the app's OAuth properties, or null if OAuth is not configured for the app. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `callback_url` | ```str``` | The app's OAuth callback URL. | | | `secret` | ```str``` | The app's OAuth secret, or null if the app does not belong to user. | | -| `scopes` | ```[str]``` | Array of OAuth scopes used by the app. | | +| `scopes` | ```List[str]``` | Array of OAuth scopes used by the app. | | | `charges_users` | ```bool``` | Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. | | - [[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/ApiAppResponseOptions.md b/sdks/python/docs/ApiAppResponseOptions.md index d97398f10..42f8144e5 100644 --- a/sdks/python/docs/ApiAppResponseOptions.md +++ b/sdks/python/docs/ApiAppResponseOptions.md @@ -3,12 +3,9 @@ An object with options that override account settings. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `can_insert_everywhere` | ```bool``` | Boolean denoting if signers can "Insert Everywhere" in one click while signing a document | | - [[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/ApiAppResponseOwnerAccount.md b/sdks/python/docs/ApiAppResponseOwnerAccount.md index a15eaa278..9b8e22f08 100644 --- a/sdks/python/docs/ApiAppResponseOwnerAccount.md +++ b/sdks/python/docs/ApiAppResponseOwnerAccount.md @@ -3,13 +3,10 @@ An object describing the app's owner ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | The owner account's ID | | | `email_address` | ```str``` | The owner account's email address | | - [[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/ApiAppResponseWhiteLabelingOptions.md b/sdks/python/docs/ApiAppResponseWhiteLabelingOptions.md index eca248444..375c8f2cf 100644 --- a/sdks/python/docs/ApiAppResponseWhiteLabelingOptions.md +++ b/sdks/python/docs/ApiAppResponseWhiteLabelingOptions.md @@ -3,9 +3,8 @@ An object with options to customize the app's signer page ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `header_background_color` | ```str``` | | | | `legal_version` | ```str``` | | | | `link_color` | ```str``` | | | @@ -21,7 +20,5 @@ An object with options to customize the app's signer page | `text_color1` | ```str``` | | | | `text_color2` | ```str``` | | | - [[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/ApiAppUpdateRequest.md b/sdks/python/docs/ApiAppUpdateRequest.md index e2cfaf79e..6e3238a61 100644 --- a/sdks/python/docs/ApiAppUpdateRequest.md +++ b/sdks/python/docs/ApiAppUpdateRequest.md @@ -3,18 +3,15 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `callback_url` | ```str``` | The URL at which the API App should receive event callbacks. | | -| `custom_logo_file` | ```file_type``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | -| `domains` | ```[str]``` | The domain names the ApiApp will be associated with. | | +| `custom_logo_file` | ```io.IOBase``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | +| `domains` | ```List[str]``` | The domain names the ApiApp will be associated with. | | | `name` | ```str``` | The name you want to assign to the ApiApp. | | | `oauth` | [```SubOAuth```](SubOAuth.md) | | | | `options` | [```SubOptions```](SubOptions.md) | | | | `white_labeling_options` | [```SubWhiteLabelingOptions```](SubWhiteLabelingOptions.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/BulkSendJobApi.md b/sdks/python/docs/BulkSendJobApi.md index ef5f43791..fce689b6a 100644 --- a/sdks/python/docs/BulkSendJobApi.md +++ b/sdks/python/docs/BulkSendJobApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```bulk_send_job_get```](BulkSendJobApi.md#bulk_send_job_get) | ```GET /bulk_send_job/{bulk_send_job_id}``` | Get Bulk Send Job| |[```bulk_send_job_list```](BulkSendJobApi.md#bulk_send_job_list) | ```GET /bulk_send_job/list``` | List Bulk Send Jobs| @@ -46,10 +46,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `bulk_send_job_id` | **str** | The id of the BulkSendJob to retrieve. | | @@ -69,7 +68,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -121,10 +119,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `page` | **int** | Which page number of the BulkSendJob List to return. Defaults to `1`. | [optional][default to 1] | @@ -143,7 +140,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/docs/BulkSendJobGetResponse.md b/sdks/python/docs/BulkSendJobGetResponse.md index 3718a3973..a39bcb8bb 100644 --- a/sdks/python/docs/BulkSendJobGetResponse.md +++ b/sdks/python/docs/BulkSendJobGetResponse.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `bulk_send_job` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `signature_requests` | [```[BulkSendJobGetResponseSignatureRequests]```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `bulk_send_job`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `signature_requests`*_required_ | [```List[BulkSendJobGetResponseSignatureRequests]```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | +| `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/BulkSendJobGetResponseSignatureRequests.md b/sdks/python/docs/BulkSendJobGetResponseSignatureRequests.md index 660eb8134..d213ed914 100644 --- a/sdks/python/docs/BulkSendJobGetResponseSignatureRequests.md +++ b/sdks/python/docs/BulkSendJobGetResponseSignatureRequests.md @@ -3,36 +3,33 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `test_mode` | ```bool, none_type``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [default to False] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `test_mode` | ```bool``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [default to False] | | `signature_request_id` | ```str``` | The id of the SignatureRequest. | | | `requester_email_address` | ```str``` | The email address of the initiator of the SignatureRequest. | | | `title` | ```str``` | The title the specified Account uses for the SignatureRequest. | | | `original_title` | ```str``` | Default Label for account. | | -| `subject` | ```str, none_type``` | The subject in the email that was initially sent to the signers. | | -| `message` | ```str, none_type``` | The custom message in the email that was initially sent to the signers. | | -| `metadata` | [```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}```](.md) | The metadata attached to the signature request. | | +| `subject` | ```str``` | The subject in the email that was initially sent to the signers. | | +| `message` | ```str``` | The custom message in the email that was initially sent to the signers. | | +| `metadata` | ```object``` | The metadata attached to the signature request. | | | `created_at` | ```int``` | Time the signature request was created. | | | `expires_at` | ```int``` | The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | | `is_complete` | ```bool``` | Whether or not the SignatureRequest has been fully executed by all signers. | | | `is_declined` | ```bool``` | Whether or not the SignatureRequest has been declined by a signer. | | | `has_error` | ```bool``` | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | | | `files_url` | ```str``` | The URL where a copy of the request's documents can be downloaded. | | -| `signing_url` | ```str, none_type``` | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | | +| `signing_url` | ```str``` | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | | | `details_url` | ```str``` | The URL where the requester and the signers can view the current status of the SignatureRequest. | | -| `cc_email_addresses` | ```[str]``` | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | | -| `signing_redirect_url` | ```str, none_type``` | The URL you want the signer redirected to after they successfully sign. | | -| `final_copy_uri` | ```str, none_type``` | The path where the completed document can be downloaded | | -| `template_ids` | ```[str], none_type``` | Templates IDs used in this SignatureRequest (if any). | | -| `custom_fields` | [```[SignatureRequestResponseCustomFieldBase], none_type```](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | | -| `attachments` | [```[SignatureRequestResponseAttachment], none_type```](SignatureRequestResponseAttachment.md) | Signer attachments. | | -| `response_data` | [```[SignatureRequestResponseDataBase], none_type```](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | | -| `signatures` | [```[SignatureRequestResponseSignatures]```](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | | +| `cc_email_addresses` | ```List[str]``` | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | | +| `signing_redirect_url` | ```str``` | The URL you want the signer redirected to after they successfully sign. | | +| `final_copy_uri` | ```str``` | The path where the completed document can be downloaded | | +| `template_ids` | ```List[str]``` | Templates IDs used in this SignatureRequest (if any). | | +| `custom_fields` | [```List[SignatureRequestResponseCustomFieldBase]```](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | | +| `attachments` | [```List[SignatureRequestResponseAttachment]```](SignatureRequestResponseAttachment.md) | Signer attachments. | | +| `response_data` | [```List[SignatureRequestResponseDataBase]```](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | | +| `signatures` | [```List[SignatureRequestResponseSignatures]```](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | | | `bulk_send_job_id` | ```str``` | The id of the BulkSendJob. | | - [[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/BulkSendJobListResponse.md b/sdks/python/docs/BulkSendJobListResponse.md index ef64fd8aa..24c7abc17 100644 --- a/sdks/python/docs/BulkSendJobListResponse.md +++ b/sdks/python/docs/BulkSendJobListResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `bulk_send_jobs` | [```[BulkSendJobResponse]```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `bulk_send_jobs`*_required_ | [```List[BulkSendJobResponse]```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.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/BulkSendJobResponse.md b/sdks/python/docs/BulkSendJobResponse.md index eca78a4c0..19e770fee 100644 --- a/sdks/python/docs/BulkSendJobResponse.md +++ b/sdks/python/docs/BulkSendJobResponse.md @@ -3,15 +3,12 @@ Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `bulk_send_job_id` | ```str, none_type``` | The id of the BulkSendJob. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `bulk_send_job_id` | ```str``` | The id of the BulkSendJob. | | | `total` | ```int``` | The total amount of Signature Requests queued for sending. | | | `is_creator` | ```bool``` | True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. | | | `created_at` | ```int``` | Time that the BulkSendJob was created. | | - [[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/BulkSendJobSendResponse.md b/sdks/python/docs/BulkSendJobSendResponse.md index 2dd2d47b7..cf31a577a 100644 --- a/sdks/python/docs/BulkSendJobSendResponse.md +++ b/sdks/python/docs/BulkSendJobSendResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `bulk_send_job` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `bulk_send_job`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.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/EmbeddedApi.md b/sdks/python/docs/EmbeddedApi.md index 3c53b0254..c581d1470 100644 --- a/sdks/python/docs/EmbeddedApi.md +++ b/sdks/python/docs/EmbeddedApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```embedded_edit_url```](EmbeddedApi.md#embedded_edit_url) | ```POST /embedded/edit_url/{template_id}``` | Get Embedded Template Edit URL| |[```embedded_sign_url```](EmbeddedApi.md#embedded_sign_url) | ```GET /embedded/sign_url/{signature_id}``` | Get Embedded Sign URL| @@ -51,10 +51,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the template to edit. | | @@ -73,7 +72,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -121,10 +119,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_id` | **str** | The id of the signature to get a signature url for. | | @@ -142,7 +139,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/docs/EmbeddedEditUrlRequest.md b/sdks/python/docs/EmbeddedEditUrlRequest.md index 47d4284f3..6382a52ea 100644 --- a/sdks/python/docs/EmbeddedEditUrlRequest.md +++ b/sdks/python/docs/EmbeddedEditUrlRequest.md @@ -3,21 +3,18 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `allow_edit_ccs` | ```bool``` | This allows the requester to enable/disable to add or change CC roles when editing the template. | [default to False] | -| `cc_roles` | ```[str]``` | The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. | | +| `cc_roles` | ```List[str]``` | The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. | | | `editor_options` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `force_signer_roles` | ```bool``` | Provide users the ability to review/edit the template signer roles. | [default to False] | | `force_subject_message` | ```bool``` | Provide users the ability to review/edit the template subject and message. | [default to False] | -| `merge_fields` | [```[SubMergeField]```](SubMergeField.md) | Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template.

Remove all merge fields on the template by passing an empty array `[]`. | | +| `merge_fields` | [```List[SubMergeField]```](SubMergeField.md) | Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template.

Remove all merge fields on the template by passing an empty array `[]`. | | | `preview_only` | ```bool``` | This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor).

**NOTE:** This parameter overwrites `show_preview=true` (if set). | [default to False] | | `show_preview` | ```bool``` | This allows the requester to enable the editor/preview experience. | [default to False] | | `show_progress_stepper` | ```bool``` | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [default to True] | | `test_mode` | ```bool``` | Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/EmbeddedEditUrlResponse.md b/sdks/python/docs/EmbeddedEditUrlResponse.md index aef313bf1..e1f57817d 100644 --- a/sdks/python/docs/EmbeddedEditUrlResponse.md +++ b/sdks/python/docs/EmbeddedEditUrlResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `embedded` | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `embedded`*_required_ | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.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/EmbeddedEditUrlResponseEmbedded.md b/sdks/python/docs/EmbeddedEditUrlResponseEmbedded.md index e00f6751c..ae396873f 100644 --- a/sdks/python/docs/EmbeddedEditUrlResponseEmbedded.md +++ b/sdks/python/docs/EmbeddedEditUrlResponseEmbedded.md @@ -3,13 +3,10 @@ An embedded template object. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `edit_url` | ```str``` | A template url that can be opened in an iFrame. | | | `expires_at` | ```int``` | The specific time that the the `edit_url` link expires, in epoch. | | - [[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/EmbeddedSignUrlResponse.md b/sdks/python/docs/EmbeddedSignUrlResponse.md index 307dc7dbe..af38fc763 100644 --- a/sdks/python/docs/EmbeddedSignUrlResponse.md +++ b/sdks/python/docs/EmbeddedSignUrlResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `embedded` | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `embedded`*_required_ | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.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/EmbeddedSignUrlResponseEmbedded.md b/sdks/python/docs/EmbeddedSignUrlResponseEmbedded.md index 098e46cf8..71373c8e0 100644 --- a/sdks/python/docs/EmbeddedSignUrlResponseEmbedded.md +++ b/sdks/python/docs/EmbeddedSignUrlResponseEmbedded.md @@ -3,13 +3,10 @@ An object that contains necessary information to set up embedded signing. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `sign_url` | ```str``` | A signature url that can be opened in an iFrame. | | | `expires_at` | ```int``` | The specific time that the the `sign_url` link expires, in epoch. | | - [[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/ErrorResponse.md b/sdks/python/docs/ErrorResponse.md index 9235a71c0..dc83b8f7c 100644 --- a/sdks/python/docs/ErrorResponse.md +++ b/sdks/python/docs/ErrorResponse.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `error`*_required_ | [```ErrorResponseError```](ErrorResponseError.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/ErrorResponseError.md b/sdks/python/docs/ErrorResponseError.md index d686a1f8f..9b0589046 100644 --- a/sdks/python/docs/ErrorResponseError.md +++ b/sdks/python/docs/ErrorResponseError.md @@ -3,14 +3,11 @@ Contains information about an error that occurred. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `error_msg`*_required_ | ```str``` | Message describing an error. | | | `error_name`*_required_ | ```str``` | Name of the error. | | | `error_path` | ```str``` | Path at which an error occurred. | | - [[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/EventCallbackRequest.md b/sdks/python/docs/EventCallbackRequest.md index 6e3f73ade..857fac582 100644 --- a/sdks/python/docs/EventCallbackRequest.md +++ b/sdks/python/docs/EventCallbackRequest.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `event`*_required_ | [```EventCallbackRequestEvent```](EventCallbackRequestEvent.md) | | | | `account` | [```AccountResponse```](AccountResponse.md) | | | | `signature_request` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | | `template` | [```TemplateResponse```](TemplateResponse.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/EventCallbackRequestEvent.md b/sdks/python/docs/EventCallbackRequestEvent.md index d658d01a1..6eadfcdeb 100644 --- a/sdks/python/docs/EventCallbackRequestEvent.md +++ b/sdks/python/docs/EventCallbackRequestEvent.md @@ -3,15 +3,12 @@ Basic information about the event that occurred. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `event_time`*_required_ | ```str``` | Time the event was created (using Unix time). | | | `event_type`*_required_ | ```str``` | Type of callback event that was triggered. | | | `event_hash`*_required_ | ```str``` | Generated hash used to verify source of event data. | | | `event_metadata` | [```EventCallbackRequestEventMetadata```](EventCallbackRequestEventMetadata.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/EventCallbackRequestEventMetadata.md b/sdks/python/docs/EventCallbackRequestEventMetadata.md index 9de3e33aa..d510eaeb4 100644 --- a/sdks/python/docs/EventCallbackRequestEventMetadata.md +++ b/sdks/python/docs/EventCallbackRequestEventMetadata.md @@ -3,15 +3,12 @@ Specific metadata about the event. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `related_signature_id` | ```str, none_type``` | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | | -| `reported_for_account_id` | ```str, none_type``` | Account ID the event was reported for. | | -| `reported_for_app_id` | ```str, none_type``` | App ID the event was reported for. | | -| `event_message` | ```str, none_type``` | Message about a declined or failed (due to error) signature flow. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `related_signature_id` | ```str``` | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | | +| `reported_for_account_id` | ```str``` | Account ID the event was reported for. | | +| `reported_for_app_id` | ```str``` | App ID the event was reported for. | | +| `event_message` | ```str``` | Message about a declined or failed (due to error) signature flow. | | [[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/FaxLineAddUserRequest.md b/sdks/python/docs/FaxLineAddUserRequest.md new file mode 100644 index 000000000..9d2c5e199 --- /dev/null +++ b/sdks/python/docs/FaxLineAddUserRequest.md @@ -0,0 +1,13 @@ +# FaxLineAddUserRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```str``` | The Fax Line number. | | +| `account_id` | ```str``` | Account ID | | +| `email_address` | ```str``` | Email address | | + +[[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/FaxLineApi.md b/sdks/python/docs/FaxLineApi.md new file mode 100644 index 000000000..e9260af67 --- /dev/null +++ b/sdks/python/docs/FaxLineApi.md @@ -0,0 +1,466 @@ +# ```dropbox_sign.FaxLineApi``` + +All URIs are relative to *https://api.hellosign.com/v3* + +Method | HTTP request | Description +------------- | ------------- | ------------- +|[```fax_line_add_user```](FaxLineApi.md#fax_line_add_user) | ```PUT /fax_line/add_user``` | Add Fax Line User| +|[```fax_line_area_code_get```](FaxLineApi.md#fax_line_area_code_get) | ```GET /fax_line/area_codes``` | Get Available Fax Line Area Codes| +|[```fax_line_create```](FaxLineApi.md#fax_line_create) | ```POST /fax_line/create``` | Purchase Fax Line| +|[```fax_line_delete```](FaxLineApi.md#fax_line_delete) | ```DELETE /fax_line``` | Delete Fax Line| +|[```fax_line_get```](FaxLineApi.md#fax_line_get) | ```GET /fax_line``` | Get Fax Line| +|[```fax_line_list```](FaxLineApi.md#fax_line_list) | ```GET /fax_line/list``` | List Fax Lines| +|[```fax_line_remove_user```](FaxLineApi.md#fax_line_remove_user) | ```PUT /fax_line/remove_user``` | Remove Fax Line Access| + + +# ```fax_line_add_user``` +> ```FaxLineResponse fax_line_add_user(fax_line_add_user_request)``` + +Add Fax Line User + +Grants a user access to the specified Fax Line. + +### 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_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineAddUserRequest( + number="[FAX_NUMBER]", + email_address="member@dropboxsign.com", + ) + + try: + response = fax_line_api.fax_line_add_user(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_add_user_request` | [**FaxLineAddUserRequest**](FaxLineAddUserRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```fax_line_area_code_get``` +> ```FaxLineAreaCodeGetResponse fax_line_area_code_get(country)``` + +Get Available Fax Line Area Codes + +Returns a response with the area codes available for a given state/provice and city. + +### 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_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_area_code_get("US", "CA") + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `country` | **str** | Filter area codes by country. | | +| `state` | **str** | Filter area codes by state. | [optional] | +| `province` | **str** | Filter area codes by province. | [optional] | +| `city` | **str** | Filter area codes by city. | [optional] | + +### Return type + +[**FaxLineAreaCodeGetResponse**](FaxLineAreaCodeGetResponse.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_line_create``` +> ```FaxLineResponse fax_line_create(fax_line_create_request)``` + +Purchase Fax Line + +Purchases a new Fax Line. + +### 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_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineCreateRequest( + area_code=209, + country="US", + ) + + try: + response = fax_line_api.fax_line_create(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_create_request` | [**FaxLineCreateRequest**](FaxLineCreateRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```fax_line_delete``` +> ```fax_line_delete(fax_line_delete_request)``` + +Delete Fax Line + +Deletes the specified Fax Line from the subscription. + +### 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_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineDeleteRequest( + number="[FAX_NUMBER]", + ) + + try: + fax_line_api.fax_line_delete(data) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_delete_request` | [**FaxLineDeleteRequest**](FaxLineDeleteRequest.md) | | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```fax_line_get``` +> ```FaxLineResponse fax_line_get(number)``` + +Get Fax Line + +Returns the properties and settings of a Fax Line. + +### 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_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_get("[FAX_NUMBER]") + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `number` | **str** | The Fax Line number. | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.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_line_list``` +> ```FaxLineListResponse fax_line_list()``` + +List Fax Lines + +Returns the properties and settings of multiple Fax Lines. + +### 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_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_list() + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `account_id` | **str** | Account ID | [optional] | +| `page` | **int** | Page | [optional][default to 1] | +| `page_size` | **int** | Page size | [optional][default to 20] | +| `show_team_lines` | **bool** | Show team lines | [optional] | + +### Return type + +[**FaxLineListResponse**](FaxLineListResponse.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_line_remove_user``` +> ```FaxLineResponse fax_line_remove_user(fax_line_remove_user_request)``` + +Remove Fax Line Access + +Removes a user's access to the specified Fax Line. + +### 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_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineRemoveUserRequest( + number="[FAX_NUMBER]", + email_address="member@dropboxsign.com", + ) + + try: + response = fax_line_api.fax_line_remove_user(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_remove_user_request` | [**FaxLineRemoveUserRequest**](FaxLineRemoveUserRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/sdks/python/docs/FaxLineAreaCodeGetCountryEnum.md b/sdks/python/docs/FaxLineAreaCodeGetCountryEnum.md new file mode 100644 index 000000000..6ad763ece --- /dev/null +++ b/sdks/python/docs/FaxLineAreaCodeGetCountryEnum.md @@ -0,0 +1,10 @@ +# FaxLineAreaCodeGetCountryEnum + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/FaxLineAreaCodeGetProvinceEnum.md b/sdks/python/docs/FaxLineAreaCodeGetProvinceEnum.md new file mode 100644 index 000000000..71e241199 --- /dev/null +++ b/sdks/python/docs/FaxLineAreaCodeGetProvinceEnum.md @@ -0,0 +1,10 @@ +# FaxLineAreaCodeGetProvinceEnum + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/FaxLineAreaCodeGetResponse.md b/sdks/python/docs/FaxLineAreaCodeGetResponse.md new file mode 100644 index 000000000..b7fc28ce7 --- /dev/null +++ b/sdks/python/docs/FaxLineAreaCodeGetResponse.md @@ -0,0 +1,11 @@ +# FaxLineAreaCodeGetResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `area_codes`*_required_ | ```List[int]``` | | | + +[[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/FaxLineAreaCodeGetStateEnum.md b/sdks/python/docs/FaxLineAreaCodeGetStateEnum.md new file mode 100644 index 000000000..d62ba3abc --- /dev/null +++ b/sdks/python/docs/FaxLineAreaCodeGetStateEnum.md @@ -0,0 +1,10 @@ +# FaxLineAreaCodeGetStateEnum + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/FaxLineCreateRequest.md b/sdks/python/docs/FaxLineCreateRequest.md new file mode 100644 index 000000000..b6b33b3ac --- /dev/null +++ b/sdks/python/docs/FaxLineCreateRequest.md @@ -0,0 +1,14 @@ +# FaxLineCreateRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `area_code`*_required_ | ```int``` | Area code | | +| `country`*_required_ | ```str``` | Country | | +| `city` | ```str``` | City | | +| `account_id` | ```str``` | Account ID | | + +[[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/FaxLineDeleteRequest.md b/sdks/python/docs/FaxLineDeleteRequest.md new file mode 100644 index 000000000..ad6985a8e --- /dev/null +++ b/sdks/python/docs/FaxLineDeleteRequest.md @@ -0,0 +1,11 @@ +# FaxLineDeleteRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```str``` | The Fax Line number. | | + +[[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/FaxLineListResponse.md b/sdks/python/docs/FaxLineListResponse.md new file mode 100644 index 000000000..7510777c0 --- /dev/null +++ b/sdks/python/docs/FaxLineListResponse.md @@ -0,0 +1,13 @@ +# FaxLineListResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `fax_lines`*_required_ | [```List[FaxLineResponseFaxLine]```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/python/docs/FaxLineRemoveUserRequest.md b/sdks/python/docs/FaxLineRemoveUserRequest.md new file mode 100644 index 000000000..561ddea6d --- /dev/null +++ b/sdks/python/docs/FaxLineRemoveUserRequest.md @@ -0,0 +1,13 @@ +# FaxLineRemoveUserRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```str``` | The Fax Line number. | | +| `account_id` | ```str``` | Account ID | | +| `email_address` | ```str``` | Email address | | + +[[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/FaxLineResponse.md b/sdks/python/docs/FaxLineResponse.md new file mode 100644 index 000000000..d96759130 --- /dev/null +++ b/sdks/python/docs/FaxLineResponse.md @@ -0,0 +1,12 @@ +# FaxLineResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_line`*_required_ | [```FaxLineResponseFaxLine```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/sdks/python/docs/FaxLineResponseFaxLine.md b/sdks/python/docs/FaxLineResponseFaxLine.md new file mode 100644 index 000000000..f3e14c0f7 --- /dev/null +++ b/sdks/python/docs/FaxLineResponseFaxLine.md @@ -0,0 +1,14 @@ +# FaxLineResponseFaxLine + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number` | ```str``` | Number | | +| `created_at` | ```int``` | Created at | | +| `updated_at` | ```int``` | Updated at | | +| `accounts` | [```List[AccountResponse]```](AccountResponse.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/FileResponse.md b/sdks/python/docs/FileResponse.md index 8c6b21151..db7181024 100644 --- a/sdks/python/docs/FileResponse.md +++ b/sdks/python/docs/FileResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `file_url` | ```str``` | URL to the file. | | -| `expires_at` | ```int``` | When the link expires. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `file_url`*_required_ | ```str``` | URL to the file. | | +| `expires_at`*_required_ | ```int``` | When the link expires. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/FileResponseDataUri.md b/sdks/python/docs/FileResponseDataUri.md index 4488bf6df..aae7f445b 100644 --- a/sdks/python/docs/FileResponseDataUri.md +++ b/sdks/python/docs/FileResponseDataUri.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `data_uri` | ```str``` | File as base64 encoded string. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `data_uri`*_required_ | ```str``` | File as base64 encoded string. | | [[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/ListInfoResponse.md b/sdks/python/docs/ListInfoResponse.md index ee5d51085..57a30754e 100644 --- a/sdks/python/docs/ListInfoResponse.md +++ b/sdks/python/docs/ListInfoResponse.md @@ -3,15 +3,12 @@ Contains pagination information about the data returned. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `num_pages` | ```int``` | Total number of pages available. | | -| `num_results` | ```int, none_type``` | Total number of objects available. | | +| `num_results` | ```int``` | Total number of objects available. | | | `page` | ```int``` | Number of the page being returned. | | | `page_size` | ```int``` | Objects returned per page. | | - [[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/OAuthApi.md b/sdks/python/docs/OAuthApi.md index 3c3d19171..9bb584d6c 100644 --- a/sdks/python/docs/OAuthApi.md +++ b/sdks/python/docs/OAuthApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```oauth_token_generate```](OAuthApi.md#oauth_token_generate) | ```POST /oauth/token``` | OAuth Token Generate| |[```oauth_token_refresh```](OAuthApi.md#oauth_token_refresh) | ```POST /oauth/token?refresh``` | OAuth Token Refresh| @@ -43,10 +43,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `o_auth_token_generate_request` | [**OAuthTokenGenerateRequest**](OAuthTokenGenerateRequest.md) | | | @@ -64,7 +63,6 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -105,10 +103,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `o_auth_token_refresh_request` | [**OAuthTokenRefreshRequest**](OAuthTokenRefreshRequest.md) | | | @@ -126,7 +123,6 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/docs/OAuthTokenGenerateRequest.md b/sdks/python/docs/OAuthTokenGenerateRequest.md index 89d7db3c3..9e53f7996 100644 --- a/sdks/python/docs/OAuthTokenGenerateRequest.md +++ b/sdks/python/docs/OAuthTokenGenerateRequest.md @@ -3,16 +3,13 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | The client id of the app requesting authorization. | | | `client_secret`*_required_ | ```str``` | The secret token of your app. | | | `code`*_required_ | ```str``` | The code passed to your callback when the user granted access. | | -| `grant_type`*_required_ | ```str``` | When generating a new token use `authorization_code`. | [default to "authorization_code"] | +| `grant_type`*_required_ | ```str``` | When generating a new token use `authorization_code`. | [default to 'authorization_code'] | | `state`*_required_ | ```str``` | Same as the state you specified earlier. | | - [[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/OAuthTokenRefreshRequest.md b/sdks/python/docs/OAuthTokenRefreshRequest.md index 99bef2e0f..9322c48d6 100644 --- a/sdks/python/docs/OAuthTokenRefreshRequest.md +++ b/sdks/python/docs/OAuthTokenRefreshRequest.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `grant_type`*_required_ | ```str``` | When refreshing an existing token use `refresh_token`. | [default to "refresh_token"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `grant_type`*_required_ | ```str``` | When refreshing an existing token use `refresh_token`. | [default to 'refresh_token'] | | `refresh_token`*_required_ | ```str``` | The token provided when you got the expired access token. | | - [[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/OAuthTokenResponse.md b/sdks/python/docs/OAuthTokenResponse.md index 4fc8542d7..a05a77d8e 100644 --- a/sdks/python/docs/OAuthTokenResponse.md +++ b/sdks/python/docs/OAuthTokenResponse.md @@ -3,16 +3,13 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `access_token` | ```str``` | | | | `token_type` | ```str``` | | | | `refresh_token` | ```str``` | | | | `expires_in` | ```int``` | Number of seconds until the `access_token` expires. Uses epoch time. | | -| `state` | ```str, none_type``` | | | - +| `state` | ```str``` | | | [[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/ReportApi.md b/sdks/python/docs/ReportApi.md index 1391cd418..66643f8db 100644 --- a/sdks/python/docs/ReportApi.md +++ b/sdks/python/docs/ReportApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```report_create```](ReportApi.md#report_create) | ```POST /report/create``` | Create Report| @@ -48,10 +48,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `report_create_request` | [**ReportCreateRequest**](ReportCreateRequest.md) | | | @@ -69,7 +68,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/docs/ReportCreateRequest.md b/sdks/python/docs/ReportCreateRequest.md index aaa25a321..c14641c66 100644 --- a/sdks/python/docs/ReportCreateRequest.md +++ b/sdks/python/docs/ReportCreateRequest.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `end_date`*_required_ | ```str``` | The (inclusive) end date for the report data in `MM/DD/YYYY` format. | | -| `report_type`*_required_ | ```[str]``` | The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | | +| `report_type`*_required_ | ```List[str]``` | The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | | | `start_date`*_required_ | ```str``` | The (inclusive) start date for the report data in `MM/DD/YYYY` format. | | - [[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/ReportCreateResponse.md b/sdks/python/docs/ReportCreateResponse.md index 5272d9a1f..2ffc8dcc9 100644 --- a/sdks/python/docs/ReportCreateResponse.md +++ b/sdks/python/docs/ReportCreateResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `report` | [```ReportResponse```](ReportResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `report`*_required_ | [```ReportResponse```](ReportResponse.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/ReportResponse.md b/sdks/python/docs/ReportResponse.md index 9c5b1a63e..381f19abb 100644 --- a/sdks/python/docs/ReportResponse.md +++ b/sdks/python/docs/ReportResponse.md @@ -3,15 +3,12 @@ Contains information about the report request. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `success` | ```str``` | A message indicating the requested operation's success | | | `start_date` | ```str``` | The (inclusive) start date for the report data in MM/DD/YYYY format. | | | `end_date` | ```str``` | The (inclusive) end date for the report data in MM/DD/YYYY format. | | -| `report_type` | ```[str]``` | The type(s) of the report you are requesting. Allowed values are "user_activity" and "document_status". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | | - +| `report_type` | ```List[str]``` | The type(s) of the report you are requesting. Allowed values are "user_activity" and "document_status". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | | [[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/SignatureRequestApi.md b/sdks/python/docs/SignatureRequestApi.md index ada94d4a6..fc770bc72 100644 --- a/sdks/python/docs/SignatureRequestApi.md +++ b/sdks/python/docs/SignatureRequestApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```signature_request_bulk_create_embedded_with_template```](SignatureRequestApi.md#signature_request_bulk_create_embedded_with_template) | ```POST /signature_request/bulk_create_embedded_with_template``` | Embedded Bulk Send with Template| |[```signature_request_bulk_send_with_template```](SignatureRequestApi.md#signature_request_bulk_send_with_template) | ```POST /signature_request/bulk_send_with_template``` | Bulk Send with Template| |[```signature_request_cancel```](SignatureRequestApi.md#signature_request_cancel) | ```POST /signature_request/cancel/{signature_request_id}``` | Cancel Incomplete Signature Request| @@ -106,10 +106,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_bulk_create_embedded_with_template_request` | [**SignatureRequestBulkCreateEmbeddedWithTemplateRequest**](SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md) | | | @@ -127,7 +126,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -221,10 +219,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_bulk_send_with_template_request` | [**SignatureRequestBulkSendWithTemplateRequest**](SignatureRequestBulkSendWithTemplateRequest.md) | | | @@ -242,7 +239,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -287,10 +283,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the incomplete SignatureRequest to cancel. | | @@ -308,7 +303,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -386,10 +380,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_create_embedded_request` | [**SignatureRequestCreateEmbeddedRequest**](SignatureRequestCreateEmbeddedRequest.md) | | | @@ -407,7 +400,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -477,10 +469,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_create_embedded_with_template_request` | [**SignatureRequestCreateEmbeddedWithTemplateRequest**](SignatureRequestCreateEmbeddedWithTemplateRequest.md) | | | @@ -498,7 +489,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -509,7 +499,7 @@ with ApiClient(configuration) as api_client: [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # ```signature_request_files``` -> ```file_type signature_request_files(signature_request_id)``` +> ```io.IOBase signature_request_files(signature_request_id)``` Download Files @@ -546,18 +536,17 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to retrieve. | | -| `file_type` | **str** | Set to `pdf` for a single merged document or `zip` for a collection of individual documents. | [optional][default to "pdf"] | +| `file_type` | **str** | Set to `pdf` for a single merged document or `zip` for a collection of individual documents. | [optional][default to pdf] | ### Return type -**file_type** +**io.IOBase** ### Authorization @@ -568,7 +557,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/pdf, application/zip, application/json - ### HTTP response details | Status code | Description | Response headers | @@ -616,10 +604,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to retrieve. | | @@ -637,7 +624,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -685,10 +671,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to retrieve. | | @@ -707,7 +692,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -755,10 +739,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to retrieve. | | @@ -776,7 +759,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -828,10 +810,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_id` | **str** | Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. | [optional] | @@ -852,7 +833,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -900,10 +880,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to release. | | @@ -921,7 +900,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -973,10 +951,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to send a reminder for. | | @@ -995,7 +972,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -1039,10 +1015,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to remove. | | @@ -1060,7 +1035,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -1149,10 +1123,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_send_request` | [**SignatureRequestSendRequest**](SignatureRequestSendRequest.md) | | | @@ -1170,7 +1143,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -1253,10 +1225,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_send_with_template_request` | [**SignatureRequestSendWithTemplateRequest**](SignatureRequestSendWithTemplateRequest.md) | | | @@ -1274,7 +1245,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -1327,10 +1297,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to update. | | @@ -1349,7 +1318,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/sdks/python/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index 2638f947d..1448d24df 100644 --- a/sdks/python/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/sdks/python/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -3,24 +3,21 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_ids`*_required_ | ```[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_ids`*_required_ | ```List[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `client_id`*_required_ | ```str``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | -| `signer_file` | ```file_type``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | -| `signer_list` | [```[SubBulkSignerList]```](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | | +| `signer_file` | ```io.IOBase``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | +| `signer_list` | [```List[SubBulkSignerList]```](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | -| `ccs` | [```[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/SignatureRequestBulkSendWithTemplateRequest.md b/sdks/python/docs/SignatureRequestBulkSendWithTemplateRequest.md index c13e5f445..6031e08ee 100644 --- a/sdks/python/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/sdks/python/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -3,24 +3,21 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_ids`*_required_ | ```[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | -| `signer_file` | ```file_type``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | -| `signer_list` | [```[SubBulkSignerList]```](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_ids`*_required_ | ```List[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `signer_file` | ```io.IOBase``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | +| `signer_list` | [```List[SubBulkSignerList]```](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | -| `ccs` | [```[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | | `client_id` | ```str``` | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/SignatureRequestCreateEmbeddedRequest.md b/sdks/python/docs/SignatureRequestCreateEmbeddedRequest.md index 0b8be5d25..98e708332 100644 --- a/sdks/python/docs/SignatureRequestCreateEmbeddedRequest.md +++ b/sdks/python/docs/SignatureRequestCreateEmbeddedRequest.md @@ -3,35 +3,32 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

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

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

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```List[str]``` | The email addresses that should be CCed. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

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

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

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

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

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

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

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

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

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

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/SignatureRequestGetResponse.md b/sdks/python/docs/SignatureRequestGetResponse.md index 09c74de50..a0ee83f2d 100644 --- a/sdks/python/docs/SignatureRequestGetResponse.md +++ b/sdks/python/docs/SignatureRequestGetResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `signature_request` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `signature_request`*_required_ | [```SignatureRequestResponse```](SignatureRequestResponse.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/SignatureRequestListResponse.md b/sdks/python/docs/SignatureRequestListResponse.md index 0e764640a..532cf61fd 100644 --- a/sdks/python/docs/SignatureRequestListResponse.md +++ b/sdks/python/docs/SignatureRequestListResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `signature_requests` | [```[SignatureRequestResponse]```](SignatureRequestResponse.md) | Contains information about signature requests. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `signature_requests`*_required_ | [```List[SignatureRequestResponse]```](SignatureRequestResponse.md) | Contains information about signature requests. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.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/SignatureRequestRemindRequest.md b/sdks/python/docs/SignatureRequestRemindRequest.md index 91a33805d..c885130ef 100644 --- a/sdks/python/docs/SignatureRequestRemindRequest.md +++ b/sdks/python/docs/SignatureRequestRemindRequest.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address`*_required_ | ```str``` | The email address of the signer to send a reminder to. | | | `name` | ```str``` | The name of the signer to send a reminder to. Include if two or more signers share an email address. | | - [[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/SignatureRequestResponse.md b/sdks/python/docs/SignatureRequestResponse.md index eca1dc2ad..a8af74ce5 100644 --- a/sdks/python/docs/SignatureRequestResponse.md +++ b/sdks/python/docs/SignatureRequestResponse.md @@ -3,36 +3,33 @@ Contains information about a signature request. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `test_mode` | ```bool, none_type``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [default to False] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `test_mode` | ```bool``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [default to False] | | `signature_request_id` | ```str``` | The id of the SignatureRequest. | | | `requester_email_address` | ```str``` | The email address of the initiator of the SignatureRequest. | | | `title` | ```str``` | The title the specified Account uses for the SignatureRequest. | | | `original_title` | ```str``` | Default Label for account. | | -| `subject` | ```str, none_type``` | The subject in the email that was initially sent to the signers. | | -| `message` | ```str, none_type``` | The custom message in the email that was initially sent to the signers. | | -| `metadata` | [```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}```](.md) | The metadata attached to the signature request. | | +| `subject` | ```str``` | The subject in the email that was initially sent to the signers. | | +| `message` | ```str``` | The custom message in the email that was initially sent to the signers. | | +| `metadata` | ```object``` | The metadata attached to the signature request. | | | `created_at` | ```int``` | Time the signature request was created. | | | `expires_at` | ```int``` | The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | | `is_complete` | ```bool``` | Whether or not the SignatureRequest has been fully executed by all signers. | | | `is_declined` | ```bool``` | Whether or not the SignatureRequest has been declined by a signer. | | | `has_error` | ```bool``` | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | | | `files_url` | ```str``` | The URL where a copy of the request's documents can be downloaded. | | -| `signing_url` | ```str, none_type``` | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | | +| `signing_url` | ```str``` | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | | | `details_url` | ```str``` | The URL where the requester and the signers can view the current status of the SignatureRequest. | | -| `cc_email_addresses` | ```[str]``` | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | | -| `signing_redirect_url` | ```str, none_type``` | The URL you want the signer redirected to after they successfully sign. | | -| `final_copy_uri` | ```str, none_type``` | The path where the completed document can be downloaded | | -| `template_ids` | ```[str], none_type``` | Templates IDs used in this SignatureRequest (if any). | | -| `custom_fields` | [```[SignatureRequestResponseCustomFieldBase], none_type```](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | | -| `attachments` | [```[SignatureRequestResponseAttachment], none_type```](SignatureRequestResponseAttachment.md) | Signer attachments. | | -| `response_data` | [```[SignatureRequestResponseDataBase], none_type```](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | | -| `signatures` | [```[SignatureRequestResponseSignatures]```](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | | -| `bulk_send_job_id` | ```str, none_type``` | The ID of the Bulk Send job which sent the signature request, if applicable. | | - +| `cc_email_addresses` | ```List[str]``` | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | | +| `signing_redirect_url` | ```str``` | The URL you want the signer redirected to after they successfully sign. | | +| `final_copy_uri` | ```str``` | The path where the completed document can be downloaded | | +| `template_ids` | ```List[str]``` | Templates IDs used in this SignatureRequest (if any). | | +| `custom_fields` | [```List[SignatureRequestResponseCustomFieldBase]```](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | | +| `attachments` | [```List[SignatureRequestResponseAttachment]```](SignatureRequestResponseAttachment.md) | Signer attachments. | | +| `response_data` | [```List[SignatureRequestResponseDataBase]```](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | | +| `signatures` | [```List[SignatureRequestResponseSignatures]```](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | | +| `bulk_send_job_id` | ```str``` | The ID of the Bulk Send job which sent the signature request, if applicable. | | [[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/SignatureRequestResponseAttachment.md b/sdks/python/docs/SignatureRequestResponseAttachment.md index 322ac83a5..a602ec03d 100644 --- a/sdks/python/docs/SignatureRequestResponseAttachment.md +++ b/sdks/python/docs/SignatureRequestResponseAttachment.md @@ -3,17 +3,14 @@ Signer attachments. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `id`*_required_ | ```str``` | The unique ID for this attachment. | | | `signer`*_required_ | ```str``` | The Signer this attachment is assigned to. | | | `name`*_required_ | ```str``` | The name of this attachment. | | | `required`*_required_ | ```bool``` | A boolean value denoting if this attachment is required. | | -| `instructions` | ```str, none_type``` | Instructions for Signer. | | -| `uploaded_at` | ```int, none_type``` | Timestamp when attachment was uploaded by Signer. | | - +| `instructions` | ```str``` | Instructions for Signer. | | +| `uploaded_at` | ```int``` | Timestamp when attachment was uploaded by Signer. | | [[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/SignatureRequestResponseCustomFieldBase.md b/sdks/python/docs/SignatureRequestResponseCustomFieldBase.md index a218c0f5c..75339e02f 100644 --- a/sdks/python/docs/SignatureRequestResponseCustomFieldBase.md +++ b/sdks/python/docs/SignatureRequestResponseCustomFieldBase.md @@ -6,16 +6,13 @@ An array of Custom Field objects containing the name and type of each custom fie * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `type`*_required_ | ```str``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `name`*_required_ | ```str``` | The name of the Custom Field. | | | `required` | ```bool``` | A boolean value denoting if this field is required. | | | `api_id` | ```str``` | The unique ID for this field. | | | `editor` | ```str``` | The name of the Role that is able to edit this field. | | - [[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/SignatureRequestResponseCustomFieldCheckbox.md b/sdks/python/docs/SignatureRequestResponseCustomFieldCheckbox.md index 53bae66fc..d3f9dbc70 100644 --- a/sdks/python/docs/SignatureRequestResponseCustomFieldCheckbox.md +++ b/sdks/python/docs/SignatureRequestResponseCustomFieldCheckbox.md @@ -3,13 +3,10 @@ This class extends `SignatureRequestResponseCustomFieldBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "checkbox"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to 'checkbox'] | | `value` | ```bool``` | A true/false for checkbox fields | | - [[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/SignatureRequestResponseCustomFieldText.md b/sdks/python/docs/SignatureRequestResponseCustomFieldText.md index 520fe0371..34222b32e 100644 --- a/sdks/python/docs/SignatureRequestResponseCustomFieldText.md +++ b/sdks/python/docs/SignatureRequestResponseCustomFieldText.md @@ -3,13 +3,10 @@ This class extends `SignatureRequestResponseCustomFieldBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "text"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to 'text'] | | `value` | ```str``` | A text string for text fields | | - [[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/SignatureRequestResponseCustomFieldTypeEnum.md b/sdks/python/docs/SignatureRequestResponseCustomFieldTypeEnum.md index b2705a846..debe8e40c 100644 --- a/sdks/python/docs/SignatureRequestResponseCustomFieldTypeEnum.md +++ b/sdks/python/docs/SignatureRequestResponseCustomFieldTypeEnum.md @@ -3,11 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- [[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/SignatureRequestResponseDataBase.md b/sdks/python/docs/SignatureRequestResponseDataBase.md index 862fcd1f4..a657e3c87 100644 --- a/sdks/python/docs/SignatureRequestResponseDataBase.md +++ b/sdks/python/docs/SignatureRequestResponseDataBase.md @@ -3,16 +3,13 @@ An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `api_id` | ```str``` | The unique ID for this field. | | | `signature_id` | ```str``` | The ID of the signature to which this response is linked. | | | `name` | ```str``` | The name of the form field. | | | `required` | ```bool``` | A boolean value denoting if this field is required. | | | `type` | ```str``` | | | - [[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/SignatureRequestResponseDataTypeEnum.md b/sdks/python/docs/SignatureRequestResponseDataTypeEnum.md index c0ebf8479..102414ea4 100644 --- a/sdks/python/docs/SignatureRequestResponseDataTypeEnum.md +++ b/sdks/python/docs/SignatureRequestResponseDataTypeEnum.md @@ -3,11 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- [[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/SignatureRequestResponseDataValueCheckbox.md b/sdks/python/docs/SignatureRequestResponseDataValueCheckbox.md index e9a22318c..f52a4be3a 100644 --- a/sdks/python/docs/SignatureRequestResponseDataValueCheckbox.md +++ b/sdks/python/docs/SignatureRequestResponseDataValueCheckbox.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A yes/no checkbox | [default to "checkbox"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A yes/no checkbox | [default to 'checkbox'] | | `value` | ```bool``` | The value of the form field. | | - [[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/SignatureRequestResponseDataValueCheckboxMerge.md b/sdks/python/docs/SignatureRequestResponseDataValueCheckboxMerge.md index b4ba1993a..c7ad20c87 100644 --- a/sdks/python/docs/SignatureRequestResponseDataValueCheckboxMerge.md +++ b/sdks/python/docs/SignatureRequestResponseDataValueCheckboxMerge.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A checkbox field that has default value set by the api | [default to "checkbox-merge"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A checkbox field that has default value set by the api | [default to 'checkbox-merge'] | | `value` | ```str``` | The value of the form field. | | - [[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/SignatureRequestResponseDataValueDateSigned.md b/sdks/python/docs/SignatureRequestResponseDataValueDateSigned.md index 7b99e63e0..d72ecc9b2 100644 --- a/sdks/python/docs/SignatureRequestResponseDataValueDateSigned.md +++ b/sdks/python/docs/SignatureRequestResponseDataValueDateSigned.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A date | [default to "date_signed"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A date | [default to 'date_signed'] | | `value` | ```str``` | The value of the form field. | | - [[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/SignatureRequestResponseDataValueDropdown.md b/sdks/python/docs/SignatureRequestResponseDataValueDropdown.md index 20d95a43b..9eef3d02e 100644 --- a/sdks/python/docs/SignatureRequestResponseDataValueDropdown.md +++ b/sdks/python/docs/SignatureRequestResponseDataValueDropdown.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | An input field for dropdowns | [default to "dropdown"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | An input field for dropdowns | [default to 'dropdown'] | | `value` | ```str``` | The value of the form field. | | - [[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/SignatureRequestResponseDataValueInitials.md b/sdks/python/docs/SignatureRequestResponseDataValueInitials.md index 8d77b11c1..33a601325 100644 --- a/sdks/python/docs/SignatureRequestResponseDataValueInitials.md +++ b/sdks/python/docs/SignatureRequestResponseDataValueInitials.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | An input field for initials | [default to "initials"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | An input field for initials | [default to 'initials'] | | `value` | ```str``` | The value of the form field. | | - [[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/SignatureRequestResponseDataValueRadio.md b/sdks/python/docs/SignatureRequestResponseDataValueRadio.md index 822697219..615a86d76 100644 --- a/sdks/python/docs/SignatureRequestResponseDataValueRadio.md +++ b/sdks/python/docs/SignatureRequestResponseDataValueRadio.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | An input field for radios | [default to "radio"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | An input field for radios | [default to 'radio'] | | `value` | ```bool``` | The value of the form field. | | - [[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/SignatureRequestResponseDataValueSignature.md b/sdks/python/docs/SignatureRequestResponseDataValueSignature.md index 754bba5e1..cd1512857 100644 --- a/sdks/python/docs/SignatureRequestResponseDataValueSignature.md +++ b/sdks/python/docs/SignatureRequestResponseDataValueSignature.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A signature input field | [default to "signature"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A signature input field | [default to 'signature'] | | `value` | ```str``` | The value of the form field. | | - [[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/SignatureRequestResponseDataValueText.md b/sdks/python/docs/SignatureRequestResponseDataValueText.md index 0046c5bf7..4b380507f 100644 --- a/sdks/python/docs/SignatureRequestResponseDataValueText.md +++ b/sdks/python/docs/SignatureRequestResponseDataValueText.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A text input field | [default to "text"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A text input field | [default to 'text'] | | `value` | ```str``` | The value of the form field. | | - [[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/SignatureRequestResponseDataValueTextMerge.md b/sdks/python/docs/SignatureRequestResponseDataValueTextMerge.md index c2ace0b15..f3e90ba7d 100644 --- a/sdks/python/docs/SignatureRequestResponseDataValueTextMerge.md +++ b/sdks/python/docs/SignatureRequestResponseDataValueTextMerge.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A text field that has default text set by the api | [default to "text-merge"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A text field that has default text set by the api | [default to 'text-merge'] | | `value` | ```str``` | The value of the form field. | | - [[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/SignatureRequestResponseSignatures.md b/sdks/python/docs/SignatureRequestResponseSignatures.md index 913b61eae..8125332ed 100644 --- a/sdks/python/docs/SignatureRequestResponseSignatures.md +++ b/sdks/python/docs/SignatureRequestResponseSignatures.md @@ -3,30 +3,27 @@ An array of signature objects, 1 for each signer. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `signature_id` | ```str``` | Signature identifier. | | -| `signer_group_guid` | ```str, none_type``` | Signer Group GUID | | +| `signer_group_guid` | ```str``` | Signer Group GUID | | | `signer_email_address` | ```str``` | The email address of the signer. | | -| `signer_name` | ```str, none_type``` | The name of the signer. | | -| `signer_role` | ```str, none_type``` | The role of the signer. | | -| `order` | ```int, none_type``` | If signer order is assigned this is the 0-based index for this signer. | | +| `signer_name` | ```str``` | The name of the signer. | | +| `signer_role` | ```str``` | The role of the signer. | | +| `order` | ```int``` | If signer order is assigned this is the 0-based index for this signer. | | | `status_code` | ```str``` | The current status of the signature. eg: awaiting_signature, signed, declined. | | -| `decline_reason` | ```str, none_type``` | The reason provided by the signer for declining the request. | | -| `signed_at` | ```int, none_type``` | Time that the document was signed or null. | | -| `last_viewed_at` | ```int, none_type``` | The time that the document was last viewed by this signer or null. | | -| `last_reminded_at` | ```int, none_type``` | The time the last reminder email was sent to the signer or null. | | +| `decline_reason` | ```str``` | The reason provided by the signer for declining the request. | | +| `signed_at` | ```int``` | Time that the document was signed or null. | | +| `last_viewed_at` | ```int``` | The time that the document was last viewed by this signer or null. | | +| `last_reminded_at` | ```int``` | The time the last reminder email was sent to the signer or null. | | | `has_pin` | ```bool``` | Boolean to indicate whether this signature requires a PIN to access. | | -| `has_sms_auth` | ```bool, none_type``` | Boolean to indicate whether this signature has SMS authentication enabled. | | -| `has_sms_delivery` | ```bool, none_type``` | Boolean to indicate whether this signature has SMS delivery enabled. | | -| `sms_phone_number` | ```str, none_type``` | The SMS phone number used for authentication or signature request delivery. | | -| `reassigned_by` | ```str, none_type``` | Email address of original signer who reassigned to this signer. | | -| `reassignment_reason` | ```str, none_type``` | Reason provided by original signer who reassigned to this signer. | | -| `reassigned_from` | ```str, none_type``` | Previous signature identifier. | | -| `error` | ```str, none_type``` | Error message pertaining to this signer, or null. | | - +| `has_sms_auth` | ```bool``` | Boolean to indicate whether this signature has SMS authentication enabled. | | +| `has_sms_delivery` | ```bool``` | Boolean to indicate whether this signature has SMS delivery enabled. | | +| `sms_phone_number` | ```str``` | The SMS phone number used for authentication or signature request delivery. | | +| `reassigned_by` | ```str``` | Email address of original signer who reassigned to this signer. | | +| `reassignment_reason` | ```str``` | Reason provided by original signer who reassigned to this signer. | | +| `reassigned_from` | ```str``` | Previous signature identifier. | | +| `error` | ```str``` | Error message pertaining to this signer, or null. | | [[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/SignatureRequestSendRequest.md b/sdks/python/docs/SignatureRequestSendRequest.md index b72146288..beb3ae0f4 100644 --- a/sdks/python/docs/SignatureRequestSendRequest.md +++ b/sdks/python/docs/SignatureRequestSendRequest.md @@ -3,37 +3,34 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

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

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

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

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

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

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

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

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

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

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

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

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

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/SignatureRequestUpdateRequest.md b/sdks/python/docs/SignatureRequestUpdateRequest.md index fcca65a4b..10ada0f0a 100644 --- a/sdks/python/docs/SignatureRequestUpdateRequest.md +++ b/sdks/python/docs/SignatureRequestUpdateRequest.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `signature_id`*_required_ | ```str``` | The signature ID for the recipient. | | | `email_address` | ```str``` | The new email address for the recipient.

This will generate a new `signature_id` value.

**NOTE:** Optional if `name` is provided. | | | `name` | ```str``` | The new name for the recipient.

**NOTE:** Optional if `email_address` is provided. | | -| `expires_at` | ```int, none_type``` | The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | - +| `expires_at` | ```int``` | The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/SubAttachment.md b/sdks/python/docs/SubAttachment.md index ebf82d5ab..273066666 100644 --- a/sdks/python/docs/SubAttachment.md +++ b/sdks/python/docs/SubAttachment.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name`*_required_ | ```str``` | The name of attachment. | | | `signer_index`*_required_ | ```int``` | The signer's index in the `signers` parameter (0-based indexing).

**NOTE:** Only one signer can be assigned per attachment. | | | `instructions` | ```str``` | The instructions for uploading the attachment. | | | `required` | ```bool``` | Determines if the attachment must be uploaded. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/SubBulkSignerList.md b/sdks/python/docs/SubBulkSignerList.md index b4e937bd8..4079ca132 100644 --- a/sdks/python/docs/SubBulkSignerList.md +++ b/sdks/python/docs/SubBulkSignerList.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `custom_fields` | [```[SubBulkSignerListCustomField]```](SubBulkSignerListCustomField.md) | An array of custom field values. | | -| `signers` | [```[SubSignatureRequestTemplateSigner]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document.

Currently only templates with a single role are supported. All signers must have the same `role` value. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `custom_fields` | [```List[SubBulkSignerListCustomField]```](SubBulkSignerListCustomField.md) | An array of custom field values. | | +| `signers` | [```List[SubSignatureRequestTemplateSigner]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document.

Currently only templates with a single role are supported. All signers must have the same `role` value. | | [[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/SubBulkSignerListCustomField.md b/sdks/python/docs/SubBulkSignerListCustomField.md index 079637d97..6ff5de065 100644 --- a/sdks/python/docs/SubBulkSignerListCustomField.md +++ b/sdks/python/docs/SubBulkSignerListCustomField.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name`*_required_ | ```str``` | The name of the custom field. Must be the field's `name` or `api_id`. | | | `value`*_required_ | ```str``` | The value of the custom field. | | - [[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/SubCC.md b/sdks/python/docs/SubCC.md index aad785e37..0a9267dfb 100644 --- a/sdks/python/docs/SubCC.md +++ b/sdks/python/docs/SubCC.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `role`*_required_ | ```str``` | Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. | | | `email_address`*_required_ | ```str``` | The email address of the CC recipient. | | - [[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/SubCustomField.md b/sdks/python/docs/SubCustomField.md index 7d70ab0d8..7aff76896 100644 --- a/sdks/python/docs/SubCustomField.md +++ b/sdks/python/docs/SubCustomField.md @@ -7,15 +7,12 @@ Pre-filled data can be used with "send-once" signature requests by add For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name`*_required_ | ```str``` | The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. | | | `editor` | ```str``` | Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`.

**NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. | | | `required` | ```bool``` | Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. | [default to False] | | `value` | ```str``` | The string that resolves (aka "pre-fills") to the merge field on the final document(s) used for signing. | | - [[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/SubEditorOptions.md b/sdks/python/docs/SubEditorOptions.md index 4cf8415a6..4ee12c25c 100644 --- a/sdks/python/docs/SubEditorOptions.md +++ b/sdks/python/docs/SubEditorOptions.md @@ -3,13 +3,10 @@ This allows the requester to specify editor options when a preparing a document ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `allow_edit_signers` | ```bool``` | Allows requesters to edit the list of signers | [default to False] | | `allow_edit_documents` | ```bool``` | Allows requesters to edit documents, including delete and add | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/SubFieldOptions.md b/sdks/python/docs/SubFieldOptions.md index ef256c01d..3d40efd8d 100644 --- a/sdks/python/docs/SubFieldOptions.md +++ b/sdks/python/docs/SubFieldOptions.md @@ -3,12 +3,9 @@ This allows the requester to specify field options for a signature request. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `date_format`*_required_ | ```str``` | Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats))

**NOTE:** Only available for Premium and higher. | | - [[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/SubFormFieldGroup.md b/sdks/python/docs/SubFormFieldGroup.md index ace9c09e4..af8de77e3 100644 --- a/sdks/python/docs/SubFormFieldGroup.md +++ b/sdks/python/docs/SubFormFieldGroup.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `group_id`*_required_ | ```str``` | ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. | | | `group_label`*_required_ | ```str``` | Name of the group | | | `requirement`*_required_ | ```str``` | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | | - [[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/SubFormFieldRule.md b/sdks/python/docs/SubFormFieldRule.md index 38561d712..1e4658e86 100644 --- a/sdks/python/docs/SubFormFieldRule.md +++ b/sdks/python/docs/SubFormFieldRule.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `id`*_required_ | ```str``` | Must be unique across all defined rules. | | -| `trigger_operator`*_required_ | ```str``` | Currently only `AND` is supported. Support for `OR` is being worked on. | [default to "AND"] | -| `triggers`*_required_ | [```[SubFormFieldRuleTrigger]```](SubFormFieldRuleTrigger.md) | An array of trigger definitions, the "if this" part of "**if this**, then that". Currently only a single trigger per rule is allowed. | | -| `actions`*_required_ | [```[SubFormFieldRuleAction]```](SubFormFieldRuleAction.md) | An array of action definitions, the "then that" part of "if this, **then that**". Any number of actions may be attached to a single rule. | | - +| `trigger_operator`*_required_ | ```str``` | Currently only `AND` is supported. Support for `OR` is being worked on. | [default to 'AND'] | +| `triggers`*_required_ | [```List[SubFormFieldRuleTrigger]```](SubFormFieldRuleTrigger.md) | An array of trigger definitions, the "if this" part of "**if this**, then that". Currently only a single trigger per rule is allowed. | | +| `actions`*_required_ | [```List[SubFormFieldRuleAction]```](SubFormFieldRuleAction.md) | An array of action definitions, the "then that" part of "if this, **then that**". Any number of actions may be attached to a single rule. | | [[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/SubFormFieldRuleAction.md b/sdks/python/docs/SubFormFieldRuleAction.md index b0e02baa0..6d38e07af 100644 --- a/sdks/python/docs/SubFormFieldRuleAction.md +++ b/sdks/python/docs/SubFormFieldRuleAction.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `hidden`*_required_ | ```bool``` | `true` to hide the target field when rule is satisfied, otherwise `false`. | | | `type`*_required_ | ```str``` | | | | `field_id` | ```str``` | **field_id** or **group_id** is required, but not both.

Must reference the `api_id` of an existing field defined within `form_fields_per_document`.

Cannot use with `group_id`. Trigger and action fields must belong to the same signer. | | | `group_id` | ```str``` | **group_id** or **field_id** is required, but not both.

Must reference the ID of an existing group defined within `form_field_groups`.

Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer. | | - [[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/SubFormFieldRuleTrigger.md b/sdks/python/docs/SubFormFieldRuleTrigger.md index 3b411c6f7..0ff0bbf26 100644 --- a/sdks/python/docs/SubFormFieldRuleTrigger.md +++ b/sdks/python/docs/SubFormFieldRuleTrigger.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `id`*_required_ | ```str``` | Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. | | | `operator`*_required_ | ```str``` | Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value | | | `value` | ```str``` | **value** or **values** is required, but not both.

The value to match against **operator**.

- When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match`

Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` | | -| `values` | ```[str]``` | **values** or **value** is required, but not both.

The values to match against **operator** when it is one of the following:

- `any` - `none` | | - +| `values` | ```List[str]``` | **values** or **value** is required, but not both.

The values to match against **operator** when it is one of the following:

- `any` - `none` | | [[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/SubFormFieldsPerDocumentBase.md b/sdks/python/docs/SubFormFieldsPerDocumentBase.md index 7e72611b7..12da98a0d 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentBase.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentBase.md @@ -16,9 +16,8 @@ The fields that should appear on the document, expressed as an array of objects. * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `document_index`*_required_ | ```int``` | Represents the integer index of the `file` or `file_url` document the field should be attached to. | | | `api_id`*_required_ | ```str``` | An identifier for the field that is unique across all documents in the request. | | | `height`*_required_ | ```int``` | Size of the field in pixels. | | @@ -29,9 +28,7 @@ The fields that should appear on the document, expressed as an array of objects. | `x`*_required_ | ```int``` | Location coordinates of the field in pixels. | | | `y`*_required_ | ```int``` | Location coordinates of the field in pixels. | | | `name` | ```str``` | Display name for the field. | | -| `page` | ```int, none_type``` | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | | - +| `page` | ```int``` | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | | [[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/SubFormFieldsPerDocumentCheckbox.md b/sdks/python/docs/SubFormFieldsPerDocumentCheckbox.md index 348ea6236..ac3ac20a5 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentCheckbox.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentCheckbox.md @@ -3,14 +3,11 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | [default to "checkbox"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | [default to 'checkbox'] | | `is_checked`*_required_ | ```bool``` | `true` for checking the checkbox field by default, otherwise `false`. | | | `group` | ```str``` | String referencing group defined in `form_field_groups` parameter. | | - [[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/SubFormFieldsPerDocumentCheckboxMerge.md b/sdks/python/docs/SubFormFieldsPerDocumentCheckboxMerge.md index 590d4c98f..70ddec82f 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentCheckboxMerge.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentCheckboxMerge.md @@ -3,12 +3,9 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. | [default to "checkbox-merge"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. | [default to 'checkbox-merge'] | [[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/SubFormFieldsPerDocumentDateSigned.md b/sdks/python/docs/SubFormFieldsPerDocumentDateSigned.md index 26cd41b22..894e416a1 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentDateSigned.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentDateSigned.md @@ -3,14 +3,11 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | [default to "date_signed"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | [default to 'date_signed'] | | `font_family` | ```str``` | Font family for the field. | | | `font_size` | ```int``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [default to 12] | - [[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/SubFormFieldsPerDocumentDropdown.md b/sdks/python/docs/SubFormFieldsPerDocumentDropdown.md index 8a984e7c3..b2ad0d63d 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentDropdown.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentDropdown.md @@ -3,16 +3,13 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | [default to "dropdown"] | -| `options`*_required_ | ```[str]``` | Array of string values representing dropdown values. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | [default to 'dropdown'] | +| `options`*_required_ | ```List[str]``` | Array of string values representing dropdown values. | | | `content` | ```str``` | Selected value in `options` array. Value must exist in array. | | | `font_family` | ```str``` | Font family for the field. | | | `font_size` | ```int``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [default to 12] | - [[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/SubFormFieldsPerDocumentFontEnum.md b/sdks/python/docs/SubFormFieldsPerDocumentFontEnum.md index 403f882cd..30e438940 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentFontEnum.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentFontEnum.md @@ -3,11 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- [[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/SubFormFieldsPerDocumentHyperlink.md b/sdks/python/docs/SubFormFieldsPerDocumentHyperlink.md index 29fa2bdd5..821d474da 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentHyperlink.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentHyperlink.md @@ -3,16 +3,13 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | [default to "hyperlink"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | [default to 'hyperlink'] | | `content`*_required_ | ```str``` | Link Text. | | | `content_url`*_required_ | ```str``` | Link URL. | | | `font_family` | ```str``` | Font family for the field. | | | `font_size` | ```int``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [default to 12] | - [[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/SubFormFieldsPerDocumentInitials.md b/sdks/python/docs/SubFormFieldsPerDocumentInitials.md index b6c01c1f0..978db25a4 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentInitials.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentInitials.md @@ -3,12 +3,9 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. | [default to "initials"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. | [default to 'initials'] | [[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/SubFormFieldsPerDocumentRadio.md b/sdks/python/docs/SubFormFieldsPerDocumentRadio.md index 0a89c862c..96789cb51 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentRadio.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentRadio.md @@ -3,14 +3,11 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | [default to "radio"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | [default to 'radio'] | | `group`*_required_ | ```str``` | String referencing group defined in `form_field_groups` parameter. | | | `is_checked`*_required_ | ```bool``` | `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. | | - [[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/SubFormFieldsPerDocumentSignature.md b/sdks/python/docs/SubFormFieldsPerDocumentSignature.md index c1d442745..b1fb9969e 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentSignature.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentSignature.md @@ -3,12 +3,9 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. | [default to "signature"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. | [default to 'signature'] | [[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/SubFormFieldsPerDocumentText.md b/sdks/python/docs/SubFormFieldsPerDocumentText.md index e0ddbf478..0456d7b99 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentText.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentText.md @@ -3,10 +3,9 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A text input field. Use the `SubFormFieldsPerDocumentText` class. | [default to "text"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A text input field. Use the `SubFormFieldsPerDocumentText` class. | [default to 'text'] | | `placeholder` | ```str``` | Placeholder value for text field. | | | `auto_fill_type` | ```str``` | Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. | | | `link_id` | ```str``` | Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. | | @@ -18,7 +17,5 @@ This class extends `SubFormFieldsPerDocumentBase`. | `font_family` | ```str``` | Font family for the field. | | | `font_size` | ```int``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [default to 12] | - [[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/SubFormFieldsPerDocumentTextMerge.md b/sdks/python/docs/SubFormFieldsPerDocumentTextMerge.md index 8bee2e6b2..5670ce99e 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentTextMerge.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentTextMerge.md @@ -3,14 +3,11 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | [default to "text-merge"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | [default to 'text-merge'] | | `font_family` | ```str``` | Font family for the field. | | | `font_size` | ```int``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [default to 12] | - [[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/SubFormFieldsPerDocumentTypeEnum.md b/sdks/python/docs/SubFormFieldsPerDocumentTypeEnum.md index 598090cba..e2f8ca561 100644 --- a/sdks/python/docs/SubFormFieldsPerDocumentTypeEnum.md +++ b/sdks/python/docs/SubFormFieldsPerDocumentTypeEnum.md @@ -3,11 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- [[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/SubMergeField.md b/sdks/python/docs/SubMergeField.md index 41fdec5ca..9066c079d 100644 --- a/sdks/python/docs/SubMergeField.md +++ b/sdks/python/docs/SubMergeField.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name`*_required_ | ```str``` | The name of the merge field. Must be unique. | | | `type`*_required_ | ```str``` | The type of merge field. | | - [[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/SubOAuth.md b/sdks/python/docs/SubOAuth.md index 5c9905971..524b04f8b 100644 --- a/sdks/python/docs/SubOAuth.md +++ b/sdks/python/docs/SubOAuth.md @@ -3,13 +3,10 @@ OAuth related parameters. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `callback_url` | ```str``` | The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) | | -| `scopes` | ```[str]``` | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | | - +| `scopes` | ```List[str]``` | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | | [[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/SubOptions.md b/sdks/python/docs/SubOptions.md index be7b7d599..62ff1a98b 100644 --- a/sdks/python/docs/SubOptions.md +++ b/sdks/python/docs/SubOptions.md @@ -3,12 +3,9 @@ Additional options supported by API App. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `can_insert_everywhere` | ```bool``` | Determines if signers can use "Insert Everywhere" when signing a document. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/SubSignatureRequestGroupedSigners.md b/sdks/python/docs/SubSignatureRequestGroupedSigners.md index 83f8e90d4..179f27bc0 100644 --- a/sdks/python/docs/SubSignatureRequestGroupedSigners.md +++ b/sdks/python/docs/SubSignatureRequestGroupedSigners.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `group`*_required_ | ```str``` | The name of the group. | | -| `signers`*_required_ | [```[SubSignatureRequestSigner]```](SubSignatureRequestSigner.md) | Signers belonging to this Group.

**NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. | | -| `order` | ```int, none_type``` | The order the group is required to sign in. Use this instead of Signer-level `order`. | | - +| `signers`*_required_ | [```List[SubSignatureRequestSigner]```](SubSignatureRequestSigner.md) | Signers belonging to this Group.

**NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. | | +| `order` | ```int``` | The order the group is required to sign in. Use this instead of Signer-level `order`. | | [[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/SubSignatureRequestSigner.md b/sdks/python/docs/SubSignatureRequestSigner.md index 731887c46..0a122bcfb 100644 --- a/sdks/python/docs/SubSignatureRequestSigner.md +++ b/sdks/python/docs/SubSignatureRequestSigner.md @@ -3,17 +3,14 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name`*_required_ | ```str``` | The name of the signer. | | | `email_address`*_required_ | ```str``` | The email address of the signer. | | -| `order` | ```int, none_type``` | The order the signer is required to sign in. | | +| `order` | ```int``` | The order the signer is required to sign in. | | | `pin` | ```str``` | The 4- to 12-character access code that will secure this signer's signature page. | | | `sms_phone_number` | ```str``` | An E.164 formatted phone number.

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. | | | `sms_phone_number_type` | ```str``` | Specifies the feature used with the `sms_phone_number`. Default `authentication`.

If `authentication`, signer is sent a verification code via SMS that is required to access the document.

If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). | | - [[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/SubSignatureRequestTemplateSigner.md b/sdks/python/docs/SubSignatureRequestTemplateSigner.md index 94596aac2..d1ca992d5 100644 --- a/sdks/python/docs/SubSignatureRequestTemplateSigner.md +++ b/sdks/python/docs/SubSignatureRequestTemplateSigner.md @@ -3,9 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `role`*_required_ | ```str``` | Must match an existing role in chosen Template(s). It's case-sensitive. | | | `name`*_required_ | ```str``` | The name of the signer. | | | `email_address`*_required_ | ```str``` | The email address of the signer. | | @@ -13,7 +12,5 @@ | `sms_phone_number` | ```str``` | An E.164 formatted phone number.

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. | | | `sms_phone_number_type` | ```str``` | Specifies the feature used with the `sms_phone_number`. Default `authentication`.

If `authentication`, signer is sent a verification code via SMS that is required to access the document.

If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). | | - [[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/SubSigningOptions.md b/sdks/python/docs/SubSigningOptions.md index 0c13e4cb4..a060bd1d6 100644 --- a/sdks/python/docs/SubSigningOptions.md +++ b/sdks/python/docs/SubSigningOptions.md @@ -5,16 +5,13 @@ This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `default_type`*_required_ | ```str``` | The default type shown (limited to the listed types) | | | `draw` | ```bool``` | Allows drawing the signature | [default to False] | | `phone` | ```bool``` | Allows using a smartphone to email the signature | [default to False] | | `type` | ```bool``` | Allows typing the signature | [default to False] | | `upload` | ```bool``` | Allows uploading the signature | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/SubTeamResponse.md b/sdks/python/docs/SubTeamResponse.md index a41fc55f7..5c655b187 100644 --- a/sdks/python/docs/SubTeamResponse.md +++ b/sdks/python/docs/SubTeamResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `team_id` | ```str``` | The id of a team | | | `name` | ```str``` | The name of a team | | - [[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/SubTemplateRole.md b/sdks/python/docs/SubTemplateRole.md index 196dd8939..09d0d74ff 100644 --- a/sdks/python/docs/SubTemplateRole.md +++ b/sdks/python/docs/SubTemplateRole.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The role name of the signer that will be displayed when the template is used to create a signature request. | | -| `order` | ```int, none_type``` | The order in which this signer role is required to sign. | | - +| `order` | ```int``` | The order in which this signer role is required to sign. | | [[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/SubUnclaimedDraftSigner.md b/sdks/python/docs/SubUnclaimedDraftSigner.md index 731cba206..a542cecc7 100644 --- a/sdks/python/docs/SubUnclaimedDraftSigner.md +++ b/sdks/python/docs/SubUnclaimedDraftSigner.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address`*_required_ | ```str``` | The email address of the signer. | | | `name`*_required_ | ```str``` | The name of the signer. | | -| `order` | ```int, none_type``` | The order the signer is required to sign in. | | - +| `order` | ```int``` | The order the signer is required to sign in. | | [[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/SubUnclaimedDraftTemplateSigner.md b/sdks/python/docs/SubUnclaimedDraftTemplateSigner.md index e8df5f38c..481850b20 100644 --- a/sdks/python/docs/SubUnclaimedDraftTemplateSigner.md +++ b/sdks/python/docs/SubUnclaimedDraftTemplateSigner.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `role`*_required_ | ```str``` | Must match an existing role in chosen Template(s). | | | `name`*_required_ | ```str``` | The name of the signer filling the role of `role`. | | | `email_address`*_required_ | ```str``` | The email address of the signer filling the role of `role`. | | - [[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/SubWhiteLabelingOptions.md b/sdks/python/docs/SubWhiteLabelingOptions.md index 1b63f2d5f..ac301537d 100644 --- a/sdks/python/docs/SubWhiteLabelingOptions.md +++ b/sdks/python/docs/SubWhiteLabelingOptions.md @@ -5,26 +5,23 @@ An array of elements and values serialized to a string, to be used to customize Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `header_background_color` | ```str``` | | [default to "#1A1A1A"] | -| `legal_version` | ```str``` | | [default to "terms1"] | -| `link_color` | ```str``` | | [default to "#00B3E6"] | -| `page_background_color` | ```str``` | | [default to "#F7F8F9"] | -| `primary_button_color` | ```str``` | | [default to "#00B3E6"] | -| `primary_button_color_hover` | ```str``` | | [default to "#00B3E6"] | -| `primary_button_text_color` | ```str``` | | [default to "#FFFFFF"] | -| `primary_button_text_color_hover` | ```str``` | | [default to "#FFFFFF"] | -| `secondary_button_color` | ```str``` | | [default to "#FFFFFF"] | -| `secondary_button_color_hover` | ```str``` | | [default to "#FFFFFF"] | -| `secondary_button_text_color` | ```str``` | | [default to "#00B3E6"] | -| `secondary_button_text_color_hover` | ```str``` | | [default to "#00B3E6"] | -| `text_color1` | ```str``` | | [default to "#808080"] | -| `text_color2` | ```str``` | | [default to "#FFFFFF"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `header_background_color` | ```str``` | | [default to '#1A1A1A'] | +| `legal_version` | ```str``` | | [default to 'terms1'] | +| `link_color` | ```str``` | | [default to '#00B3E6'] | +| `page_background_color` | ```str``` | | [default to '#F7F8F9'] | +| `primary_button_color` | ```str``` | | [default to '#00B3E6'] | +| `primary_button_color_hover` | ```str``` | | [default to '#00B3E6'] | +| `primary_button_text_color` | ```str``` | | [default to '#FFFFFF'] | +| `primary_button_text_color_hover` | ```str``` | | [default to '#FFFFFF'] | +| `secondary_button_color` | ```str``` | | [default to '#FFFFFF'] | +| `secondary_button_color_hover` | ```str``` | | [default to '#FFFFFF'] | +| `secondary_button_text_color` | ```str``` | | [default to '#00B3E6'] | +| `secondary_button_text_color_hover` | ```str``` | | [default to '#00B3E6'] | +| `text_color1` | ```str``` | | [default to '#808080'] | +| `text_color2` | ```str``` | | [default to '#FFFFFF'] | | `reset_to_default` | ```bool``` | Resets white labeling options to defaults. Only useful when updating an API App. | | - [[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/TeamAddMemberRequest.md b/sdks/python/docs/TeamAddMemberRequest.md index 40d3ee739..8b3120ff9 100644 --- a/sdks/python/docs/TeamAddMemberRequest.md +++ b/sdks/python/docs/TeamAddMemberRequest.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | `account_id` or `email_address` is required. If both are provided, the account id prevails.

Account id of the user to invite to your Team. | | | `email_address` | ```str``` | `account_id` or `email_address` is required, If both are provided, the account id prevails.

Email address of the user to invite to your Team. | | | `role` | ```str``` | A role member will take in a new Team.

**NOTE:** This parameter is used only if `team_id` is provided. | | - [[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/TeamApi.md b/sdks/python/docs/TeamApi.md index 8f4318ed3..d2cda32fa 100644 --- a/sdks/python/docs/TeamApi.md +++ b/sdks/python/docs/TeamApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```team_add_member```](TeamApi.md#team_add_member) | ```PUT /team/add_member``` | Add User to Team| |[```team_create```](TeamApi.md#team_create) | ```POST /team/create``` | Create Team| |[```team_delete```](TeamApi.md#team_delete) | ```DELETE /team/destroy``` | Delete Team| @@ -56,10 +56,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_add_member_request` | [**TeamAddMemberRequest**](TeamAddMemberRequest.md) | | | @@ -78,7 +77,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -128,10 +126,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_create_request` | [**TeamCreateRequest**](TeamCreateRequest.md) | | | @@ -149,7 +146,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -192,10 +188,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -211,7 +206,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -257,10 +251,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -276,7 +269,6 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -322,10 +314,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_id` | **str** | The id of the team. | [optional] | @@ -343,7 +334,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -391,10 +381,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `email_address` | **str** | The email address for which to display the team invites. | [optional] | @@ -412,7 +401,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -460,10 +448,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_id` | **str** | The id of the team that a member list is being requested from. | | @@ -483,7 +470,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -534,10 +520,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_remove_member_request` | [**TeamRemoveMemberRequest**](TeamRemoveMemberRequest.md) | | | @@ -555,7 +540,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -603,10 +587,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_id` | **str** | The id of the parent Team. | | @@ -626,7 +609,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -676,10 +658,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_update_request` | [**TeamUpdateRequest**](TeamUpdateRequest.md) | | | @@ -697,7 +678,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/docs/TeamCreateRequest.md b/sdks/python/docs/TeamCreateRequest.md index 132a1a36e..41d0b75f3 100644 --- a/sdks/python/docs/TeamCreateRequest.md +++ b/sdks/python/docs/TeamCreateRequest.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `name` | ```str``` | The name of your Team. | [default to "Untitled Team"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `name` | ```str``` | The name of your Team. | [default to 'Untitled Team'] | [[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/TeamGetInfoResponse.md b/sdks/python/docs/TeamGetInfoResponse.md index aecd9518a..b7c0dad0d 100644 --- a/sdks/python/docs/TeamGetInfoResponse.md +++ b/sdks/python/docs/TeamGetInfoResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `team` | [```TeamInfoResponse```](TeamInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `team`*_required_ | [```TeamInfoResponse```](TeamInfoResponse.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/TeamGetResponse.md b/sdks/python/docs/TeamGetResponse.md index cc950e7fc..9443320b5 100644 --- a/sdks/python/docs/TeamGetResponse.md +++ b/sdks/python/docs/TeamGetResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `team` | [```TeamResponse```](TeamResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `team`*_required_ | [```TeamResponse```](TeamResponse.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/TeamInfoResponse.md b/sdks/python/docs/TeamInfoResponse.md index 3d19173d2..832a13027 100644 --- a/sdks/python/docs/TeamInfoResponse.md +++ b/sdks/python/docs/TeamInfoResponse.md @@ -3,16 +3,13 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `team_id` | ```str``` | The id of a team | | | `team_parent` | [```TeamParentResponse```](TeamParentResponse.md) | | | | `name` | ```str``` | The name of a team | | | `num_members` | ```int``` | Number of members within a team | | | `num_sub_teams` | ```int``` | Number of sub teams within a team | | - [[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/TeamInviteResponse.md b/sdks/python/docs/TeamInviteResponse.md index 8c7cf802b..8e6e284c2 100644 --- a/sdks/python/docs/TeamInviteResponse.md +++ b/sdks/python/docs/TeamInviteResponse.md @@ -3,9 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address` | ```str``` | Email address of the user invited to this team. | | | `team_id` | ```str``` | Id of the team. | | | `role` | ```str``` | Role of the user invited to this team. | | @@ -13,7 +12,5 @@ | `redeemed_at` | ```int``` | Timestamp when the invitation was redeemed. | | | `expires_at` | ```int``` | Timestamp when the invitation is expiring. | | - [[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/TeamInvitesResponse.md b/sdks/python/docs/TeamInvitesResponse.md index 58eda2899..2b8097dca 100644 --- a/sdks/python/docs/TeamInvitesResponse.md +++ b/sdks/python/docs/TeamInvitesResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `team_invites` | [```[TeamInviteResponse]```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `team_invites`*_required_ | [```List[TeamInviteResponse]```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/TeamMemberResponse.md b/sdks/python/docs/TeamMemberResponse.md index d6ed7c830..0bb958d08 100644 --- a/sdks/python/docs/TeamMemberResponse.md +++ b/sdks/python/docs/TeamMemberResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | Account id of the team member. | | | `email_address` | ```str``` | Email address of the team member. | | | `role` | ```str``` | The specific role a member has on the team. | | - [[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/TeamMembersResponse.md b/sdks/python/docs/TeamMembersResponse.md index 2fadc892a..1d04f6711 100644 --- a/sdks/python/docs/TeamMembersResponse.md +++ b/sdks/python/docs/TeamMembersResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `team_members` | [```[TeamMemberResponse]```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `team_members`*_required_ | [```List[TeamMemberResponse]```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/TeamParentResponse.md b/sdks/python/docs/TeamParentResponse.md index c1347cd0c..ef6e9fb95 100644 --- a/sdks/python/docs/TeamParentResponse.md +++ b/sdks/python/docs/TeamParentResponse.md @@ -3,13 +3,10 @@ Information about the parent team if a team has one, set to `null` otherwise. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `team_id` | ```str``` | The id of a team | | | `name` | ```str``` | The name of a team | | - [[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/TeamRemoveMemberRequest.md b/sdks/python/docs/TeamRemoveMemberRequest.md index 7cc6c70ff..1f9445fcc 100644 --- a/sdks/python/docs/TeamRemoveMemberRequest.md +++ b/sdks/python/docs/TeamRemoveMemberRequest.md @@ -3,16 +3,13 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Account id to remove from your Team. | | | `email_address` | ```str``` | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Email address of the Account to remove from your Team. | | | `new_owner_email_address` | ```str``` | The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account.

**NOTE:** Only available for Enterprise plans. | | | `new_team_id` | ```str``` | Id of the new Team. | | | `new_role` | ```str``` | A new role member will take in a new Team.

**NOTE:** This parameter is used only if `new_team_id` is provided. | | - [[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/TeamResponse.md b/sdks/python/docs/TeamResponse.md index dc1fadc47..150fd646e 100644 --- a/sdks/python/docs/TeamResponse.md +++ b/sdks/python/docs/TeamResponse.md @@ -3,15 +3,12 @@ Contains information about your team and its members ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The name of your Team | | -| `accounts` | [```[AccountResponse]```](AccountResponse.md) | | | -| `invited_accounts` | [```[AccountResponse]```](AccountResponse.md) | A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. | | -| `invited_emails` | ```[str]``` | A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. | | - +| `accounts` | [```List[AccountResponse]```](AccountResponse.md) | | | +| `invited_accounts` | [```List[AccountResponse]```](AccountResponse.md) | A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. | | +| `invited_emails` | ```List[str]``` | A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. | | [[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/TeamSubTeamsResponse.md b/sdks/python/docs/TeamSubTeamsResponse.md index afd481b20..549f85004 100644 --- a/sdks/python/docs/TeamSubTeamsResponse.md +++ b/sdks/python/docs/TeamSubTeamsResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `sub_teams` | [```[SubTeamResponse]```](SubTeamResponse.md) | Contains a list with sub teams. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `sub_teams`*_required_ | [```List[SubTeamResponse]```](SubTeamResponse.md) | Contains a list with sub teams. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/TeamUpdateRequest.md b/sdks/python/docs/TeamUpdateRequest.md index 56cf99980..086b33d87 100644 --- a/sdks/python/docs/TeamUpdateRequest.md +++ b/sdks/python/docs/TeamUpdateRequest.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The name of your Team. | | - [[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/TemplateAddUserRequest.md b/sdks/python/docs/TemplateAddUserRequest.md index d3adc205c..a8ee5eb21 100644 --- a/sdks/python/docs/TemplateAddUserRequest.md +++ b/sdks/python/docs/TemplateAddUserRequest.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | The id of the Account to give access to the Template.
**NOTE:** The account id prevails if email address is also provided. | | | `email_address` | ```str``` | The email address of the Account to give access to the Template.
**NOTE:** The account id prevails if it is also provided. | | | `skip_notification` | ```bool``` | If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/TemplateApi.md b/sdks/python/docs/TemplateApi.md index 6651a7c25..787b5ef55 100644 --- a/sdks/python/docs/TemplateApi.md +++ b/sdks/python/docs/TemplateApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```template_add_user```](TemplateApi.md#template_add_user) | ```POST /template/add_user/{template_id}``` | Add User to Template| |[```template_create```](TemplateApi.md#template_create) | ```POST /template/create``` | Create Template| |[```template_create_embedded_draft```](TemplateApi.md#template_create_embedded_draft) | ```POST /template/create_embedded_draft``` | Create Embedded Template Draft| @@ -59,10 +59,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the Template to give the Account access to. | | @@ -81,7 +80,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -164,10 +162,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_create_request` | [**TemplateCreateRequest**](TemplateCreateRequest.md) | | | @@ -185,7 +182,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -268,10 +264,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_create_embedded_draft_request` | [**TemplateCreateEmbeddedDraftRequest**](TemplateCreateEmbeddedDraftRequest.md) | | | @@ -289,7 +284,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -334,10 +328,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the Template to delete. | | @@ -355,7 +348,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -366,7 +358,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # ```template_files``` -> ```file_type template_files(template_id)``` +> ```io.IOBase template_files(template_id)``` Get Template Files @@ -403,10 +395,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the template files to retrieve. | | @@ -414,7 +405,7 @@ with ApiClient(configuration) as api_client: ### Return type -**file_type** +**io.IOBase** ### Authorization @@ -425,7 +416,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/pdf, application/zip, application/json - ### HTTP response details | Status code | Description | Response headers | @@ -473,10 +463,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the template files to retrieve. | | @@ -494,7 +483,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -542,10 +530,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the template files to retrieve. | | @@ -564,7 +551,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -612,10 +598,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the Template to retrieve. | | @@ -633,7 +618,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -683,10 +667,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_id` | **str** | Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. | [optional] | @@ -707,7 +690,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -759,10 +741,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the Template to remove the Account's access to. | | @@ -781,7 +762,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -833,10 +813,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The ID of the template whose files to update. | | @@ -855,7 +834,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/docs/TemplateCreateEmbeddedDraftRequest.md b/sdks/python/docs/TemplateCreateEmbeddedDraftRequest.md index db0ae9828..2f257373d 100644 --- a/sdks/python/docs/TemplateCreateEmbeddedDraftRequest.md +++ b/sdks/python/docs/TemplateCreateEmbeddedDraftRequest.md @@ -3,36 +3,33 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `allow_ccs` | ```bool``` | This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. | [default to True] | | `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to False] | -| `attachments` | [```[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | -| `cc_roles` | ```[str]``` | The CC roles that must be assigned when using the template to send a signature request | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_roles` | ```List[str]``` | The CC roles that must be assigned when using the template to send a signature request | | | `editor_options` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | | `force_signer_roles` | ```bool``` | Provide users the ability to review/edit the template signer roles. | [default to False] | | `force_subject_message` | ```bool``` | Provide users the ability to review/edit the template subject and message. | [default to False] | -| `form_field_groups` | [```[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | -| `form_field_rules` | [```[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | -| `form_fields_per_document` | [```[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | -| `merge_fields` | [```[SubMergeField]```](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `merge_fields` | [```List[SubMergeField]```](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | | | `message` | ```str``` | The default template email message. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `show_preview` | ```bool``` | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | [default to False] | | `show_progress_stepper` | ```bool``` | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [default to True] | -| `signer_roles` | [```[SubTemplateRole]```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | +| `signer_roles` | [```List[SubTemplateRole]```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | | `skip_me_now` | ```bool``` | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [default to False] | | `subject` | ```str``` | The template title (alias). | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | | `use_preexisting_fields` | ```bool``` | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/TemplateCreateEmbeddedDraftResponse.md b/sdks/python/docs/TemplateCreateEmbeddedDraftResponse.md index 3014a273b..d0bfc7799 100644 --- a/sdks/python/docs/TemplateCreateEmbeddedDraftResponse.md +++ b/sdks/python/docs/TemplateCreateEmbeddedDraftResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template` | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template`*_required_ | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.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/TemplateCreateEmbeddedDraftResponseTemplate.md b/sdks/python/docs/TemplateCreateEmbeddedDraftResponseTemplate.md index 254517242..56b48ec48 100644 --- a/sdks/python/docs/TemplateCreateEmbeddedDraftResponseTemplate.md +++ b/sdks/python/docs/TemplateCreateEmbeddedDraftResponseTemplate.md @@ -3,15 +3,12 @@ Template object with parameters: `template_id`, `edit_url`, `expires_at`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `template_id` | ```str``` | The id of the Template. | | | `edit_url` | ```str``` | Link to edit the template. | | | `expires_at` | ```int``` | When the link expires. | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +| `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/TemplateCreateRequest.md b/sdks/python/docs/TemplateCreateRequest.md index b79634a44..ec9fb40ea 100644 --- a/sdks/python/docs/TemplateCreateRequest.md +++ b/sdks/python/docs/TemplateCreateRequest.md @@ -3,29 +3,26 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `form_fields_per_document`*_required_ | [```[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | -| `signer_roles`*_required_ | [```[SubTemplateRole]```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `form_fields_per_document`*_required_ | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `signer_roles`*_required_ | [```List[SubTemplateRole]```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to False] | -| `attachments` | [```[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | -| `cc_roles` | ```[str]``` | The CC roles that must be assigned when using the template to send a signature request | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_roles` | ```List[str]``` | The CC roles that must be assigned when using the template to send a signature request | | | `client_id` | ```str``` | Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. | | | `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | -| `form_field_groups` | [```[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | -| `form_field_rules` | [```[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | -| `merge_fields` | [```[SubMergeField]```](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `merge_fields` | [```List[SubMergeField]```](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | | | `message` | ```str``` | The default template email message. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `subject` | ```str``` | The template title (alias). | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | | `use_preexisting_fields` | ```bool``` | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/TemplateCreateResponse.md b/sdks/python/docs/TemplateCreateResponse.md index 742a854c6..466455c86 100644 --- a/sdks/python/docs/TemplateCreateResponse.md +++ b/sdks/python/docs/TemplateCreateResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template` | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template`*_required_ | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.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/TemplateCreateResponseTemplate.md b/sdks/python/docs/TemplateCreateResponseTemplate.md index a26dab427..1c3d76f37 100644 --- a/sdks/python/docs/TemplateCreateResponseTemplate.md +++ b/sdks/python/docs/TemplateCreateResponseTemplate.md @@ -3,12 +3,9 @@ Template object with parameters: `template_id`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `template_id` | ```str``` | The id of the Template. | | - [[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/TemplateEditResponse.md b/sdks/python/docs/TemplateEditResponse.md index d4405b397..acc73fbf7 100644 --- a/sdks/python/docs/TemplateEditResponse.md +++ b/sdks/python/docs/TemplateEditResponse.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_id` | ```str``` | The id of the Template. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_id`*_required_ | ```str``` | The id of the Template. | | [[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/TemplateGetResponse.md b/sdks/python/docs/TemplateGetResponse.md index 2e72a1565..05a0b2407 100644 --- a/sdks/python/docs/TemplateGetResponse.md +++ b/sdks/python/docs/TemplateGetResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template` | [```TemplateResponse```](TemplateResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template`*_required_ | [```TemplateResponse```](TemplateResponse.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/TemplateListResponse.md b/sdks/python/docs/TemplateListResponse.md index 305855f4c..60fb194da 100644 --- a/sdks/python/docs/TemplateListResponse.md +++ b/sdks/python/docs/TemplateListResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `templates` | [```[TemplateResponse]```](TemplateResponse.md) | List of templates that the API caller has access to. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `templates`*_required_ | [```List[TemplateResponse]```](TemplateResponse.md) | List of templates that the API caller has access to. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.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/TemplateRemoveUserRequest.md b/sdks/python/docs/TemplateRemoveUserRequest.md index a4782eb10..36b2de004 100644 --- a/sdks/python/docs/TemplateRemoveUserRequest.md +++ b/sdks/python/docs/TemplateRemoveUserRequest.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | | | `email_address` | ```str``` | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | | - [[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/TemplateResponse.md b/sdks/python/docs/TemplateResponse.md index 4da804789..7fb5cedbc 100644 --- a/sdks/python/docs/TemplateResponse.md +++ b/sdks/python/docs/TemplateResponse.md @@ -3,26 +3,23 @@ Contains information about the templates you and your team have created. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `template_id` | ```str``` | The id of the Template. | | | `title` | ```str``` | The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | | | `message` | ```str``` | The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | | | `updated_at` | ```int``` | Time the template was last updated. | | -| `is_embedded` | ```bool, none_type``` | `true` if this template was created using an embedded flow, `false` if it was created on our website. | | -| `is_creator` | ```bool, none_type``` | `true` if you are the owner of this template, `false` if it's been shared with you by a team member. | | -| `can_edit` | ```bool, none_type``` | Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). | | -| `is_locked` | ```bool, none_type``` | Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. | | -| `metadata` | [```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}```](.md) | The metadata attached to the template. | | -| `signer_roles` | [```[TemplateResponseSignerRole]```](TemplateResponseSignerRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | -| `cc_roles` | [```[TemplateResponseCCRole]```](TemplateResponseCCRole.md) | An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. | | -| `documents` | [```[TemplateResponseDocument]```](TemplateResponseDocument.md) | An array describing each document associated with this Template. Includes form field data for each document. | | -| `custom_fields` | [```[TemplateResponseDocumentCustomFieldBase], none_type```](TemplateResponseDocumentCustomFieldBase.md) | Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | | -| `named_form_fields` | [```[TemplateResponseDocumentFormFieldBase], none_type```](TemplateResponseDocumentFormFieldBase.md) | Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | | -| `accounts` | [```[TemplateResponseAccount], none_type```](TemplateResponseAccount.md) | An array of the Accounts that can use this Template. | | - +| `is_embedded` | ```bool``` | `true` if this template was created using an embedded flow, `false` if it was created on our website. | | +| `is_creator` | ```bool``` | `true` if you are the owner of this template, `false` if it's been shared with you by a team member. | | +| `can_edit` | ```bool``` | Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). | | +| `is_locked` | ```bool``` | Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. | | +| `metadata` | ```object``` | The metadata attached to the template. | | +| `signer_roles` | [```List[TemplateResponseSignerRole]```](TemplateResponseSignerRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | +| `cc_roles` | [```List[TemplateResponseCCRole]```](TemplateResponseCCRole.md) | An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. | | +| `documents` | [```List[TemplateResponseDocument]```](TemplateResponseDocument.md) | An array describing each document associated with this Template. Includes form field data for each document. | | +| `custom_fields` | [```List[TemplateResponseDocumentCustomFieldBase]```](TemplateResponseDocumentCustomFieldBase.md) | Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | | +| `named_form_fields` | [```List[TemplateResponseDocumentFormFieldBase]```](TemplateResponseDocumentFormFieldBase.md) | Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | | +| `accounts` | [```List[TemplateResponseAccount]```](TemplateResponseAccount.md) | An array of the Accounts that can use this Template. | | [[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/TemplateResponseAccount.md b/sdks/python/docs/TemplateResponseAccount.md index ea5942df8..7668fc726 100644 --- a/sdks/python/docs/TemplateResponseAccount.md +++ b/sdks/python/docs/TemplateResponseAccount.md @@ -3,9 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | The id of the Account. | | | `email_address` | ```str``` | The email address associated with the Account. | | | `is_locked` | ```bool``` | Returns `true` if the user has been locked out of their account by a team admin. | | @@ -13,7 +12,5 @@ | `is_paid_hf` | ```bool``` | Returns `true` if the user has a paid HelloFax account. | | | `quotas` | [```TemplateResponseAccountQuota```](TemplateResponseAccountQuota.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/TemplateResponseAccountQuota.md b/sdks/python/docs/TemplateResponseAccountQuota.md index 3a3cbb9e4..7e83dcc11 100644 --- a/sdks/python/docs/TemplateResponseAccountQuota.md +++ b/sdks/python/docs/TemplateResponseAccountQuota.md @@ -3,15 +3,12 @@ An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `templates_left` | ```int``` | API templates remaining. | | | `api_signature_requests_left` | ```int``` | API signature requests remaining. | | | `documents_left` | ```int``` | Signature requests remaining. | | | `sms_verifications_left` | ```int``` | SMS verifications remaining. | | - [[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/TemplateResponseCCRole.md b/sdks/python/docs/TemplateResponseCCRole.md index 3f963b6d0..1aa9fa707 100644 --- a/sdks/python/docs/TemplateResponseCCRole.md +++ b/sdks/python/docs/TemplateResponseCCRole.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The name of the Role. | | - [[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/TemplateResponseDocument.md b/sdks/python/docs/TemplateResponseDocument.md index d45af8ee6..8071995b9 100644 --- a/sdks/python/docs/TemplateResponseDocument.md +++ b/sdks/python/docs/TemplateResponseDocument.md @@ -3,17 +3,14 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | Name of the associated file. | | | `index` | ```int``` | Document ordering, the lowest index is displayed first and the highest last (0-based indexing). | | -| `field_groups` | [```[TemplateResponseDocumentFieldGroup]```](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | | -| `form_fields` | [```[TemplateResponseDocumentFormFieldBase]```](TemplateResponseDocumentFormFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | | -| `custom_fields` | [```[TemplateResponseDocumentCustomFieldBase]```](TemplateResponseDocumentCustomFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | | -| `static_fields` | [```[TemplateResponseDocumentStaticFieldBase], none_type```](TemplateResponseDocumentStaticFieldBase.md) | An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. | | - +| `field_groups` | [```List[TemplateResponseDocumentFieldGroup]```](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | | +| `form_fields` | [```List[TemplateResponseDocumentFormFieldBase]```](TemplateResponseDocumentFormFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | | +| `custom_fields` | [```List[TemplateResponseDocumentCustomFieldBase]```](TemplateResponseDocumentCustomFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | | +| `static_fields` | [```List[TemplateResponseDocumentStaticFieldBase]```](TemplateResponseDocumentStaticFieldBase.md) | An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. | | [[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/TemplateResponseDocumentCustomFieldBase.md b/sdks/python/docs/TemplateResponseDocumentCustomFieldBase.md index c05c9f7a2..83354a3f4 100644 --- a/sdks/python/docs/TemplateResponseDocumentCustomFieldBase.md +++ b/sdks/python/docs/TemplateResponseDocumentCustomFieldBase.md @@ -3,21 +3,18 @@ An array of Form Field objects containing the name and type of each named field. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `type`*_required_ | ```str``` | | | | `api_id` | ```str``` | The unique ID for this field. | | | `name` | ```str``` | The name of the Custom Field. | | -| `signer` | ```str, none_type``` | The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). | | +| `signer` | ```str``` | The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). | | | `x` | ```int``` | The horizontal offset in pixels for this form field. | | | `y` | ```int``` | The vertical offset in pixels for this form field. | | | `width` | ```int``` | The width in pixels of this form field. | | | `height` | ```int``` | The height in pixels of this form field. | | | `required` | ```bool``` | Boolean showing whether or not this field is required. | | -| `group` | ```str, none_type``` | The name of the group this field is in. If this field is not a group, this defaults to `null`. | | - +| `group` | ```str``` | The name of the group this field is in. If this field is not a group, this defaults to `null`. | | [[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/TemplateResponseDocumentCustomFieldCheckbox.md b/sdks/python/docs/TemplateResponseDocumentCustomFieldCheckbox.md index b0f7e6085..0bbf24c50 100644 --- a/sdks/python/docs/TemplateResponseDocumentCustomFieldCheckbox.md +++ b/sdks/python/docs/TemplateResponseDocumentCustomFieldCheckbox.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentCustomFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to "checkbox"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to 'checkbox'] | [[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/TemplateResponseDocumentCustomFieldText.md b/sdks/python/docs/TemplateResponseDocumentCustomFieldText.md index a2197392f..474097e03 100644 --- a/sdks/python/docs/TemplateResponseDocumentCustomFieldText.md +++ b/sdks/python/docs/TemplateResponseDocumentCustomFieldText.md @@ -3,16 +3,13 @@ This class extends `TemplateResponseDocumentCustomFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to "text"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to 'text'] | | `avg_text_length` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `is_multiline` | ```bool``` | Whether this form field is multiline text. | | | `original_font_size` | ```int``` | Original font size used in this form field's text. | | | `font_family` | ```str``` | Font family used in this form field's text. | | - [[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/TemplateResponseDocumentFieldGroup.md b/sdks/python/docs/TemplateResponseDocumentFieldGroup.md index f35b44591..29a19c7cf 100644 --- a/sdks/python/docs/TemplateResponseDocumentFieldGroup.md +++ b/sdks/python/docs/TemplateResponseDocumentFieldGroup.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The name of the form field group. | | | `rule` | [```TemplateResponseDocumentFieldGroupRule```](TemplateResponseDocumentFieldGroupRule.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/TemplateResponseDocumentFieldGroupRule.md b/sdks/python/docs/TemplateResponseDocumentFieldGroupRule.md index 06a8393b3..3f0a44f1a 100644 --- a/sdks/python/docs/TemplateResponseDocumentFieldGroupRule.md +++ b/sdks/python/docs/TemplateResponseDocumentFieldGroupRule.md @@ -3,13 +3,10 @@ The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping). ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `requirement` | ```str``` | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | | | `group_label` | ```str``` | Name of the group | | - [[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/TemplateResponseDocumentFormFieldBase.md b/sdks/python/docs/TemplateResponseDocumentFormFieldBase.md index bb4b91a4b..b8aecfa10 100644 --- a/sdks/python/docs/TemplateResponseDocumentFormFieldBase.md +++ b/sdks/python/docs/TemplateResponseDocumentFormFieldBase.md @@ -3,9 +3,8 @@ An array of Form Field objects containing the name and type of each named field. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `type`*_required_ | ```str``` | | | | `api_id` | ```str``` | A unique id for the form field. | | | `name` | ```str``` | The name of the form field. | | @@ -15,9 +14,7 @@ An array of Form Field objects containing the name and type of each named field. | `width` | ```int``` | The width in pixels of this form field. | | | `height` | ```int``` | The height in pixels of this form field. | | | `required` | ```bool``` | Boolean showing whether or not this field is required. | | -| `group` | ```str, none_type``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | | - +| `group` | ```str``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | | [[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/TemplateResponseDocumentFormFieldCheckbox.md b/sdks/python/docs/TemplateResponseDocumentFormFieldCheckbox.md index 6aad7acdc..6d35e1c71 100644 --- a/sdks/python/docs/TemplateResponseDocumentFormFieldCheckbox.md +++ b/sdks/python/docs/TemplateResponseDocumentFormFieldCheckbox.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "checkbox"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'checkbox'] | [[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/TemplateResponseDocumentFormFieldDateSigned.md b/sdks/python/docs/TemplateResponseDocumentFormFieldDateSigned.md index a07b7f327..863ed1190 100644 --- a/sdks/python/docs/TemplateResponseDocumentFormFieldDateSigned.md +++ b/sdks/python/docs/TemplateResponseDocumentFormFieldDateSigned.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "date_signed"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'date_signed'] | [[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/TemplateResponseDocumentFormFieldDropdown.md b/sdks/python/docs/TemplateResponseDocumentFormFieldDropdown.md index 155e1e322..99d07332c 100644 --- a/sdks/python/docs/TemplateResponseDocumentFormFieldDropdown.md +++ b/sdks/python/docs/TemplateResponseDocumentFormFieldDropdown.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "dropdown"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'dropdown'] | [[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/TemplateResponseDocumentFormFieldHyperlink.md b/sdks/python/docs/TemplateResponseDocumentFormFieldHyperlink.md index b1e73fa7d..dd7db8dde 100644 --- a/sdks/python/docs/TemplateResponseDocumentFormFieldHyperlink.md +++ b/sdks/python/docs/TemplateResponseDocumentFormFieldHyperlink.md @@ -3,16 +3,13 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "hyperlink"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'hyperlink'] | | `avg_text_length` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `is_multiline` | ```bool``` | Whether this form field is multiline text. | | | `original_font_size` | ```int``` | Original font size used in this form field's text. | | | `font_family` | ```str``` | Font family used in this form field's text. | | - [[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/TemplateResponseDocumentFormFieldInitials.md b/sdks/python/docs/TemplateResponseDocumentFormFieldInitials.md index 86c5942fe..80cc52231 100644 --- a/sdks/python/docs/TemplateResponseDocumentFormFieldInitials.md +++ b/sdks/python/docs/TemplateResponseDocumentFormFieldInitials.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "initials"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'initials'] | [[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/TemplateResponseDocumentFormFieldRadio.md b/sdks/python/docs/TemplateResponseDocumentFormFieldRadio.md index 5a69222e7..af3e60ed9 100644 --- a/sdks/python/docs/TemplateResponseDocumentFormFieldRadio.md +++ b/sdks/python/docs/TemplateResponseDocumentFormFieldRadio.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "radio"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'radio'] | [[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/TemplateResponseDocumentFormFieldSignature.md b/sdks/python/docs/TemplateResponseDocumentFormFieldSignature.md index 6b33dd7c7..304eaf502 100644 --- a/sdks/python/docs/TemplateResponseDocumentFormFieldSignature.md +++ b/sdks/python/docs/TemplateResponseDocumentFormFieldSignature.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "signature"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'signature'] | [[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/TemplateResponseDocumentFormFieldText.md b/sdks/python/docs/TemplateResponseDocumentFormFieldText.md index b4214e34e..bafb6e36b 100644 --- a/sdks/python/docs/TemplateResponseDocumentFormFieldText.md +++ b/sdks/python/docs/TemplateResponseDocumentFormFieldText.md @@ -3,17 +3,14 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "text"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'text'] | | `avg_text_length` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `is_multiline` | ```bool``` | Whether this form field is multiline text. | | | `original_font_size` | ```int``` | Original font size used in this form field's text. | | | `font_family` | ```str``` | Font family used in this form field's text. | | -| `validation_type` | ```str, none_type``` | Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. | | - +| `validation_type` | ```str``` | Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. | | [[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/TemplateResponseDocumentStaticFieldBase.md b/sdks/python/docs/TemplateResponseDocumentStaticFieldBase.md index 1b4ad5311..a7347b687 100644 --- a/sdks/python/docs/TemplateResponseDocumentStaticFieldBase.md +++ b/sdks/python/docs/TemplateResponseDocumentStaticFieldBase.md @@ -3,21 +3,18 @@ An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `type`*_required_ | ```str``` | | | | `api_id` | ```str``` | A unique id for the static field. | | | `name` | ```str``` | The name of the static field. | | -| `signer` | ```str``` | The signer of the Static Field. | [default to "me_now"] | +| `signer` | ```str``` | The signer of the Static Field. | [default to 'me_now'] | | `x` | ```int``` | The horizontal offset in pixels for this static field. | | | `y` | ```int``` | The vertical offset in pixels for this static field. | | | `width` | ```int``` | The width in pixels of this static field. | | | `height` | ```int``` | The height in pixels of this static field. | | | `required` | ```bool``` | Boolean showing whether or not this field is required. | | -| `group` | ```str, none_type``` | The name of the group this field is in. If this field is not a group, this defaults to `null`. | | - +| `group` | ```str``` | The name of the group this field is in. If this field is not a group, this defaults to `null`. | | [[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/TemplateResponseDocumentStaticFieldCheckbox.md b/sdks/python/docs/TemplateResponseDocumentStaticFieldCheckbox.md index aed2054db..a1acbb17c 100644 --- a/sdks/python/docs/TemplateResponseDocumentStaticFieldCheckbox.md +++ b/sdks/python/docs/TemplateResponseDocumentStaticFieldCheckbox.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "checkbox"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'checkbox'] | [[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/TemplateResponseDocumentStaticFieldDateSigned.md b/sdks/python/docs/TemplateResponseDocumentStaticFieldDateSigned.md index 8eeaa39b7..62c4b1e7d 100644 --- a/sdks/python/docs/TemplateResponseDocumentStaticFieldDateSigned.md +++ b/sdks/python/docs/TemplateResponseDocumentStaticFieldDateSigned.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "date_signed"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'date_signed'] | [[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/TemplateResponseDocumentStaticFieldDropdown.md b/sdks/python/docs/TemplateResponseDocumentStaticFieldDropdown.md index d3fac7957..302afcf69 100644 --- a/sdks/python/docs/TemplateResponseDocumentStaticFieldDropdown.md +++ b/sdks/python/docs/TemplateResponseDocumentStaticFieldDropdown.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "dropdown"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'dropdown'] | [[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/TemplateResponseDocumentStaticFieldHyperlink.md b/sdks/python/docs/TemplateResponseDocumentStaticFieldHyperlink.md index c7c08bfea..52e93c2ef 100644 --- a/sdks/python/docs/TemplateResponseDocumentStaticFieldHyperlink.md +++ b/sdks/python/docs/TemplateResponseDocumentStaticFieldHyperlink.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "hyperlink"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'hyperlink'] | [[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/TemplateResponseDocumentStaticFieldInitials.md b/sdks/python/docs/TemplateResponseDocumentStaticFieldInitials.md index f60380d6f..227f77c7b 100644 --- a/sdks/python/docs/TemplateResponseDocumentStaticFieldInitials.md +++ b/sdks/python/docs/TemplateResponseDocumentStaticFieldInitials.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "initials"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'initials'] | [[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/TemplateResponseDocumentStaticFieldRadio.md b/sdks/python/docs/TemplateResponseDocumentStaticFieldRadio.md index 1274162b8..8002b86de 100644 --- a/sdks/python/docs/TemplateResponseDocumentStaticFieldRadio.md +++ b/sdks/python/docs/TemplateResponseDocumentStaticFieldRadio.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "radio"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'radio'] | [[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/TemplateResponseDocumentStaticFieldSignature.md b/sdks/python/docs/TemplateResponseDocumentStaticFieldSignature.md index a9496a99e..443328009 100644 --- a/sdks/python/docs/TemplateResponseDocumentStaticFieldSignature.md +++ b/sdks/python/docs/TemplateResponseDocumentStaticFieldSignature.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "signature"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'signature'] | [[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/TemplateResponseDocumentStaticFieldText.md b/sdks/python/docs/TemplateResponseDocumentStaticFieldText.md index 89c3cffb0..1988dc85f 100644 --- a/sdks/python/docs/TemplateResponseDocumentStaticFieldText.md +++ b/sdks/python/docs/TemplateResponseDocumentStaticFieldText.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "text"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'text'] | [[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/TemplateResponseFieldAvgTextLength.md b/sdks/python/docs/TemplateResponseFieldAvgTextLength.md index 07c94cbb2..f50991c74 100644 --- a/sdks/python/docs/TemplateResponseFieldAvgTextLength.md +++ b/sdks/python/docs/TemplateResponseFieldAvgTextLength.md @@ -3,13 +3,10 @@ Average text length in this field. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `num_lines` | ```int``` | Number of lines. | | | `num_chars_per_line` | ```int``` | Number of characters per line. | | - [[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/TemplateResponseSignerRole.md b/sdks/python/docs/TemplateResponseSignerRole.md index f4e0d4537..7a65a361d 100644 --- a/sdks/python/docs/TemplateResponseSignerRole.md +++ b/sdks/python/docs/TemplateResponseSignerRole.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The name of the Role. | | | `order` | ```int``` | If signer order is assigned this is the 0-based index for this role. | | - [[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/TemplateUpdateFilesRequest.md b/sdks/python/docs/TemplateUpdateFilesRequest.md index f3a429f57..7122faddb 100644 --- a/sdks/python/docs/TemplateUpdateFilesRequest.md +++ b/sdks/python/docs/TemplateUpdateFilesRequest.md @@ -3,17 +3,14 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id` | ```str``` | Client id of the app you're using to update this template. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to use for the template.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to use for the template.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `message` | ```str``` | The new default template email message. | | | `subject` | ```str``` | The new default template email subject. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/TemplateUpdateFilesResponse.md b/sdks/python/docs/TemplateUpdateFilesResponse.md index 254d949af..75af64c6d 100644 --- a/sdks/python/docs/TemplateUpdateFilesResponse.md +++ b/sdks/python/docs/TemplateUpdateFilesResponse.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template` | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template`*_required_ | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.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/TemplateUpdateFilesResponseTemplate.md b/sdks/python/docs/TemplateUpdateFilesResponseTemplate.md index 3dbc3392d..27ea3171f 100644 --- a/sdks/python/docs/TemplateUpdateFilesResponseTemplate.md +++ b/sdks/python/docs/TemplateUpdateFilesResponseTemplate.md @@ -3,13 +3,10 @@ Contains template id ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `template_id` | ```str``` | The id of the Template. | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +| `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/UnclaimedDraftApi.md b/sdks/python/docs/UnclaimedDraftApi.md index 3aa6a49bf..03e8228fb 100644 --- a/sdks/python/docs/UnclaimedDraftApi.md +++ b/sdks/python/docs/UnclaimedDraftApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```unclaimed_draft_create```](UnclaimedDraftApi.md#unclaimed_draft_create) | ```POST /unclaimed_draft/create``` | Create Unclaimed Draft| |[```unclaimed_draft_create_embedded```](UnclaimedDraftApi.md#unclaimed_draft_create_embedded) | ```POST /unclaimed_draft/create_embedded``` | Create Embedded Unclaimed Draft| |[```unclaimed_draft_create_embedded_with_template```](UnclaimedDraftApi.md#unclaimed_draft_create_embedded_with_template) | ```POST /unclaimed_draft/create_embedded_with_template``` | Create Embedded Unclaimed Draft with Template| @@ -89,10 +89,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `unclaimed_draft_create_request` | [**UnclaimedDraftCreateRequest**](UnclaimedDraftCreateRequest.md) | | | @@ -110,7 +109,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -163,10 +161,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `unclaimed_draft_create_embedded_request` | [**UnclaimedDraftCreateEmbeddedRequest**](UnclaimedDraftCreateEmbeddedRequest.md) | | | @@ -184,7 +181,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -250,10 +246,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `unclaimed_draft_create_embedded_with_template_request` | [**UnclaimedDraftCreateEmbeddedWithTemplateRequest**](UnclaimedDraftCreateEmbeddedWithTemplateRequest.md) | | | @@ -271,7 +266,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -324,10 +318,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The ID of the signature request to edit and resend. | | @@ -346,7 +339,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/docs/UnclaimedDraftCreateEmbeddedRequest.md b/sdks/python/docs/UnclaimedDraftCreateEmbeddedRequest.md index 94e5e0451..bc81c3c4a 100644 --- a/sdks/python/docs/UnclaimedDraftCreateEmbeddedRequest.md +++ b/sdks/python/docs/UnclaimedDraftCreateEmbeddedRequest.md @@ -3,47 +3,44 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `requester_email_address`*_required_ | ```str``` | The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `allow_ccs` | ```bool``` | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [default to True] | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | | `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

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

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```List[str]``` | The email addresses that should be CCed. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

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

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | | `hide_text_tags` | ```bool``` | Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. | [default to False] | | `hold_request` | ```bool``` | The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. | [default to False] | | `is_for_embedded_signing` | ```bool``` | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [default to False] | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `requesting_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully request a signature. | | | `show_preview` | ```bool``` | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | | | `show_progress_stepper` | ```bool``` | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [default to True] | -| `signers` | [```[SubUnclaimedDraftSigner]```](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | | +| `signers` | [```List[SubUnclaimedDraftSigner]```](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `skip_me_now` | ```bool``` | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [default to False] | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | -| `type` | ```str``` | The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. | [default to "request_signature"] | +| `type` | ```str``` | The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. | [default to 'request_signature'] | | `use_preexisting_fields` | ```bool``` | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [default to False] | | `use_text_tags` | ```bool``` | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [default to False] | | `populate_auto_fill_fields` | ```bool``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to False] | -| `expires_at` | ```int, none_type``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | | - +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | | [[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/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md b/sdks/python/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md index d5a2806a4..ef959b997 100644 --- a/sdks/python/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +++ b/sdks/python/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md @@ -3,31 +3,30 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `requester_email_address`*_required_ | ```str``` | The email address of the user that should be designated as the requester of this draft. | | -| `template_ids`*_required_ | ```[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | | +| `template_ids`*_required_ | ```List[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | | `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to False] | -| `ccs` | [```[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | | `editor_options` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | -| `files` | ```[file_type]``` | Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | | -| `file_urls` | ```[str]``` | Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | | +| `file_urls` | ```List[str]``` | Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | | | `force_signer_roles` | ```bool``` | Provide users the ability to review/edit the template signer roles. | [default to False] | | `force_subject_message` | ```bool``` | Provide users the ability to review/edit the template subject and message. | [default to False] | | `hold_request` | ```bool``` | The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. | [default to False] | | `is_for_embedded_signing` | ```bool``` | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [default to False] | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `preview_only` | ```bool``` | This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor).

- `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience.

**NOTE:** This parameter overwrites `show_preview=1` (if set). | [default to False] | | `requesting_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully request a signature. | | | `show_preview` | ```bool``` | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | [default to False] | | `show_progress_stepper` | ```bool``` | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [default to True] | -| `signers` | [```[SubUnclaimedDraftTemplateSigner]```](SubUnclaimedDraftTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `signers` | [```List[SubUnclaimedDraftTemplateSigner]```](SubUnclaimedDraftTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `skip_me_now` | ```bool``` | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [default to False] | @@ -37,7 +36,5 @@ | `populate_auto_fill_fields` | ```bool``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to False] | | `allow_ccs` | ```bool``` | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/UnclaimedDraftCreateRequest.md b/sdks/python/docs/UnclaimedDraftCreateRequest.md index 78379a276..61471fcf0 100644 --- a/sdks/python/docs/UnclaimedDraftCreateRequest.md +++ b/sdks/python/docs/UnclaimedDraftCreateRequest.md @@ -3,35 +3,32 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `type`*_required_ | ```str``` | The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

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

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | -| `attachments` | [```[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | -| `cc_email_addresses` | ```[str]``` | The email addresses that should be CCed. | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```List[str]``` | The email addresses that should be CCed. | | | `client_id` | ```str``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

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

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

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

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

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | | `hide_text_tags` | ```bool``` | Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. | [default to False] | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `show_progress_stepper` | ```bool``` | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [default to True] | -| `signers` | [```[SubUnclaimedDraftSigner]```](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | | +| `signers` | [```List[SubUnclaimedDraftSigner]```](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `use_preexisting_fields` | ```bool``` | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [default to False] | | `use_text_tags` | ```bool``` | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [default to False] | -| `expires_at` | ```int, none_type``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | | - +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | | [[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/UnclaimedDraftCreateResponse.md b/sdks/python/docs/UnclaimedDraftCreateResponse.md index 98222ba9c..bfb420cdd 100644 --- a/sdks/python/docs/UnclaimedDraftCreateResponse.md +++ b/sdks/python/docs/UnclaimedDraftCreateResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `unclaimed_draft` | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `unclaimed_draft`*_required_ | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.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/UnclaimedDraftEditAndResendRequest.md b/sdks/python/docs/UnclaimedDraftEditAndResendRequest.md index 6c76b3f0c..d13a104a7 100644 --- a/sdks/python/docs/UnclaimedDraftEditAndResendRequest.md +++ b/sdks/python/docs/UnclaimedDraftEditAndResendRequest.md @@ -3,9 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `editor_options` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `is_for_embedded_signing` | ```bool``` | The request created from this draft will also be signable in embedded mode if set to `true`. | | @@ -15,7 +14,5 @@ | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/sdks/python/docs/UnclaimedDraftResponse.md b/sdks/python/docs/UnclaimedDraftResponse.md index 8865726c5..2a3e4f967 100644 --- a/sdks/python/docs/UnclaimedDraftResponse.md +++ b/sdks/python/docs/UnclaimedDraftResponse.md @@ -3,17 +3,14 @@ A group of documents that a user can take ownership of via the claim URL. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `signature_request_id` | ```str, none_type``` | The ID of the signature request that is represented by this UnclaimedDraft. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `signature_request_id` | ```str``` | The ID of the signature request that is represented by this UnclaimedDraft. | | | `claim_url` | ```str``` | The URL to be used to claim this UnclaimedDraft. | | -| `signing_redirect_url` | ```str, none_type``` | The URL you want signers redirected to after they successfully sign. | | -| `requesting_redirect_url` | ```str, none_type``` | The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). | | -| `expires_at` | ```int, none_type``` | When the link expires. | | +| `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | +| `requesting_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). | | +| `expires_at` | ```int``` | When the link expires. | | | `test_mode` | ```bool``` | Whether this is a test draft. Signature requests made from test drafts have no legal value. | | - [[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/WarningResponse.md b/sdks/python/docs/WarningResponse.md index 33a233dc2..3de57d0fc 100644 --- a/sdks/python/docs/WarningResponse.md +++ b/sdks/python/docs/WarningResponse.md @@ -3,13 +3,10 @@ A list of warnings. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `warning_msg`*_required_ | ```str``` | Warning message | | | `warning_name`*_required_ | ```str``` | Warning name | | - [[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 ccc78f37b..c8eb4dc5d 100644 --- a/sdks/python/dropbox_sign/__init__.py +++ b/sdks/python/dropbox_sign/__init__.py @@ -1,30 +1,218 @@ +# coding: utf-8 + # flake8: noqa """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +__version__ = "1.6-dev" -__version__ = "1.5-dev" +# import apis into sdk package +from dropbox_sign.apis import * # import ApiClient +from dropbox_sign.api_response import ApiResponse from dropbox_sign.api_client import ApiClient - -# import Configuration from dropbox_sign.configuration import Configuration - -# import exceptions from dropbox_sign.exceptions import OpenApiException -from dropbox_sign.exceptions import ApiAttributeError from dropbox_sign.exceptions import ApiTypeError from dropbox_sign.exceptions import ApiValueError from dropbox_sign.exceptions import ApiKeyError +from dropbox_sign.exceptions import ApiAttributeError from dropbox_sign.exceptions import ApiException +# import models into sdk package +from dropbox_sign.models.account_create_request import AccountCreateRequest +from dropbox_sign.models.account_create_response import AccountCreateResponse +from dropbox_sign.models.account_get_response import AccountGetResponse +from dropbox_sign.models.account_response import AccountResponse +from dropbox_sign.models.account_response_quotas import AccountResponseQuotas +from dropbox_sign.models.account_response_usage import AccountResponseUsage +from dropbox_sign.models.account_update_request import AccountUpdateRequest +from dropbox_sign.models.account_verify_request import AccountVerifyRequest +from dropbox_sign.models.account_verify_response import AccountVerifyResponse +from dropbox_sign.models.account_verify_response_account import AccountVerifyResponseAccount +from dropbox_sign.models.api_app_create_request import ApiAppCreateRequest +from dropbox_sign.models.api_app_get_response import ApiAppGetResponse +from dropbox_sign.models.api_app_list_response import ApiAppListResponse +from dropbox_sign.models.api_app_response import ApiAppResponse +from dropbox_sign.models.api_app_response_o_auth import ApiAppResponseOAuth +from dropbox_sign.models.api_app_response_options import ApiAppResponseOptions +from dropbox_sign.models.api_app_response_owner_account import ApiAppResponseOwnerAccount +from dropbox_sign.models.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions +from dropbox_sign.models.api_app_update_request import ApiAppUpdateRequest +from dropbox_sign.models.bulk_send_job_get_response import BulkSendJobGetResponse +from dropbox_sign.models.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests +from dropbox_sign.models.bulk_send_job_list_response import BulkSendJobListResponse +from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse +from dropbox_sign.models.bulk_send_job_send_response import BulkSendJobSendResponse +from dropbox_sign.models.embedded_edit_url_request import EmbeddedEditUrlRequest +from dropbox_sign.models.embedded_edit_url_response import EmbeddedEditUrlResponse +from dropbox_sign.models.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded +from dropbox_sign.models.embedded_sign_url_response import EmbeddedSignUrlResponse +from dropbox_sign.models.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded +from dropbox_sign.models.error_response import ErrorResponse +from dropbox_sign.models.error_response_error import ErrorResponseError +from dropbox_sign.models.event_callback_request import EventCallbackRequest +from dropbox_sign.models.event_callback_request_event import EventCallbackRequestEvent +from dropbox_sign.models.event_callback_request_event_metadata import EventCallbackRequestEventMetadata +from dropbox_sign.models.fax_line_add_user_request import FaxLineAddUserRequest +from dropbox_sign.models.fax_line_area_code_get_country_enum import FaxLineAreaCodeGetCountryEnum +from dropbox_sign.models.fax_line_area_code_get_province_enum import FaxLineAreaCodeGetProvinceEnum +from dropbox_sign.models.fax_line_area_code_get_response import FaxLineAreaCodeGetResponse +from dropbox_sign.models.fax_line_area_code_get_state_enum import FaxLineAreaCodeGetStateEnum +from dropbox_sign.models.fax_line_create_request import FaxLineCreateRequest +from dropbox_sign.models.fax_line_delete_request import FaxLineDeleteRequest +from dropbox_sign.models.fax_line_list_response import FaxLineListResponse +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.file_response import FileResponse +from dropbox_sign.models.file_response_data_uri import FileResponseDataUri +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.o_auth_token_generate_request import OAuthTokenGenerateRequest +from dropbox_sign.models.o_auth_token_refresh_request import OAuthTokenRefreshRequest +from dropbox_sign.models.o_auth_token_response import OAuthTokenResponse +from dropbox_sign.models.report_create_request import ReportCreateRequest +from dropbox_sign.models.report_create_response import ReportCreateResponse +from dropbox_sign.models.report_response import ReportResponse +from dropbox_sign.models.signature_request_bulk_create_embedded_with_template_request import SignatureRequestBulkCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_bulk_send_with_template_request import SignatureRequestBulkSendWithTemplateRequest +from dropbox_sign.models.signature_request_create_embedded_request import SignatureRequestCreateEmbeddedRequest +from dropbox_sign.models.signature_request_create_embedded_with_template_request import SignatureRequestCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_get_response import SignatureRequestGetResponse +from dropbox_sign.models.signature_request_list_response import SignatureRequestListResponse +from dropbox_sign.models.signature_request_remind_request import SignatureRequestRemindRequest +from dropbox_sign.models.signature_request_response import SignatureRequestResponse +from dropbox_sign.models.signature_request_response_attachment import SignatureRequestResponseAttachment +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from dropbox_sign.models.signature_request_response_custom_field_checkbox import SignatureRequestResponseCustomFieldCheckbox +from dropbox_sign.models.signature_request_response_custom_field_text import SignatureRequestResponseCustomFieldText +from dropbox_sign.models.signature_request_response_custom_field_type_enum import SignatureRequestResponseCustomFieldTypeEnum +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from dropbox_sign.models.signature_request_response_data_type_enum import SignatureRequestResponseDataTypeEnum +from dropbox_sign.models.signature_request_response_data_value_checkbox import SignatureRequestResponseDataValueCheckbox +from dropbox_sign.models.signature_request_response_data_value_checkbox_merge import SignatureRequestResponseDataValueCheckboxMerge +from dropbox_sign.models.signature_request_response_data_value_date_signed import SignatureRequestResponseDataValueDateSigned +from dropbox_sign.models.signature_request_response_data_value_dropdown import SignatureRequestResponseDataValueDropdown +from dropbox_sign.models.signature_request_response_data_value_initials import SignatureRequestResponseDataValueInitials +from dropbox_sign.models.signature_request_response_data_value_radio import SignatureRequestResponseDataValueRadio +from dropbox_sign.models.signature_request_response_data_value_signature import SignatureRequestResponseDataValueSignature +from dropbox_sign.models.signature_request_response_data_value_text import SignatureRequestResponseDataValueText +from dropbox_sign.models.signature_request_response_data_value_text_merge import SignatureRequestResponseDataValueTextMerge +from dropbox_sign.models.signature_request_response_signatures import SignatureRequestResponseSignatures +from dropbox_sign.models.signature_request_send_request import SignatureRequestSendRequest +from dropbox_sign.models.signature_request_send_with_template_request import SignatureRequestSendWithTemplateRequest +from dropbox_sign.models.signature_request_update_request import SignatureRequestUpdateRequest +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_bulk_signer_list import SubBulkSignerList +from dropbox_sign.models.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_field_rule_action import SubFormFieldRuleAction +from dropbox_sign.models.sub_form_field_rule_trigger import SubFormFieldRuleTrigger +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_form_fields_per_document_checkbox import SubFormFieldsPerDocumentCheckbox +from dropbox_sign.models.sub_form_fields_per_document_checkbox_merge import SubFormFieldsPerDocumentCheckboxMerge +from dropbox_sign.models.sub_form_fields_per_document_date_signed import SubFormFieldsPerDocumentDateSigned +from dropbox_sign.models.sub_form_fields_per_document_dropdown import SubFormFieldsPerDocumentDropdown +from dropbox_sign.models.sub_form_fields_per_document_font_enum import SubFormFieldsPerDocumentFontEnum +from dropbox_sign.models.sub_form_fields_per_document_hyperlink import SubFormFieldsPerDocumentHyperlink +from dropbox_sign.models.sub_form_fields_per_document_initials import SubFormFieldsPerDocumentInitials +from dropbox_sign.models.sub_form_fields_per_document_radio import SubFormFieldsPerDocumentRadio +from dropbox_sign.models.sub_form_fields_per_document_signature import SubFormFieldsPerDocumentSignature +from dropbox_sign.models.sub_form_fields_per_document_text import SubFormFieldsPerDocumentText +from dropbox_sign.models.sub_form_fields_per_document_text_merge import SubFormFieldsPerDocumentTextMerge +from dropbox_sign.models.sub_form_fields_per_document_type_enum import SubFormFieldsPerDocumentTypeEnum +from dropbox_sign.models.sub_merge_field import SubMergeField +from dropbox_sign.models.sub_o_auth import SubOAuth +from dropbox_sign.models.sub_options import SubOptions +from dropbox_sign.models.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from dropbox_sign.models.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from dropbox_sign.models.sub_team_response import SubTeamResponse +from dropbox_sign.models.sub_template_role import SubTemplateRole +from dropbox_sign.models.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner +from dropbox_sign.models.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner +from dropbox_sign.models.sub_white_labeling_options import SubWhiteLabelingOptions +from dropbox_sign.models.team_add_member_request import TeamAddMemberRequest +from dropbox_sign.models.team_create_request import TeamCreateRequest +from dropbox_sign.models.team_get_info_response import TeamGetInfoResponse +from dropbox_sign.models.team_get_response import TeamGetResponse +from dropbox_sign.models.team_info_response import TeamInfoResponse +from dropbox_sign.models.team_invite_response import TeamInviteResponse +from dropbox_sign.models.team_invites_response import TeamInvitesResponse +from dropbox_sign.models.team_member_response import TeamMemberResponse +from dropbox_sign.models.team_members_response import TeamMembersResponse +from dropbox_sign.models.team_parent_response import TeamParentResponse +from dropbox_sign.models.team_remove_member_request import TeamRemoveMemberRequest +from dropbox_sign.models.team_response import TeamResponse +from dropbox_sign.models.team_sub_teams_response import TeamSubTeamsResponse +from dropbox_sign.models.team_update_request import TeamUpdateRequest +from dropbox_sign.models.template_add_user_request import TemplateAddUserRequest +from dropbox_sign.models.template_create_embedded_draft_request import TemplateCreateEmbeddedDraftRequest +from dropbox_sign.models.template_create_embedded_draft_response import TemplateCreateEmbeddedDraftResponse +from dropbox_sign.models.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate +from dropbox_sign.models.template_create_request import TemplateCreateRequest +from dropbox_sign.models.template_create_response import TemplateCreateResponse +from dropbox_sign.models.template_create_response_template import TemplateCreateResponseTemplate +from dropbox_sign.models.template_edit_response import TemplateEditResponse +from dropbox_sign.models.template_get_response import TemplateGetResponse +from dropbox_sign.models.template_list_response import TemplateListResponse +from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest +from dropbox_sign.models.template_response import TemplateResponse +from dropbox_sign.models.template_response_account import TemplateResponseAccount +from dropbox_sign.models.template_response_account_quota import TemplateResponseAccountQuota +from dropbox_sign.models.template_response_cc_role import TemplateResponseCCRole +from dropbox_sign.models.template_response_document import TemplateResponseDocument +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from dropbox_sign.models.template_response_document_custom_field_checkbox import TemplateResponseDocumentCustomFieldCheckbox +from dropbox_sign.models.template_response_document_custom_field_text import TemplateResponseDocumentCustomFieldText +from dropbox_sign.models.template_response_document_field_group import TemplateResponseDocumentFieldGroup +from dropbox_sign.models.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_document_form_field_checkbox import TemplateResponseDocumentFormFieldCheckbox +from dropbox_sign.models.template_response_document_form_field_date_signed import TemplateResponseDocumentFormFieldDateSigned +from dropbox_sign.models.template_response_document_form_field_dropdown import TemplateResponseDocumentFormFieldDropdown +from dropbox_sign.models.template_response_document_form_field_hyperlink import TemplateResponseDocumentFormFieldHyperlink +from dropbox_sign.models.template_response_document_form_field_initials import TemplateResponseDocumentFormFieldInitials +from dropbox_sign.models.template_response_document_form_field_radio import TemplateResponseDocumentFormFieldRadio +from dropbox_sign.models.template_response_document_form_field_signature import TemplateResponseDocumentFormFieldSignature +from dropbox_sign.models.template_response_document_form_field_text import TemplateResponseDocumentFormFieldText +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from dropbox_sign.models.template_response_document_static_field_checkbox import TemplateResponseDocumentStaticFieldCheckbox +from dropbox_sign.models.template_response_document_static_field_date_signed import TemplateResponseDocumentStaticFieldDateSigned +from dropbox_sign.models.template_response_document_static_field_dropdown import TemplateResponseDocumentStaticFieldDropdown +from dropbox_sign.models.template_response_document_static_field_hyperlink import TemplateResponseDocumentStaticFieldHyperlink +from dropbox_sign.models.template_response_document_static_field_initials import TemplateResponseDocumentStaticFieldInitials +from dropbox_sign.models.template_response_document_static_field_radio import TemplateResponseDocumentStaticFieldRadio +from dropbox_sign.models.template_response_document_static_field_signature import TemplateResponseDocumentStaticFieldSignature +from dropbox_sign.models.template_response_document_static_field_text import TemplateResponseDocumentStaticFieldText +from dropbox_sign.models.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength +from dropbox_sign.models.template_response_signer_role import TemplateResponseSignerRole +from dropbox_sign.models.template_update_files_request import TemplateUpdateFilesRequest +from dropbox_sign.models.template_update_files_response import TemplateUpdateFilesResponse +from dropbox_sign.models.template_update_files_response_template import TemplateUpdateFilesResponseTemplate +from dropbox_sign.models.unclaimed_draft_create_embedded_request import UnclaimedDraftCreateEmbeddedRequest +from dropbox_sign.models.unclaimed_draft_create_embedded_with_template_request import UnclaimedDraftCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.unclaimed_draft_create_request import UnclaimedDraftCreateRequest +from dropbox_sign.models.unclaimed_draft_create_response import UnclaimedDraftCreateResponse +from dropbox_sign.models.unclaimed_draft_edit_and_resend_request import UnclaimedDraftEditAndResendRequest +from dropbox_sign.models.unclaimed_draft_response import UnclaimedDraftResponse +from dropbox_sign.models.warning_response import WarningResponse from dropbox_sign.event_callback_helper import EventCallbackHelper diff --git a/sdks/python/dropbox_sign/api/__init__.py b/sdks/python/dropbox_sign/api/__init__.py index 5edf83a81..05f20926a 100644 --- a/sdks/python/dropbox_sign/api/__init__.py +++ b/sdks/python/dropbox_sign/api/__init__.py @@ -1,3 +1,15 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from dropbox_sign.apis import AccountApi +# flake8: noqa + +# import apis into api package +from dropbox_sign.api.account_api import AccountApi +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_line_api import FaxLineApi +from dropbox_sign.api.o_auth_api import OAuthApi +from dropbox_sign.api.report_api import ReportApi +from dropbox_sign.api.signature_request_api import SignatureRequestApi +from dropbox_sign.api.team_api import TeamApi +from dropbox_sign.api.template_api import TemplateApi +from dropbox_sign.api.unclaimed_draft_api import UnclaimedDraftApi + diff --git a/sdks/python/dropbox_sign/api/account_api.py b/sdks/python/dropbox_sign/api/account_api.py index 5ca7fdd35..f4cb4dca5 100644 --- a/sdks/python/dropbox_sign/api/account_api.py +++ b/sdks/python/dropbox_sign/api/account_api.py @@ -1,657 +1,1222 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from dropbox_sign.models.account_create_request import AccountCreateRequest +from dropbox_sign.models.account_create_response import AccountCreateResponse +from dropbox_sign.models.account_get_response import AccountGetResponse +from dropbox_sign.models.account_update_request import AccountUpdateRequest +from dropbox_sign.models.account_verify_request import AccountVerifyRequest +from dropbox_sign.models.account_verify_response import AccountVerifyResponse + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.account_create_request import AccountCreateRequest -from dropbox_sign.model.account_create_response import AccountCreateResponse -from dropbox_sign.model.account_get_response import AccountGetResponse -from dropbox_sign.model.account_update_request import AccountUpdateRequest -from dropbox_sign.model.account_verify_request import AccountVerifyRequest -from dropbox_sign.model.account_verify_response import AccountVerifyResponse -from dropbox_sign.model.error_response import ErrorResponse - - -class AccountApi(object): +class AccountApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.account_create_endpoint = _Endpoint( - settings={ - 'response_type': (AccountCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/account/create', - 'operation_id': 'account_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_create_request', - ], - 'required': [ - 'account_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_create_request': - (AccountCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'account_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.account_get_endpoint = _Endpoint( - settings={ - 'response_type': (AccountGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/account', - 'operation_id': 'account_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_id', - 'email_address', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'email_address': - (str,), - }, - 'attribute_map': { - 'account_id': 'account_id', - 'email_address': 'email_address', - }, - 'location_map': { - 'account_id': 'query', - 'email_address': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.account_update_endpoint = _Endpoint( - settings={ - 'response_type': (AccountGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/account', - 'operation_id': 'account_update', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_update_request', - ], - 'required': [ - 'account_update_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_update_request': - (AccountUpdateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'account_update_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.account_verify_endpoint = _Endpoint( - settings={ - 'response_type': (AccountVerifyResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/account/verify', - 'operation_id': 'account_verify', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_verify_request', - ], - 'required': [ - 'account_verify_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_verify_request': - (AccountVerifyRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'account_verify_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def account_create( self, - account_create_request, - **kwargs + account_create_request: AccountCreateRequest, + _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, ) -> AccountCreateResponse: - """Create Account # noqa: E501 - - Creates a new Dropbox Sign Account that is associated with the specified `email_address`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.account_create(account_create_request, async_req=True) - >>> result = thread.get() - - Args: - account_create_request (AccountCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AccountCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['account_create_request'] = \ - account_create_request - try: - return self.account_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[AccountCreateResponse], - _check_type=True, - ) + """Create Account + + Creates a new Dropbox Sign Account that is associated with the specified `email_address`. + + :param account_create_request: (required) + :type account_create_request: AccountCreateRequest + :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._account_create_serialize( + account_create_request=account_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountCreateResponse", + '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 account_create_with_http_info( + self, + account_create_request: AccountCreateRequest, + _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[AccountCreateResponse]: + """Create Account + + Creates a new Dropbox Sign Account that is associated with the specified `email_address`. + + :param account_create_request: (required) + :type account_create_request: AccountCreateRequest + :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._account_create_serialize( + account_create_request=account_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountCreateResponse", + '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 account_create_without_preload_content( + self, + account_create_request: AccountCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Account + + Creates a new Dropbox Sign Account that is associated with the specified `email_address`. + + :param account_create_request: (required) + :type account_create_request: AccountCreateRequest + :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._account_create_serialize( + account_create_request=account_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + def _account_create_serialize( + self, + account_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = account_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if account_create_request is not None and has_files is False: + _body_params = account_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/account/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e + + + @validate_call def account_get( self, - **kwargs + account_id: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account.")] = None, + email_address: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account.")] = 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, ) -> AccountGetResponse: - """Get Account # noqa: E501 - - Returns the properties and settings of your Account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.account_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - account_id (str): `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account.. [optional] - email_address (str): `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AccountGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.account_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[AccountGetResponse], - _check_type=True, - ) + """Get Account - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + Returns the properties and settings of your Account. - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + :param account_id: `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. + :type account_id: str + :param email_address: `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. + :type email_address: 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._account_get_serialize( + account_id=account_id, + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '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 account_get_with_http_info( + self, + account_id: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account.")] = None, + email_address: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account.")] = 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[AccountGetResponse]: + """Get Account + + Returns the properties and settings of your Account. + + :param account_id: `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. + :type account_id: str + :param email_address: `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. + :type email_address: 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._account_get_serialize( + account_id=account_id, + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '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 account_get_without_preload_content( + self, + account_id: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account.")] = None, + email_address: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account.")] = 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: + """Get Account + + Returns the properties and settings of your Account. + + :param account_id: `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. + :type account_id: str + :param email_address: `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. + :type email_address: 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._account_get_serialize( + account_id=account_id, + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _account_get_serialize( + self, + account_id, + email_address, + _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 account_id is not None: + + _query_params.append(('account_id', account_id)) + + if email_address is not None: + + _query_params.append(('email_address', email_address)) + + # process the header parameters + # process the form parameters + # process the body parameter - raise e + # 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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/account', + 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 account_update( self, - account_update_request, - **kwargs + account_update_request: AccountUpdateRequest, + _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, ) -> AccountGetResponse: - """Update Account # noqa: E501 - - Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.account_update(account_update_request, async_req=True) - >>> result = thread.get() - - Args: - account_update_request (AccountUpdateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AccountGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['account_update_request'] = \ - account_update_request - try: - return self.account_update_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[AccountGetResponse], - _check_type=True, - ) + """Update Account + + Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + :param account_update_request: (required) + :type account_update_request: AccountUpdateRequest + :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._account_update_serialize( + account_update_request=account_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '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 account_update_with_http_info( + self, + account_update_request: AccountUpdateRequest, + _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[AccountGetResponse]: + """Update Account + + Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. + + :param account_update_request: (required) + :type account_update_request: AccountUpdateRequest + :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._account_update_serialize( + account_update_request=account_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '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 account_update_without_preload_content( + self, + account_update_request: AccountUpdateRequest, + _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: + """Update Account + + Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. + + :param account_update_request: (required) + :type account_update_request: AccountUpdateRequest + :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._account_update_serialize( + account_update_request=account_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _account_update_serialize( + self, + account_update_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 = account_update_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 account_update_request is not None and has_files is False: + _body_params = account_update_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/account', + 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 + ) - raise e + + + @validate_call def account_verify( self, - account_verify_request, - **kwargs + account_verify_request: AccountVerifyRequest, + _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, ) -> AccountVerifyResponse: - """Verify Account # noqa: E501 - - Verifies whether an Dropbox Sign Account exists for the given email address. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.account_verify(account_verify_request, async_req=True) - >>> result = thread.get() - - Args: - account_verify_request (AccountVerifyRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AccountVerifyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['account_verify_request'] = \ - account_verify_request - try: - return self.account_verify_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[AccountVerifyResponse], - _check_type=True, - ) + """Verify Account + + Verifies whether an Dropbox Sign Account exists for the given email address. + + :param account_verify_request: (required) + :type account_verify_request: AccountVerifyRequest + :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._account_verify_serialize( + account_verify_request=account_verify_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountVerifyResponse", + '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 account_verify_with_http_info( + self, + account_verify_request: AccountVerifyRequest, + _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[AccountVerifyResponse]: + """Verify Account - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + Verifies whether an Dropbox Sign Account exists for the given email address. + + :param account_verify_request: (required) + :type account_verify_request: AccountVerifyRequest + :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._account_verify_serialize( + account_verify_request=account_verify_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountVerifyResponse", + '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 account_verify_without_preload_content( + self, + account_verify_request: AccountVerifyRequest, + _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: + """Verify Account - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + Verifies whether an Dropbox Sign Account exists for the given email address. + + :param account_verify_request: (required) + :type account_verify_request: AccountVerifyRequest + :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._account_verify_serialize( + account_verify_request=account_verify_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountVerifyResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _account_verify_serialize( + self, + account_verify_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 = account_verify_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 account_verify_request is not None and has_files is False: + _body_params = account_verify_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/account/verify', + 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 + ) - raise e diff --git a/sdks/python/dropbox_sign/api/api_app_api.py b/sdks/python/dropbox_sign/api/api_app_api.py index c575780ef..ab502c58b 100644 --- a/sdks/python/dropbox_sign/api/api_app_api.py +++ b/sdks/python/dropbox_sign/api/api_app_api.py @@ -1,796 +1,1465 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + 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 __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.api_app_create_request import ApiAppCreateRequest -from dropbox_sign.model.api_app_get_response import ApiAppGetResponse -from dropbox_sign.model.api_app_list_response import ApiAppListResponse -from dropbox_sign.model.api_app_update_request import ApiAppUpdateRequest -from dropbox_sign.model.error_response import ErrorResponse - - -class ApiAppApi(object): +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from dropbox_sign.models.api_app_create_request import ApiAppCreateRequest +from dropbox_sign.models.api_app_get_response import ApiAppGetResponse +from dropbox_sign.models.api_app_list_response import ApiAppListResponse +from dropbox_sign.models.api_app_update_request import ApiAppUpdateRequest + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class ApiAppApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.api_app_create_endpoint = _Endpoint( - settings={ - 'response_type': (ApiAppGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/api_app', - 'operation_id': 'api_app_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'api_app_create_request', - ], - 'required': [ - 'api_app_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'api_app_create_request': - (ApiAppCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'api_app_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.api_app_delete_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/api_app/{client_id}', - 'operation_id': 'api_app_delete', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'client_id', - ], - 'required': [ - 'client_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client_id': - (str,), - }, - 'attribute_map': { - 'client_id': 'client_id', - }, - 'location_map': { - 'client_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.api_app_get_endpoint = _Endpoint( - settings={ - 'response_type': (ApiAppGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/api_app/{client_id}', - 'operation_id': 'api_app_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'client_id', - ], - 'required': [ - 'client_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client_id': - (str,), - }, - 'attribute_map': { - 'client_id': 'client_id', - }, - 'location_map': { - 'client_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.api_app_list_endpoint = _Endpoint( - settings={ - 'response_type': (ApiAppListResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/api_app/list', - 'operation_id': 'api_app_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'page', - 'page_size', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'page': - (int,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'page': 'page', - 'page_size': 'page_size', - }, - 'location_map': { - 'page': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.api_app_update_endpoint = _Endpoint( - settings={ - 'response_type': (ApiAppGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/api_app/{client_id}', - 'operation_id': 'api_app_update', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'client_id', - 'api_app_update_request', - ], - 'required': [ - 'client_id', - 'api_app_update_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client_id': - (str,), - 'api_app_update_request': - (ApiAppUpdateRequest,), - }, - 'attribute_map': { - 'client_id': 'client_id', - }, - 'location_map': { - 'client_id': 'path', - 'api_app_update_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) + + @validate_call def api_app_create( self, - api_app_create_request, - **kwargs + api_app_create_request: ApiAppCreateRequest, + _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, ) -> ApiAppGetResponse: - """Create API App # noqa: E501 - - Creates a new API App. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.api_app_create(api_app_create_request, async_req=True) - >>> result = thread.get() - - Args: - api_app_create_request (ApiAppCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiAppGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['api_app_create_request'] = \ - api_app_create_request - try: - return self.api_app_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 201: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ApiAppGetResponse], - _check_type=True, - ) + """Create API App + + Creates a new API App. + + :param api_app_create_request: (required) + :type api_app_create_request: ApiAppCreateRequest + :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._api_app_create_serialize( + api_app_create_request=api_app_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiAppGetResponse", + '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 api_app_create_with_http_info( + self, + api_app_create_request: ApiAppCreateRequest, + _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[ApiAppGetResponse]: + """Create API App + + Creates a new API App. + + :param api_app_create_request: (required) + :type api_app_create_request: ApiAppCreateRequest + :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._api_app_create_serialize( + api_app_create_request=api_app_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiAppGetResponse", + '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 api_app_create_without_preload_content( + self, + api_app_create_request: ApiAppCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create API App + + Creates a new API App. + + :param api_app_create_request: (required) + :type api_app_create_request: ApiAppCreateRequest + :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._api_app_create_serialize( + api_app_create_request=api_app_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _api_app_create_serialize( + self, + api_app_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = api_app_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if api_app_create_request is not None and has_files is False: + _body_params = api_app_create_request + - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api_app', + 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 + ) + - raise e + + @validate_call def api_app_delete( self, - client_id, - **kwargs + client_id: Annotated[StrictStr, Field(description="The client id of the API App to delete.")], + _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 API App # noqa: E501 - - Deletes an API App. Can only be invoked for apps you own. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.api_app_delete(client_id, async_req=True) - >>> result = thread.get() - - Args: - client_id (str): The client id of the API App to delete. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_id'] = \ - client_id - return self.api_app_delete_endpoint.call_with_http_info(**kwargs) + """Delete API App - def api_app_get( + Deletes an API App. Can only be invoked for apps you own. + + :param client_id: The client id of the API App to delete. (required) + :type client_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._api_app_delete_serialize( + client_id=client_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 api_app_delete_with_http_info( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to delete.")], + _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 API App + + Deletes an API App. Can only be invoked for apps you own. + + :param client_id: The client id of the API App to delete. (required) + :type client_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._api_app_delete_serialize( + client_id=client_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 api_app_delete_without_preload_content( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to delete.")], + _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 API App + + Deletes an API App. Can only be invoked for apps you own. + + :param client_id: The client id of the API App to delete. (required) + :type client_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._api_app_delete_serialize( + client_id=client_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 _api_app_delete_serialize( self, client_id, - **kwargs + _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 client_id is not None: + _path_params['client_id'] = client_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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api_app/{client_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 api_app_get( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to retrieve.")], + _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, ) -> ApiAppGetResponse: - """Get API App # noqa: E501 - - Returns an object with information about an API App. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.api_app_get(client_id, async_req=True) - >>> result = thread.get() - - Args: - client_id (str): The client id of the API App to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiAppGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_id'] = \ - client_id - try: - return self.api_app_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ApiAppGetResponse], - _check_type=True, - ) + """Get API App - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + Returns an object with information about an API App. - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + :param client_id: The client id of the API App to retrieve. (required) + :type client_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._api_app_get_serialize( + client_id=client_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '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 api_app_get_with_http_info( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to retrieve.")], + _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[ApiAppGetResponse]: + """Get API App + + Returns an object with information about an API App. + + :param client_id: The client id of the API App to retrieve. (required) + :type client_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._api_app_get_serialize( + client_id=client_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '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, + ) - raise e + @validate_call + def api_app_get_without_preload_content( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to retrieve.")], + _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 API App + + Returns an object with information about an API App. + + :param client_id: The client id of the API App to retrieve. (required) + :type client_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._api_app_get_serialize( + client_id=client_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _api_app_get_serialize( + self, + client_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 client_id is not None: + _path_params['client_id'] = client_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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api_app/{client_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 api_app_list( self, - **kwargs + page: Annotated[Optional[StrictInt], Field(description="Which page number of the API App List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = 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, ) -> ApiAppListResponse: - """List API Apps # noqa: E501 - - Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.api_app_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - page (int): Which page number of the API App List to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.. [optional] if omitted the server will use the default value of 20 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiAppListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.api_app_list_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ApiAppListResponse], - _check_type=True, - ) + """List API Apps + + Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. + + :param page: Which page number of the API App List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :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._api_app_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': "ApiAppListResponse", + '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 api_app_list_with_http_info( + self, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the API App List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = 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[ApiAppListResponse]: + """List API Apps + + Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. + + :param page: Which page number of the API App List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :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._api_app_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': "ApiAppListResponse", + '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 api_app_list_without_preload_content( + self, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the API App List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = 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: + """List API Apps + + Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. + + :param page: Which page number of the API App List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :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._api_app_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': "ApiAppListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _api_app_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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api_app/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 + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def api_app_update( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to update.")], + api_app_update_request: ApiAppUpdateRequest, + _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, + ) -> ApiAppGetResponse: + """Update API App + + Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. + + :param client_id: The client id of the API App to update. (required) + :type client_id: str + :param api_app_update_request: (required) + :type api_app_update_request: ApiAppUpdateRequest + :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._api_app_update_serialize( + client_id=client_id, + api_app_update_request=api_app_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '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 api_app_update_with_http_info( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to update.")], + api_app_update_request: ApiAppUpdateRequest, + _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[ApiAppGetResponse]: + """Update API App + + Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. + + :param client_id: The client id of the API App to update. (required) + :type client_id: str + :param api_app_update_request: (required) + :type api_app_update_request: ApiAppUpdateRequest + :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._api_app_update_serialize( + client_id=client_id, + api_app_update_request=api_app_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '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 api_app_update_without_preload_content( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to update.")], + api_app_update_request: ApiAppUpdateRequest, + _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: + """Update API App + + Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. + + :param client_id: The client id of the API App to update. (required) + :type client_id: str + :param api_app_update_request: (required) + :type api_app_update_request: ApiAppUpdateRequest + :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._api_app_update_serialize( + client_id=client_id, + api_app_update_request=api_app_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _api_app_update_serialize( self, client_id, api_app_update_request, - **kwargs - ) -> ApiAppGetResponse: - """Update API App # noqa: E501 - - Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.api_app_update(client_id, api_app_update_request, async_req=True) - >>> result = thread.get() - - Args: - client_id (str): The client id of the API App to update. - api_app_update_request (ApiAppUpdateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiAppGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_id'] = \ - client_id - kwargs['api_app_update_request'] = \ - api_app_update_request - try: - return self.api_app_update_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ApiAppGetResponse], - _check_type=True, - ) + _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 = api_app_update_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) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # process the path parameters + if client_id is not None: + _path_params['client_id'] = client_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if api_app_update_request is not None and has_files is False: + _body_params = api_app_update_request - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/api_app/{client_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 + ) - raise e diff --git a/sdks/python/dropbox_sign/api/bulk_send_job_api.py b/sdks/python/dropbox_sign/api/bulk_send_job_api.py index 93e39e19e..8bb2a4386 100644 --- a/sdks/python/dropbox_sign/api/bulk_send_job_api.py +++ b/sdks/python/dropbox_sign/api/bulk_send_job_api.py @@ -1,358 +1,621 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + 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 __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from dropbox_sign.models.bulk_send_job_get_response import BulkSendJobGetResponse +from dropbox_sign.models.bulk_send_job_list_response import BulkSendJobListResponse -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.bulk_send_job_get_response import BulkSendJobGetResponse -from dropbox_sign.model.bulk_send_job_list_response import BulkSendJobListResponse -from dropbox_sign.model.error_response import ErrorResponse +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -class BulkSendJobApi(object): +class BulkSendJobApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.bulk_send_job_get_endpoint = _Endpoint( - settings={ - 'response_type': (BulkSendJobGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/bulk_send_job/{bulk_send_job_id}', - 'operation_id': 'bulk_send_job_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'bulk_send_job_id', - 'page', - 'page_size', - ], - 'required': [ - 'bulk_send_job_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'bulk_send_job_id': - (str,), - 'page': - (int,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'bulk_send_job_id': 'bulk_send_job_id', - 'page': 'page', - 'page_size': 'page_size', - }, - 'location_map': { - 'bulk_send_job_id': 'path', - 'page': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.bulk_send_job_list_endpoint = _Endpoint( - settings={ - 'response_type': (BulkSendJobListResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/bulk_send_job/list', - 'operation_id': 'bulk_send_job_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'page', - 'page_size', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'page': - (int,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'page': 'page', - 'page_size': 'page_size', - }, - 'location_map': { - 'page': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def bulk_send_job_get( self, - bulk_send_job_id, - **kwargs + bulk_send_job_id: Annotated[StrictStr, Field(description="The id of the BulkSendJob to retrieve.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = 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, ) -> BulkSendJobGetResponse: - """Get Bulk Send Job # noqa: E501 - - Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.bulk_send_job_get(bulk_send_job_id, async_req=True) - >>> result = thread.get() - - Args: - bulk_send_job_id (str): The id of the BulkSendJob to retrieve. - - Keyword Args: - page (int): Which page number of the BulkSendJob list to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.. [optional] if omitted the server will use the default value of 20 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - BulkSendJobGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """Get Bulk Send Job + + Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. + + :param bulk_send_job_id: The id of the BulkSendJob to retrieve. (required) + :type bulk_send_job_id: str + :param page: Which page number of the BulkSendJob list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :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._bulk_send_job_get_serialize( + bulk_send_job_id=bulk_send_job_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def bulk_send_job_get_with_http_info( + self, + bulk_send_job_id: Annotated[StrictStr, Field(description="The id of the BulkSendJob to retrieve.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = 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[BulkSendJobGetResponse]: + """Get Bulk Send Job + + Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. + + :param bulk_send_job_id: The id of the BulkSendJob to retrieve. (required) + :type bulk_send_job_id: str + :param page: Which page number of the BulkSendJob list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :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._bulk_send_job_get_serialize( + bulk_send_job_id=bulk_send_job_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def bulk_send_job_get_without_preload_content( + self, + bulk_send_job_id: Annotated[StrictStr, Field(description="The id of the BulkSendJob to retrieve.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = 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: + """Get Bulk Send Job + + Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. + + :param bulk_send_job_id: The id of the BulkSendJob to retrieve. (required) + :type bulk_send_job_id: str + :param page: Which page number of the BulkSendJob list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :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._bulk_send_job_get_serialize( + bulk_send_job_id=bulk_send_job_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['bulk_send_job_id'] = \ - bulk_send_job_id - try: - return self.bulk_send_job_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[BulkSendJobGetResponse], - _check_type=True, - ) - - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - - raise e + return response_data.response + + + def _bulk_send_job_get_serialize( + self, + bulk_send_job_id, + 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 + if bulk_send_job_id is not None: + _path_params['bulk_send_job_id'] = bulk_send_job_id + # 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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/bulk_send_job/{bulk_send_job_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 bulk_send_job_list( self, - **kwargs + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = 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, ) -> BulkSendJobListResponse: - """List Bulk Send Jobs # noqa: E501 - - Returns a list of BulkSendJob that you can access. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.bulk_send_job_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - page (int): Which page number of the BulkSendJob List to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.. [optional] if omitted the server will use the default value of 20 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - BulkSendJobListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """List Bulk Send Jobs + + Returns a list of BulkSendJob that you can access. + + :param page: Which page number of the BulkSendJob List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :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._bulk_send_job_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def bulk_send_job_list_with_http_info( + self, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = 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[BulkSendJobListResponse]: + """List Bulk Send Jobs + + Returns a list of BulkSendJob that you can access. + + :param page: Which page number of the BulkSendJob List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :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._bulk_send_job_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def bulk_send_job_list_without_preload_content( + self, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = 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: + """List Bulk Send Jobs + + Returns a list of BulkSendJob that you can access. + + :param page: Which page number of the BulkSendJob List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :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._bulk_send_job_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': "BulkSendJobListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + return response_data.response + + + def _bulk_send_job_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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/bulk_send_job/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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.bulk_send_job_list_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[BulkSendJobListResponse], - _check_type=True, - ) - - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - - raise e + diff --git a/sdks/python/dropbox_sign/api/embedded_api.py b/sdks/python/dropbox_sign/api/embedded_api.py index 78d374f79..8d9f6237e 100644 --- a/sdks/python/dropbox_sign/api/embedded_api.py +++ b/sdks/python/dropbox_sign/api/embedded_api.py @@ -1,358 +1,618 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + 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 __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from dropbox_sign.models.embedded_edit_url_request import EmbeddedEditUrlRequest +from dropbox_sign.models.embedded_edit_url_response import EmbeddedEditUrlResponse +from dropbox_sign.models.embedded_sign_url_response import EmbeddedSignUrlResponse -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.embedded_edit_url_request import EmbeddedEditUrlRequest -from dropbox_sign.model.embedded_edit_url_response import EmbeddedEditUrlResponse -from dropbox_sign.model.embedded_sign_url_response import EmbeddedSignUrlResponse -from dropbox_sign.model.error_response import ErrorResponse +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -class EmbeddedApi(object): +class EmbeddedApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.embedded_edit_url_endpoint = _Endpoint( - settings={ - 'response_type': (EmbeddedEditUrlResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/embedded/edit_url/{template_id}', - 'operation_id': 'embedded_edit_url', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'embedded_edit_url_request', - ], - 'required': [ - 'template_id', - 'embedded_edit_url_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - 'embedded_edit_url_request': - (EmbeddedEditUrlRequest,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - 'embedded_edit_url_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.embedded_sign_url_endpoint = _Endpoint( - settings={ - 'response_type': (EmbeddedSignUrlResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/embedded/sign_url/{signature_id}', - 'operation_id': 'embedded_sign_url', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_id', - ], - 'required': [ - 'signature_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_id': - (str,), - }, - 'attribute_map': { - 'signature_id': 'signature_id', - }, - 'location_map': { - 'signature_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def embedded_edit_url( self, - template_id, - embedded_edit_url_request, - **kwargs + template_id: Annotated[StrictStr, Field(description="The id of the template to edit.")], + embedded_edit_url_request: EmbeddedEditUrlRequest, + _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, ) -> EmbeddedEditUrlResponse: - """Get Embedded Template Edit URL # noqa: E501 - - Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.embedded_edit_url(template_id, embedded_edit_url_request, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the template to edit. - embedded_edit_url_request (EmbeddedEditUrlRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - EmbeddedEditUrlResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """Get Embedded Template Edit URL + + Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. + + :param template_id: The id of the template to edit. (required) + :type template_id: str + :param embedded_edit_url_request: (required) + :type embedded_edit_url_request: EmbeddedEditUrlRequest + :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._embedded_edit_url_serialize( + template_id=template_id, + embedded_edit_url_request=embedded_edit_url_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedEditUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def embedded_edit_url_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template to edit.")], + embedded_edit_url_request: EmbeddedEditUrlRequest, + _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[EmbeddedEditUrlResponse]: + """Get Embedded Template Edit URL + + Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. + + :param template_id: The id of the template to edit. (required) + :type template_id: str + :param embedded_edit_url_request: (required) + :type embedded_edit_url_request: EmbeddedEditUrlRequest + :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._embedded_edit_url_serialize( + template_id=template_id, + embedded_edit_url_request=embedded_edit_url_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedEditUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def embedded_edit_url_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template to edit.")], + embedded_edit_url_request: EmbeddedEditUrlRequest, + _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 Embedded Template Edit URL + + Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. + + :param template_id: The id of the template to edit. (required) + :type template_id: str + :param embedded_edit_url_request: (required) + :type embedded_edit_url_request: EmbeddedEditUrlRequest + :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._embedded_edit_url_serialize( + template_id=template_id, + embedded_edit_url_request=embedded_edit_url_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedEditUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - kwargs['embedded_edit_url_request'] = \ - embedded_edit_url_request - try: - return self.embedded_edit_url_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[EmbeddedEditUrlResponse], - _check_type=True, - ) + return response_data.response + + + def _embedded_edit_url_serialize( + self, + template_id, + embedded_edit_url_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 = embedded_edit_url_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 - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if embedded_edit_url_request is not None and has_files is False: + _body_params = embedded_edit_url_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/embedded/edit_url/{template_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 + ) + - raise e + + @validate_call def embedded_sign_url( self, - signature_id, - **kwargs + signature_id: Annotated[StrictStr, Field(description="The id of the signature to get a signature url for.")], + _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, ) -> EmbeddedSignUrlResponse: - """Get Embedded Sign URL # noqa: E501 - - 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. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.embedded_sign_url(signature_id, async_req=True) - >>> result = thread.get() - - Args: - signature_id (str): The id of the signature to get a signature url for. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - EmbeddedSignUrlResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """Get Embedded Sign URL + + 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. + + :param signature_id: The id of the signature to get a signature url for. (required) + :type signature_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._embedded_sign_url_serialize( + signature_id=signature_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedSignUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def embedded_sign_url_with_http_info( + self, + signature_id: Annotated[StrictStr, Field(description="The id of the signature to get a signature url for.")], + _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[EmbeddedSignUrlResponse]: + """Get Embedded Sign URL + + 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. + + :param signature_id: The id of the signature to get a signature url for. (required) + :type signature_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._embedded_sign_url_serialize( + signature_id=signature_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedSignUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def embedded_sign_url_without_preload_content( + self, + signature_id: Annotated[StrictStr, Field(description="The id of the signature to get a signature url for.")], + _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 Embedded Sign URL + + 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. + + :param signature_id: The id of the signature to get a signature url for. (required) + :type signature_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._embedded_sign_url_serialize( + signature_id=signature_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedSignUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_id'] = \ - signature_id - try: - return self.embedded_sign_url_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[EmbeddedSignUrlResponse], - _check_type=True, - ) + return response_data.response - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + def _embedded_sign_url_serialize( + self, + signature_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 signature_id is not None: + _path_params['signature_id'] = signature_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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/embedded/sign_url/{signature_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 + ) - raise e diff --git a/sdks/python/dropbox_sign/api/fax_line_api.py b/sdks/python/dropbox_sign/api/fax_line_api.py new file mode 100644 index 000000000..5d9aa8809 --- /dev/null +++ b/sdks/python/dropbox_sign/api/fax_line_api.py @@ -0,0 +1,2129 @@ +# 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, StrictBool, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from dropbox_sign.models.fax_line_add_user_request import FaxLineAddUserRequest +from dropbox_sign.models.fax_line_area_code_get_response import FaxLineAreaCodeGetResponse +from dropbox_sign.models.fax_line_create_request import FaxLineCreateRequest +from dropbox_sign.models.fax_line_delete_request import FaxLineDeleteRequest +from dropbox_sign.models.fax_line_list_response import FaxLineListResponse +from dropbox_sign.models.fax_line_remove_user_request import FaxLineRemoveUserRequest +from dropbox_sign.models.fax_line_response import FaxLineResponse + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class FaxLineApi: + """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_line_add_user( + self, + fax_line_add_user_request: FaxLineAddUserRequest, + _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, + ) -> FaxLineResponse: + """Add Fax Line User + + Grants a user access to the specified Fax Line. + + :param fax_line_add_user_request: (required) + :type fax_line_add_user_request: FaxLineAddUserRequest + :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_line_add_user_serialize( + fax_line_add_user_request=fax_line_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '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_line_add_user_with_http_info( + self, + fax_line_add_user_request: FaxLineAddUserRequest, + _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[FaxLineResponse]: + """Add Fax Line User + + Grants a user access to the specified Fax Line. + + :param fax_line_add_user_request: (required) + :type fax_line_add_user_request: FaxLineAddUserRequest + :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_line_add_user_serialize( + fax_line_add_user_request=fax_line_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '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_line_add_user_without_preload_content( + self, + fax_line_add_user_request: FaxLineAddUserRequest, + _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: + """Add Fax Line User + + Grants a user access to the specified Fax Line. + + :param fax_line_add_user_request: (required) + :type fax_line_add_user_request: FaxLineAddUserRequest + :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_line_add_user_serialize( + fax_line_add_user_request=fax_line_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_add_user_serialize( + self, + fax_line_add_user_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_line_add_user_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_line_add_user_request is not None and has_files is False: + _body_params = fax_line_add_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/fax_line/add_user', + 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_line_area_code_get( + self, + country: Annotated[StrictStr, Field(description="Filter area codes by country.")], + state: Annotated[Optional[StrictStr], Field(description="Filter area codes by state.")] = None, + province: Annotated[Optional[StrictStr], Field(description="Filter area codes by province.")] = None, + city: Annotated[Optional[StrictStr], Field(description="Filter area codes by city.")] = 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, + ) -> FaxLineAreaCodeGetResponse: + """Get Available Fax Line Area Codes + + Returns a response with the area codes available for a given state/provice and city. + + :param country: Filter area codes by country. (required) + :type country: str + :param state: Filter area codes by state. + :type state: str + :param province: Filter area codes by province. + :type province: str + :param city: Filter area codes by city. + :type city: 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_line_area_code_get_serialize( + country=country, + state=state, + province=province, + city=city, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineAreaCodeGetResponse", + '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_line_area_code_get_with_http_info( + self, + country: Annotated[StrictStr, Field(description="Filter area codes by country.")], + state: Annotated[Optional[StrictStr], Field(description="Filter area codes by state.")] = None, + province: Annotated[Optional[StrictStr], Field(description="Filter area codes by province.")] = None, + city: Annotated[Optional[StrictStr], Field(description="Filter area codes by city.")] = 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[FaxLineAreaCodeGetResponse]: + """Get Available Fax Line Area Codes + + Returns a response with the area codes available for a given state/provice and city. + + :param country: Filter area codes by country. (required) + :type country: str + :param state: Filter area codes by state. + :type state: str + :param province: Filter area codes by province. + :type province: str + :param city: Filter area codes by city. + :type city: 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_line_area_code_get_serialize( + country=country, + state=state, + province=province, + city=city, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineAreaCodeGetResponse", + '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_line_area_code_get_without_preload_content( + self, + country: Annotated[StrictStr, Field(description="Filter area codes by country.")], + state: Annotated[Optional[StrictStr], Field(description="Filter area codes by state.")] = None, + province: Annotated[Optional[StrictStr], Field(description="Filter area codes by province.")] = None, + city: Annotated[Optional[StrictStr], Field(description="Filter area codes by city.")] = 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: + """Get Available Fax Line Area Codes + + Returns a response with the area codes available for a given state/provice and city. + + :param country: Filter area codes by country. (required) + :type country: str + :param state: Filter area codes by state. + :type state: str + :param province: Filter area codes by province. + :type province: str + :param city: Filter area codes by city. + :type city: 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_line_area_code_get_serialize( + country=country, + state=state, + province=province, + city=city, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineAreaCodeGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_area_code_get_serialize( + self, + country, + state, + province, + city, + _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 country is not None: + + _query_params.append(('country', country)) + + if state is not None: + + _query_params.append(('state', state)) + + if province is not None: + + _query_params.append(('province', province)) + + if city is not None: + + _query_params.append(('city', city)) + + # 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_line/area_codes', + 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_line_create( + self, + fax_line_create_request: FaxLineCreateRequest, + _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, + ) -> FaxLineResponse: + """Purchase Fax Line + + Purchases a new Fax Line. + + :param fax_line_create_request: (required) + :type fax_line_create_request: FaxLineCreateRequest + :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_line_create_serialize( + fax_line_create_request=fax_line_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '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_line_create_with_http_info( + self, + fax_line_create_request: FaxLineCreateRequest, + _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[FaxLineResponse]: + """Purchase Fax Line + + Purchases a new Fax Line. + + :param fax_line_create_request: (required) + :type fax_line_create_request: FaxLineCreateRequest + :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_line_create_serialize( + fax_line_create_request=fax_line_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '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_line_create_without_preload_content( + self, + fax_line_create_request: FaxLineCreateRequest, + _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: + """Purchase Fax Line + + Purchases a new Fax Line. + + :param fax_line_create_request: (required) + :type fax_line_create_request: FaxLineCreateRequest + :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_line_create_serialize( + fax_line_create_request=fax_line_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_create_serialize( + self, + fax_line_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = fax_line_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if fax_line_create_request is not None and has_files is False: + _body_params = fax_line_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + 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_line/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def fax_line_delete( + self, + fax_line_delete_request: FaxLineDeleteRequest, + _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 Line + + Deletes the specified Fax Line from the subscription. + + :param fax_line_delete_request: (required) + :type fax_line_delete_request: FaxLineDeleteRequest + :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_line_delete_serialize( + fax_line_delete_request=fax_line_delete_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def fax_line_delete_with_http_info( + self, + fax_line_delete_request: FaxLineDeleteRequest, + _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 Line + + Deletes the specified Fax Line from the subscription. + + :param fax_line_delete_request: (required) + :type fax_line_delete_request: FaxLineDeleteRequest + :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_line_delete_serialize( + fax_line_delete_request=fax_line_delete_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def fax_line_delete_without_preload_content( + self, + fax_line_delete_request: FaxLineDeleteRequest, + _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 Line + + Deletes the specified Fax Line from the subscription. + + :param fax_line_delete_request: (required) + :type fax_line_delete_request: FaxLineDeleteRequest + :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_line_delete_serialize( + fax_line_delete_request=fax_line_delete_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_delete_serialize( + self, + fax_line_delete_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_line_delete_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_line_delete_request is not None and has_files is False: + _body_params = fax_line_delete_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/fax_line', + 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_line_get( + self, + number: Annotated[StrictStr, Field(description="The Fax Line number.")], + _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, + ) -> FaxLineResponse: + """Get Fax Line + + Returns the properties and settings of a Fax Line. + + :param number: The Fax Line number. (required) + :type number: 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_line_get_serialize( + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '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_line_get_with_http_info( + self, + number: Annotated[StrictStr, Field(description="The Fax Line number.")], + _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[FaxLineResponse]: + """Get Fax Line + + Returns the properties and settings of a Fax Line. + + :param number: The Fax Line number. (required) + :type number: 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_line_get_serialize( + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '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_line_get_without_preload_content( + self, + number: Annotated[StrictStr, Field(description="The Fax Line number.")], + _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 Line + + Returns the properties and settings of a Fax Line. + + :param number: The Fax Line number. (required) + :type number: 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_line_get_serialize( + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_get_serialize( + self, + number, + _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 number is not None: + + _query_params.append(('number', number)) + + # 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_line', + 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_line_list( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Account ID")] = None, + page: Annotated[Optional[StrictInt], Field(description="Page")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Page size")] = None, + show_team_lines: Annotated[Optional[StrictBool], Field(description="Show team lines")] = 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, + ) -> FaxLineListResponse: + """List Fax Lines + + Returns the properties and settings of multiple Fax Lines. + + :param account_id: Account ID + :type account_id: str + :param page: Page + :type page: int + :param page_size: Page size + :type page_size: int + :param show_team_lines: Show team lines + :type show_team_lines: bool + :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_line_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + show_team_lines=show_team_lines, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineListResponse", + '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_line_list_with_http_info( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Account ID")] = None, + page: Annotated[Optional[StrictInt], Field(description="Page")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Page size")] = None, + show_team_lines: Annotated[Optional[StrictBool], Field(description="Show team lines")] = 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[FaxLineListResponse]: + """List Fax Lines + + Returns the properties and settings of multiple Fax Lines. + + :param account_id: Account ID + :type account_id: str + :param page: Page + :type page: int + :param page_size: Page size + :type page_size: int + :param show_team_lines: Show team lines + :type show_team_lines: bool + :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_line_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + show_team_lines=show_team_lines, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineListResponse", + '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_line_list_without_preload_content( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Account ID")] = None, + page: Annotated[Optional[StrictInt], Field(description="Page")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Page size")] = None, + show_team_lines: Annotated[Optional[StrictBool], Field(description="Show team lines")] = 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: + """List Fax Lines + + Returns the properties and settings of multiple Fax Lines. + + :param account_id: Account ID + :type account_id: str + :param page: Page + :type page: int + :param page_size: Page size + :type page_size: int + :param show_team_lines: Show team lines + :type show_team_lines: bool + :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_line_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + show_team_lines=show_team_lines, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_list_serialize( + self, + account_id, + page, + page_size, + show_team_lines, + _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 account_id is not None: + + _query_params.append(('account_id', account_id)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if show_team_lines is not None: + + _query_params.append(('show_team_lines', show_team_lines)) + + # 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_line/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_line_remove_user( + self, + fax_line_remove_user_request: FaxLineRemoveUserRequest, + _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, + ) -> FaxLineResponse: + """Remove Fax Line Access + + Removes a user's access to the specified Fax Line. + + :param fax_line_remove_user_request: (required) + :type fax_line_remove_user_request: FaxLineRemoveUserRequest + :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_line_remove_user_serialize( + fax_line_remove_user_request=fax_line_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '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_line_remove_user_with_http_info( + self, + fax_line_remove_user_request: FaxLineRemoveUserRequest, + _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[FaxLineResponse]: + """Remove Fax Line Access + + Removes a user's access to the specified Fax Line. + + :param fax_line_remove_user_request: (required) + :type fax_line_remove_user_request: FaxLineRemoveUserRequest + :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_line_remove_user_serialize( + fax_line_remove_user_request=fax_line_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '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_line_remove_user_without_preload_content( + self, + fax_line_remove_user_request: FaxLineRemoveUserRequest, + _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: + """Remove Fax Line Access + + Removes a user's access to the specified Fax Line. + + :param fax_line_remove_user_request: (required) + :type fax_line_remove_user_request: FaxLineRemoveUserRequest + :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_line_remove_user_serialize( + fax_line_remove_user_request=fax_line_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_remove_user_serialize( + self, + fax_line_remove_user_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_line_remove_user_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_line_remove_user_request is not None and has_files is False: + _body_params = fax_line_remove_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/fax_line/remove_user', + 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/api/o_auth_api.py b/sdks/python/dropbox_sign/api/o_auth_api.py index 8c85a5b08..12165fcbc 100644 --- a/sdks/python/dropbox_sign/api/o_auth_api.py +++ b/sdks/python/dropbox_sign/api/o_auth_api.py @@ -1,328 +1,632 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + 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 __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 +from dropbox_sign.models.o_auth_token_generate_request import OAuthTokenGenerateRequest +from dropbox_sign.models.o_auth_token_refresh_request import OAuthTokenRefreshRequest +from dropbox_sign.models.o_auth_token_response import OAuthTokenResponse -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.o_auth_token_generate_request import OAuthTokenGenerateRequest -from dropbox_sign.model.o_auth_token_refresh_request import OAuthTokenRefreshRequest -from dropbox_sign.model.o_auth_token_response import OAuthTokenResponse +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -class OAuthApi(object): +class OAuthApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.oauth_token_generate_endpoint = _Endpoint( - settings={ - 'response_type': (OAuthTokenResponse,), - 'auth': [], - 'endpoint_path': '/oauth/token', - 'operation_id': 'oauth_token_generate', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://app.hellosign.com", - 'description': "No description provided", - }, - ] - }, - params_map={ - 'all': [ - 'o_auth_token_generate_request', - ], - 'required': [ - 'o_auth_token_generate_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'o_auth_token_generate_request': - (OAuthTokenGenerateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'o_auth_token_generate_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.oauth_token_refresh_endpoint = _Endpoint( - settings={ - 'response_type': (OAuthTokenResponse,), - 'auth': [], - 'endpoint_path': '/oauth/token?refresh', - 'operation_id': 'oauth_token_refresh', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://app.hellosign.com", - 'description': "No description provided", - }, - ] - }, - params_map={ - 'all': [ - 'o_auth_token_refresh_request', - ], - 'required': [ - 'o_auth_token_refresh_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'o_auth_token_refresh_request': - (OAuthTokenRefreshRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'o_auth_token_refresh_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def oauth_token_generate( self, - o_auth_token_generate_request, - **kwargs + o_auth_token_generate_request: OAuthTokenGenerateRequest, + _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=1)] = 0, ) -> OAuthTokenResponse: - """OAuth Token Generate # noqa: E501 - - Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.oauth_token_generate(o_auth_token_generate_request, async_req=True) - >>> result = thread.get() - - Args: - o_auth_token_generate_request (OAuthTokenGenerateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - OAuthTokenResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """OAuth Token Generate + + Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. + + :param o_auth_token_generate_request: (required) + :type o_auth_token_generate_request: OAuthTokenGenerateRequest + :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._oauth_token_generate_serialize( + o_auth_token_generate_request=o_auth_token_generate_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def oauth_token_generate_with_http_info( + self, + o_auth_token_generate_request: OAuthTokenGenerateRequest, + _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=1)] = 0, + ) -> ApiResponse[OAuthTokenResponse]: + """OAuth Token Generate + + Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. + + :param o_auth_token_generate_request: (required) + :type o_auth_token_generate_request: OAuthTokenGenerateRequest + :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._oauth_token_generate_serialize( + o_auth_token_generate_request=o_auth_token_generate_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def oauth_token_generate_without_preload_content( + self, + o_auth_token_generate_request: OAuthTokenGenerateRequest, + _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=1)] = 0, + ) -> RESTResponseType: + """OAuth Token Generate + + Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. + + :param o_auth_token_generate_request: (required) + :type o_auth_token_generate_request: OAuthTokenGenerateRequest + :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._oauth_token_generate_serialize( + o_auth_token_generate_request=o_auth_token_generate_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['o_auth_token_generate_request'] = \ - o_auth_token_generate_request - try: - return self.oauth_token_generate_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[OAuthTokenResponse], - _check_type=True, + return response_data.response + + + def _oauth_token_generate_serialize( + self, + o_auth_token_generate_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://app.hellosign.com' + ] + _host = _hosts[_host_index] + + _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 = o_auth_token_generate_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 o_auth_token_generate_request is not None and has_files is False: + _body_params = o_auth_token_generate_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/oauth/token', + 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 + ) + + - raise e + @validate_call def oauth_token_refresh( self, - o_auth_token_refresh_request, - **kwargs + o_auth_token_refresh_request: OAuthTokenRefreshRequest, + _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=1)] = 0, ) -> OAuthTokenResponse: - """OAuth Token Refresh # noqa: E501 - - Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.oauth_token_refresh(o_auth_token_refresh_request, async_req=True) - >>> result = thread.get() - - Args: - o_auth_token_refresh_request (OAuthTokenRefreshRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - OAuthTokenResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """OAuth Token Refresh + + Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. + + :param o_auth_token_refresh_request: (required) + :type o_auth_token_refresh_request: OAuthTokenRefreshRequest + :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._oauth_token_refresh_serialize( + o_auth_token_refresh_request=o_auth_token_refresh_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def oauth_token_refresh_with_http_info( + self, + o_auth_token_refresh_request: OAuthTokenRefreshRequest, + _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=1)] = 0, + ) -> ApiResponse[OAuthTokenResponse]: + """OAuth Token Refresh + + Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. + + :param o_auth_token_refresh_request: (required) + :type o_auth_token_refresh_request: OAuthTokenRefreshRequest + :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._oauth_token_refresh_serialize( + o_auth_token_refresh_request=o_auth_token_refresh_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def oauth_token_refresh_without_preload_content( + self, + o_auth_token_refresh_request: OAuthTokenRefreshRequest, + _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=1)] = 0, + ) -> RESTResponseType: + """OAuth Token Refresh + + Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. + + :param o_auth_token_refresh_request: (required) + :type o_auth_token_refresh_request: OAuthTokenRefreshRequest + :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._oauth_token_refresh_serialize( + o_auth_token_refresh_request=o_auth_token_refresh_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['o_auth_token_refresh_request'] = \ - o_auth_token_refresh_request - try: - return self.oauth_token_refresh_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[OAuthTokenResponse], - _check_type=True, + return response_data.response + + + def _oauth_token_refresh_serialize( + self, + o_auth_token_refresh_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://app.hellosign.com' + ] + _host = _hosts[_host_index] + + _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 = o_auth_token_refresh_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 o_auth_token_refresh_request is not None and has_files is False: + _body_params = o_auth_token_refresh_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/oauth/token?refresh', + 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 + ) - raise e diff --git a/sdks/python/dropbox_sign/api/report_api.py b/sdks/python/dropbox_sign/api/report_api.py index 72295306f..8ce80c120 100644 --- a/sdks/python/dropbox_sign/api/report_api.py +++ b/sdks/python/dropbox_sign/api/report_api.py @@ -1,194 +1,336 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + 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 __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 +from dropbox_sign.models.report_create_request import ReportCreateRequest +from dropbox_sign.models.report_create_response import ReportCreateResponse -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.report_create_request import ReportCreateRequest -from dropbox_sign.model.report_create_response import ReportCreateResponse +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -class ReportApi(object): +class ReportApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.report_create_endpoint = _Endpoint( - settings={ - 'response_type': (ReportCreateResponse,), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/report/create', - 'operation_id': 'report_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'report_create_request', - ], - 'required': [ - 'report_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'report_create_request': - (ReportCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'report_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def report_create( self, - report_create_request, - **kwargs + report_create_request: ReportCreateRequest, + _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, ) -> ReportCreateResponse: - """Create Report # noqa: E501 - - Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.report_create(report_create_request, async_req=True) - >>> result = thread.get() - - Args: - report_create_request (ReportCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ReportCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """Create Report + + Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. + + :param report_create_request: (required) + :type report_create_request: ReportCreateRequest + :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._report_create_serialize( + report_create_request=report_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReportCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def report_create_with_http_info( + self, + report_create_request: ReportCreateRequest, + _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[ReportCreateResponse]: + """Create Report + + Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. + + :param report_create_request: (required) + :type report_create_request: ReportCreateRequest + :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._report_create_serialize( + report_create_request=report_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReportCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def report_create_without_preload_content( + self, + report_create_request: ReportCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Report + + Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. + + :param report_create_request: (required) + :type report_create_request: ReportCreateRequest + :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._report_create_serialize( + report_create_request=report_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReportCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['report_create_request'] = \ - report_create_request - try: - return self.report_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ReportCreateResponse], - _check_type=True, - ) + return response_data.response + + + def _report_create_serialize( + self, + report_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + _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 - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + has_files = False + body_param = report_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if report_create_request is not None and has_files is False: + _body_params = report_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + 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='/report/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/sdks/python/dropbox_sign/api/signature_request_api.py b/sdks/python/dropbox_sign/api/signature_request_api.py index 3ce10edbf..d95641f60 100644 --- a/sdks/python/dropbox_sign/api/signature_request_api.py +++ b/sdks/python/dropbox_sign/api/signature_request_api.py @@ -1,2505 +1,4664 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) - -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.bulk_send_job_send_response import BulkSendJobSendResponse -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.file_response import FileResponse -from dropbox_sign.model.file_response_data_uri import FileResponseDataUri -from dropbox_sign.model.signature_request_bulk_create_embedded_with_template_request import SignatureRequestBulkCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.signature_request_bulk_send_with_template_request import SignatureRequestBulkSendWithTemplateRequest -from dropbox_sign.model.signature_request_create_embedded_request import SignatureRequestCreateEmbeddedRequest -from dropbox_sign.model.signature_request_create_embedded_with_template_request import SignatureRequestCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.signature_request_get_response import SignatureRequestGetResponse -from dropbox_sign.model.signature_request_list_response import SignatureRequestListResponse -from dropbox_sign.model.signature_request_remind_request import SignatureRequestRemindRequest -from dropbox_sign.model.signature_request_send_request import SignatureRequestSendRequest -from dropbox_sign.model.signature_request_send_with_template_request import SignatureRequestSendWithTemplateRequest -from dropbox_sign.model.signature_request_update_request import SignatureRequestUpdateRequest - - -class SignatureRequestApi(object): + 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, StrictInt, StrictStr, field_validator +from typing import Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.bulk_send_job_send_response import BulkSendJobSendResponse +from dropbox_sign.models.file_response import FileResponse +from dropbox_sign.models.file_response_data_uri import FileResponseDataUri +from dropbox_sign.models.signature_request_bulk_create_embedded_with_template_request import SignatureRequestBulkCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_bulk_send_with_template_request import SignatureRequestBulkSendWithTemplateRequest +from dropbox_sign.models.signature_request_create_embedded_request import SignatureRequestCreateEmbeddedRequest +from dropbox_sign.models.signature_request_create_embedded_with_template_request import SignatureRequestCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_get_response import SignatureRequestGetResponse +from dropbox_sign.models.signature_request_list_response import SignatureRequestListResponse +from dropbox_sign.models.signature_request_remind_request import SignatureRequestRemindRequest +from dropbox_sign.models.signature_request_send_request import SignatureRequestSendRequest +from dropbox_sign.models.signature_request_send_with_template_request import SignatureRequestSendWithTemplateRequest +from dropbox_sign.models.signature_request_update_request import SignatureRequestUpdateRequest + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class SignatureRequestApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.signature_request_bulk_create_embedded_with_template_endpoint = _Endpoint( - settings={ - 'response_type': (BulkSendJobSendResponse,), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/signature_request/bulk_create_embedded_with_template', - 'operation_id': 'signature_request_bulk_create_embedded_with_template', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_bulk_create_embedded_with_template_request', - ], - 'required': [ - 'signature_request_bulk_create_embedded_with_template_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_bulk_create_embedded_with_template_request': - (SignatureRequestBulkCreateEmbeddedWithTemplateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_bulk_create_embedded_with_template_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_bulk_send_with_template_endpoint = _Endpoint( - settings={ - 'response_type': (BulkSendJobSendResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/bulk_send_with_template', - 'operation_id': 'signature_request_bulk_send_with_template', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_bulk_send_with_template_request', - ], - 'required': [ - 'signature_request_bulk_send_with_template_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_bulk_send_with_template_request': - (SignatureRequestBulkSendWithTemplateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_bulk_send_with_template_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_cancel_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/cancel/{signature_request_id}', - 'operation_id': 'signature_request_cancel', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_create_embedded_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/create_embedded', - 'operation_id': 'signature_request_create_embedded', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_create_embedded_request', - ], - 'required': [ - 'signature_request_create_embedded_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_create_embedded_request': - (SignatureRequestCreateEmbeddedRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_create_embedded_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_create_embedded_with_template_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/create_embedded_with_template', - 'operation_id': 'signature_request_create_embedded_with_template', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_create_embedded_with_template_request', - ], - 'required': [ - 'signature_request_create_embedded_with_template_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_create_embedded_with_template_request': - (SignatureRequestCreateEmbeddedWithTemplateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_create_embedded_with_template_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_files_endpoint = _Endpoint( - settings={ - 'response_type': (file_type,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/files/{signature_request_id}', - 'operation_id': 'signature_request_files', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - 'file_type', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - 'file_type', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('file_type',): { - - "PDF": "pdf", - "ZIP": "zip" - }, - }, - 'openapi_types': { - 'signature_request_id': - (str,), - 'file_type': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - 'file_type': 'file_type', - }, - 'location_map': { - 'signature_request_id': 'path', - 'file_type': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/pdf', - 'application/zip', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_files_as_data_uri_endpoint = _Endpoint( - settings={ - 'response_type': (FileResponseDataUri,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/files_as_data_uri/{signature_request_id}', - 'operation_id': 'signature_request_files_as_data_uri', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_files_as_file_url_endpoint = _Endpoint( - settings={ - 'response_type': (FileResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/files_as_file_url/{signature_request_id}', - 'operation_id': 'signature_request_files_as_file_url', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - 'force_download', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - 'force_download': - (int,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - 'force_download': 'force_download', - }, - 'location_map': { - 'signature_request_id': 'path', - 'force_download': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_get_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/{signature_request_id}', - 'operation_id': 'signature_request_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_list_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestListResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/list', - 'operation_id': 'signature_request_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_id', - 'page', - 'page_size', - 'query', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'page': - (int,), - 'page_size': - (int,), - 'query': - (str,), - }, - 'attribute_map': { - 'account_id': 'account_id', - 'page': 'page', - 'page_size': 'page_size', - 'query': 'query', - }, - 'location_map': { - 'account_id': 'query', - 'page': 'query', - 'page_size': 'query', - 'query': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_release_hold_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/release_hold/{signature_request_id}', - 'operation_id': 'signature_request_release_hold', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_remind_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/remind/{signature_request_id}', - 'operation_id': 'signature_request_remind', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - 'signature_request_remind_request', - ], - 'required': [ - 'signature_request_id', - 'signature_request_remind_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - 'signature_request_remind_request': - (SignatureRequestRemindRequest,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - 'signature_request_remind_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.signature_request_remove_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/signature_request/remove/{signature_request_id}', - 'operation_id': 'signature_request_remove', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_send_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/send', - 'operation_id': 'signature_request_send', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_send_request', - ], - 'required': [ - 'signature_request_send_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_send_request': - (SignatureRequestSendRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_send_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_send_with_template_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/send_with_template', - 'operation_id': 'signature_request_send_with_template', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_send_with_template_request', - ], - 'required': [ - 'signature_request_send_with_template_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_send_with_template_request': - (SignatureRequestSendWithTemplateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_send_with_template_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_update_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/update/{signature_request_id}', - 'operation_id': 'signature_request_update', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - 'signature_request_update_request', - ], - 'required': [ - 'signature_request_id', - 'signature_request_update_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - 'signature_request_update_request': - (SignatureRequestUpdateRequest,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - 'signature_request_update_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def signature_request_bulk_create_embedded_with_template( self, - signature_request_bulk_create_embedded_with_template_request, - **kwargs + signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest, + _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, ) -> BulkSendJobSendResponse: - """Embedded Bulk Send with Template # noqa: E501 - - Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_bulk_create_embedded_with_template(signature_request_bulk_create_embedded_with_template_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_bulk_create_embedded_with_template_request (SignatureRequestBulkCreateEmbeddedWithTemplateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - BulkSendJobSendResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_bulk_create_embedded_with_template_request'] = \ - signature_request_bulk_create_embedded_with_template_request - try: - return self.signature_request_bulk_create_embedded_with_template_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[BulkSendJobSendResponse], - _check_type=True, + """Embedded Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_create_embedded_with_template_request: (required) + :type signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_create_embedded_with_template_serialize( + signature_request_bulk_create_embedded_with_template_request=signature_request_bulk_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_bulk_create_embedded_with_template_with_http_info( + self, + signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest, + _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[BulkSendJobSendResponse]: + """Embedded Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_create_embedded_with_template_request: (required) + :type signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_create_embedded_with_template_serialize( + signature_request_bulk_create_embedded_with_template_request=signature_request_bulk_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_bulk_create_embedded_with_template_without_preload_content( + self, + signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest, + _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: + """Embedded Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_create_embedded_with_template_request: (required) + :type signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_create_embedded_with_template_serialize( + signature_request_bulk_create_embedded_with_template_request=signature_request_bulk_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_bulk_create_embedded_with_template_serialize( + self, + signature_request_bulk_create_embedded_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_bulk_create_embedded_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_bulk_create_embedded_with_template_request is not None and has_files is False: + _body_params = signature_request_bulk_create_embedded_with_template_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/bulk_create_embedded_with_template', + 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 + ) - raise e + + + @validate_call def signature_request_bulk_send_with_template( self, - signature_request_bulk_send_with_template_request, - **kwargs + signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest, + _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, ) -> BulkSendJobSendResponse: - """Bulk Send with Template # noqa: E501 - - Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_bulk_send_with_template(signature_request_bulk_send_with_template_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_bulk_send_with_template_request (SignatureRequestBulkSendWithTemplateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - BulkSendJobSendResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_bulk_send_with_template_request'] = \ - signature_request_bulk_send_with_template_request - try: - return self.signature_request_bulk_send_with_template_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[BulkSendJobSendResponse], - _check_type=True, + """Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_send_with_template_request: (required) + :type signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_send_with_template_serialize( + signature_request_bulk_send_with_template_request=signature_request_bulk_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_bulk_send_with_template_with_http_info( + self, + signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest, + _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[BulkSendJobSendResponse]: + """Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_send_with_template_request: (required) + :type signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_send_with_template_serialize( + signature_request_bulk_send_with_template_request=signature_request_bulk_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_bulk_send_with_template_without_preload_content( + self, + signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest, + _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: + """Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_send_with_template_request: (required) + :type signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_send_with_template_serialize( + signature_request_bulk_send_with_template_request=signature_request_bulk_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_bulk_send_with_template_serialize( + self, + signature_request_bulk_send_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_bulk_send_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_bulk_send_with_template_request is not None and has_files is False: + _body_params = signature_request_bulk_send_with_template_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/bulk_send_with_template', + 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 + ) - raise e + + + @validate_call def signature_request_cancel( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the incomplete SignatureRequest to cancel.")], + _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: - """Cancel Incomplete Signature Request # noqa: E501 - - Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_cancel(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the incomplete SignatureRequest to cancel. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - return self.signature_request_cancel_endpoint.call_with_http_info(**kwargs) + """Cancel Incomplete Signature Request + + Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. + + :param signature_request_id: The id of the incomplete SignatureRequest to cancel. (required) + :type signature_request_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._signature_request_cancel_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_cancel_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the incomplete SignatureRequest to cancel.")], + _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]: + """Cancel Incomplete Signature Request + + Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. + + :param signature_request_id: The id of the incomplete SignatureRequest to cancel. (required) + :type signature_request_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._signature_request_cancel_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_cancel_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the incomplete SignatureRequest to cancel.")], + _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: + """Cancel Incomplete Signature Request + + Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. + + :param signature_request_id: The id of the incomplete SignatureRequest to cancel. (required) + :type signature_request_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._signature_request_cancel_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_cancel_serialize( + self, + signature_request_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 signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # 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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/cancel/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def signature_request_create_embedded( self, - signature_request_create_embedded_request, - **kwargs + signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Create Embedded Signature Request # noqa: E501 - - Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_create_embedded(signature_request_create_embedded_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_create_embedded_request (SignatureRequestCreateEmbeddedRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_create_embedded_request'] = \ - signature_request_create_embedded_request - try: - return self.signature_request_create_embedded_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, + """Create Embedded Signature Request + + Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_request: (required) + :type signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_serialize( + signature_request_create_embedded_request=signature_request_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_create_embedded_with_http_info( + self, + signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Create Embedded Signature Request + + Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_request: (required) + :type signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_serialize( + signature_request_create_embedded_request=signature_request_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_create_embedded_without_preload_content( + self, + signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Embedded Signature Request + + Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_request: (required) + :type signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_serialize( + signature_request_create_embedded_request=signature_request_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_create_embedded_serialize( + self, + signature_request_create_embedded_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_create_embedded_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_create_embedded_request is not None and has_files is False: + _body_params = signature_request_create_embedded_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/create_embedded', + 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 + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def signature_request_create_embedded_with_template( self, - signature_request_create_embedded_with_template_request, - **kwargs + signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Create Embedded Signature Request with Template # noqa: E501 - - Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_create_embedded_with_template(signature_request_create_embedded_with_template_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_create_embedded_with_template_request (SignatureRequestCreateEmbeddedWithTemplateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_create_embedded_with_template_request'] = \ - signature_request_create_embedded_with_template_request - try: - return self.signature_request_create_embedded_with_template_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, + """Create Embedded Signature Request with Template + + Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_with_template_request: (required) + :type signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_with_template_serialize( + signature_request_create_embedded_with_template_request=signature_request_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_create_embedded_with_template_with_http_info( + self, + signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Create Embedded Signature Request with Template + + Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_with_template_request: (required) + :type signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_with_template_serialize( + signature_request_create_embedded_with_template_request=signature_request_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_create_embedded_with_template_without_preload_content( + self, + signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Embedded Signature Request with Template + + Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_with_template_request: (required) + :type signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_with_template_serialize( + signature_request_create_embedded_with_template_request=signature_request_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_create_embedded_with_template_serialize( + self, + signature_request_create_embedded_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_create_embedded_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_create_embedded_with_template_request is not None and has_files is False: + _body_params = signature_request_create_embedded_with_template_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/create_embedded_with_template', + 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 + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def signature_request_files( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = 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, + ) -> io.IOBase: + """Download Files + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: 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._signature_request_files_serialize( + signature_request_id=signature_request_id, + file_type=file_type, + _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 signature_request_files_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = 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[io.IOBase]: + """Download Files + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: 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._signature_request_files_serialize( + signature_request_id=signature_request_id, + file_type=file_type, + _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 signature_request_files_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = 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: + """Download Files + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: 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._signature_request_files_serialize( + signature_request_id=signature_request_id, + file_type=file_type, + _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 _signature_request_files_serialize( self, signature_request_id, - **kwargs - ) -> file_type: - """Download Files # noqa: E501 - - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_files(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to retrieve. - - Keyword Args: - file_type (str): Set to `pdf` for a single merged document or `zip` for a collection of individual documents.. [optional] if omitted the server will use the default value of "pdf" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - try: - return self.signature_request_files_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[file_type], - _check_type=True, - ) + file_type, + _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 signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + if file_type is not None: + + _query_params.append(('file_type', file_type)) + + # 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/zip', + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/signature_request/files/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def signature_request_files_as_data_uri( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _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, ) -> FileResponseDataUri: - """Download Files as Data Uri # noqa: E501 - - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_files_as_data_uri(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FileResponseDataUri - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - try: - return self.signature_request_files_as_data_uri_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[FileResponseDataUri], - _check_type=True, - ) + """Download Files as Data Uri + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_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._signature_request_files_as_data_uri_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_files_as_data_uri_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _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[FileResponseDataUri]: + """Download Files as Data Uri + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_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._signature_request_files_as_data_uri_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_files_as_data_uri_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _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: + """Download Files as Data Uri + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_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._signature_request_files_as_data_uri_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_files_as_data_uri_serialize( + self, + signature_request_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 signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] - raise e + return self.api_client.param_serialize( + method='GET', + resource_path='/signature_request/files_as_data_uri/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def signature_request_files_as_file_url( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = 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, ) -> FileResponse: - """Download Files as File Url # noqa: E501 - - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_files_as_file_url(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to retrieve. - - Keyword Args: - force_download (int): By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.. [optional] if omitted the server will use the default value of 1 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FileResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - try: - return self.signature_request_files_as_file_url_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[FileResponse], - _check_type=True, - ) + """Download Files as File Url + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: 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._signature_request_files_as_file_url_serialize( + signature_request_id=signature_request_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_files_as_file_url_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = 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[FileResponse]: + """Download Files as File Url + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: 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._signature_request_files_as_file_url_serialize( + signature_request_id=signature_request_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_files_as_file_url_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = 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: + """Download Files as File Url + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: 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._signature_request_files_as_file_url_serialize( + signature_request_id=signature_request_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_files_as_file_url_serialize( + self, + signature_request_id, + force_download, + _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 signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + if force_download is not None: + + _query_params.append(('force_download', force_download)) + + # 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' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/signature_request/files_as_file_url/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def signature_request_get( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Get Signature Request # noqa: E501 - - Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_get(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - try: - return self.signature_request_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, - ) + """Get Signature Request + + Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_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._signature_request_get_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_get_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Get Signature Request + + Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_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._signature_request_get_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_get_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _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 Signature Request + + Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_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._signature_request_get_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_get_serialize( + self, + signature_request_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 signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/signature_request/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def signature_request_list( self, - **kwargs + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SignatureRequest List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the SignatureRequest objects.")] = 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, ) -> SignatureRequestListResponse: - """List Signature Requests # noqa: E501 - - Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - account_id (str): Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.. [optional] - page (int): Which page number of the SignatureRequest List to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.. [optional] if omitted the server will use the default value of 20 - query (str): String that includes search terms and/or fields to be used to filter the SignatureRequest objects.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.signature_request_list_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestListResponse], - _check_type=True, - ) + """List Signature Requests + + Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. + + :param account_id: Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the SignatureRequest List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the SignatureRequest objects. + :type query: 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._signature_request_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_list_with_http_info( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SignatureRequest List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the SignatureRequest objects.")] = 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[SignatureRequestListResponse]: + """List Signature Requests + + Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. + + :param account_id: Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the SignatureRequest List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the SignatureRequest objects. + :type query: 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._signature_request_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_list_without_preload_content( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SignatureRequest List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the SignatureRequest objects.")] = 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: + """List Signature Requests + + Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. + + :param account_id: Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the SignatureRequest List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the SignatureRequest objects. + :type query: 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._signature_request_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_list_serialize( + self, + account_id, + page, + page_size, + query, + _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 account_id is not None: + + _query_params.append(('account_id', account_id)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if query is not None: + + _query_params.append(('query', query)) + + # 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' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/signature_request/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 + ) + - raise e + + @validate_call def signature_request_release_hold( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to release.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Release On-Hold Signature Request # noqa: E501 - - Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_release_hold(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to release. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - try: - return self.signature_request_release_hold_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, - ) + """Release On-Hold Signature Request + + Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. + + :param signature_request_id: The id of the SignatureRequest to release. (required) + :type signature_request_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._signature_request_release_hold_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_release_hold_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to release.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Release On-Hold Signature Request + + Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. + + :param signature_request_id: The id of the SignatureRequest to release. (required) + :type signature_request_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._signature_request_release_hold_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_release_hold_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to release.")], + _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: + """Release On-Hold Signature Request + + Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. + + :param signature_request_id: The id of the SignatureRequest to release. (required) + :type signature_request_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._signature_request_release_hold_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_release_hold_serialize( + self, + signature_request_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 signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/release_hold/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def signature_request_remind( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to send a reminder for.")], + signature_request_remind_request: SignatureRequestRemindRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignatureRequestGetResponse: + """Send Request Reminder + + Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. + + :param signature_request_id: The id of the SignatureRequest to send a reminder for. (required) + :type signature_request_id: str + :param signature_request_remind_request: (required) + :type signature_request_remind_request: SignatureRequestRemindRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_remind_serialize( + signature_request_id=signature_request_id, + signature_request_remind_request=signature_request_remind_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_remind_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to send a reminder for.")], + signature_request_remind_request: SignatureRequestRemindRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Send Request Reminder + + Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. + + :param signature_request_id: The id of the SignatureRequest to send a reminder for. (required) + :type signature_request_id: str + :param signature_request_remind_request: (required) + :type signature_request_remind_request: SignatureRequestRemindRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_remind_serialize( + signature_request_id=signature_request_id, + signature_request_remind_request=signature_request_remind_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_remind_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to send a reminder for.")], + signature_request_remind_request: SignatureRequestRemindRequest, + _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 Request Reminder + + Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. + + :param signature_request_id: The id of the SignatureRequest to send a reminder for. (required) + :type signature_request_id: str + :param signature_request_remind_request: (required) + :type signature_request_remind_request: SignatureRequestRemindRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_remind_serialize( + signature_request_id=signature_request_id, + signature_request_remind_request=signature_request_remind_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_remind_serialize( self, signature_request_id, signature_request_remind_request, - **kwargs - ) -> SignatureRequestGetResponse: - """Send Request Reminder # noqa: E501 - - Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_remind(signature_request_id, signature_request_remind_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to send a reminder for. - signature_request_remind_request (SignatureRequestRemindRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - kwargs['signature_request_remind_request'] = \ - signature_request_remind_request - try: - return self.signature_request_remind_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_remind_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_remind_request is not None and has_files is False: + _body_params = signature_request_remind_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/remind/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def signature_request_remove( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to remove.")], + _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: - """Remove Signature Request Access # noqa: E501 - - Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_remove(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to remove. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - return self.signature_request_remove_endpoint.call_with_http_info(**kwargs) + """Remove Signature Request Access + + Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. + + :param signature_request_id: The id of the SignatureRequest to remove. (required) + :type signature_request_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._signature_request_remove_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_remove_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to remove.")], + _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]: + """Remove Signature Request Access + + Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. + + :param signature_request_id: The id of the SignatureRequest to remove. (required) + :type signature_request_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._signature_request_remove_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_remove_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to remove.")], + _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: + """Remove Signature Request Access + + Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. + + :param signature_request_id: The id of the SignatureRequest to remove. (required) + :type signature_request_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._signature_request_remove_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_remove_serialize( + self, + signature_request_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 signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # 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='POST', + resource_path='/signature_request/remove/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def signature_request_send( self, - signature_request_send_request, - **kwargs + signature_request_send_request: SignatureRequestSendRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Send Signature Request # noqa: E501 - - Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_send(signature_request_send_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_send_request (SignatureRequestSendRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_send_request'] = \ - signature_request_send_request - try: - return self.signature_request_send_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, + """Send Signature Request + + Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. + + :param signature_request_send_request: (required) + :type signature_request_send_request: SignatureRequestSendRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_serialize( + signature_request_send_request=signature_request_send_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_send_with_http_info( + self, + signature_request_send_request: SignatureRequestSendRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Send Signature Request + + Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. + + :param signature_request_send_request: (required) + :type signature_request_send_request: SignatureRequestSendRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_serialize( + signature_request_send_request=signature_request_send_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_send_without_preload_content( + self, + signature_request_send_request: SignatureRequestSendRequest, + _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 Signature Request + + Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. + + :param signature_request_send_request: (required) + :type signature_request_send_request: SignatureRequestSendRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_serialize( + signature_request_send_request=signature_request_send_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_send_serialize( + self, + signature_request_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 = signature_request_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 signature_request_send_request is not None and has_files is False: + _body_params = signature_request_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 - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/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 + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def signature_request_send_with_template( self, - signature_request_send_with_template_request, - **kwargs + signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Send with Template # noqa: E501 - - Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_send_with_template(signature_request_send_with_template_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_send_with_template_request (SignatureRequestSendWithTemplateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_send_with_template_request'] = \ - signature_request_send_with_template_request - try: - return self.signature_request_send_with_template_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, + """Send with Template + + Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. + + :param signature_request_send_with_template_request: (required) + :type signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_with_template_serialize( + signature_request_send_with_template_request=signature_request_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_send_with_template_with_http_info( + self, + signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Send with Template + + Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. + + :param signature_request_send_with_template_request: (required) + :type signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_with_template_serialize( + signature_request_send_with_template_request=signature_request_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_send_with_template_without_preload_content( + self, + signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest, + _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 with Template + + Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. + + :param signature_request_send_with_template_request: (required) + :type signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_with_template_serialize( + signature_request_send_with_template_request=signature_request_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_send_with_template_serialize( + self, + signature_request_send_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_send_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_send_with_template_request is not None and has_files is False: + _body_params = signature_request_send_with_template_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/send_with_template', + 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 + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def signature_request_update( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to update.")], + signature_request_update_request: SignatureRequestUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignatureRequestGetResponse: + """Update Signature Request + + Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. + + :param signature_request_id: The id of the SignatureRequest to update. (required) + :type signature_request_id: str + :param signature_request_update_request: (required) + :type signature_request_update_request: SignatureRequestUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_update_serialize( + signature_request_id=signature_request_id, + signature_request_update_request=signature_request_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_update_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to update.")], + signature_request_update_request: SignatureRequestUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Update Signature Request + + Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. + + :param signature_request_id: The id of the SignatureRequest to update. (required) + :type signature_request_id: str + :param signature_request_update_request: (required) + :type signature_request_update_request: SignatureRequestUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_update_serialize( + signature_request_id=signature_request_id, + signature_request_update_request=signature_request_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_update_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to update.")], + signature_request_update_request: SignatureRequestUpdateRequest, + _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: + """Update Signature Request + + Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. + + :param signature_request_id: The id of the SignatureRequest to update. (required) + :type signature_request_id: str + :param signature_request_update_request: (required) + :type signature_request_update_request: SignatureRequestUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_update_serialize( + signature_request_id=signature_request_id, + signature_request_update_request=signature_request_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_update_serialize( self, signature_request_id, signature_request_update_request, - **kwargs - ) -> SignatureRequestGetResponse: - """Update Signature Request # noqa: E501 - - Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_update(signature_request_id, signature_request_update_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to update. - signature_request_update_request (SignatureRequestUpdateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - kwargs['signature_request_update_request'] = \ - signature_request_update_request - try: - return self.signature_request_update_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, - ) - - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_update_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_update_request is not None and has_files is False: + _body_params = signature_request_update_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/update/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/sdks/python/dropbox_sign/api/team_api.py b/sdks/python/dropbox_sign/api/team_api.py index 98dc21564..a4c5db66a 100644 --- a/sdks/python/dropbox_sign/api/team_api.py +++ b/sdks/python/dropbox_sign/api/team_api.py @@ -1,1557 +1,2878 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - + Generated by OpenAPI Generator (https://openapi-generator.tech) -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.team_add_member_request import TeamAddMemberRequest -from dropbox_sign.model.team_create_request import TeamCreateRequest -from dropbox_sign.model.team_get_info_response import TeamGetInfoResponse -from dropbox_sign.model.team_get_response import TeamGetResponse -from dropbox_sign.model.team_invites_response import TeamInvitesResponse -from dropbox_sign.model.team_members_response import TeamMembersResponse -from dropbox_sign.model.team_remove_member_request import TeamRemoveMemberRequest -from dropbox_sign.model.team_sub_teams_response import TeamSubTeamsResponse -from dropbox_sign.model.team_update_request import TeamUpdateRequest - - -class TeamApi(object): + 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, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from dropbox_sign.models.team_add_member_request import TeamAddMemberRequest +from dropbox_sign.models.team_create_request import TeamCreateRequest +from dropbox_sign.models.team_get_info_response import TeamGetInfoResponse +from dropbox_sign.models.team_get_response import TeamGetResponse +from dropbox_sign.models.team_invites_response import TeamInvitesResponse +from dropbox_sign.models.team_members_response import TeamMembersResponse +from dropbox_sign.models.team_remove_member_request import TeamRemoveMemberRequest +from dropbox_sign.models.team_sub_teams_response import TeamSubTeamsResponse +from dropbox_sign.models.team_update_request import TeamUpdateRequest + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class TeamApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.team_add_member_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/add_member', - 'operation_id': 'team_add_member', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_add_member_request', - 'team_id', - ], - 'required': [ - 'team_add_member_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_add_member_request': - (TeamAddMemberRequest,), - 'team_id': - (str,), - }, - 'attribute_map': { - 'team_id': 'team_id', - }, - 'location_map': { - 'team_add_member_request': 'body', - 'team_id': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.team_create_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/create', - 'operation_id': 'team_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_create_request', - ], - 'required': [ - 'team_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_create_request': - (TeamCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'team_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.team_delete_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/destroy', - 'operation_id': 'team_delete', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_get_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team', - 'operation_id': 'team_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_info_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetInfoResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/info', - 'operation_id': 'team_info', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_id', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_id': - (str,), - }, - 'attribute_map': { - 'team_id': 'team_id', - }, - 'location_map': { - 'team_id': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_invites_endpoint = _Endpoint( - settings={ - 'response_type': (TeamInvitesResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/invites', - 'operation_id': 'team_invites', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'email_address', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'email_address': - (str,), - }, - 'attribute_map': { - 'email_address': 'email_address', - }, - 'location_map': { - 'email_address': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_members_endpoint = _Endpoint( - settings={ - 'response_type': (TeamMembersResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/members/{team_id}', - 'operation_id': 'team_members', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_id', - 'page', - 'page_size', - ], - 'required': [ - 'team_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'page_size', - ] - }, - root_map={ - 'validations': { - ('page_size',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_id': - (str,), - 'page': - (int,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'team_id': 'team_id', - 'page': 'page', - 'page_size': 'page_size', - }, - 'location_map': { - 'team_id': 'path', - 'page': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_remove_member_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/remove_member', - 'operation_id': 'team_remove_member', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_remove_member_request', - ], - 'required': [ - 'team_remove_member_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_remove_member_request': - (TeamRemoveMemberRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'team_remove_member_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.team_sub_teams_endpoint = _Endpoint( - settings={ - 'response_type': (TeamSubTeamsResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/sub_teams/{team_id}', - 'operation_id': 'team_sub_teams', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_id', - 'page', - 'page_size', - ], - 'required': [ - 'team_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'page_size', - ] - }, - root_map={ - 'validations': { - ('page_size',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_id': - (str,), - 'page': - (int,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'team_id': 'team_id', - 'page': 'page', - 'page_size': 'page_size', - }, - 'location_map': { - 'team_id': 'path', - 'page': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_update_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team', - 'operation_id': 'team_update', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_update_request', - ], - 'required': [ - 'team_update_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_update_request': - (TeamUpdateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'team_update_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def team_add_member( self, - team_add_member_request, - **kwargs + team_add_member_request: TeamAddMemberRequest, + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = 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, ) -> TeamGetResponse: - """Add User to Team # noqa: E501 - - Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_add_member(team_add_member_request, async_req=True) - >>> result = thread.get() - - Args: - team_add_member_request (TeamAddMemberRequest): - - Keyword Args: - team_id (str): The id of the team.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_add_member_request'] = \ - team_add_member_request - try: - return self.team_add_member_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetResponse], - _check_type=True, + """Add User to Team + + Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. + + :param team_add_member_request: (required) + :type team_add_member_request: TeamAddMemberRequest + :param team_id: The id of the team. + :type team_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._team_add_member_serialize( + team_add_member_request=team_add_member_request, + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '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 team_add_member_with_http_info( + self, + team_add_member_request: TeamAddMemberRequest, + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = 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[TeamGetResponse]: + """Add User to Team + + Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. + + :param team_add_member_request: (required) + :type team_add_member_request: TeamAddMemberRequest + :param team_id: The id of the team. + :type team_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._team_add_member_serialize( + team_add_member_request=team_add_member_request, + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '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 team_add_member_without_preload_content( + self, + team_add_member_request: TeamAddMemberRequest, + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = 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: + """Add User to Team + + Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. + + :param team_add_member_request: (required) + :type team_add_member_request: TeamAddMemberRequest + :param team_id: The id of the team. + :type team_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._team_add_member_serialize( + team_add_member_request=team_add_member_request, + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_add_member_serialize( + self, + team_add_member_request, + team_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 + + has_files = False + body_param = team_add_member_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 + if team_id is not None: + + _query_params.append(('team_id', team_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + if team_add_member_request is not None and has_files is False: + _body_params = team_add_member_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/team/add_member', + 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 + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def team_create( self, - team_create_request, - **kwargs + team_create_request: TeamCreateRequest, + _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, ) -> TeamGetResponse: - """Create Team # noqa: E501 - - Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_create(team_create_request, async_req=True) - >>> result = thread.get() - - Args: - team_create_request (TeamCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_create_request'] = \ - team_create_request - try: - return self.team_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetResponse], - _check_type=True, + """Create Team + + Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. + + :param team_create_request: (required) + :type team_create_request: TeamCreateRequest + :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._team_create_serialize( + team_create_request=team_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '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 team_create_with_http_info( + self, + team_create_request: TeamCreateRequest, + _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[TeamGetResponse]: + """Create Team + + Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. + + :param team_create_request: (required) + :type team_create_request: TeamCreateRequest + :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._team_create_serialize( + team_create_request=team_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '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 team_create_without_preload_content( + self, + team_create_request: TeamCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Team + + Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. + + :param team_create_request: (required) + :type team_create_request: TeamCreateRequest + :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._team_create_serialize( + team_create_request=team_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_create_serialize( + self, + team_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = team_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if team_create_request is not None and has_files is False: + _body_params = team_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/team/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def team_delete( self, - **kwargs + _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 Team # noqa: E501 - - Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_delete(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - return self.team_delete_endpoint.call_with_http_info(**kwargs) + """Delete Team + + Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). + + :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._team_delete_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_delete_with_http_info( + self, + _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 Team + + Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). + + :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._team_delete_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_delete_without_preload_content( + self, + _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 Team + + Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). + + :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._team_delete_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_delete_serialize( + self, + _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 + # 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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/team/destroy', + 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 team_get( self, - **kwargs + _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, ) -> TeamGetResponse: - """Get Team # noqa: E501 - - Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.team_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetResponse], - _check_type=True, - ) + """Get Team + + Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. + + :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._team_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '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 team_get_with_http_info( + self, + _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[TeamGetResponse]: + """Get Team + + Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. + + :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._team_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '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 team_get_without_preload_content( + self, + _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 Team + + Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. + + :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._team_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_get_serialize( + self, + _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 + # 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' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/team', + 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 + ) + - raise e + + @validate_call def team_info( self, - **kwargs + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = 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, ) -> TeamGetInfoResponse: - """Get Team Info # noqa: E501 - - Provides information about a team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_info(async_req=True) - >>> result = thread.get() - - - Keyword Args: - team_id (str): The id of the team.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetInfoResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.team_info_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetInfoResponse], - _check_type=True, - ) + """Get Team Info + + Provides information about a team. + + :param team_id: The id of the team. + :type team_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._team_info_serialize( + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetInfoResponse", + '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 team_info_with_http_info( + self, + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = 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[TeamGetInfoResponse]: + """Get Team Info + + Provides information about a team. + + :param team_id: The id of the team. + :type team_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._team_info_serialize( + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetInfoResponse", + '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 team_info_without_preload_content( + self, + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = 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: + """Get Team Info + + Provides information about a team. + + :param team_id: The id of the team. + :type team_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._team_info_serialize( + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetInfoResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_info_serialize( + self, + team_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 + # process the query parameters + if team_id is not None: + + _query_params.append(('team_id', team_id)) + + # 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' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/team/info', + 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 + ) + - raise e + + @validate_call def team_invites( self, - **kwargs + email_address: Annotated[Optional[StrictStr], Field(description="The email address for which to display the team invites.")] = 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, ) -> TeamInvitesResponse: - """List Team Invites # noqa: E501 - - Provides a list of team invites (and their roles). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_invites(async_req=True) - >>> result = thread.get() - - - Keyword Args: - email_address (str): The email address for which to display the team invites.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamInvitesResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.team_invites_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamInvitesResponse], - _check_type=True, - ) + """List Team Invites + + Provides a list of team invites (and their roles). + + :param email_address: The email address for which to display the team invites. + :type email_address: 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._team_invites_serialize( + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamInvitesResponse", + '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 team_invites_with_http_info( + self, + email_address: Annotated[Optional[StrictStr], Field(description="The email address for which to display the team invites.")] = 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[TeamInvitesResponse]: + """List Team Invites + + Provides a list of team invites (and their roles). + + :param email_address: The email address for which to display the team invites. + :type email_address: 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._team_invites_serialize( + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamInvitesResponse", + '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 team_invites_without_preload_content( + self, + email_address: Annotated[Optional[StrictStr], Field(description="The email address for which to display the team invites.")] = 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: + """List Team Invites + + Provides a list of team invites (and their roles). + + :param email_address: The email address for which to display the team invites. + :type email_address: 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._team_invites_serialize( + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamInvitesResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_invites_serialize( + self, + email_address, + _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 email_address is not None: + + _query_params.append(('email_address', email_address)) + + # 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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/team/invites', + 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 + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def team_members( self, - team_id, - **kwargs + team_id: Annotated[StrictStr, Field(description="The id of the team that a member list is being requested from.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the team member list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = 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, ) -> TeamMembersResponse: - """List Team Members # noqa: E501 - - Provides a paginated list of members (and their roles) that belong to a given team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_members(team_id, async_req=True) - >>> result = thread.get() - - Args: - team_id (str): The id of the team that a member list is being requested from. - - Keyword Args: - page (int): Which page number of the team member list to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.. [optional] if omitted the server will use the default value of 20 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamMembersResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_id'] = \ - team_id - try: - return self.team_members_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamMembersResponse], - _check_type=True, - ) + """List Team Members + + Provides a paginated list of members (and their roles) that belong to a given team. + + :param team_id: The id of the team that a member list is being requested from. (required) + :type team_id: str + :param page: Which page number of the team member list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :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._team_members_serialize( + team_id=team_id, + 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': "TeamMembersResponse", + '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 team_members_with_http_info( + self, + team_id: Annotated[StrictStr, Field(description="The id of the team that a member list is being requested from.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the team member list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = 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[TeamMembersResponse]: + """List Team Members + + Provides a paginated list of members (and their roles) that belong to a given team. + + :param team_id: The id of the team that a member list is being requested from. (required) + :type team_id: str + :param page: Which page number of the team member list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :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._team_members_serialize( + team_id=team_id, + 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': "TeamMembersResponse", + '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 team_members_without_preload_content( + self, + team_id: Annotated[StrictStr, Field(description="The id of the team that a member list is being requested from.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the team member list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = 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: + """List Team Members + + Provides a paginated list of members (and their roles) that belong to a given team. + + :param team_id: The id of the team that a member list is being requested from. (required) + :type team_id: str + :param page: Which page number of the team member list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :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._team_members_serialize( + team_id=team_id, + 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': "TeamMembersResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_members_serialize( + self, + team_id, + 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 + if team_id is not None: + _path_params['team_id'] = team_id + # 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' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/team/members/{team_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 + ) - raise e + + + @validate_call def team_remove_member( self, - team_remove_member_request, - **kwargs + team_remove_member_request: TeamRemoveMemberRequest, + _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, ) -> TeamGetResponse: - """Remove User from Team # noqa: E501 - - Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_remove_member(team_remove_member_request, async_req=True) - >>> result = thread.get() - - Args: - team_remove_member_request (TeamRemoveMemberRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_remove_member_request'] = \ - team_remove_member_request - try: - return self.team_remove_member_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 201: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetResponse], - _check_type=True, + """Remove User from Team + + Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. + + :param team_remove_member_request: (required) + :type team_remove_member_request: TeamRemoveMemberRequest + :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._team_remove_member_serialize( + team_remove_member_request=team_remove_member_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TeamGetResponse", + '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 team_remove_member_with_http_info( + self, + team_remove_member_request: TeamRemoveMemberRequest, + _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[TeamGetResponse]: + """Remove User from Team + + Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. + + :param team_remove_member_request: (required) + :type team_remove_member_request: TeamRemoveMemberRequest + :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._team_remove_member_serialize( + team_remove_member_request=team_remove_member_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TeamGetResponse", + '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 team_remove_member_without_preload_content( + self, + team_remove_member_request: TeamRemoveMemberRequest, + _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: + """Remove User from Team + + Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. + + :param team_remove_member_request: (required) + :type team_remove_member_request: TeamRemoveMemberRequest + :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._team_remove_member_serialize( + team_remove_member_request=team_remove_member_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_remove_member_serialize( + self, + team_remove_member_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 = team_remove_member_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 team_remove_member_request is not None and has_files is False: + _body_params = team_remove_member_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/team/remove_member', + 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 + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def team_sub_teams( self, - team_id, - **kwargs + team_id: Annotated[StrictStr, Field(description="The id of the parent Team.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SubTeam List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = 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, ) -> TeamSubTeamsResponse: - """List Sub Teams # noqa: E501 - - Provides a paginated list of sub teams that belong to a given team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_sub_teams(team_id, async_req=True) - >>> result = thread.get() - - Args: - team_id (str): The id of the parent Team. - - Keyword Args: - page (int): Which page number of the SubTeam List to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.. [optional] if omitted the server will use the default value of 20 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamSubTeamsResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_id'] = \ - team_id - try: - return self.team_sub_teams_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamSubTeamsResponse], - _check_type=True, - ) + """List Sub Teams + + Provides a paginated list of sub teams that belong to a given team. + + :param team_id: The id of the parent Team. (required) + :type team_id: str + :param page: Which page number of the SubTeam List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :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._team_sub_teams_serialize( + team_id=team_id, + 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': "TeamSubTeamsResponse", + '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 team_sub_teams_with_http_info( + self, + team_id: Annotated[StrictStr, Field(description="The id of the parent Team.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SubTeam List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = 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[TeamSubTeamsResponse]: + """List Sub Teams + + Provides a paginated list of sub teams that belong to a given team. + + :param team_id: The id of the parent Team. (required) + :type team_id: str + :param page: Which page number of the SubTeam List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :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._team_sub_teams_serialize( + team_id=team_id, + 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': "TeamSubTeamsResponse", + '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 team_sub_teams_without_preload_content( + self, + team_id: Annotated[StrictStr, Field(description="The id of the parent Team.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SubTeam List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = 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: + """List Sub Teams + + Provides a paginated list of sub teams that belong to a given team. + + :param team_id: The id of the parent Team. (required) + :type team_id: str + :param page: Which page number of the SubTeam List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :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._team_sub_teams_serialize( + team_id=team_id, + 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': "TeamSubTeamsResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_sub_teams_serialize( + self, + team_id, + 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 + if team_id is not None: + _path_params['team_id'] = team_id + # 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' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/team/sub_teams/{team_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 + ) - raise e + + + @validate_call def team_update( self, - team_update_request, - **kwargs + team_update_request: TeamUpdateRequest, + _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, ) -> TeamGetResponse: - """Update Team # noqa: E501 - - Updates the name of your Team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_update(team_update_request, async_req=True) - >>> result = thread.get() - - Args: - team_update_request (TeamUpdateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_update_request'] = \ - team_update_request - try: - return self.team_update_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetResponse], - _check_type=True, - ) - - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + """Update Team + + Updates the name of your Team. + + :param team_update_request: (required) + :type team_update_request: TeamUpdateRequest + :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._team_update_serialize( + team_update_request=team_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '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 team_update_with_http_info( + self, + team_update_request: TeamUpdateRequest, + _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[TeamGetResponse]: + """Update Team + + Updates the name of your Team. + + :param team_update_request: (required) + :type team_update_request: TeamUpdateRequest + :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._team_update_serialize( + team_update_request=team_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '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 team_update_without_preload_content( + self, + team_update_request: TeamUpdateRequest, + _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: + """Update Team + + Updates the name of your Team. + + :param team_update_request: (required) + :type team_update_request: TeamUpdateRequest + :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._team_update_serialize( + team_update_request=team_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_update_serialize( + self, + team_update_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 = team_update_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 team_update_request is not None and has_files is False: + _body_params = team_update_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/team', + 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 + ) - raise e diff --git a/sdks/python/dropbox_sign/api/template_api.py b/sdks/python/dropbox_sign/api/template_api.py index aa5eed855..459469f5e 100644 --- a/sdks/python/dropbox_sign/api/template_api.py +++ b/sdks/python/dropbox_sign/api/template_api.py @@ -1,1778 +1,3257 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - + Generated by OpenAPI Generator (https://openapi-generator.tech) -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.file_response import FileResponse -from dropbox_sign.model.file_response_data_uri import FileResponseDataUri -from dropbox_sign.model.template_add_user_request import TemplateAddUserRequest -from dropbox_sign.model.template_create_embedded_draft_request import TemplateCreateEmbeddedDraftRequest -from dropbox_sign.model.template_create_embedded_draft_response import TemplateCreateEmbeddedDraftResponse -from dropbox_sign.model.template_create_request import TemplateCreateRequest -from dropbox_sign.model.template_create_response import TemplateCreateResponse -from dropbox_sign.model.template_get_response import TemplateGetResponse -from dropbox_sign.model.template_list_response import TemplateListResponse -from dropbox_sign.model.template_remove_user_request import TemplateRemoveUserRequest -from dropbox_sign.model.template_update_files_request import TemplateUpdateFilesRequest -from dropbox_sign.model.template_update_files_response import TemplateUpdateFilesResponse - - -class TemplateApi(object): + 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, StrictInt, StrictStr, field_validator +from typing import Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.file_response import FileResponse +from dropbox_sign.models.file_response_data_uri import FileResponseDataUri +from dropbox_sign.models.template_add_user_request import TemplateAddUserRequest +from dropbox_sign.models.template_create_embedded_draft_request import TemplateCreateEmbeddedDraftRequest +from dropbox_sign.models.template_create_embedded_draft_response import TemplateCreateEmbeddedDraftResponse +from dropbox_sign.models.template_create_request import TemplateCreateRequest +from dropbox_sign.models.template_create_response import TemplateCreateResponse +from dropbox_sign.models.template_get_response import TemplateGetResponse +from dropbox_sign.models.template_list_response import TemplateListResponse +from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest +from dropbox_sign.models.template_update_files_request import TemplateUpdateFilesRequest +from dropbox_sign.models.template_update_files_response import TemplateUpdateFilesResponse + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class TemplateApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.template_add_user_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/add_user/{template_id}', - 'operation_id': 'template_add_user', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'template_add_user_request', - ], - 'required': [ - 'template_id', - 'template_add_user_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - 'template_add_user_request': - (TemplateAddUserRequest,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - 'template_add_user_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.template_create_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/create', - 'operation_id': 'template_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_create_request', - ], - 'required': [ - 'template_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_create_request': - (TemplateCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'template_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.template_create_embedded_draft_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateCreateEmbeddedDraftResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/create_embedded_draft', - 'operation_id': 'template_create_embedded_draft', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_create_embedded_draft_request', - ], - 'required': [ - 'template_create_embedded_draft_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_create_embedded_draft_request': - (TemplateCreateEmbeddedDraftRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'template_create_embedded_draft_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.template_delete_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/delete/{template_id}', - 'operation_id': 'template_delete', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - ], - 'required': [ - 'template_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_files_endpoint = _Endpoint( - settings={ - 'response_type': (file_type,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/files/{template_id}', - 'operation_id': 'template_files', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'file_type', - ], - 'required': [ - 'template_id', - ], - 'nullable': [ - ], - 'enum': [ - 'file_type', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('file_type',): { - - "PDF": "pdf", - "ZIP": "zip" - }, - }, - 'openapi_types': { - 'template_id': - (str,), - 'file_type': - (str,), - }, - 'attribute_map': { - 'template_id': 'template_id', - 'file_type': 'file_type', - }, - 'location_map': { - 'template_id': 'path', - 'file_type': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/pdf', - 'application/zip', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_files_as_data_uri_endpoint = _Endpoint( - settings={ - 'response_type': (FileResponseDataUri,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/files_as_data_uri/{template_id}', - 'operation_id': 'template_files_as_data_uri', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - ], - 'required': [ - 'template_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_files_as_file_url_endpoint = _Endpoint( - settings={ - 'response_type': (FileResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/files_as_file_url/{template_id}', - 'operation_id': 'template_files_as_file_url', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'force_download', - ], - 'required': [ - 'template_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - 'force_download': - (int,), - }, - 'attribute_map': { - 'template_id': 'template_id', - 'force_download': 'force_download', - }, - 'location_map': { - 'template_id': 'path', - 'force_download': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_get_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/{template_id}', - 'operation_id': 'template_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - ], - 'required': [ - 'template_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_list_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateListResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/list', - 'operation_id': 'template_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_id', - 'page', - 'page_size', - 'query', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'page_size', - ] - }, - root_map={ - 'validations': { - ('page_size',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'page': - (int,), - 'page_size': - (int,), - 'query': - (str,), - }, - 'attribute_map': { - 'account_id': 'account_id', - 'page': 'page', - 'page_size': 'page_size', - 'query': 'query', - }, - 'location_map': { - 'account_id': 'query', - 'page': 'query', - 'page_size': 'query', - 'query': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_remove_user_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/remove_user/{template_id}', - 'operation_id': 'template_remove_user', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'template_remove_user_request', - ], - 'required': [ - 'template_id', - 'template_remove_user_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - 'template_remove_user_request': - (TemplateRemoveUserRequest,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - 'template_remove_user_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.template_update_files_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateUpdateFilesResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/update_files/{template_id}', - 'operation_id': 'template_update_files', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'template_update_files_request', - ], - 'required': [ - 'template_id', - 'template_update_files_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - 'template_update_files_request': - (TemplateUpdateFilesRequest,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - 'template_update_files_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) + + @validate_call def template_add_user( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to give the Account access to.")], + template_add_user_request: TemplateAddUserRequest, + _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, + ) -> TemplateGetResponse: + """Add User to Template + + Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. + + :param template_id: The id of the Template to give the Account access to. (required) + :type template_id: str + :param template_add_user_request: (required) + :type template_add_user_request: TemplateAddUserRequest + :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._template_add_user_serialize( + template_id=template_id, + template_add_user_request=template_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '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 template_add_user_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to give the Account access to.")], + template_add_user_request: TemplateAddUserRequest, + _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[TemplateGetResponse]: + """Add User to Template + + Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. + + :param template_id: The id of the Template to give the Account access to. (required) + :type template_id: str + :param template_add_user_request: (required) + :type template_add_user_request: TemplateAddUserRequest + :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._template_add_user_serialize( + template_id=template_id, + template_add_user_request=template_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '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 template_add_user_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to give the Account access to.")], + template_add_user_request: TemplateAddUserRequest, + _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: + """Add User to Template + + Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. + + :param template_id: The id of the Template to give the Account access to. (required) + :type template_id: str + :param template_add_user_request: (required) + :type template_add_user_request: TemplateAddUserRequest + :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._template_add_user_serialize( + template_id=template_id, + template_add_user_request=template_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_add_user_serialize( self, template_id, template_add_user_request, - **kwargs - ) -> TemplateGetResponse: - """Add User to Template # noqa: E501 - - Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_add_user(template_id, template_add_user_request, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the Template to give the Account access to. - template_add_user_request (TemplateAddUserRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - kwargs['template_add_user_request'] = \ - template_add_user_request - try: - return self.template_add_user_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateGetResponse], - _check_type=True, + _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 = template_add_user_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_add_user_request is not None and has_files is False: + _body_params = template_add_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/add_user/{template_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 + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def template_create( self, - template_create_request, - **kwargs + template_create_request: TemplateCreateRequest, + _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, ) -> TemplateCreateResponse: - """Create Template # noqa: E501 - - Creates a template that can then be used. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_create(template_create_request, async_req=True) - >>> result = thread.get() - - Args: - template_create_request (TemplateCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_create_request'] = \ - template_create_request - try: - return self.template_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateCreateResponse], - _check_type=True, + """Create Template + + Creates a template that can then be used. + + :param template_create_request: (required) + :type template_create_request: TemplateCreateRequest + :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._template_create_serialize( + template_create_request=template_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateResponse", + '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 template_create_with_http_info( + self, + template_create_request: TemplateCreateRequest, + _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[TemplateCreateResponse]: + """Create Template + + Creates a template that can then be used. + + :param template_create_request: (required) + :type template_create_request: TemplateCreateRequest + :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._template_create_serialize( + template_create_request=template_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateResponse", + '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 template_create_without_preload_content( + self, + template_create_request: TemplateCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Template + + Creates a template that can then be used. + + :param template_create_request: (required) + :type template_create_request: TemplateCreateRequest + :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._template_create_serialize( + template_create_request=template_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_create_serialize( + self, + template_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = template_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_create_request is not None and has_files is False: + _body_params = template_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def template_create_embedded_draft( self, - template_create_embedded_draft_request, - **kwargs + template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest, + _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, ) -> TemplateCreateEmbeddedDraftResponse: - """Create Embedded Template Draft # noqa: E501 - - The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_create_embedded_draft(template_create_embedded_draft_request, async_req=True) - >>> result = thread.get() - - Args: - template_create_embedded_draft_request (TemplateCreateEmbeddedDraftRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateCreateEmbeddedDraftResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_create_embedded_draft_request'] = \ - template_create_embedded_draft_request - try: - return self.template_create_embedded_draft_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateCreateEmbeddedDraftResponse], - _check_type=True, + """Create Embedded Template Draft + + The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. + + :param template_create_embedded_draft_request: (required) + :type template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest + :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._template_create_embedded_draft_serialize( + template_create_embedded_draft_request=template_create_embedded_draft_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateEmbeddedDraftResponse", + '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 template_create_embedded_draft_with_http_info( + self, + template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest, + _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[TemplateCreateEmbeddedDraftResponse]: + """Create Embedded Template Draft + + The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. + + :param template_create_embedded_draft_request: (required) + :type template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest + :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._template_create_embedded_draft_serialize( + template_create_embedded_draft_request=template_create_embedded_draft_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateEmbeddedDraftResponse", + '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 template_create_embedded_draft_without_preload_content( + self, + template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Embedded Template Draft + + The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. + + :param template_create_embedded_draft_request: (required) + :type template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest + :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._template_create_embedded_draft_serialize( + template_create_embedded_draft_request=template_create_embedded_draft_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateEmbeddedDraftResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_create_embedded_draft_serialize( + self, + template_create_embedded_draft_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 = template_create_embedded_draft_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 template_create_embedded_draft_request is not None and has_files is False: + _body_params = template_create_embedded_draft_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/create_embedded_draft', + 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 + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def template_delete( self, - template_id, - **kwargs + template_id: Annotated[StrictStr, Field(description="The id of the Template to delete.")], + _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 Template # noqa: E501 - - Completely deletes the template specified from the account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_delete(template_id, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the Template to delete. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - return self.template_delete_endpoint.call_with_http_info(**kwargs) + """Delete Template + + Completely deletes the template specified from the account. + + :param template_id: The id of the Template to delete. (required) + :type template_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._template_delete_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_delete_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to delete.")], + _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 Template + + Completely deletes the template specified from the account. + + :param template_id: The id of the Template to delete. (required) + :type template_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._template_delete_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_delete_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to delete.")], + _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 Template + + Completely deletes the template specified from the account. + + :param template_id: The id of the Template to delete. (required) + :type template_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._template_delete_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_delete_serialize( + self, + template_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 template_id is not None: + _path_params['template_id'] = template_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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/delete/{template_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 template_files( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = 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, + ) -> io.IOBase: + """Get Template Files + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: 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._template_files_serialize( + template_id=template_id, + file_type=file_type, + _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 template_files_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = 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[io.IOBase]: + """Get Template Files + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: 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._template_files_serialize( + template_id=template_id, + file_type=file_type, + _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 template_files_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = 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: + """Get Template Files + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: 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._template_files_serialize( + template_id=template_id, + file_type=file_type, + _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 _template_files_serialize( self, template_id, - **kwargs - ) -> file_type: - """Get Template Files # noqa: E501 - - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_files(template_id, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the template files to retrieve. - - Keyword Args: - file_type (str): Set to `pdf` for a single merged document or `zip` for a collection of individual documents.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - try: - return self.template_files_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[file_type], - _check_type=True, - ) + file_type, + _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 template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + if file_type is not None: + + _query_params.append(('file_type', file_type)) + + # 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/zip', + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/template/files/{template_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 + ) + - raise e + + @validate_call def template_files_as_data_uri( self, - template_id, - **kwargs + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + _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, ) -> FileResponseDataUri: - """Get Template Files as Data Uri # noqa: E501 - - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_files_as_data_uri(template_id, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the template files to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FileResponseDataUri - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - try: - return self.template_files_as_data_uri_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[FileResponseDataUri], - _check_type=True, - ) + """Get Template Files as Data Uri + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_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._template_files_as_data_uri_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '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 template_files_as_data_uri_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + _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[FileResponseDataUri]: + """Get Template Files as Data Uri + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_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._template_files_as_data_uri_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '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 template_files_as_data_uri_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + _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 Template Files as Data Uri + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_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._template_files_as_data_uri_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_files_as_data_uri_serialize( + self, + template_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 template_id is not None: + _path_params['template_id'] = template_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' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/template/files_as_data_uri/{template_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 + ) - raise e + + + @validate_call def template_files_as_file_url( self, - template_id, - **kwargs + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = 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, ) -> FileResponse: - """Get Template Files as File Url # noqa: E501 - - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_files_as_file_url(template_id, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the template files to retrieve. - - Keyword Args: - force_download (int): By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.. [optional] if omitted the server will use the default value of 1 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FileResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - try: - return self.template_files_as_file_url_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[FileResponse], - _check_type=True, - ) + """Get Template Files as File Url + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: 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._template_files_as_file_url_serialize( + template_id=template_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '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 template_files_as_file_url_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = 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[FileResponse]: + """Get Template Files as File Url + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: 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._template_files_as_file_url_serialize( + template_id=template_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '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 template_files_as_file_url_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = 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: + """Get Template Files as File Url + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: 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._template_files_as_file_url_serialize( + template_id=template_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_files_as_file_url_serialize( + self, + template_id, + force_download, + _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 template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + if force_download is not None: + + _query_params.append(('force_download', force_download)) + + # 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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/template/files_as_file_url/{template_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 + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def template_get( self, - template_id, - **kwargs + template_id: Annotated[StrictStr, Field(description="The id of the Template to retrieve.")], + _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, ) -> TemplateGetResponse: - """Get Template # noqa: E501 - - Returns the Template specified by the `template_id` parameter. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_get(template_id, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the Template to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - try: - return self.template_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateGetResponse], - _check_type=True, - ) + """Get Template + + Returns the Template specified by the `template_id` parameter. + + :param template_id: The id of the Template to retrieve. (required) + :type template_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._template_get_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '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 template_get_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to retrieve.")], + _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[TemplateGetResponse]: + """Get Template + + Returns the Template specified by the `template_id` parameter. + + :param template_id: The id of the Template to retrieve. (required) + :type template_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._template_get_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '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 template_get_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to retrieve.")], + _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 Template + + Returns the Template specified by the `template_id` parameter. + + :param template_id: The id of the Template to retrieve. (required) + :type template_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._template_get_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_get_serialize( + self, + template_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 template_id is not None: + _path_params['template_id'] = template_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' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/template/{template_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 + ) - raise e + + + @validate_call def template_list( self, - **kwargs + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the Template List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the Template objects.")] = 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, ) -> TemplateListResponse: - """List Templates # noqa: E501 - - Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - account_id (str): Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.. [optional] - page (int): Which page number of the Template List to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.. [optional] if omitted the server will use the default value of 20 - query (str): String that includes search terms and/or fields to be used to filter the Template objects.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.template_list_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateListResponse], - _check_type=True, - ) + """List Templates + + Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. + + :param account_id: Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the Template List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the Template objects. + :type query: 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._template_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateListResponse", + '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 template_list_with_http_info( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the Template List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the Template objects.")] = 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[TemplateListResponse]: + """List Templates + + Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. + + :param account_id: Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the Template List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the Template objects. + :type query: 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._template_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateListResponse", + '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 template_list_without_preload_content( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the Template List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the Template objects.")] = 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: + """List Templates + + Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. + + :param account_id: Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the Template List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the Template objects. + :type query: 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._template_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_list_serialize( + self, + account_id, + page, + page_size, + query, + _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 account_id is not None: + + _query_params.append(('account_id', account_id)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if query is not None: + + _query_params.append(('query', query)) + + # 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', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/template/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 + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def template_remove_user( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to remove the Account's access to.")], + template_remove_user_request: TemplateRemoveUserRequest, + _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, + ) -> TemplateGetResponse: + """Remove User from Template + + Removes the specified Account's access to the specified Template. + + :param template_id: The id of the Template to remove the Account's access to. (required) + :type template_id: str + :param template_remove_user_request: (required) + :type template_remove_user_request: TemplateRemoveUserRequest + :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._template_remove_user_serialize( + template_id=template_id, + template_remove_user_request=template_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '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 template_remove_user_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to remove the Account's access to.")], + template_remove_user_request: TemplateRemoveUserRequest, + _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[TemplateGetResponse]: + """Remove User from Template + + Removes the specified Account's access to the specified Template. + + :param template_id: The id of the Template to remove the Account's access to. (required) + :type template_id: str + :param template_remove_user_request: (required) + :type template_remove_user_request: TemplateRemoveUserRequest + :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._template_remove_user_serialize( + template_id=template_id, + template_remove_user_request=template_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '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 template_remove_user_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to remove the Account's access to.")], + template_remove_user_request: TemplateRemoveUserRequest, + _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: + """Remove User from Template + + Removes the specified Account's access to the specified Template. + + :param template_id: The id of the Template to remove the Account's access to. (required) + :type template_id: str + :param template_remove_user_request: (required) + :type template_remove_user_request: TemplateRemoveUserRequest + :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._template_remove_user_serialize( + template_id=template_id, + template_remove_user_request=template_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_remove_user_serialize( self, template_id, template_remove_user_request, - **kwargs - ) -> TemplateGetResponse: - """Remove User from Template # noqa: E501 - - Removes the specified Account's access to the specified Template. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_remove_user(template_id, template_remove_user_request, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the Template to remove the Account's access to. - template_remove_user_request (TemplateRemoveUserRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - kwargs['template_remove_user_request'] = \ - template_remove_user_request - try: - return self.template_remove_user_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateGetResponse], - _check_type=True, + _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 = template_remove_user_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_remove_user_request is not None and has_files is False: + _body_params = template_remove_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/remove_user/{template_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 + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def template_update_files( + self, + template_id: Annotated[StrictStr, Field(description="The ID of the template whose files to update.")], + template_update_files_request: TemplateUpdateFilesRequest, + _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, + ) -> TemplateUpdateFilesResponse: + """Update Template Files + + Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). + + :param template_id: The ID of the template whose files to update. (required) + :type template_id: str + :param template_update_files_request: (required) + :type template_update_files_request: TemplateUpdateFilesRequest + :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._template_update_files_serialize( + template_id=template_id, + template_update_files_request=template_update_files_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateUpdateFilesResponse", + '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 template_update_files_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The ID of the template whose files to update.")], + template_update_files_request: TemplateUpdateFilesRequest, + _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[TemplateUpdateFilesResponse]: + """Update Template Files + + Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). + + :param template_id: The ID of the template whose files to update. (required) + :type template_id: str + :param template_update_files_request: (required) + :type template_update_files_request: TemplateUpdateFilesRequest + :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._template_update_files_serialize( + template_id=template_id, + template_update_files_request=template_update_files_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateUpdateFilesResponse", + '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 template_update_files_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The ID of the template whose files to update.")], + template_update_files_request: TemplateUpdateFilesRequest, + _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: + """Update Template Files + + Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). + + :param template_id: The ID of the template whose files to update. (required) + :type template_id: str + :param template_update_files_request: (required) + :type template_update_files_request: TemplateUpdateFilesRequest + :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._template_update_files_serialize( + template_id=template_id, + template_update_files_request=template_update_files_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateUpdateFilesResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_update_files_serialize( self, template_id, template_update_files_request, - **kwargs - ) -> TemplateUpdateFilesResponse: - """Update Template Files # noqa: E501 - - Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_update_files(template_id, template_update_files_request, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The ID of the template whose files to update. - template_update_files_request (TemplateUpdateFilesRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateUpdateFilesResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - kwargs['template_update_files_request'] = \ - template_update_files_request - try: - return self.template_update_files_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateUpdateFilesResponse], - _check_type=True, - ) - - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + _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 = template_update_files_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_update_files_request is not None and has_files is False: + _body_params = template_update_files_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/update_files/{template_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 + ) - raise e diff --git a/sdks/python/dropbox_sign/api/unclaimed_draft_api.py b/sdks/python/dropbox_sign/api/unclaimed_draft_api.py index b66f30104..24580c554 100644 --- a/sdks/python/dropbox_sign/api/unclaimed_draft_api.py +++ b/sdks/python/dropbox_sign/api/unclaimed_draft_api.py @@ -1,670 +1,1254 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from dropbox_sign.models.unclaimed_draft_create_embedded_request import UnclaimedDraftCreateEmbeddedRequest +from dropbox_sign.models.unclaimed_draft_create_embedded_with_template_request import UnclaimedDraftCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.unclaimed_draft_create_request import UnclaimedDraftCreateRequest +from dropbox_sign.models.unclaimed_draft_create_response import UnclaimedDraftCreateResponse +from dropbox_sign.models.unclaimed_draft_edit_and_resend_request import UnclaimedDraftEditAndResendRequest + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.unclaimed_draft_create_embedded_request import UnclaimedDraftCreateEmbeddedRequest -from dropbox_sign.model.unclaimed_draft_create_embedded_with_template_request import UnclaimedDraftCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.unclaimed_draft_create_request import UnclaimedDraftCreateRequest -from dropbox_sign.model.unclaimed_draft_create_response import UnclaimedDraftCreateResponse -from dropbox_sign.model.unclaimed_draft_edit_and_resend_request import UnclaimedDraftEditAndResendRequest - - -class UnclaimedDraftApi(object): +class UnclaimedDraftApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.unclaimed_draft_create_endpoint = _Endpoint( - settings={ - 'response_type': (UnclaimedDraftCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/unclaimed_draft/create', - 'operation_id': 'unclaimed_draft_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'unclaimed_draft_create_request', - ], - 'required': [ - 'unclaimed_draft_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'unclaimed_draft_create_request': - (UnclaimedDraftCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'unclaimed_draft_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.unclaimed_draft_create_embedded_endpoint = _Endpoint( - settings={ - 'response_type': (UnclaimedDraftCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/unclaimed_draft/create_embedded', - 'operation_id': 'unclaimed_draft_create_embedded', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'unclaimed_draft_create_embedded_request', - ], - 'required': [ - 'unclaimed_draft_create_embedded_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'unclaimed_draft_create_embedded_request': - (UnclaimedDraftCreateEmbeddedRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'unclaimed_draft_create_embedded_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.unclaimed_draft_create_embedded_with_template_endpoint = _Endpoint( - settings={ - 'response_type': (UnclaimedDraftCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/unclaimed_draft/create_embedded_with_template', - 'operation_id': 'unclaimed_draft_create_embedded_with_template', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'unclaimed_draft_create_embedded_with_template_request', - ], - 'required': [ - 'unclaimed_draft_create_embedded_with_template_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'unclaimed_draft_create_embedded_with_template_request': - (UnclaimedDraftCreateEmbeddedWithTemplateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'unclaimed_draft_create_embedded_with_template_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.unclaimed_draft_edit_and_resend_endpoint = _Endpoint( - settings={ - 'response_type': (UnclaimedDraftCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/unclaimed_draft/edit_and_resend/{signature_request_id}', - 'operation_id': 'unclaimed_draft_edit_and_resend', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - 'unclaimed_draft_edit_and_resend_request', - ], - 'required': [ - 'signature_request_id', - 'unclaimed_draft_edit_and_resend_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - 'unclaimed_draft_edit_and_resend_request': - (UnclaimedDraftEditAndResendRequest,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - 'unclaimed_draft_edit_and_resend_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def unclaimed_draft_create( self, - unclaimed_draft_create_request, - **kwargs + unclaimed_draft_create_request: UnclaimedDraftCreateRequest, + _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, ) -> UnclaimedDraftCreateResponse: - """Create Unclaimed Draft # noqa: E501 - - Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unclaimed_draft_create(unclaimed_draft_create_request, async_req=True) - >>> result = thread.get() - - Args: - unclaimed_draft_create_request (UnclaimedDraftCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - UnclaimedDraftCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['unclaimed_draft_create_request'] = \ - unclaimed_draft_create_request - try: - return self.unclaimed_draft_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[UnclaimedDraftCreateResponse], - _check_type=True, - ) + """Create Unclaimed Draft + + Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. + + :param unclaimed_draft_create_request: (required) + :type unclaimed_draft_create_request: UnclaimedDraftCreateRequest + :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._unclaimed_draft_create_serialize( + unclaimed_draft_create_request=unclaimed_draft_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '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 unclaimed_draft_create_with_http_info( + self, + unclaimed_draft_create_request: UnclaimedDraftCreateRequest, + _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[UnclaimedDraftCreateResponse]: + """Create Unclaimed Draft + + Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. + + :param unclaimed_draft_create_request: (required) + :type unclaimed_draft_create_request: UnclaimedDraftCreateRequest + :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._unclaimed_draft_create_serialize( + unclaimed_draft_create_request=unclaimed_draft_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '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 unclaimed_draft_create_without_preload_content( + self, + unclaimed_draft_create_request: UnclaimedDraftCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Unclaimed Draft + + Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. + + :param unclaimed_draft_create_request: (required) + :type unclaimed_draft_create_request: UnclaimedDraftCreateRequest + :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._unclaimed_draft_create_serialize( + unclaimed_draft_create_request=unclaimed_draft_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unclaimed_draft_create_serialize( + self, + unclaimed_draft_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = unclaimed_draft_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if unclaimed_draft_create_request is not None and has_files is False: + _body_params = unclaimed_draft_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/unclaimed_draft/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + - raise e + @validate_call def unclaimed_draft_create_embedded( self, - unclaimed_draft_create_embedded_request, - **kwargs + unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest, + _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, ) -> UnclaimedDraftCreateResponse: - """Create Embedded Unclaimed Draft # noqa: E501 - - Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unclaimed_draft_create_embedded(unclaimed_draft_create_embedded_request, async_req=True) - >>> result = thread.get() - - Args: - unclaimed_draft_create_embedded_request (UnclaimedDraftCreateEmbeddedRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - UnclaimedDraftCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['unclaimed_draft_create_embedded_request'] = \ - unclaimed_draft_create_embedded_request - try: - return self.unclaimed_draft_create_embedded_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[UnclaimedDraftCreateResponse], - _check_type=True, - ) + """Create Embedded Unclaimed Draft + + Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_request: (required) + :type unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest + :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._unclaimed_draft_create_embedded_serialize( + unclaimed_draft_create_embedded_request=unclaimed_draft_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '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 unclaimed_draft_create_embedded_with_http_info( + self, + unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest, + _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[UnclaimedDraftCreateResponse]: + """Create Embedded Unclaimed Draft + + Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_request: (required) + :type unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest + :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._unclaimed_draft_create_embedded_serialize( + unclaimed_draft_create_embedded_request=unclaimed_draft_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '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 unclaimed_draft_create_embedded_without_preload_content( + self, + unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Embedded Unclaimed Draft + + Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_request: (required) + :type unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest + :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._unclaimed_draft_create_embedded_serialize( + unclaimed_draft_create_embedded_request=unclaimed_draft_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unclaimed_draft_create_embedded_serialize( + self, + unclaimed_draft_create_embedded_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = unclaimed_draft_create_embedded_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + 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 unclaimed_draft_create_embedded_request is not None and has_files is False: + _body_params = unclaimed_draft_create_embedded_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + return self.api_client.param_serialize( + method='POST', + resource_path='/unclaimed_draft/create_embedded', + 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 unclaimed_draft_create_embedded_with_template( self, - unclaimed_draft_create_embedded_with_template_request, - **kwargs + unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest, + _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, ) -> UnclaimedDraftCreateResponse: - """Create Embedded Unclaimed Draft with Template # noqa: E501 - - Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unclaimed_draft_create_embedded_with_template(unclaimed_draft_create_embedded_with_template_request, async_req=True) - >>> result = thread.get() - - Args: - unclaimed_draft_create_embedded_with_template_request (UnclaimedDraftCreateEmbeddedWithTemplateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - UnclaimedDraftCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['unclaimed_draft_create_embedded_with_template_request'] = \ - unclaimed_draft_create_embedded_with_template_request - try: - return self.unclaimed_draft_create_embedded_with_template_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[UnclaimedDraftCreateResponse], - _check_type=True, - ) + """Create Embedded Unclaimed Draft with Template + + Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_with_template_request: (required) + :type unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest + :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._unclaimed_draft_create_embedded_with_template_serialize( + unclaimed_draft_create_embedded_with_template_request=unclaimed_draft_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '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 unclaimed_draft_create_embedded_with_template_with_http_info( + self, + unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest, + _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[UnclaimedDraftCreateResponse]: + """Create Embedded Unclaimed Draft with Template + + Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_with_template_request: (required) + :type unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest + :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._unclaimed_draft_create_embedded_with_template_serialize( + unclaimed_draft_create_embedded_with_template_request=unclaimed_draft_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '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 unclaimed_draft_create_embedded_with_template_without_preload_content( + self, + unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Embedded Unclaimed Draft with Template + + Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_with_template_request: (required) + :type unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest + :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._unclaimed_draft_create_embedded_with_template_serialize( + unclaimed_draft_create_embedded_with_template_request=unclaimed_draft_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unclaimed_draft_create_embedded_with_template_serialize( + self, + unclaimed_draft_create_embedded_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = unclaimed_draft_create_embedded_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if unclaimed_draft_create_embedded_with_template_request is not None and has_files is False: + _body_params = unclaimed_draft_create_embedded_with_template_request + - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/unclaimed_draft/create_embedded_with_template', + 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 + ) + + - raise e + @validate_call def unclaimed_draft_edit_and_resend( + self, + signature_request_id: Annotated[StrictStr, Field(description="The ID of the signature request to edit and resend.")], + unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest, + _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, + ) -> UnclaimedDraftCreateResponse: + """Edit and Resend Unclaimed Draft + + Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param signature_request_id: The ID of the signature request to edit and resend. (required) + :type signature_request_id: str + :param unclaimed_draft_edit_and_resend_request: (required) + :type unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest + :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._unclaimed_draft_edit_and_resend_serialize( + signature_request_id=signature_request_id, + unclaimed_draft_edit_and_resend_request=unclaimed_draft_edit_and_resend_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '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 unclaimed_draft_edit_and_resend_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The ID of the signature request to edit and resend.")], + unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest, + _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[UnclaimedDraftCreateResponse]: + """Edit and Resend Unclaimed Draft + + Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param signature_request_id: The ID of the signature request to edit and resend. (required) + :type signature_request_id: str + :param unclaimed_draft_edit_and_resend_request: (required) + :type unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest + :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._unclaimed_draft_edit_and_resend_serialize( + signature_request_id=signature_request_id, + unclaimed_draft_edit_and_resend_request=unclaimed_draft_edit_and_resend_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '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 unclaimed_draft_edit_and_resend_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The ID of the signature request to edit and resend.")], + unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Edit and Resend Unclaimed Draft + + Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param signature_request_id: The ID of the signature request to edit and resend. (required) + :type signature_request_id: str + :param unclaimed_draft_edit_and_resend_request: (required) + :type unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest + :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._unclaimed_draft_edit_and_resend_serialize( + signature_request_id=signature_request_id, + unclaimed_draft_edit_and_resend_request=unclaimed_draft_edit_and_resend_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unclaimed_draft_edit_and_resend_serialize( self, signature_request_id, unclaimed_draft_edit_and_resend_request, - **kwargs - ) -> UnclaimedDraftCreateResponse: - """Edit and Resend Unclaimed Draft # noqa: E501 - - Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unclaimed_draft_edit_and_resend(signature_request_id, unclaimed_draft_edit_and_resend_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The ID of the signature request to edit and resend. - unclaimed_draft_edit_and_resend_request (UnclaimedDraftEditAndResendRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - UnclaimedDraftCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - kwargs['unclaimed_draft_edit_and_resend_request'] = \ - unclaimed_draft_edit_and_resend_request - try: - return self.unclaimed_draft_edit_and_resend_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[UnclaimedDraftCreateResponse], - _check_type=True, - ) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + _collection_formats: Dict[str, str] = { + } - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + _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 = unclaimed_draft_edit_and_resend_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if unclaimed_draft_edit_and_resend_request is not None and has_files is False: + _body_params = unclaimed_draft_edit_and_resend_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/unclaimed_draft/edit_and_resend/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/sdks/python/dropbox_sign/api_client.py b/sdks/python/dropbox_sign/api_client.py index f162a0807..9916d6995 100644 --- a/sdks/python/dropbox_sign/api_client.py +++ b/sdks/python/dropbox_sign/api_client.py @@ -1,46 +1,50 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal import json -import atexit import mimetypes -from multiprocessing.pool import ThreadPool -import io import os import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField +import tempfile +import io +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr -from dropbox_sign import rest from dropbox_sign.configuration import Configuration -from dropbox_sign.exceptions import ApiTypeError, ApiValueError, ApiException -from dropbox_sign.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types +from dropbox_sign.api_response import ApiResponse, T as ApiResponseT +import dropbox_sign.models +from dropbox_sign import rest +from dropbox_sign.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException ) +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] -class ApiClient(object): +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -48,28 +52,39 @@ class ApiClient(object): the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided if configuration is None: - configuration = Configuration.get_default_copy() + configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -77,31 +92,14 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.5-dev/python' + self.user_agent = 'OpenAPI-Generator/1.6-dev/python' + self.client_side_validation = configuration.client_side_validation def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -115,26 +113,69 @@ def user_agent(self, value): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - def __call_api( + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None - ): + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :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. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -145,14 +186,17 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -160,336 +204,269 @@ def __call_api( quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict) ) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) - # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead url = _host + resource_path + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except ApiException as e: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ - return_data = response_data + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg - if not _preload_content: - return (return_data) - return return_data + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None content_type = response_data.getheader('content-type') if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes + :param obj: The data to serialize. :return: The serialized form of data. """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() - } - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): return obj - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item) for item in obj] - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) # fetch data from response object - try: - received_data = json.loads(response.data) - except TypeError: - received_data = response.data - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. + return self.__deserialize(data, response_type) - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :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. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(dropbox_sign.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) + return self.__deserialize_model(data, klass) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -498,10 +475,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -521,396 +498,296 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): - """Builds form parameters. + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) """ - if files is None: - return [] + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) + else: + new_params.append((k, quote(str(v)))) + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters(self, files: Dict[str, Union[str, bytes, io.IOBase]]): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, io.IOBase): + filename = os.path.basename(v.name) + filedata = v.read() + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] - def select_header_content_type(self, content_types, method=None, body=None): + def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' + return None - content_types = [x.lower() for x in content_types] + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' + return content_types[0] - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body): + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting ) + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) + def __deserialize_file(self, response): + """Deserializes body to file - if kwargs['_check_input_type'] is False: - return + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - """We want to support a single typed object parameter for all endpoints, - including of multipart/form-data content-types. - """ - body = param_value.to_dict() - remove_files = [] - - for oas_name in param_value.openapi_types: - if hasattr(param_value, oas_name): - obj = param_value[oas_name] - if isinstance(obj, file_type): - params['file'][oas_name] = [obj] - remove_files.append(oas_name) - elif isinstance(obj, list): - i = 0 - for obj_value in obj: - if isinstance(obj_value, file_type): - key = oas_name + '[' + str(i) + ']' - params['file'][key] = [obj_value] - remove_files.append(oas_name) - i += 1 - - # remove duplicates - remove_files = list(set(remove_files)) - - for remove in remove_files: - body.pop(remove) - - if len(remove_files): - for param in body: - param_value_full = (param, body[param]) - - # do not change non-JSON values - if (not isinstance(body[param], (str, bool, int, float))): - param_value_full = (param, json.dumps(body[param])) - - params['form'].append(param_value_full) - else: - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][base_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format + with open(path, "wb") as f: + f.write(response.data) - return params + return path - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. - api_instance = AccountApi() - api_instance.account_create # this is an instance of the class Endpoint - api_instance.account_create() # this invokes api_instance.account_create.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.account_create.callable or self.callable in this class + :param data: str. + :param klass: class literal. + :return: int, long, float, str, bool. """ - return self.callable(self, *args, **kwargs) + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value - def call_with_http_info(self, **kwargs): + def __deserialize_date(self, string): + """Deserializes string to date. + :param string: str. + :return: date. + """ try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. - self.__validate_inputs(kwargs) + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) - params = self.__gather_params(kwargs) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. - # Remove None values from query parameters - query_to_keep = [] - for key, value in params['query']: - if value is not None: - query_to_keep = query_to_keep + [(key, value)] + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) - params['query'] = query_to_keep + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if len(params['form']) > 0 or ('file' in params.keys() and len(params['file']) > 0): - params['header']['Content-Type'] = 'multipart/form-data' - elif params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) + return klass.from_dict(data) diff --git a/sdks/python/dropbox_sign/api_response.py b/sdks/python/dropbox_sign/api_response.py new file mode 100644 index 000000000..9bc7c11f6 --- /dev/null +++ b/sdks/python/dropbox_sign/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/sdks/python/dropbox_sign/apis/__init__.py b/sdks/python/dropbox_sign/apis/__init__.py index dca24c92e..16344f32d 100644 --- a/sdks/python/dropbox_sign/apis/__init__.py +++ b/sdks/python/dropbox_sign/apis/__init__.py @@ -1,23 +1,11 @@ - # flake8: noqa -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from .api.account_api import AccountApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - # Import APIs into API package: from dropbox_sign.api.account_api import AccountApi 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_line_api import FaxLineApi from dropbox_sign.api.o_auth_api import OAuthApi from dropbox_sign.api.report_api import ReportApi from dropbox_sign.api.signature_request_api import SignatureRequestApi diff --git a/sdks/python/dropbox_sign/configuration.py b/sdks/python/dropbox_sign/configuration.py index 59af89232..4041cb85a 100644 --- a/sdks/python/dropbox_sign/configuration.py +++ b/sdks/python/dropbox_sign/configuration.py @@ -1,23 +1,27 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import copy import logging +from logging import FileHandler import multiprocessing import sys +from typing import Optional import urllib3 -from http import client as http_client -from dropbox_sign.exceptions import ApiValueError - +import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -25,46 +29,23 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. +class Configuration: + """This class contains various settings of the API client. - :param host: Base url + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. :param server_index: Index to servers configuration. :param server_variables: Mapping with string values to replace variables in templated server configuration. The validation of enums is performed for @@ -73,9 +54,11 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format + in PEM format. + :param retries: Number of retries for API requests. :Example: @@ -90,8 +73,7 @@ class Configuration(object): Configure API client with HTTP basic authentication: conf = dropbox_sign.Configuration( - username='the-user', - password='the-password', + username='YOUR_API_KEY', ) """ @@ -100,14 +82,16 @@ class Configuration(object): def __init__(self, host=None, api_key=None, api_key_prefix=None, - access_token=None, username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", + access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, - ): + retries=None, + *, + debug: Optional[bool] = None + ) -> None: """Constructor """ self._base_path = "https://api.hellosign.com/v3" if host is None else host @@ -121,13 +105,15 @@ def __init__(self, host=None, self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} - if api_key: + if api_key and not username: self.api_key = api_key """dict to store API key(s) """ @@ -145,8 +131,9 @@ def __init__(self, host=None, self.password = password """Password for HTTP basic authentication """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations + self.access_token = access_token + """Access token + """ self.logger = {} """Logging Settings """ @@ -158,13 +145,16 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -185,6 +175,10 @@ def __init__(self, host=None, self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -194,26 +188,32 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation self.client_side_validation = True - # Options to pass down to the underlying urllib3 socket self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ def __deepcopy__(self, memo): cls = self.__class__ @@ -231,13 +231,6 @@ def __deepcopy__(self, memo): def __setattr__(self, name, value): object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s @classmethod def set_default(cls, default): @@ -248,21 +241,31 @@ def set_default(cls, default): :param default: object of Configuration """ - cls._default = copy.deepcopy(default) + cls._default = default @classmethod def get_default_copy(cls): - """Return new instance of configuration. + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default - configuration passed by the set_default method. + configuration. :return: The configuration object. """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() + if cls._default is None: + cls._default = Configuration() + return cls._default @property def logger_file(self): @@ -316,15 +319,15 @@ def debug(self, value): # if debug status is True, turn on debug logging for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 @property def logger_format(self): @@ -387,7 +390,7 @@ def auth_settings(self): :return: The Auth Settings information dict. """ auth = {} - if self.username is not None or self.password is not None: + if self.username is not None: auth['api_key'] = { 'type': 'basic', 'in': 'header', @@ -413,7 +416,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 3.0.0\n"\ - "SDK Package Version: 1.5-dev".\ + "SDK Package Version: 1.6-dev".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/sdks/python/dropbox_sign/exceptions.py b/sdks/python/dropbox_sign/exceptions.py index 460c01fc9..ba101a20f 100644 --- a/sdks/python/dropbox_sign/exceptions.py +++ b/sdks/python/dropbox_sign/exceptions.py @@ -1,14 +1,20 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 +from typing import Any, Optional +from typing_extensions import Self +from dropbox_sign.models.error_response import ErrorResponse class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -16,7 +22,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -44,7 +50,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -62,7 +68,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -81,7 +87,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -99,17 +105,56 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data: ErrorResponse = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -119,34 +164,30 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message -class NotFoundException(ApiException): +class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) +class NotFoundException(ApiException): + pass -class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) +class UnauthorizedException(ApiException): + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) + pass def render_path(path_to_item): diff --git a/sdks/python/dropbox_sign/model/__init__.py b/sdks/python/dropbox_sign/model/__init__.py deleted file mode 100644 index cfe32b784..000000000 --- a/sdks/python/dropbox_sign/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB diff --git a/sdks/python/dropbox_sign/model/account_create_request.py b/sdks/python/dropbox_sign/model/account_create_request.py deleted file mode 100644 index f0cedb207..000000000 --- a/sdks/python/dropbox_sign/model/account_create_request.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'client_secret': (str,), # noqa: E501 - 'locale': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'client_secret': 'client_secret', # noqa: E501 - 'locale': 'locale', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def client_secret(self) -> str: - return self.get("client_secret") - - @client_secret.setter - def client_secret(self, value: str): - setattr(self, "client_secret", value) - - @property - def locale(self) -> str: - return self.get("locale") - - @locale.setter - def locale(self, value: str): - setattr(self, "locale", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email_address, *args, **kwargs): # noqa: E501 - """AccountCreateRequest - a model defined in OpenAPI - - Args: - email_address (str): The email address which will be associated with the new Account. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client_id (str): Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization). [optional] # noqa: E501 - client_secret (str): Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization). [optional] # noqa: E501 - locale (str): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, email_address, *args, **kwargs): # noqa: E501 - """AccountCreateRequest - a model defined in OpenAPI - - Args: - email_address (str): The email address which will be associated with the new Account. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client_id (str): Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization). [optional] # noqa: E501 - client_secret (str): Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization). [optional] # noqa: E501 - locale (str): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/account_create_response.py b/sdks/python/dropbox_sign/model/account_create_response.py deleted file mode 100644 index f65c75707..000000000 --- a/sdks/python/dropbox_sign/model/account_create_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.o_auth_token_response import OAuthTokenResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.o_auth_token_response import OAuthTokenResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['AccountResponse'] = AccountResponse - globals()['OAuthTokenResponse'] = OAuthTokenResponse - globals()['WarningResponse'] = WarningResponse - - -class AccountCreateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account': (AccountResponse,), # noqa: E501 - 'oauth_data': (OAuthTokenResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountCreateResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountCreateResponse], - _check_type=True, - ) - - attribute_map = { - 'account': 'account', # noqa: E501 - 'oauth_data': 'oauth_data', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account(self) -> AccountResponse: - return self.get("account") - - @account.setter - def account(self, value: AccountResponse): - setattr(self, "account", value) - - @property - def oauth_data(self) -> OAuthTokenResponse: - return self.get("oauth_data") - - @oauth_data.setter - def oauth_data(self, value: OAuthTokenResponse): - setattr(self, "oauth_data", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - oauth_data (OAuthTokenResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - oauth_data (OAuthTokenResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/account_get_response.py b/sdks/python/dropbox_sign/model/account_get_response.py deleted file mode 100644 index 93d494ecc..000000000 --- a/sdks/python/dropbox_sign/model/account_get_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['AccountResponse'] = AccountResponse - globals()['WarningResponse'] = WarningResponse - - -class AccountGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account': (AccountResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountGetResponse], - _check_type=True, - ) - - attribute_map = { - 'account': 'account', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account(self) -> AccountResponse: - return self.get("account") - - @account.setter - def account(self, value: AccountResponse): - setattr(self, "account", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/account_response.py b/sdks/python/dropbox_sign/model/account_response.py deleted file mode 100644 index 3c35e6342..000000000 --- a/sdks/python/dropbox_sign/model/account_response.py +++ /dev/null @@ -1,414 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_response_quotas import AccountResponseQuotas - from dropbox_sign.model.account_response_usage import AccountResponseUsage - - -def lazy_import(): - from dropbox_sign.model.account_response_quotas import AccountResponseQuotas - from dropbox_sign.model.account_response_usage import AccountResponseUsage - globals()['AccountResponseQuotas'] = AccountResponseQuotas - globals()['AccountResponseUsage'] = AccountResponseUsage - - -class AccountResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'is_locked': (bool,), # noqa: E501 - 'is_paid_hs': (bool,), # noqa: E501 - 'is_paid_hf': (bool,), # noqa: E501 - 'quotas': (AccountResponseQuotas,), # noqa: E501 - 'callback_url': (str, none_type,), # noqa: E501 - 'role_code': (str, none_type,), # noqa: E501 - 'team_id': (str, none_type,), # noqa: E501 - 'locale': (str, none_type,), # noqa: E501 - 'usage': (AccountResponseUsage,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountResponse], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'is_locked': 'is_locked', # noqa: E501 - 'is_paid_hs': 'is_paid_hs', # noqa: E501 - 'is_paid_hf': 'is_paid_hf', # noqa: E501 - 'quotas': 'quotas', # noqa: E501 - 'callback_url': 'callback_url', # noqa: E501 - 'role_code': 'role_code', # noqa: E501 - 'team_id': 'team_id', # noqa: E501 - 'locale': 'locale', # noqa: E501 - 'usage': 'usage', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def is_locked(self) -> bool: - return self.get("is_locked") - - @is_locked.setter - def is_locked(self, value: bool): - setattr(self, "is_locked", value) - - @property - def is_paid_hs(self) -> bool: - return self.get("is_paid_hs") - - @is_paid_hs.setter - def is_paid_hs(self, value: bool): - setattr(self, "is_paid_hs", value) - - @property - def is_paid_hf(self) -> bool: - return self.get("is_paid_hf") - - @is_paid_hf.setter - def is_paid_hf(self, value: bool): - setattr(self, "is_paid_hf", value) - - @property - def quotas(self) -> AccountResponseQuotas: - return self.get("quotas") - - @quotas.setter - def quotas(self, value: AccountResponseQuotas): - setattr(self, "quotas", value) - - @property - def callback_url(self) -> Optional[str]: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: Optional[str]): - setattr(self, "callback_url", value) - - @property - def role_code(self) -> Optional[str]: - return self.get("role_code") - - @role_code.setter - def role_code(self, value: Optional[str]): - setattr(self, "role_code", value) - - @property - def team_id(self) -> Optional[str]: - return self.get("team_id") - - @team_id.setter - def team_id(self, value: Optional[str]): - setattr(self, "team_id", value) - - @property - def locale(self) -> Optional[str]: - return self.get("locale") - - @locale.setter - def locale(self, value: Optional[str]): - setattr(self, "locale", value) - - @property - def usage(self) -> AccountResponseUsage: - return self.get("usage") - - @usage.setter - def usage(self, value: AccountResponseUsage): - setattr(self, "usage", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The ID of the Account. [optional] # noqa: E501 - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - is_locked (bool): Returns `true` if the user has been locked out of their account by a team admin.. [optional] # noqa: E501 - is_paid_hs (bool): Returns `true` if the user has a paid Dropbox Sign account.. [optional] # noqa: E501 - is_paid_hf (bool): Returns `true` if the user has a paid HelloFax account.. [optional] # noqa: E501 - quotas (AccountResponseQuotas): [optional] # noqa: E501 - callback_url (str, none_type): The URL that Dropbox Sign events will `POST` to.. [optional] # noqa: E501 - role_code (str, none_type): The membership role for the team.. [optional] # noqa: E501 - team_id (str, none_type): The id of the team account belongs to.. [optional] # noqa: E501 - locale (str, none_type): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - usage (AccountResponseUsage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The ID of the Account. [optional] # noqa: E501 - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - is_locked (bool): Returns `true` if the user has been locked out of their account by a team admin.. [optional] # noqa: E501 - is_paid_hs (bool): Returns `true` if the user has a paid Dropbox Sign account.. [optional] # noqa: E501 - is_paid_hf (bool): Returns `true` if the user has a paid HelloFax account.. [optional] # noqa: E501 - quotas (AccountResponseQuotas): [optional] # noqa: E501 - callback_url (str, none_type): The URL that Dropbox Sign events will `POST` to.. [optional] # noqa: E501 - role_code (str, none_type): The membership role for the team.. [optional] # noqa: E501 - team_id (str, none_type): The id of the team account belongs to.. [optional] # noqa: E501 - locale (str, none_type): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - usage (AccountResponseUsage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/account_response_quotas.py b/sdks/python/dropbox_sign/model/account_response_quotas.py deleted file mode 100644 index a38ffcc40..000000000 --- a/sdks/python/dropbox_sign/model/account_response_quotas.py +++ /dev/null @@ -1,343 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountResponseQuotas(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'api_signature_requests_left': (int, none_type,), # noqa: E501 - 'documents_left': (int, none_type,), # noqa: E501 - 'templates_total': (int, none_type,), # noqa: E501 - 'templates_left': (int, none_type,), # noqa: E501 - 'sms_verifications_left': (int, none_type,), # noqa: E501 - 'num_fax_pages_left': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountResponseQuotas: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountResponseQuotas], - _check_type=True, - ) - - attribute_map = { - 'api_signature_requests_left': 'api_signature_requests_left', # noqa: E501 - 'documents_left': 'documents_left', # noqa: E501 - 'templates_total': 'templates_total', # noqa: E501 - 'templates_left': 'templates_left', # noqa: E501 - 'sms_verifications_left': 'sms_verifications_left', # noqa: E501 - 'num_fax_pages_left': 'num_fax_pages_left', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def api_signature_requests_left(self) -> Optional[int]: - return self.get("api_signature_requests_left") - - @api_signature_requests_left.setter - def api_signature_requests_left(self, value: Optional[int]): - setattr(self, "api_signature_requests_left", value) - - @property - def documents_left(self) -> Optional[int]: - return self.get("documents_left") - - @documents_left.setter - def documents_left(self, value: Optional[int]): - setattr(self, "documents_left", value) - - @property - def templates_total(self) -> Optional[int]: - return self.get("templates_total") - - @templates_total.setter - def templates_total(self, value: Optional[int]): - setattr(self, "templates_total", value) - - @property - def templates_left(self) -> Optional[int]: - return self.get("templates_left") - - @templates_left.setter - def templates_left(self, value: Optional[int]): - setattr(self, "templates_left", value) - - @property - def sms_verifications_left(self) -> Optional[int]: - return self.get("sms_verifications_left") - - @sms_verifications_left.setter - def sms_verifications_left(self, value: Optional[int]): - setattr(self, "sms_verifications_left", value) - - @property - def num_fax_pages_left(self) -> Optional[int]: - return self.get("num_fax_pages_left") - - @num_fax_pages_left.setter - def num_fax_pages_left(self, value: Optional[int]): - setattr(self, "num_fax_pages_left", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountResponseQuotas - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_signature_requests_left (int, none_type): API signature requests remaining.. [optional] # noqa: E501 - documents_left (int, none_type): Signature requests remaining.. [optional] # noqa: E501 - templates_total (int, none_type): Total API templates allowed.. [optional] # noqa: E501 - templates_left (int, none_type): API templates remaining.. [optional] # noqa: E501 - sms_verifications_left (int, none_type): SMS verifications remaining.. [optional] # noqa: E501 - num_fax_pages_left (int, none_type): Number of fax pages left. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountResponseQuotas - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_signature_requests_left (int, none_type): API signature requests remaining.. [optional] # noqa: E501 - documents_left (int, none_type): Signature requests remaining.. [optional] # noqa: E501 - templates_total (int, none_type): Total API templates allowed.. [optional] # noqa: E501 - templates_left (int, none_type): API templates remaining.. [optional] # noqa: E501 - sms_verifications_left (int, none_type): SMS verifications remaining.. [optional] # noqa: E501 - num_fax_pages_left (int, none_type): Number of fax pages left. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/account_response_usage.py b/sdks/python/dropbox_sign/model/account_response_usage.py deleted file mode 100644 index 8bdf363ee..000000000 --- a/sdks/python/dropbox_sign/model/account_response_usage.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountResponseUsage(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'fax_pages_sent': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountResponseUsage: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountResponseUsage], - _check_type=True, - ) - - attribute_map = { - 'fax_pages_sent': 'fax_pages_sent', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def fax_pages_sent(self) -> Optional[int]: - return self.get("fax_pages_sent") - - @fax_pages_sent.setter - def fax_pages_sent(self, value: Optional[int]): - setattr(self, "fax_pages_sent", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountResponseUsage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - fax_pages_sent (int, none_type): Number of fax pages sent. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountResponseUsage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - fax_pages_sent (int, none_type): Number of fax pages sent. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/account_update_request.py b/sdks/python/dropbox_sign/model/account_update_request.py deleted file mode 100644 index 3f7530df6..000000000 --- a/sdks/python/dropbox_sign/model/account_update_request.py +++ /dev/null @@ -1,307 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountUpdateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str, none_type,), # noqa: E501 - 'callback_url': (str,), # noqa: E501 - 'locale': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountUpdateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountUpdateRequest], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'callback_url': 'callback_url', # noqa: E501 - 'locale': 'locale', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> Optional[str]: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: Optional[str]): - setattr(self, "account_id", value) - - @property - def callback_url(self) -> str: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: str): - setattr(self, "callback_url", value) - - @property - def locale(self) -> str: - return self.get("locale") - - @locale.setter - def locale(self, value: str): - setattr(self, "locale", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str, none_type): The ID of the Account. [optional] # noqa: E501 - callback_url (str): The URL that Dropbox Sign should POST events to.. [optional] # noqa: E501 - locale (str): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str, none_type): The ID of the Account. [optional] # noqa: E501 - callback_url (str): The URL that Dropbox Sign should POST events to.. [optional] # noqa: E501 - locale (str): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/account_verify_request.py b/sdks/python/dropbox_sign/model/account_verify_request.py deleted file mode 100644 index 51b7dc967..000000000 --- a/sdks/python/dropbox_sign/model/account_verify_request.py +++ /dev/null @@ -1,289 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountVerifyRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountVerifyRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountVerifyRequest], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email_address, *args, **kwargs): # noqa: E501 - """AccountVerifyRequest - a model defined in OpenAPI - - Args: - email_address (str): Email address to run the verification for. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, email_address, *args, **kwargs): # noqa: E501 - """AccountVerifyRequest - a model defined in OpenAPI - - Args: - email_address (str): Email address to run the verification for. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/account_verify_response.py b/sdks/python/dropbox_sign/model/account_verify_response.py deleted file mode 100644 index 759ccafaf..000000000 --- a/sdks/python/dropbox_sign/model/account_verify_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_verify_response_account import AccountVerifyResponseAccount - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.account_verify_response_account import AccountVerifyResponseAccount - from dropbox_sign.model.warning_response import WarningResponse - globals()['AccountVerifyResponseAccount'] = AccountVerifyResponseAccount - globals()['WarningResponse'] = WarningResponse - - -class AccountVerifyResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account': (AccountVerifyResponseAccount,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountVerifyResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountVerifyResponse], - _check_type=True, - ) - - attribute_map = { - 'account': 'account', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account(self) -> AccountVerifyResponseAccount: - return self.get("account") - - @account.setter - def account(self, value: AccountVerifyResponseAccount): - setattr(self, "account", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountVerifyResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountVerifyResponseAccount): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountVerifyResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountVerifyResponseAccount): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/account_verify_response_account.py b/sdks/python/dropbox_sign/model/account_verify_response_account.py deleted file mode 100644 index ab275f434..000000000 --- a/sdks/python/dropbox_sign/model/account_verify_response_account.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountVerifyResponseAccount(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountVerifyResponseAccount: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountVerifyResponseAccount], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountVerifyResponseAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountVerifyResponseAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/api_app_create_request.py b/sdks/python/dropbox_sign/model/api_app_create_request.py deleted file mode 100644 index e9f887a74..000000000 --- a/sdks/python/dropbox_sign/model/api_app_create_request.py +++ /dev/null @@ -1,381 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_o_auth import SubOAuth - from dropbox_sign.model.sub_options import SubOptions - from dropbox_sign.model.sub_white_labeling_options import SubWhiteLabelingOptions - - -def lazy_import(): - from dropbox_sign.model.sub_o_auth import SubOAuth - from dropbox_sign.model.sub_options import SubOptions - from dropbox_sign.model.sub_white_labeling_options import SubWhiteLabelingOptions - globals()['SubOAuth'] = SubOAuth - globals()['SubOptions'] = SubOptions - globals()['SubWhiteLabelingOptions'] = SubWhiteLabelingOptions - - -class ApiAppCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('domains',): { - 'max_items': 2, - 'min_items': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'domains': ([str],), # noqa: E501 - 'name': (str,), # noqa: E501 - 'callback_url': (str,), # noqa: E501 - 'custom_logo_file': (file_type,), # noqa: E501 - 'oauth': (SubOAuth,), # noqa: E501 - 'options': (SubOptions,), # noqa: E501 - 'white_labeling_options': (SubWhiteLabelingOptions,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'domains': 'domains', # noqa: E501 - 'name': 'name', # noqa: E501 - 'callback_url': 'callback_url', # noqa: E501 - 'custom_logo_file': 'custom_logo_file', # noqa: E501 - 'oauth': 'oauth', # noqa: E501 - 'options': 'options', # noqa: E501 - 'white_labeling_options': 'white_labeling_options', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def domains(self) -> List[str]: - return self.get("domains") - - @domains.setter - def domains(self, value: List[str]): - setattr(self, "domains", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def callback_url(self) -> str: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: str): - setattr(self, "callback_url", value) - - @property - def custom_logo_file(self) -> file_type: - return self.get("custom_logo_file") - - @custom_logo_file.setter - def custom_logo_file(self, value: file_type): - setattr(self, "custom_logo_file", value) - - @property - def oauth(self) -> SubOAuth: - return self.get("oauth") - - @oauth.setter - def oauth(self, value: SubOAuth): - setattr(self, "oauth", value) - - @property - def options(self) -> SubOptions: - return self.get("options") - - @options.setter - def options(self, value: SubOptions): - setattr(self, "options", value) - - @property - def white_labeling_options(self) -> SubWhiteLabelingOptions: - return self.get("white_labeling_options") - - @white_labeling_options.setter - def white_labeling_options(self, value: SubWhiteLabelingOptions): - setattr(self, "white_labeling_options", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, domains, name, *args, **kwargs): # noqa: E501 - """ApiAppCreateRequest - a model defined in OpenAPI - - Args: - domains ([str]): The domain names the ApiApp will be associated with. - name (str): The name you want to assign to the ApiApp. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The URL at which the ApiApp should receive event callbacks.. [optional] # noqa: E501 - custom_logo_file (file_type): An image file to use as a custom logo in embedded contexts. (Only applies to some API plans). [optional] # noqa: E501 - oauth (SubOAuth): [optional] # noqa: E501 - options (SubOptions): [optional] # noqa: E501 - white_labeling_options (SubWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.domains = domains - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, domains, name, *args, **kwargs): # noqa: E501 - """ApiAppCreateRequest - a model defined in OpenAPI - - Args: - domains ([str]): The domain names the ApiApp will be associated with. - name (str): The name you want to assign to the ApiApp. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The URL at which the ApiApp should receive event callbacks.. [optional] # noqa: E501 - custom_logo_file (file_type): An image file to use as a custom logo in embedded contexts. (Only applies to some API plans). [optional] # noqa: E501 - oauth (SubOAuth): [optional] # noqa: E501 - options (SubOptions): [optional] # noqa: E501 - white_labeling_options (SubWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.domains = domains - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/api_app_get_response.py b/sdks/python/dropbox_sign/model/api_app_get_response.py deleted file mode 100644 index 306458f99..000000000 --- a/sdks/python/dropbox_sign/model/api_app_get_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.api_app_response import ApiAppResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.api_app_response import ApiAppResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ApiAppResponse'] = ApiAppResponse - globals()['WarningResponse'] = WarningResponse - - -class ApiAppGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'api_app': (ApiAppResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppGetResponse], - _check_type=True, - ) - - attribute_map = { - 'api_app': 'api_app', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def api_app(self) -> ApiAppResponse: - return self.get("api_app") - - @api_app.setter - def api_app(self, value: ApiAppResponse): - setattr(self, "api_app", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_app (ApiAppResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_app (ApiAppResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/api_app_list_response.py b/sdks/python/dropbox_sign/model/api_app_list_response.py deleted file mode 100644 index e3d49ab69..000000000 --- a/sdks/python/dropbox_sign/model/api_app_list_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.api_app_response import ApiAppResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.api_app_response import ApiAppResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ApiAppResponse'] = ApiAppResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['WarningResponse'] = WarningResponse - - -class ApiAppListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'api_apps': ([ApiAppResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppListResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppListResponse], - _check_type=True, - ) - - attribute_map = { - 'api_apps': 'api_apps', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def api_apps(self) -> List[ApiAppResponse]: - return self.get("api_apps") - - @api_apps.setter - def api_apps(self, value: List[ApiAppResponse]): - setattr(self, "api_apps", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_apps ([ApiAppResponse]): Contains information about API Apps.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_apps ([ApiAppResponse]): Contains information about API Apps.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/api_app_response.py b/sdks/python/dropbox_sign/model/api_app_response.py deleted file mode 100644 index e9b610da3..000000000 --- a/sdks/python/dropbox_sign/model/api_app_response.py +++ /dev/null @@ -1,408 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.api_app_response_o_auth import ApiAppResponseOAuth - from dropbox_sign.model.api_app_response_options import ApiAppResponseOptions - from dropbox_sign.model.api_app_response_owner_account import ApiAppResponseOwnerAccount - from dropbox_sign.model.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions - - -def lazy_import(): - from dropbox_sign.model.api_app_response_o_auth import ApiAppResponseOAuth - from dropbox_sign.model.api_app_response_options import ApiAppResponseOptions - from dropbox_sign.model.api_app_response_owner_account import ApiAppResponseOwnerAccount - from dropbox_sign.model.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions - globals()['ApiAppResponseOAuth'] = ApiAppResponseOAuth - globals()['ApiAppResponseOptions'] = ApiAppResponseOptions - globals()['ApiAppResponseOwnerAccount'] = ApiAppResponseOwnerAccount - globals()['ApiAppResponseWhiteLabelingOptions'] = ApiAppResponseWhiteLabelingOptions - - -class ApiAppResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'callback_url': (str, none_type,), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'created_at': (int,), # noqa: E501 - 'domains': ([str],), # noqa: E501 - 'name': (str,), # noqa: E501 - 'is_approved': (bool,), # noqa: E501 - 'oauth': (ApiAppResponseOAuth,), # noqa: E501 - 'options': (ApiAppResponseOptions,), # noqa: E501 - 'owner_account': (ApiAppResponseOwnerAccount,), # noqa: E501 - 'white_labeling_options': (ApiAppResponseWhiteLabelingOptions,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppResponse], - _check_type=True, - ) - - attribute_map = { - 'callback_url': 'callback_url', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 - 'domains': 'domains', # noqa: E501 - 'name': 'name', # noqa: E501 - 'is_approved': 'is_approved', # noqa: E501 - 'oauth': 'oauth', # noqa: E501 - 'options': 'options', # noqa: E501 - 'owner_account': 'owner_account', # noqa: E501 - 'white_labeling_options': 'white_labeling_options', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def callback_url(self) -> Optional[str]: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: Optional[str]): - setattr(self, "callback_url", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def created_at(self) -> int: - return self.get("created_at") - - @created_at.setter - def created_at(self, value: int): - setattr(self, "created_at", value) - - @property - def domains(self) -> List[str]: - return self.get("domains") - - @domains.setter - def domains(self, value: List[str]): - setattr(self, "domains", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def is_approved(self) -> bool: - return self.get("is_approved") - - @is_approved.setter - def is_approved(self, value: bool): - setattr(self, "is_approved", value) - - @property - def oauth(self) -> ApiAppResponseOAuth: - return self.get("oauth") - - @oauth.setter - def oauth(self, value: ApiAppResponseOAuth): - setattr(self, "oauth", value) - - @property - def options(self) -> ApiAppResponseOptions: - return self.get("options") - - @options.setter - def options(self, value: ApiAppResponseOptions): - setattr(self, "options", value) - - @property - def owner_account(self) -> ApiAppResponseOwnerAccount: - return self.get("owner_account") - - @owner_account.setter - def owner_account(self, value: ApiAppResponseOwnerAccount): - setattr(self, "owner_account", value) - - @property - def white_labeling_options(self) -> ApiAppResponseWhiteLabelingOptions: - return self.get("white_labeling_options") - - @white_labeling_options.setter - def white_labeling_options(self, value: ApiAppResponseWhiteLabelingOptions): - setattr(self, "white_labeling_options", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str, none_type): The app's callback URL (for events). [optional] # noqa: E501 - client_id (str): The app's client id. [optional] # noqa: E501 - created_at (int): The time that the app was created. [optional] # noqa: E501 - domains ([str]): The domain name(s) associated with the app. [optional] # noqa: E501 - name (str): The name of the app. [optional] # noqa: E501 - is_approved (bool): Boolean to indicate if the app has been approved. [optional] # noqa: E501 - oauth (ApiAppResponseOAuth): [optional] # noqa: E501 - options (ApiAppResponseOptions): [optional] # noqa: E501 - owner_account (ApiAppResponseOwnerAccount): [optional] # noqa: E501 - white_labeling_options (ApiAppResponseWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str, none_type): The app's callback URL (for events). [optional] # noqa: E501 - client_id (str): The app's client id. [optional] # noqa: E501 - created_at (int): The time that the app was created. [optional] # noqa: E501 - domains ([str]): The domain name(s) associated with the app. [optional] # noqa: E501 - name (str): The name of the app. [optional] # noqa: E501 - is_approved (bool): Boolean to indicate if the app has been approved. [optional] # noqa: E501 - oauth (ApiAppResponseOAuth): [optional] # noqa: E501 - options (ApiAppResponseOptions): [optional] # noqa: E501 - owner_account (ApiAppResponseOwnerAccount): [optional] # noqa: E501 - white_labeling_options (ApiAppResponseWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/api_app_response_o_auth.py b/sdks/python/dropbox_sign/model/api_app_response_o_auth.py deleted file mode 100644 index 9453dcbb8..000000000 --- a/sdks/python/dropbox_sign/model/api_app_response_o_auth.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ApiAppResponseOAuth(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'callback_url': (str,), # noqa: E501 - 'secret': (str,), # noqa: E501 - 'scopes': ([str],), # noqa: E501 - 'charges_users': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppResponseOAuth: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppResponseOAuth], - _check_type=True, - ) - - attribute_map = { - 'callback_url': 'callback_url', # noqa: E501 - 'secret': 'secret', # noqa: E501 - 'scopes': 'scopes', # noqa: E501 - 'charges_users': 'charges_users', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def callback_url(self) -> str: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: str): - setattr(self, "callback_url", value) - - @property - def secret(self) -> str: - return self.get("secret") - - @secret.setter - def secret(self, value: str): - setattr(self, "secret", value) - - @property - def scopes(self) -> List[str]: - return self.get("scopes") - - @scopes.setter - def scopes(self, value: List[str]): - setattr(self, "scopes", value) - - @property - def charges_users(self) -> bool: - return self.get("charges_users") - - @charges_users.setter - def charges_users(self, value: bool): - setattr(self, "charges_users", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppResponseOAuth - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The app's OAuth callback URL.. [optional] # noqa: E501 - secret (str): The app's OAuth secret, or null if the app does not belong to user.. [optional] # noqa: E501 - scopes ([str]): Array of OAuth scopes used by the app.. [optional] # noqa: E501 - charges_users (bool): Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppResponseOAuth - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The app's OAuth callback URL.. [optional] # noqa: E501 - secret (str): The app's OAuth secret, or null if the app does not belong to user.. [optional] # noqa: E501 - scopes ([str]): Array of OAuth scopes used by the app.. [optional] # noqa: E501 - charges_users (bool): Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/api_app_response_options.py b/sdks/python/dropbox_sign/model/api_app_response_options.py deleted file mode 100644 index ab439045d..000000000 --- a/sdks/python/dropbox_sign/model/api_app_response_options.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ApiAppResponseOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'can_insert_everywhere': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppResponseOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppResponseOptions], - _check_type=True, - ) - - attribute_map = { - 'can_insert_everywhere': 'can_insert_everywhere', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def can_insert_everywhere(self) -> bool: - return self.get("can_insert_everywhere") - - @can_insert_everywhere.setter - def can_insert_everywhere(self, value: bool): - setattr(self, "can_insert_everywhere", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppResponseOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - can_insert_everywhere (bool): Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppResponseOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - can_insert_everywhere (bool): Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/api_app_response_owner_account.py b/sdks/python/dropbox_sign/model/api_app_response_owner_account.py deleted file mode 100644 index 519ec0cf9..000000000 --- a/sdks/python/dropbox_sign/model/api_app_response_owner_account.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ApiAppResponseOwnerAccount(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppResponseOwnerAccount: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppResponseOwnerAccount], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppResponseOwnerAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The owner account's ID. [optional] # noqa: E501 - email_address (str): The owner account's email address. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppResponseOwnerAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The owner account's ID. [optional] # noqa: E501 - email_address (str): The owner account's email address. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/api_app_response_white_labeling_options.py b/sdks/python/dropbox_sign/model/api_app_response_white_labeling_options.py deleted file mode 100644 index 61a6f1b55..000000000 --- a/sdks/python/dropbox_sign/model/api_app_response_white_labeling_options.py +++ /dev/null @@ -1,439 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ApiAppResponseWhiteLabelingOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'header_background_color': (str,), # noqa: E501 - 'legal_version': (str,), # noqa: E501 - 'link_color': (str,), # noqa: E501 - 'page_background_color': (str,), # noqa: E501 - 'primary_button_color': (str,), # noqa: E501 - 'primary_button_color_hover': (str,), # noqa: E501 - 'primary_button_text_color': (str,), # noqa: E501 - 'primary_button_text_color_hover': (str,), # noqa: E501 - 'secondary_button_color': (str,), # noqa: E501 - 'secondary_button_color_hover': (str,), # noqa: E501 - 'secondary_button_text_color': (str,), # noqa: E501 - 'secondary_button_text_color_hover': (str,), # noqa: E501 - 'text_color1': (str,), # noqa: E501 - 'text_color2': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppResponseWhiteLabelingOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppResponseWhiteLabelingOptions], - _check_type=True, - ) - - attribute_map = { - 'header_background_color': 'header_background_color', # noqa: E501 - 'legal_version': 'legal_version', # noqa: E501 - 'link_color': 'link_color', # noqa: E501 - 'page_background_color': 'page_background_color', # noqa: E501 - 'primary_button_color': 'primary_button_color', # noqa: E501 - 'primary_button_color_hover': 'primary_button_color_hover', # noqa: E501 - 'primary_button_text_color': 'primary_button_text_color', # noqa: E501 - 'primary_button_text_color_hover': 'primary_button_text_color_hover', # noqa: E501 - 'secondary_button_color': 'secondary_button_color', # noqa: E501 - 'secondary_button_color_hover': 'secondary_button_color_hover', # noqa: E501 - 'secondary_button_text_color': 'secondary_button_text_color', # noqa: E501 - 'secondary_button_text_color_hover': 'secondary_button_text_color_hover', # noqa: E501 - 'text_color1': 'text_color1', # noqa: E501 - 'text_color2': 'text_color2', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def header_background_color(self) -> str: - return self.get("header_background_color") - - @header_background_color.setter - def header_background_color(self, value: str): - setattr(self, "header_background_color", value) - - @property - def legal_version(self) -> str: - return self.get("legal_version") - - @legal_version.setter - def legal_version(self, value: str): - setattr(self, "legal_version", value) - - @property - def link_color(self) -> str: - return self.get("link_color") - - @link_color.setter - def link_color(self, value: str): - setattr(self, "link_color", value) - - @property - def page_background_color(self) -> str: - return self.get("page_background_color") - - @page_background_color.setter - def page_background_color(self, value: str): - setattr(self, "page_background_color", value) - - @property - def primary_button_color(self) -> str: - return self.get("primary_button_color") - - @primary_button_color.setter - def primary_button_color(self, value: str): - setattr(self, "primary_button_color", value) - - @property - def primary_button_color_hover(self) -> str: - return self.get("primary_button_color_hover") - - @primary_button_color_hover.setter - def primary_button_color_hover(self, value: str): - setattr(self, "primary_button_color_hover", value) - - @property - def primary_button_text_color(self) -> str: - return self.get("primary_button_text_color") - - @primary_button_text_color.setter - def primary_button_text_color(self, value: str): - setattr(self, "primary_button_text_color", value) - - @property - def primary_button_text_color_hover(self) -> str: - return self.get("primary_button_text_color_hover") - - @primary_button_text_color_hover.setter - def primary_button_text_color_hover(self, value: str): - setattr(self, "primary_button_text_color_hover", value) - - @property - def secondary_button_color(self) -> str: - return self.get("secondary_button_color") - - @secondary_button_color.setter - def secondary_button_color(self, value: str): - setattr(self, "secondary_button_color", value) - - @property - def secondary_button_color_hover(self) -> str: - return self.get("secondary_button_color_hover") - - @secondary_button_color_hover.setter - def secondary_button_color_hover(self, value: str): - setattr(self, "secondary_button_color_hover", value) - - @property - def secondary_button_text_color(self) -> str: - return self.get("secondary_button_text_color") - - @secondary_button_text_color.setter - def secondary_button_text_color(self, value: str): - setattr(self, "secondary_button_text_color", value) - - @property - def secondary_button_text_color_hover(self) -> str: - return self.get("secondary_button_text_color_hover") - - @secondary_button_text_color_hover.setter - def secondary_button_text_color_hover(self, value: str): - setattr(self, "secondary_button_text_color_hover", value) - - @property - def text_color1(self) -> str: - return self.get("text_color1") - - @text_color1.setter - def text_color1(self, value: str): - setattr(self, "text_color1", value) - - @property - def text_color2(self) -> str: - return self.get("text_color2") - - @text_color2.setter - def text_color2(self, value: str): - setattr(self, "text_color2", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppResponseWhiteLabelingOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - header_background_color (str): [optional] # noqa: E501 - legal_version (str): [optional] # noqa: E501 - link_color (str): [optional] # noqa: E501 - page_background_color (str): [optional] # noqa: E501 - primary_button_color (str): [optional] # noqa: E501 - primary_button_color_hover (str): [optional] # noqa: E501 - primary_button_text_color (str): [optional] # noqa: E501 - primary_button_text_color_hover (str): [optional] # noqa: E501 - secondary_button_color (str): [optional] # noqa: E501 - secondary_button_color_hover (str): [optional] # noqa: E501 - secondary_button_text_color (str): [optional] # noqa: E501 - secondary_button_text_color_hover (str): [optional] # noqa: E501 - text_color1 (str): [optional] # noqa: E501 - text_color2 (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppResponseWhiteLabelingOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - header_background_color (str): [optional] # noqa: E501 - legal_version (str): [optional] # noqa: E501 - link_color (str): [optional] # noqa: E501 - page_background_color (str): [optional] # noqa: E501 - primary_button_color (str): [optional] # noqa: E501 - primary_button_color_hover (str): [optional] # noqa: E501 - primary_button_text_color (str): [optional] # noqa: E501 - primary_button_text_color_hover (str): [optional] # noqa: E501 - secondary_button_color (str): [optional] # noqa: E501 - secondary_button_color_hover (str): [optional] # noqa: E501 - secondary_button_text_color (str): [optional] # noqa: E501 - secondary_button_text_color_hover (str): [optional] # noqa: E501 - text_color1 (str): [optional] # noqa: E501 - text_color2 (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/api_app_update_request.py b/sdks/python/dropbox_sign/model/api_app_update_request.py deleted file mode 100644 index 87885b375..000000000 --- a/sdks/python/dropbox_sign/model/api_app_update_request.py +++ /dev/null @@ -1,372 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_o_auth import SubOAuth - from dropbox_sign.model.sub_options import SubOptions - from dropbox_sign.model.sub_white_labeling_options import SubWhiteLabelingOptions - - -def lazy_import(): - from dropbox_sign.model.sub_o_auth import SubOAuth - from dropbox_sign.model.sub_options import SubOptions - from dropbox_sign.model.sub_white_labeling_options import SubWhiteLabelingOptions - globals()['SubOAuth'] = SubOAuth - globals()['SubOptions'] = SubOptions - globals()['SubWhiteLabelingOptions'] = SubWhiteLabelingOptions - - -class ApiAppUpdateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('domains',): { - 'max_items': 2, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'callback_url': (str,), # noqa: E501 - 'custom_logo_file': (file_type,), # noqa: E501 - 'domains': ([str],), # noqa: E501 - 'name': (str,), # noqa: E501 - 'oauth': (SubOAuth,), # noqa: E501 - 'options': (SubOptions,), # noqa: E501 - 'white_labeling_options': (SubWhiteLabelingOptions,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppUpdateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppUpdateRequest], - _check_type=True, - ) - - attribute_map = { - 'callback_url': 'callback_url', # noqa: E501 - 'custom_logo_file': 'custom_logo_file', # noqa: E501 - 'domains': 'domains', # noqa: E501 - 'name': 'name', # noqa: E501 - 'oauth': 'oauth', # noqa: E501 - 'options': 'options', # noqa: E501 - 'white_labeling_options': 'white_labeling_options', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def callback_url(self) -> str: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: str): - setattr(self, "callback_url", value) - - @property - def custom_logo_file(self) -> file_type: - return self.get("custom_logo_file") - - @custom_logo_file.setter - def custom_logo_file(self, value: file_type): - setattr(self, "custom_logo_file", value) - - @property - def domains(self) -> List[str]: - return self.get("domains") - - @domains.setter - def domains(self, value: List[str]): - setattr(self, "domains", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def oauth(self) -> SubOAuth: - return self.get("oauth") - - @oauth.setter - def oauth(self, value: SubOAuth): - setattr(self, "oauth", value) - - @property - def options(self) -> SubOptions: - return self.get("options") - - @options.setter - def options(self, value: SubOptions): - setattr(self, "options", value) - - @property - def white_labeling_options(self) -> SubWhiteLabelingOptions: - return self.get("white_labeling_options") - - @white_labeling_options.setter - def white_labeling_options(self, value: SubWhiteLabelingOptions): - setattr(self, "white_labeling_options", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The URL at which the API App should receive event callbacks.. [optional] # noqa: E501 - custom_logo_file (file_type): An image file to use as a custom logo in embedded contexts. (Only applies to some API plans). [optional] # noqa: E501 - domains ([str]): The domain names the ApiApp will be associated with.. [optional] # noqa: E501 - name (str): The name you want to assign to the ApiApp.. [optional] # noqa: E501 - oauth (SubOAuth): [optional] # noqa: E501 - options (SubOptions): [optional] # noqa: E501 - white_labeling_options (SubWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The URL at which the API App should receive event callbacks.. [optional] # noqa: E501 - custom_logo_file (file_type): An image file to use as a custom logo in embedded contexts. (Only applies to some API plans). [optional] # noqa: E501 - domains ([str]): The domain names the ApiApp will be associated with.. [optional] # noqa: E501 - name (str): The name you want to assign to the ApiApp.. [optional] # noqa: E501 - oauth (SubOAuth): [optional] # noqa: E501 - options (SubOptions): [optional] # noqa: E501 - white_labeling_options (SubWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/bulk_send_job_get_response.py b/sdks/python/dropbox_sign/model/bulk_send_job_get_response.py deleted file mode 100644 index 3fce46bf5..000000000 --- a/sdks/python/dropbox_sign/model/bulk_send_job_get_response.py +++ /dev/null @@ -1,336 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['BulkSendJobGetResponseSignatureRequests'] = BulkSendJobGetResponseSignatureRequests - globals()['BulkSendJobResponse'] = BulkSendJobResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['WarningResponse'] = WarningResponse - - -class BulkSendJobGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'bulk_send_job': (BulkSendJobResponse,), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'signature_requests': ([BulkSendJobGetResponseSignatureRequests],), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> BulkSendJobGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[BulkSendJobGetResponse], - _check_type=True, - ) - - attribute_map = { - 'bulk_send_job': 'bulk_send_job', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'signature_requests': 'signature_requests', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def bulk_send_job(self) -> BulkSendJobResponse: - return self.get("bulk_send_job") - - @bulk_send_job.setter - def bulk_send_job(self, value: BulkSendJobResponse): - setattr(self, "bulk_send_job", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def signature_requests(self) -> List[BulkSendJobGetResponseSignatureRequests]: - return self.get("signature_requests") - - @signature_requests.setter - def signature_requests(self, value: List[BulkSendJobGetResponseSignatureRequests]): - setattr(self, "signature_requests", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BulkSendJobGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job (BulkSendJobResponse): [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - signature_requests ([BulkSendJobGetResponseSignatureRequests]): Contains information about the Signature Requests sent in bulk.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BulkSendJobGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job (BulkSendJobResponse): [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - signature_requests ([BulkSendJobGetResponseSignatureRequests]): Contains information about the Signature Requests sent in bulk.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/bulk_send_job_get_response_signature_requests.py b/sdks/python/dropbox_sign/model/bulk_send_job_get_response_signature_requests.py deleted file mode 100644 index b9963bbc6..000000000 --- a/sdks/python/dropbox_sign/model/bulk_send_job_get_response_signature_requests.py +++ /dev/null @@ -1,639 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.signature_request_response_attachment import SignatureRequestResponseAttachment - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - from dropbox_sign.model.signature_request_response_signatures import SignatureRequestResponseSignatures - - -def lazy_import(): - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.signature_request_response_attachment import SignatureRequestResponseAttachment - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - from dropbox_sign.model.signature_request_response_signatures import SignatureRequestResponseSignatures - globals()['SignatureRequestResponse'] = SignatureRequestResponse - globals()['SignatureRequestResponseAttachment'] = SignatureRequestResponseAttachment - globals()['SignatureRequestResponseCustomFieldBase'] = SignatureRequestResponseCustomFieldBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - globals()['SignatureRequestResponseSignatures'] = SignatureRequestResponseSignatures - - -class BulkSendJobGetResponseSignatureRequests(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'test_mode': (bool, none_type,), # noqa: E501 - 'signature_request_id': (str,), # noqa: E501 - 'requester_email_address': (str,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'original_title': (str,), # noqa: E501 - 'subject': (str, none_type,), # noqa: E501 - 'message': (str, none_type,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'created_at': (int,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - 'is_complete': (bool,), # noqa: E501 - 'is_declined': (bool,), # noqa: E501 - 'has_error': (bool,), # noqa: E501 - 'files_url': (str,), # noqa: E501 - 'signing_url': (str, none_type,), # noqa: E501 - 'details_url': (str,), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'signing_redirect_url': (str, none_type,), # noqa: E501 - 'final_copy_uri': (str, none_type,), # noqa: E501 - 'template_ids': ([str], none_type,), # noqa: E501 - 'custom_fields': ([SignatureRequestResponseCustomFieldBase], none_type,), # noqa: E501 - 'attachments': ([SignatureRequestResponseAttachment], none_type,), # noqa: E501 - 'response_data': ([SignatureRequestResponseDataBase], none_type,), # noqa: E501 - 'signatures': ([SignatureRequestResponseSignatures],), # noqa: E501 - 'bulk_send_job_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> BulkSendJobGetResponseSignatureRequests: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[BulkSendJobGetResponseSignatureRequests], - _check_type=True, - ) - - - attribute_map = { - 'test_mode': 'test_mode', # noqa: E501 - 'signature_request_id': 'signature_request_id', # noqa: E501 - 'requester_email_address': 'requester_email_address', # noqa: E501 - 'title': 'title', # noqa: E501 - 'original_title': 'original_title', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - 'is_complete': 'is_complete', # noqa: E501 - 'is_declined': 'is_declined', # noqa: E501 - 'has_error': 'has_error', # noqa: E501 - 'files_url': 'files_url', # noqa: E501 - 'signing_url': 'signing_url', # noqa: E501 - 'details_url': 'details_url', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'final_copy_uri': 'final_copy_uri', # noqa: E501 - 'template_ids': 'template_ids', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'response_data': 'response_data', # noqa: E501 - 'signatures': 'signatures', # noqa: E501 - 'bulk_send_job_id': 'bulk_send_job_id', # noqa: E501 - } - - read_only_vars = { - } - - @property - def test_mode(self) -> Optional[bool]: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: Optional[bool]): - setattr(self, "test_mode", value) - - @property - def signature_request_id(self) -> str: - return self.get("signature_request_id") - - @signature_request_id.setter - def signature_request_id(self, value: str): - setattr(self, "signature_request_id", value) - - @property - def requester_email_address(self) -> str: - return self.get("requester_email_address") - - @requester_email_address.setter - def requester_email_address(self, value: str): - setattr(self, "requester_email_address", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def original_title(self) -> str: - return self.get("original_title") - - @original_title.setter - def original_title(self, value: str): - setattr(self, "original_title", value) - - @property - def subject(self) -> Optional[str]: - return self.get("subject") - - @subject.setter - def subject(self, value: Optional[str]): - setattr(self, "subject", value) - - @property - def message(self) -> Optional[str]: - return self.get("message") - - @message.setter - def message(self, value: Optional[str]): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def created_at(self) -> int: - return self.get("created_at") - - @created_at.setter - def created_at(self, value: int): - setattr(self, "created_at", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @property - def is_complete(self) -> bool: - return self.get("is_complete") - - @is_complete.setter - def is_complete(self, value: bool): - setattr(self, "is_complete", value) - - @property - def is_declined(self) -> bool: - return self.get("is_declined") - - @is_declined.setter - def is_declined(self, value: bool): - setattr(self, "is_declined", value) - - @property - def has_error(self) -> bool: - return self.get("has_error") - - @has_error.setter - def has_error(self, value: bool): - setattr(self, "has_error", value) - - @property - def files_url(self) -> str: - return self.get("files_url") - - @files_url.setter - def files_url(self, value: str): - setattr(self, "files_url", value) - - @property - def signing_url(self) -> Optional[str]: - return self.get("signing_url") - - @signing_url.setter - def signing_url(self, value: Optional[str]): - setattr(self, "signing_url", value) - - @property - def details_url(self) -> str: - return self.get("details_url") - - @details_url.setter - def details_url(self, value: str): - setattr(self, "details_url", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def signing_redirect_url(self) -> Optional[str]: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: Optional[str]): - setattr(self, "signing_redirect_url", value) - - @property - def final_copy_uri(self) -> Optional[str]: - return self.get("final_copy_uri") - - @final_copy_uri.setter - def final_copy_uri(self, value: Optional[str]): - setattr(self, "final_copy_uri", value) - - @property - def template_ids(self) -> Optional[List[str]]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: Optional[List[str]]): - setattr(self, "template_ids", value) - - @property - def custom_fields(self) -> Optional[List[SignatureRequestResponseCustomFieldBase]]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: Optional[List[SignatureRequestResponseCustomFieldBase]]): - setattr(self, "custom_fields", value) - - @property - def attachments(self) -> Optional[List[SignatureRequestResponseAttachment]]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: Optional[List[SignatureRequestResponseAttachment]]): - setattr(self, "attachments", value) - - @property - def response_data(self) -> Optional[List[SignatureRequestResponseDataBase]]: - return self.get("response_data") - - @response_data.setter - def response_data(self, value: Optional[List[SignatureRequestResponseDataBase]]): - setattr(self, "response_data", value) - - @property - def signatures(self) -> List[SignatureRequestResponseSignatures]: - return self.get("signatures") - - @signatures.setter - def signatures(self, value: List[SignatureRequestResponseSignatures]): - setattr(self, "signatures", value) - - @property - def bulk_send_job_id(self) -> str: - return self.get("bulk_send_job_id") - - @bulk_send_job_id.setter - def bulk_send_job_id(self, value: str): - setattr(self, "bulk_send_job_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BulkSendJobGetResponseSignatureRequests - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - test_mode (bool, none_type): Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - signature_request_id (str): The id of the SignatureRequest.. [optional] # noqa: E501 - requester_email_address (str): The email address of the initiator of the SignatureRequest.. [optional] # noqa: E501 - title (str): The title the specified Account uses for the SignatureRequest.. [optional] # noqa: E501 - original_title (str): Default Label for account.. [optional] # noqa: E501 - subject (str, none_type): The subject in the email that was initially sent to the signers.. [optional] # noqa: E501 - message (str, none_type): The custom message in the email that was initially sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the signature request.. [optional] # noqa: E501 - created_at (int): Time the signature request was created.. [optional] # noqa: E501 - expires_at (int): The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - is_complete (bool): Whether or not the SignatureRequest has been fully executed by all signers.. [optional] # noqa: E501 - is_declined (bool): Whether or not the SignatureRequest has been declined by a signer.. [optional] # noqa: E501 - has_error (bool): Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).. [optional] # noqa: E501 - files_url (str): The URL where a copy of the request's documents can be downloaded.. [optional] # noqa: E501 - signing_url (str, none_type): The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.. [optional] # noqa: E501 - details_url (str): The URL where the requester and the signers can view the current status of the SignatureRequest.. [optional] # noqa: E501 - cc_email_addresses ([str]): A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want the signer redirected to after they successfully sign.. [optional] # noqa: E501 - final_copy_uri (str, none_type): The path where the completed document can be downloaded. [optional] # noqa: E501 - template_ids ([str], none_type): Templates IDs used in this SignatureRequest (if any).. [optional] # noqa: E501 - custom_fields ([SignatureRequestResponseCustomFieldBase], none_type): An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`. [optional] # noqa: E501 - attachments ([SignatureRequestResponseAttachment], none_type): Signer attachments.. [optional] # noqa: E501 - response_data ([SignatureRequestResponseDataBase], none_type): An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.. [optional] # noqa: E501 - signatures ([SignatureRequestResponseSignatures]): An array of signature objects, 1 for each signer.. [optional] # noqa: E501 - bulk_send_job_id (str): The id of the BulkSendJob.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BulkSendJobGetResponseSignatureRequests - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - test_mode (bool, none_type): Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - signature_request_id (str): The id of the SignatureRequest.. [optional] # noqa: E501 - requester_email_address (str): The email address of the initiator of the SignatureRequest.. [optional] # noqa: E501 - title (str): The title the specified Account uses for the SignatureRequest.. [optional] # noqa: E501 - original_title (str): Default Label for account.. [optional] # noqa: E501 - subject (str, none_type): The subject in the email that was initially sent to the signers.. [optional] # noqa: E501 - message (str, none_type): The custom message in the email that was initially sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the signature request.. [optional] # noqa: E501 - created_at (int): Time the signature request was created.. [optional] # noqa: E501 - expires_at (int): The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - is_complete (bool): Whether or not the SignatureRequest has been fully executed by all signers.. [optional] # noqa: E501 - is_declined (bool): Whether or not the SignatureRequest has been declined by a signer.. [optional] # noqa: E501 - has_error (bool): Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).. [optional] # noqa: E501 - files_url (str): The URL where a copy of the request's documents can be downloaded.. [optional] # noqa: E501 - signing_url (str, none_type): The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.. [optional] # noqa: E501 - details_url (str): The URL where the requester and the signers can view the current status of the SignatureRequest.. [optional] # noqa: E501 - cc_email_addresses ([str]): A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want the signer redirected to after they successfully sign.. [optional] # noqa: E501 - final_copy_uri (str, none_type): The path where the completed document can be downloaded. [optional] # noqa: E501 - template_ids ([str], none_type): Templates IDs used in this SignatureRequest (if any).. [optional] # noqa: E501 - custom_fields ([SignatureRequestResponseCustomFieldBase], none_type): An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`. [optional] # noqa: E501 - attachments ([SignatureRequestResponseAttachment], none_type): Signer attachments.. [optional] # noqa: E501 - response_data ([SignatureRequestResponseDataBase], none_type): An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.. [optional] # noqa: E501 - signatures ([SignatureRequestResponseSignatures]): An array of signature objects, 1 for each signer.. [optional] # noqa: E501 - bulk_send_job_id (str): The id of the BulkSendJob.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/bulk_send_job_list_response.py b/sdks/python/dropbox_sign/model/bulk_send_job_list_response.py deleted file mode 100644 index b2b54d58a..000000000 --- a/sdks/python/dropbox_sign/model/bulk_send_job_list_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['BulkSendJobResponse'] = BulkSendJobResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['WarningResponse'] = WarningResponse - - -class BulkSendJobListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'bulk_send_jobs': ([BulkSendJobResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> BulkSendJobListResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[BulkSendJobListResponse], - _check_type=True, - ) - - attribute_map = { - 'bulk_send_jobs': 'bulk_send_jobs', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def bulk_send_jobs(self) -> List[BulkSendJobResponse]: - return self.get("bulk_send_jobs") - - @bulk_send_jobs.setter - def bulk_send_jobs(self, value: List[BulkSendJobResponse]): - setattr(self, "bulk_send_jobs", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BulkSendJobListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_jobs ([BulkSendJobResponse]): Contains a list of BulkSendJobs that the API caller has access to.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BulkSendJobListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_jobs ([BulkSendJobResponse]): Contains a list of BulkSendJobs that the API caller has access to.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/bulk_send_job_response.py b/sdks/python/dropbox_sign/model/bulk_send_job_response.py deleted file mode 100644 index a2f7066c1..000000000 --- a/sdks/python/dropbox_sign/model/bulk_send_job_response.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class BulkSendJobResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bulk_send_job_id': (str, none_type,), # noqa: E501 - 'total': (int,), # noqa: E501 - 'is_creator': (bool,), # noqa: E501 - 'created_at': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> BulkSendJobResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[BulkSendJobResponse], - _check_type=True, - ) - - attribute_map = { - 'bulk_send_job_id': 'bulk_send_job_id', # noqa: E501 - 'total': 'total', # noqa: E501 - 'is_creator': 'is_creator', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def bulk_send_job_id(self) -> Optional[str]: - return self.get("bulk_send_job_id") - - @bulk_send_job_id.setter - def bulk_send_job_id(self, value: Optional[str]): - setattr(self, "bulk_send_job_id", value) - - @property - def total(self) -> int: - return self.get("total") - - @total.setter - def total(self, value: int): - setattr(self, "total", value) - - @property - def is_creator(self) -> bool: - return self.get("is_creator") - - @is_creator.setter - def is_creator(self, value: bool): - setattr(self, "is_creator", value) - - @property - def created_at(self) -> int: - return self.get("created_at") - - @created_at.setter - def created_at(self, value: int): - setattr(self, "created_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BulkSendJobResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job_id (str, none_type): The id of the BulkSendJob.. [optional] # noqa: E501 - total (int): The total amount of Signature Requests queued for sending.. [optional] # noqa: E501 - is_creator (bool): True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member.. [optional] # noqa: E501 - created_at (int): Time that the BulkSendJob was created.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BulkSendJobResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job_id (str, none_type): The id of the BulkSendJob.. [optional] # noqa: E501 - total (int): The total amount of Signature Requests queued for sending.. [optional] # noqa: E501 - is_creator (bool): True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member.. [optional] # noqa: E501 - created_at (int): Time that the BulkSendJob was created.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/bulk_send_job_send_response.py b/sdks/python/dropbox_sign/model/bulk_send_job_send_response.py deleted file mode 100644 index c605e04ef..000000000 --- a/sdks/python/dropbox_sign/model/bulk_send_job_send_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['BulkSendJobResponse'] = BulkSendJobResponse - globals()['WarningResponse'] = WarningResponse - - -class BulkSendJobSendResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'bulk_send_job': (BulkSendJobResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> BulkSendJobSendResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[BulkSendJobSendResponse], - _check_type=True, - ) - - attribute_map = { - 'bulk_send_job': 'bulk_send_job', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def bulk_send_job(self) -> BulkSendJobResponse: - return self.get("bulk_send_job") - - @bulk_send_job.setter - def bulk_send_job(self, value: BulkSendJobResponse): - setattr(self, "bulk_send_job", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BulkSendJobSendResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job (BulkSendJobResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BulkSendJobSendResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job (BulkSendJobResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/embedded_edit_url_request.py b/sdks/python/dropbox_sign/model/embedded_edit_url_request.py deleted file mode 100644 index b1544ed08..000000000 --- a/sdks/python/dropbox_sign/model/embedded_edit_url_request.py +++ /dev/null @@ -1,402 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_merge_field import SubMergeField - - -def lazy_import(): - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_merge_field import SubMergeField - globals()['SubEditorOptions'] = SubEditorOptions - globals()['SubMergeField'] = SubMergeField - - -class EmbeddedEditUrlRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'allow_edit_ccs': (bool,), # noqa: E501 - 'cc_roles': ([str],), # noqa: E501 - 'editor_options': (SubEditorOptions,), # noqa: E501 - 'force_signer_roles': (bool,), # noqa: E501 - 'force_subject_message': (bool,), # noqa: E501 - 'merge_fields': ([SubMergeField],), # noqa: E501 - 'preview_only': (bool,), # noqa: E501 - 'show_preview': (bool,), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EmbeddedEditUrlRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EmbeddedEditUrlRequest], - _check_type=True, - ) - - attribute_map = { - 'allow_edit_ccs': 'allow_edit_ccs', # noqa: E501 - 'cc_roles': 'cc_roles', # noqa: E501 - 'editor_options': 'editor_options', # noqa: E501 - 'force_signer_roles': 'force_signer_roles', # noqa: E501 - 'force_subject_message': 'force_subject_message', # noqa: E501 - 'merge_fields': 'merge_fields', # noqa: E501 - 'preview_only': 'preview_only', # noqa: E501 - 'show_preview': 'show_preview', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def allow_edit_ccs(self) -> bool: - return self.get("allow_edit_ccs") - - @allow_edit_ccs.setter - def allow_edit_ccs(self, value: bool): - setattr(self, "allow_edit_ccs", value) - - @property - def cc_roles(self) -> List[str]: - return self.get("cc_roles") - - @cc_roles.setter - def cc_roles(self, value: List[str]): - setattr(self, "cc_roles", value) - - @property - def editor_options(self) -> SubEditorOptions: - return self.get("editor_options") - - @editor_options.setter - def editor_options(self, value: SubEditorOptions): - setattr(self, "editor_options", value) - - @property - def force_signer_roles(self) -> bool: - return self.get("force_signer_roles") - - @force_signer_roles.setter - def force_signer_roles(self, value: bool): - setattr(self, "force_signer_roles", value) - - @property - def force_subject_message(self) -> bool: - return self.get("force_subject_message") - - @force_subject_message.setter - def force_subject_message(self, value: bool): - setattr(self, "force_subject_message", value) - - @property - def merge_fields(self) -> List[SubMergeField]: - return self.get("merge_fields") - - @merge_fields.setter - def merge_fields(self, value: List[SubMergeField]): - setattr(self, "merge_fields", value) - - @property - def preview_only(self) -> bool: - return self.get("preview_only") - - @preview_only.setter - def preview_only(self, value: bool): - setattr(self, "preview_only", value) - - @property - def show_preview(self) -> bool: - return self.get("show_preview") - - @show_preview.setter - def show_preview(self, value: bool): - setattr(self, "show_preview", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_edit_ccs (bool): This allows the requester to enable/disable to add or change CC roles when editing the template.. [optional] if omitted the server will use the default value of False # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - merge_fields ([SubMergeField]): Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`.. [optional] # noqa: E501 - preview_only (bool): This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set).. [optional] if omitted the server will use the default value of False # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - test_mode (bool): Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_edit_ccs (bool): This allows the requester to enable/disable to add or change CC roles when editing the template.. [optional] if omitted the server will use the default value of False # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - merge_fields ([SubMergeField]): Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`.. [optional] # noqa: E501 - preview_only (bool): This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set).. [optional] if omitted the server will use the default value of False # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - test_mode (bool): Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/embedded_edit_url_response.py b/sdks/python/dropbox_sign/model/embedded_edit_url_response.py deleted file mode 100644 index 963f7a365..000000000 --- a/sdks/python/dropbox_sign/model/embedded_edit_url_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded - from dropbox_sign.model.warning_response import WarningResponse - globals()['EmbeddedEditUrlResponseEmbedded'] = EmbeddedEditUrlResponseEmbedded - globals()['WarningResponse'] = WarningResponse - - -class EmbeddedEditUrlResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'embedded': (EmbeddedEditUrlResponseEmbedded,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EmbeddedEditUrlResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EmbeddedEditUrlResponse], - _check_type=True, - ) - - attribute_map = { - 'embedded': 'embedded', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def embedded(self) -> EmbeddedEditUrlResponseEmbedded: - return self.get("embedded") - - @embedded.setter - def embedded(self, value: EmbeddedEditUrlResponseEmbedded): - setattr(self, "embedded", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - embedded (EmbeddedEditUrlResponseEmbedded): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - embedded (EmbeddedEditUrlResponseEmbedded): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/embedded_edit_url_response_embedded.py b/sdks/python/dropbox_sign/model/embedded_edit_url_response_embedded.py deleted file mode 100644 index c2cf26745..000000000 --- a/sdks/python/dropbox_sign/model/embedded_edit_url_response_embedded.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class EmbeddedEditUrlResponseEmbedded(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'edit_url': (str,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EmbeddedEditUrlResponseEmbedded: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EmbeddedEditUrlResponseEmbedded], - _check_type=True, - ) - - attribute_map = { - 'edit_url': 'edit_url', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def edit_url(self) -> str: - return self.get("edit_url") - - @edit_url.setter - def edit_url(self, value: str): - setattr(self, "edit_url", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlResponseEmbedded - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - edit_url (str): A template url that can be opened in an iFrame.. [optional] # noqa: E501 - expires_at (int): The specific time that the the `edit_url` link expires, in epoch.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlResponseEmbedded - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - edit_url (str): A template url that can be opened in an iFrame.. [optional] # noqa: E501 - expires_at (int): The specific time that the the `edit_url` link expires, in epoch.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/embedded_sign_url_response.py b/sdks/python/dropbox_sign/model/embedded_sign_url_response.py deleted file mode 100644 index 0166f9969..000000000 --- a/sdks/python/dropbox_sign/model/embedded_sign_url_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded - from dropbox_sign.model.warning_response import WarningResponse - globals()['EmbeddedSignUrlResponseEmbedded'] = EmbeddedSignUrlResponseEmbedded - globals()['WarningResponse'] = WarningResponse - - -class EmbeddedSignUrlResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'embedded': (EmbeddedSignUrlResponseEmbedded,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EmbeddedSignUrlResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EmbeddedSignUrlResponse], - _check_type=True, - ) - - attribute_map = { - 'embedded': 'embedded', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def embedded(self) -> EmbeddedSignUrlResponseEmbedded: - return self.get("embedded") - - @embedded.setter - def embedded(self, value: EmbeddedSignUrlResponseEmbedded): - setattr(self, "embedded", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddedSignUrlResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - embedded (EmbeddedSignUrlResponseEmbedded): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddedSignUrlResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - embedded (EmbeddedSignUrlResponseEmbedded): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/embedded_sign_url_response_embedded.py b/sdks/python/dropbox_sign/model/embedded_sign_url_response_embedded.py deleted file mode 100644 index 22ae6918e..000000000 --- a/sdks/python/dropbox_sign/model/embedded_sign_url_response_embedded.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class EmbeddedSignUrlResponseEmbedded(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'sign_url': (str,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EmbeddedSignUrlResponseEmbedded: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EmbeddedSignUrlResponseEmbedded], - _check_type=True, - ) - - attribute_map = { - 'sign_url': 'sign_url', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def sign_url(self) -> str: - return self.get("sign_url") - - @sign_url.setter - def sign_url(self, value: str): - setattr(self, "sign_url", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddedSignUrlResponseEmbedded - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sign_url (str): A signature url that can be opened in an iFrame.. [optional] # noqa: E501 - expires_at (int): The specific time that the the `sign_url` link expires, in epoch.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddedSignUrlResponseEmbedded - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sign_url (str): A signature url that can be opened in an iFrame.. [optional] # noqa: E501 - expires_at (int): The specific time that the the `sign_url` link expires, in epoch.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/error_response.py b/sdks/python/dropbox_sign/model/error_response.py deleted file mode 100644 index 981ce0c4c..000000000 --- a/sdks/python/dropbox_sign/model/error_response.py +++ /dev/null @@ -1,297 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.error_response_error import ErrorResponseError - - -def lazy_import(): - from dropbox_sign.model.error_response_error import ErrorResponseError - globals()['ErrorResponseError'] = ErrorResponseError - - -class ErrorResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'error': (ErrorResponseError,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ErrorResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ErrorResponse], - _check_type=True, - ) - - attribute_map = { - 'error': 'error', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def error(self) -> ErrorResponseError: - return self.get("error") - - @error.setter - def error(self, value: ErrorResponseError): - setattr(self, "error", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, error, *args, **kwargs): # noqa: E501 - """ErrorResponse - a model defined in OpenAPI - - Args: - error (ErrorResponseError): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.error = error - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, error, *args, **kwargs): # noqa: E501 - """ErrorResponse - a model defined in OpenAPI - - Args: - error (ErrorResponseError): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.error = error - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/error_response_error.py b/sdks/python/dropbox_sign/model/error_response_error.py deleted file mode 100644 index b71019221..000000000 --- a/sdks/python/dropbox_sign/model/error_response_error.py +++ /dev/null @@ -1,315 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ErrorResponseError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'error_msg': (str,), # noqa: E501 - 'error_name': (str,), # noqa: E501 - 'error_path': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ErrorResponseError: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ErrorResponseError], - _check_type=True, - ) - - attribute_map = { - 'error_msg': 'error_msg', # noqa: E501 - 'error_name': 'error_name', # noqa: E501 - 'error_path': 'error_path', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def error_msg(self) -> str: - return self.get("error_msg") - - @error_msg.setter - def error_msg(self, value: str): - setattr(self, "error_msg", value) - - @property - def error_name(self) -> str: - return self.get("error_name") - - @error_name.setter - def error_name(self, value: str): - setattr(self, "error_name", value) - - @property - def error_path(self) -> str: - return self.get("error_path") - - @error_path.setter - def error_path(self, value: str): - setattr(self, "error_path", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, error_msg, error_name, *args, **kwargs): # noqa: E501 - """ErrorResponseError - a model defined in OpenAPI - - Args: - error_msg (str): Message describing an error. - error_name (str): Name of the error. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - error_path (str): Path at which an error occurred.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.error_msg = error_msg - self.error_name = error_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, error_msg, error_name, *args, **kwargs): # noqa: E501 - """ErrorResponseError - a model defined in OpenAPI - - Args: - error_msg (str): Message describing an error. - error_name (str): Name of the error. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - error_path (str): Path at which an error occurred.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.error_msg = error_msg - self.error_name = error_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/event_callback_request.py b/sdks/python/dropbox_sign/model/event_callback_request.py deleted file mode 100644 index 24f455f60..000000000 --- a/sdks/python/dropbox_sign/model/event_callback_request.py +++ /dev/null @@ -1,342 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.event_callback_request_event import EventCallbackRequestEvent - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.template_response import TemplateResponse - - -def lazy_import(): - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.event_callback_request_event import EventCallbackRequestEvent - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.template_response import TemplateResponse - globals()['AccountResponse'] = AccountResponse - globals()['EventCallbackRequestEvent'] = EventCallbackRequestEvent - globals()['SignatureRequestResponse'] = SignatureRequestResponse - globals()['TemplateResponse'] = TemplateResponse - - -class EventCallbackRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event': (EventCallbackRequestEvent,), # noqa: E501 - 'account': (AccountResponse,), # noqa: E501 - 'signature_request': (SignatureRequestResponse,), # noqa: E501 - 'template': (TemplateResponse,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EventCallbackRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EventCallbackRequest], - _check_type=True, - ) - - attribute_map = { - 'event': 'event', # noqa: E501 - 'account': 'account', # noqa: E501 - 'signature_request': 'signature_request', # noqa: E501 - 'template': 'template', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def event(self) -> EventCallbackRequestEvent: - return self.get("event") - - @event.setter - def event(self, value: EventCallbackRequestEvent): - setattr(self, "event", value) - - @property - def account(self) -> AccountResponse: - return self.get("account") - - @account.setter - def account(self, value: AccountResponse): - setattr(self, "account", value) - - @property - def signature_request(self) -> SignatureRequestResponse: - return self.get("signature_request") - - @signature_request.setter - def signature_request(self, value: SignatureRequestResponse): - setattr(self, "signature_request", value) - - @property - def template(self) -> TemplateResponse: - return self.get("template") - - @template.setter - def template(self, value: TemplateResponse): - setattr(self, "template", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, event, *args, **kwargs): # noqa: E501 - """EventCallbackRequest - a model defined in OpenAPI - - Args: - event (EventCallbackRequestEvent): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - signature_request (SignatureRequestResponse): [optional] # noqa: E501 - template (TemplateResponse): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.event = event - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, event, *args, **kwargs): # noqa: E501 - """EventCallbackRequest - a model defined in OpenAPI - - Args: - event (EventCallbackRequestEvent): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - signature_request (SignatureRequestResponse): [optional] # noqa: E501 - template (TemplateResponse): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.event = event - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/event_callback_request_event.py b/sdks/python/dropbox_sign/model/event_callback_request_event.py deleted file mode 100644 index 36fd019dc..000000000 --- a/sdks/python/dropbox_sign/model/event_callback_request_event.py +++ /dev/null @@ -1,362 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.event_callback_request_event_metadata import EventCallbackRequestEventMetadata - - -def lazy_import(): - from dropbox_sign.model.event_callback_request_event_metadata import EventCallbackRequestEventMetadata - globals()['EventCallbackRequestEventMetadata'] = EventCallbackRequestEventMetadata - - -class EventCallbackRequestEvent(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('event_type',): { - 'ACCOUNT_CONFIRMED': "account_confirmed", - 'UNKNOWN_ERROR': "unknown_error", - 'FILE_ERROR': "file_error", - 'SIGN_URL_INVALID': "sign_url_invalid", - 'SIGNATURE_REQUEST_VIEWED': "signature_request_viewed", - 'SIGNATURE_REQUEST_SIGNED': "signature_request_signed", - 'SIGNATURE_REQUEST_SENT': "signature_request_sent", - 'SIGNATURE_REQUEST_ALL_SIGNED': "signature_request_all_signed", - 'SIGNATURE_REQUEST_EMAIL_BOUNCE': "signature_request_email_bounce", - 'SIGNATURE_REQUEST_REMIND': "signature_request_remind", - 'SIGNATURE_REQUEST_INCOMPLETE_QES': "signature_request_incomplete_qes", - 'SIGNATURE_REQUEST_DESTROYED': "signature_request_destroyed", - 'SIGNATURE_REQUEST_CANCELED': "signature_request_canceled", - 'SIGNATURE_REQUEST_DOWNLOADABLE': "signature_request_downloadable", - 'SIGNATURE_REQUEST_DECLINED': "signature_request_declined", - 'SIGNATURE_REQUEST_REASSIGNED': "signature_request_reassigned", - 'SIGNATURE_REQUEST_INVALID': "signature_request_invalid", - 'SIGNATURE_REQUEST_PREPARED': "signature_request_prepared", - 'SIGNATURE_REQUEST_EXPIRED': "signature_request_expired", - 'TEMPLATE_CREATED': "template_created", - 'TEMPLATE_ERROR': "template_error", - 'CALLBACK_TEST': "callback_test", - 'SIGNATURE_REQUEST_SIGNER_REMOVED': "signature_request_signer_removed", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_time': (str,), # noqa: E501 - 'event_type': (str,), # noqa: E501 - 'event_hash': (str,), # noqa: E501 - 'event_metadata': (EventCallbackRequestEventMetadata,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EventCallbackRequestEvent: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EventCallbackRequestEvent], - _check_type=True, - ) - - attribute_map = { - 'event_time': 'event_time', # noqa: E501 - 'event_type': 'event_type', # noqa: E501 - 'event_hash': 'event_hash', # noqa: E501 - 'event_metadata': 'event_metadata', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def event_time(self) -> str: - return self.get("event_time") - - @event_time.setter - def event_time(self, value: str): - setattr(self, "event_time", value) - - @property - def event_type(self) -> str: - return self.get("event_type") - - @event_type.setter - def event_type(self, value: str): - setattr(self, "event_type", value) - - @property - def event_hash(self) -> str: - return self.get("event_hash") - - @event_hash.setter - def event_hash(self, value: str): - setattr(self, "event_hash", value) - - @property - def event_metadata(self) -> EventCallbackRequestEventMetadata: - return self.get("event_metadata") - - @event_metadata.setter - def event_metadata(self, value: EventCallbackRequestEventMetadata): - setattr(self, "event_metadata", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, event_time, event_type, event_hash, *args, **kwargs): # noqa: E501 - """EventCallbackRequestEvent - a model defined in OpenAPI - - Args: - event_time (str): Time the event was created (using Unix time). - event_type (str): Type of callback event that was triggered. - event_hash (str): Generated hash used to verify source of event data. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_metadata (EventCallbackRequestEventMetadata): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.event_time = event_time - self.event_type = event_type - self.event_hash = event_hash - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, event_time, event_type, event_hash, *args, **kwargs): # noqa: E501 - """EventCallbackRequestEvent - a model defined in OpenAPI - - Args: - event_time (str): Time the event was created (using Unix time). - event_type (str): Type of callback event that was triggered. - event_hash (str): Generated hash used to verify source of event data. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_metadata (EventCallbackRequestEventMetadata): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.event_time = event_time - self.event_type = event_type - self.event_hash = event_hash - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/event_callback_request_event_metadata.py b/sdks/python/dropbox_sign/model/event_callback_request_event_metadata.py deleted file mode 100644 index a0975c0db..000000000 --- a/sdks/python/dropbox_sign/model/event_callback_request_event_metadata.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class EventCallbackRequestEventMetadata(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'related_signature_id': (str, none_type,), # noqa: E501 - 'reported_for_account_id': (str, none_type,), # noqa: E501 - 'reported_for_app_id': (str, none_type,), # noqa: E501 - 'event_message': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EventCallbackRequestEventMetadata: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EventCallbackRequestEventMetadata], - _check_type=True, - ) - - attribute_map = { - 'related_signature_id': 'related_signature_id', # noqa: E501 - 'reported_for_account_id': 'reported_for_account_id', # noqa: E501 - 'reported_for_app_id': 'reported_for_app_id', # noqa: E501 - 'event_message': 'event_message', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def related_signature_id(self) -> Optional[str]: - return self.get("related_signature_id") - - @related_signature_id.setter - def related_signature_id(self, value: Optional[str]): - setattr(self, "related_signature_id", value) - - @property - def reported_for_account_id(self) -> Optional[str]: - return self.get("reported_for_account_id") - - @reported_for_account_id.setter - def reported_for_account_id(self, value: Optional[str]): - setattr(self, "reported_for_account_id", value) - - @property - def reported_for_app_id(self) -> Optional[str]: - return self.get("reported_for_app_id") - - @reported_for_app_id.setter - def reported_for_app_id(self, value: Optional[str]): - setattr(self, "reported_for_app_id", value) - - @property - def event_message(self) -> Optional[str]: - return self.get("event_message") - - @event_message.setter - def event_message(self, value: Optional[str]): - setattr(self, "event_message", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EventCallbackRequestEventMetadata - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - related_signature_id (str, none_type): Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events.. [optional] # noqa: E501 - reported_for_account_id (str, none_type): Account ID the event was reported for.. [optional] # noqa: E501 - reported_for_app_id (str, none_type): App ID the event was reported for.. [optional] # noqa: E501 - event_message (str, none_type): Message about a declined or failed (due to error) signature flow.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EventCallbackRequestEventMetadata - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - related_signature_id (str, none_type): Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events.. [optional] # noqa: E501 - reported_for_account_id (str, none_type): Account ID the event was reported for.. [optional] # noqa: E501 - reported_for_app_id (str, none_type): App ID the event was reported for.. [optional] # noqa: E501 - event_message (str, none_type): Message about a declined or failed (due to error) signature flow.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/file_response.py b/sdks/python/dropbox_sign/model/file_response.py deleted file mode 100644 index 1eae681d7..000000000 --- a/sdks/python/dropbox_sign/model/file_response.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class FileResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'file_url': (str,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> FileResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[FileResponse], - _check_type=True, - ) - - attribute_map = { - 'file_url': 'file_url', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def file_url(self) -> str: - return self.get("file_url") - - @file_url.setter - def file_url(self, value: str): - setattr(self, "file_url", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FileResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file_url (str): URL to the file.. [optional] # noqa: E501 - expires_at (int): When the link expires.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FileResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file_url (str): URL to the file.. [optional] # noqa: E501 - expires_at (int): When the link expires.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/file_response_data_uri.py b/sdks/python/dropbox_sign/model/file_response_data_uri.py deleted file mode 100644 index f103c7fcf..000000000 --- a/sdks/python/dropbox_sign/model/file_response_data_uri.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class FileResponseDataUri(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'data_uri': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> FileResponseDataUri: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[FileResponseDataUri], - _check_type=True, - ) - - attribute_map = { - 'data_uri': 'data_uri', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def data_uri(self) -> str: - return self.get("data_uri") - - @data_uri.setter - def data_uri(self, value: str): - setattr(self, "data_uri", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FileResponseDataUri - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - data_uri (str): File as base64 encoded string.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FileResponseDataUri - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - data_uri (str): File as base64 encoded string.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/list_info_response.py b/sdks/python/dropbox_sign/model/list_info_response.py deleted file mode 100644 index b50762f6d..000000000 --- a/sdks/python/dropbox_sign/model/list_info_response.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ListInfoResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'num_pages': (int,), # noqa: E501 - 'num_results': (int, none_type,), # noqa: E501 - 'page': (int,), # noqa: E501 - 'page_size': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ListInfoResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ListInfoResponse], - _check_type=True, - ) - - attribute_map = { - 'num_pages': 'num_pages', # noqa: E501 - 'num_results': 'num_results', # noqa: E501 - 'page': 'page', # noqa: E501 - 'page_size': 'page_size', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def num_pages(self) -> int: - return self.get("num_pages") - - @num_pages.setter - def num_pages(self, value: int): - setattr(self, "num_pages", value) - - @property - def num_results(self) -> Optional[int]: - return self.get("num_results") - - @num_results.setter - def num_results(self, value: Optional[int]): - setattr(self, "num_results", value) - - @property - def page(self) -> int: - return self.get("page") - - @page.setter - def page(self, value: int): - setattr(self, "page", value) - - @property - def page_size(self) -> int: - return self.get("page_size") - - @page_size.setter - def page_size(self, value: int): - setattr(self, "page_size", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ListInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - num_pages (int): Total number of pages available.. [optional] # noqa: E501 - num_results (int, none_type): Total number of objects available.. [optional] # noqa: E501 - page (int): Number of the page being returned.. [optional] # noqa: E501 - page_size (int): Objects returned per page.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ListInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - num_pages (int): Total number of pages available.. [optional] # noqa: E501 - num_results (int, none_type): Total number of objects available.. [optional] # noqa: E501 - page (int): Number of the page being returned.. [optional] # noqa: E501 - page_size (int): Objects returned per page.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/o_auth_token_generate_request.py b/sdks/python/dropbox_sign/model/o_auth_token_generate_request.py deleted file mode 100644 index 40269de78..000000000 --- a/sdks/python/dropbox_sign/model/o_auth_token_generate_request.py +++ /dev/null @@ -1,347 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class OAuthTokenGenerateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'client_id': (str,), # noqa: E501 - 'client_secret': (str,), # noqa: E501 - 'code': (str,), # noqa: E501 - 'grant_type': (str,), # noqa: E501 - 'state': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> OAuthTokenGenerateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[OAuthTokenGenerateRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'client_secret': 'client_secret', # noqa: E501 - 'code': 'code', # noqa: E501 - 'grant_type': 'grant_type', # noqa: E501 - 'state': 'state', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def client_secret(self) -> str: - return self.get("client_secret") - - @client_secret.setter - def client_secret(self, value: str): - setattr(self, "client_secret", value) - - @property - def code(self) -> str: - return self.get("code") - - @code.setter - def code(self, value: str): - setattr(self, "code", value) - - @property - def grant_type(self) -> str: - return self.get("grant_type") - - @grant_type.setter - def grant_type(self, value: str): - setattr(self, "grant_type", value) - - @property - def state(self) -> str: - return self.get("state") - - @state.setter - def state(self, value: str): - setattr(self, "state", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, client_secret, code, state, *args, **kwargs): # noqa: E501 - """OAuthTokenGenerateRequest - a model defined in OpenAPI - - Args: - client_id (str): The client id of the app requesting authorization. - client_secret (str): The secret token of your app. - code (str): The code passed to your callback when the user granted access. - state (str): Same as the state you specified earlier. - - Keyword Args: - grant_type (str): When generating a new token use `authorization_code`.. defaults to "authorization_code" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - grant_type = kwargs.get('grant_type', "authorization_code") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.client_secret = client_secret - self.code = code - self.grant_type = grant_type - self.state = state - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, client_secret, code, state, *args, **kwargs): # noqa: E501 - """OAuthTokenGenerateRequest - a model defined in OpenAPI - - Args: - client_id (str): The client id of the app requesting authorization. - client_secret (str): The secret token of your app. - code (str): The code passed to your callback when the user granted access. - state (str): Same as the state you specified earlier. - - Keyword Args: - grant_type (str): When generating a new token use `authorization_code`.. defaults to "authorization_code" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - grant_type = kwargs.get('grant_type', "authorization_code") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.client_secret = client_secret - self.code = code - self.grant_type = grant_type - self.state = state - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/o_auth_token_refresh_request.py b/sdks/python/dropbox_sign/model/o_auth_token_refresh_request.py deleted file mode 100644 index 6165d395a..000000000 --- a/sdks/python/dropbox_sign/model/o_auth_token_refresh_request.py +++ /dev/null @@ -1,305 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class OAuthTokenRefreshRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'grant_type': (str,), # noqa: E501 - 'refresh_token': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> OAuthTokenRefreshRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[OAuthTokenRefreshRequest], - _check_type=True, - ) - - attribute_map = { - 'grant_type': 'grant_type', # noqa: E501 - 'refresh_token': 'refresh_token', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def grant_type(self) -> str: - return self.get("grant_type") - - @grant_type.setter - def grant_type(self, value: str): - setattr(self, "grant_type", value) - - @property - def refresh_token(self) -> str: - return self.get("refresh_token") - - @refresh_token.setter - def refresh_token(self, value: str): - setattr(self, "refresh_token", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, refresh_token, *args, **kwargs): # noqa: E501 - """OAuthTokenRefreshRequest - a model defined in OpenAPI - - Args: - refresh_token (str): The token provided when you got the expired access token. - - Keyword Args: - grant_type (str): When refreshing an existing token use `refresh_token`.. defaults to "refresh_token" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - grant_type = kwargs.get('grant_type', "refresh_token") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.grant_type = grant_type - self.refresh_token = refresh_token - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, refresh_token, *args, **kwargs): # noqa: E501 - """OAuthTokenRefreshRequest - a model defined in OpenAPI - - Args: - refresh_token (str): The token provided when you got the expired access token. - - Keyword Args: - grant_type (str): When refreshing an existing token use `refresh_token`.. defaults to "refresh_token" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - grant_type = kwargs.get('grant_type', "refresh_token") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.grant_type = grant_type - self.refresh_token = refresh_token - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/o_auth_token_response.py b/sdks/python/dropbox_sign/model/o_auth_token_response.py deleted file mode 100644 index 56faff819..000000000 --- a/sdks/python/dropbox_sign/model/o_auth_token_response.py +++ /dev/null @@ -1,331 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class OAuthTokenResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'access_token': (str,), # noqa: E501 - 'token_type': (str,), # noqa: E501 - 'refresh_token': (str,), # noqa: E501 - 'expires_in': (int,), # noqa: E501 - 'state': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> OAuthTokenResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[OAuthTokenResponse], - _check_type=True, - ) - - attribute_map = { - 'access_token': 'access_token', # noqa: E501 - 'token_type': 'token_type', # noqa: E501 - 'refresh_token': 'refresh_token', # noqa: E501 - 'expires_in': 'expires_in', # noqa: E501 - 'state': 'state', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def access_token(self) -> str: - return self.get("access_token") - - @access_token.setter - def access_token(self, value: str): - setattr(self, "access_token", value) - - @property - def token_type(self) -> str: - return self.get("token_type") - - @token_type.setter - def token_type(self, value: str): - setattr(self, "token_type", value) - - @property - def refresh_token(self) -> str: - return self.get("refresh_token") - - @refresh_token.setter - def refresh_token(self, value: str): - setattr(self, "refresh_token", value) - - @property - def expires_in(self) -> int: - return self.get("expires_in") - - @expires_in.setter - def expires_in(self, value: int): - setattr(self, "expires_in", value) - - @property - def state(self) -> Optional[str]: - return self.get("state") - - @state.setter - def state(self, value: Optional[str]): - setattr(self, "state", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """OAuthTokenResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - access_token (str): [optional] # noqa: E501 - token_type (str): [optional] # noqa: E501 - refresh_token (str): [optional] # noqa: E501 - expires_in (int): Number of seconds until the `access_token` expires. Uses epoch time.. [optional] # noqa: E501 - state (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """OAuthTokenResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - access_token (str): [optional] # noqa: E501 - token_type (str): [optional] # noqa: E501 - refresh_token (str): [optional] # noqa: E501 - expires_in (int): Number of seconds until the `access_token` expires. Uses epoch time.. [optional] # noqa: E501 - state (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/report_create_request.py b/sdks/python/dropbox_sign/model/report_create_request.py deleted file mode 100644 index 7a749faed..000000000 --- a/sdks/python/dropbox_sign/model/report_create_request.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ReportCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('report_type',): { - 'USER_ACTIVITY': "user_activity", - 'DOCUMENT_STATUS': "document_status", - }, - } - - validations = { - ('report_type',): { - 'max_items': 2, - 'min_items': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'end_date': (str,), # noqa: E501 - 'report_type': ([str],), # noqa: E501 - 'start_date': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ReportCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ReportCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'end_date': 'end_date', # noqa: E501 - 'report_type': 'report_type', # noqa: E501 - 'start_date': 'start_date', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def end_date(self) -> str: - return self.get("end_date") - - @end_date.setter - def end_date(self, value: str): - setattr(self, "end_date", value) - - @property - def report_type(self) -> List[str]: - return self.get("report_type") - - @report_type.setter - def report_type(self, value: List[str]): - setattr(self, "report_type", value) - - @property - def start_date(self) -> str: - return self.get("start_date") - - @start_date.setter - def start_date(self, value: str): - setattr(self, "start_date", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, end_date, report_type, start_date, *args, **kwargs): # noqa: E501 - """ReportCreateRequest - a model defined in OpenAPI - - Args: - end_date (str): The (inclusive) end date for the report data in `MM/DD/YYYY` format. - report_type ([str]): The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). - start_date (str): The (inclusive) start date for the report data in `MM/DD/YYYY` format. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.end_date = end_date - self.report_type = report_type - self.start_date = start_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, end_date, report_type, start_date, *args, **kwargs): # noqa: E501 - """ReportCreateRequest - a model defined in OpenAPI - - Args: - end_date (str): The (inclusive) end date for the report data in `MM/DD/YYYY` format. - report_type ([str]): The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). - start_date (str): The (inclusive) start date for the report data in `MM/DD/YYYY` format. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.end_date = end_date - self.report_type = report_type - self.start_date = start_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/report_create_response.py b/sdks/python/dropbox_sign/model/report_create_response.py deleted file mode 100644 index 6c6c14c92..000000000 --- a/sdks/python/dropbox_sign/model/report_create_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.report_response import ReportResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.report_response import ReportResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ReportResponse'] = ReportResponse - globals()['WarningResponse'] = WarningResponse - - -class ReportCreateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'report': (ReportResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ReportCreateResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ReportCreateResponse], - _check_type=True, - ) - - attribute_map = { - 'report': 'report', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def report(self) -> ReportResponse: - return self.get("report") - - @report.setter - def report(self, value: ReportResponse): - setattr(self, "report", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ReportCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - report (ReportResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ReportCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - report (ReportResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/report_response.py b/sdks/python/dropbox_sign/model/report_response.py deleted file mode 100644 index 2ac5c4da8..000000000 --- a/sdks/python/dropbox_sign/model/report_response.py +++ /dev/null @@ -1,323 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ReportResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('report_type',): { - 'USER_ACTIVITY': "user_activity", - 'DOCUMENT_STATUS': "document_status", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'success': (str,), # noqa: E501 - 'start_date': (str,), # noqa: E501 - 'end_date': (str,), # noqa: E501 - 'report_type': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ReportResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ReportResponse], - _check_type=True, - ) - - attribute_map = { - 'success': 'success', # noqa: E501 - 'start_date': 'start_date', # noqa: E501 - 'end_date': 'end_date', # noqa: E501 - 'report_type': 'report_type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def success(self) -> str: - return self.get("success") - - @success.setter - def success(self, value: str): - setattr(self, "success", value) - - @property - def start_date(self) -> str: - return self.get("start_date") - - @start_date.setter - def start_date(self, value: str): - setattr(self, "start_date", value) - - @property - def end_date(self) -> str: - return self.get("end_date") - - @end_date.setter - def end_date(self, value: str): - setattr(self, "end_date", value) - - @property - def report_type(self) -> List[str]: - return self.get("report_type") - - @report_type.setter - def report_type(self, value: List[str]): - setattr(self, "report_type", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ReportResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - success (str): A message indicating the requested operation's success. [optional] # noqa: E501 - start_date (str): The (inclusive) start date for the report data in MM/DD/YYYY format.. [optional] # noqa: E501 - end_date (str): The (inclusive) end date for the report data in MM/DD/YYYY format.. [optional] # noqa: E501 - report_type ([str]): The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ReportResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - success (str): A message indicating the requested operation's success. [optional] # noqa: E501 - start_date (str): The (inclusive) start date for the report data in MM/DD/YYYY format.. [optional] # noqa: E501 - end_date (str): The (inclusive) end date for the report data in MM/DD/YYYY format.. [optional] # noqa: E501 - report_type ([str]): The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_bulk_create_embedded_with_template_request.py b/sdks/python/dropbox_sign/model/signature_request_bulk_create_embedded_with_template_request.py deleted file mode 100644 index 5ec551848..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_bulk_create_embedded_with_template_request.py +++ /dev/null @@ -1,460 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_bulk_signer_list import SubBulkSignerList - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - - -def lazy_import(): - from dropbox_sign.model.sub_bulk_signer_list import SubBulkSignerList - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - globals()['SubBulkSignerList'] = SubBulkSignerList - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - - -class SignatureRequestBulkCreateEmbeddedWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'signer_file': (file_type,), # noqa: E501 - 'signer_list': ([SubBulkSignerList],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestBulkCreateEmbeddedWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestBulkCreateEmbeddedWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'signer_file': 'signer_file', # noqa: E501 - 'signer_list': 'signer_list', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def signer_file(self) -> file_type: - return self.get("signer_file") - - @signer_file.setter - def signer_file(self, value: file_type): - setattr(self, "signer_file", value) - - @property - def signer_list(self) -> List[SubBulkSignerList]: - return self.get("signer_list") - - @signer_list.setter - def signer_list(self, value: List[SubBulkSignerList]): - setattr(self, "signer_list", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestBulkCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signer_file (file_type): `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```. [optional] # noqa: E501 - signer_list ([SubBulkSignerList]): `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestBulkCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signer_file (file_type): `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```. [optional] # noqa: E501 - signer_list ([SubBulkSignerList]): `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_bulk_send_with_template_request.py b/sdks/python/dropbox_sign/model/signature_request_bulk_send_with_template_request.py deleted file mode 100644 index ff6b3f3fa..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_bulk_send_with_template_request.py +++ /dev/null @@ -1,458 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_bulk_signer_list import SubBulkSignerList - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - - -def lazy_import(): - from dropbox_sign.model.sub_bulk_signer_list import SubBulkSignerList - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - globals()['SubBulkSignerList'] = SubBulkSignerList - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - - -class SignatureRequestBulkSendWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'signer_file': (file_type,), # noqa: E501 - 'signer_list': ([SubBulkSignerList],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestBulkSendWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestBulkSendWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'signer_file': 'signer_file', # noqa: E501 - 'signer_list': 'signer_list', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def signer_file(self) -> file_type: - return self.get("signer_file") - - @signer_file.setter - def signer_file(self, value: file_type): - setattr(self, "signer_file", value) - - @property - def signer_list(self) -> List[SubBulkSignerList]: - return self.get("signer_list") - - @signer_list.setter - def signer_list(self, value: List[SubBulkSignerList]): - setattr(self, "signer_list", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, *args, **kwargs): # noqa: E501 - """SignatureRequestBulkSendWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signer_file (file_type): `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```. [optional] # noqa: E501 - signer_list ([SubBulkSignerList]): `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, *args, **kwargs): # noqa: E501 - """SignatureRequestBulkSendWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signer_file (file_type): `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```. [optional] # noqa: E501 - signer_list ([SubBulkSignerList]): `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_create_embedded_request.py b/sdks/python/dropbox_sign/model/signature_request_create_embedded_request.py deleted file mode 100644 index 962e24c33..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_create_embedded_request.py +++ /dev/null @@ -1,608 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSignatureRequestGroupedSigners'] = SubSignatureRequestGroupedSigners - globals()['SubSignatureRequestSigner'] = SubSignatureRequestSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestCreateEmbeddedRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestSigner],), # noqa: E501 - 'grouped_signers': ([SubSignatureRequestGroupedSigners],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestCreateEmbeddedRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestCreateEmbeddedRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'grouped_signers': 'grouped_signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def signers(self) -> List[SubSignatureRequestSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestSigner]): - setattr(self, "signers", value) - - @property - def grouped_signers(self) -> List[SubSignatureRequestGroupedSigners]: - return self.get("grouped_signers") - - @grouped_signers.setter - def grouped_signers(self, value: List[SubSignatureRequestGroupedSigners]): - setattr(self, "grouped_signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestCreateEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestCreateEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_create_embedded_with_template_request.py b/sdks/python/dropbox_sign/model/signature_request_create_embedded_with_template_request.py deleted file mode 100644 index 437351b7a..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_create_embedded_with_template_request.py +++ /dev/null @@ -1,489 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - globals()['SubSignatureRequestTemplateSigner'] = SubSignatureRequestTemplateSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestCreateEmbeddedWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'signers': ([SubSignatureRequestTemplateSigner],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestCreateEmbeddedWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestCreateEmbeddedWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def signers(self) -> List[SubSignatureRequestTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestTemplateSigner]): - setattr(self, "signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, client_id, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, client_id, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_edit_embedded_request.py b/sdks/python/dropbox_sign/model/signature_request_edit_embedded_request.py deleted file mode 100644 index 831290ef4..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_edit_embedded_request.py +++ /dev/null @@ -1,608 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSignatureRequestGroupedSigners'] = SubSignatureRequestGroupedSigners - globals()['SubSignatureRequestSigner'] = SubSignatureRequestSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestEditEmbeddedRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestSigner],), # noqa: E501 - 'grouped_signers': ([SubSignatureRequestGroupedSigners],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestEditEmbeddedRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestEditEmbeddedRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'grouped_signers': 'grouped_signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def signers(self) -> List[SubSignatureRequestSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestSigner]): - setattr(self, "signers", value) - - @property - def grouped_signers(self) -> List[SubSignatureRequestGroupedSigners]: - return self.get("grouped_signers") - - @grouped_signers.setter - def grouped_signers(self, value: List[SubSignatureRequestGroupedSigners]): - setattr(self, "grouped_signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestEditEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestEditEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_edit_embedded_with_template_request.py b/sdks/python/dropbox_sign/model/signature_request_edit_embedded_with_template_request.py deleted file mode 100644 index 8e3e2cb63..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_edit_embedded_with_template_request.py +++ /dev/null @@ -1,489 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - globals()['SubSignatureRequestTemplateSigner'] = SubSignatureRequestTemplateSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestEditEmbeddedWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'signers': ([SubSignatureRequestTemplateSigner],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestEditEmbeddedWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestEditEmbeddedWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def signers(self) -> List[SubSignatureRequestTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestTemplateSigner]): - setattr(self, "signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, client_id, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestEditEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, client_id, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestEditEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_edit_request.py b/sdks/python/dropbox_sign/model/signature_request_edit_request.py deleted file mode 100644 index 42d01ad86..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_edit_request.py +++ /dev/null @@ -1,626 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSignatureRequestGroupedSigners'] = SubSignatureRequestGroupedSigners - globals()['SubSignatureRequestSigner'] = SubSignatureRequestSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestEditRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestSigner],), # noqa: E501 - 'grouped_signers': ([SubSignatureRequestGroupedSigners],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'is_qualified_signature': (bool,), # noqa: E501 - 'is_eid': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestEditRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestEditRequest], - _check_type=True, - ) - - attribute_map = { - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'grouped_signers': 'grouped_signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'is_qualified_signature': 'is_qualified_signature', # noqa: E501 - 'is_eid': 'is_eid', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def signers(self) -> List[SubSignatureRequestSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestSigner]): - setattr(self, "signers", value) - - @property - def grouped_signers(self) -> List[SubSignatureRequestGroupedSigners]: - return self.get("grouped_signers") - - @grouped_signers.setter - def grouped_signers(self, value: List[SubSignatureRequestGroupedSigners]): - setattr(self, "grouped_signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def is_qualified_signature(self) -> bool: - return self.get("is_qualified_signature") - - @is_qualified_signature.setter - def is_qualified_signature(self, value: bool): - setattr(self, "is_qualified_signature", value) - - @property - def is_eid(self) -> bool: - return self.get("is_eid") - - @is_eid.setter - def is_eid(self, value: bool): - setattr(self, "is_eid", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestEditRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestEditRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_edit_with_template_request.py b/sdks/python/dropbox_sign/model/signature_request_edit_with_template_request.py deleted file mode 100644 index 380a06bae..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_edit_with_template_request.py +++ /dev/null @@ -1,511 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - globals()['SubSignatureRequestTemplateSigner'] = SubSignatureRequestTemplateSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestEditWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestTemplateSigner],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'is_qualified_signature': (bool,), # noqa: E501 - 'is_eid': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestEditWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestEditWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'is_qualified_signature': 'is_qualified_signature', # noqa: E501 - 'is_eid': 'is_eid', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def signers(self) -> List[SubSignatureRequestTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestTemplateSigner]): - setattr(self, "signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def is_qualified_signature(self) -> bool: - return self.get("is_qualified_signature") - - @is_qualified_signature.setter - def is_qualified_signature(self, value: bool): - setattr(self, "is_qualified_signature", value) - - @property - def is_eid(self) -> bool: - return self.get("is_eid") - - @is_eid.setter - def is_eid(self, value: bool): - setattr(self, "is_eid", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestEditWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestEditWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_get_response.py b/sdks/python/dropbox_sign/model/signature_request_get_response.py deleted file mode 100644 index c07ff1d2b..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_get_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['SignatureRequestResponse'] = SignatureRequestResponse - globals()['WarningResponse'] = WarningResponse - - -class SignatureRequestGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'signature_request': (SignatureRequestResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestGetResponse], - _check_type=True, - ) - - attribute_map = { - 'signature_request': 'signature_request', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def signature_request(self) -> SignatureRequestResponse: - return self.get("signature_request") - - @signature_request.setter - def signature_request(self, value: SignatureRequestResponse): - setattr(self, "signature_request", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_request (SignatureRequestResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_request (SignatureRequestResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_list_response.py b/sdks/python/dropbox_sign/model/signature_request_list_response.py deleted file mode 100644 index a6f5fbe93..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_list_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['SignatureRequestResponse'] = SignatureRequestResponse - globals()['WarningResponse'] = WarningResponse - - -class SignatureRequestListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'signature_requests': ([SignatureRequestResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestListResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestListResponse], - _check_type=True, - ) - - attribute_map = { - 'signature_requests': 'signature_requests', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def signature_requests(self) -> List[SignatureRequestResponse]: - return self.get("signature_requests") - - @signature_requests.setter - def signature_requests(self, value: List[SignatureRequestResponse]): - setattr(self, "signature_requests", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_requests ([SignatureRequestResponse]): Contains information about signature requests.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_requests ([SignatureRequestResponse]): Contains information about signature requests.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_remind_request.py b/sdks/python/dropbox_sign/model/signature_request_remind_request.py deleted file mode 100644 index ba4dc8476..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_remind_request.py +++ /dev/null @@ -1,301 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestRemindRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestRemindRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestRemindRequest], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email_address, *args, **kwargs): # noqa: E501 - """SignatureRequestRemindRequest - a model defined in OpenAPI - - Args: - email_address (str): The email address of the signer to send a reminder to. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the signer to send a reminder to. Include if two or more signers share an email address.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, email_address, *args, **kwargs): # noqa: E501 - """SignatureRequestRemindRequest - a model defined in OpenAPI - - Args: - email_address (str): The email address of the signer to send a reminder to. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the signer to send a reminder to. Include if two or more signers share an email address.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_response.py b/sdks/python/dropbox_sign/model/signature_request_response.py deleted file mode 100644 index 79929fb8b..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response.py +++ /dev/null @@ -1,588 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_attachment import SignatureRequestResponseAttachment - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - from dropbox_sign.model.signature_request_response_signatures import SignatureRequestResponseSignatures - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_attachment import SignatureRequestResponseAttachment - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - from dropbox_sign.model.signature_request_response_signatures import SignatureRequestResponseSignatures - globals()['SignatureRequestResponseAttachment'] = SignatureRequestResponseAttachment - globals()['SignatureRequestResponseCustomFieldBase'] = SignatureRequestResponseCustomFieldBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - globals()['SignatureRequestResponseSignatures'] = SignatureRequestResponseSignatures - - -class SignatureRequestResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'test_mode': (bool, none_type,), # noqa: E501 - 'signature_request_id': (str,), # noqa: E501 - 'requester_email_address': (str,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'original_title': (str,), # noqa: E501 - 'subject': (str, none_type,), # noqa: E501 - 'message': (str, none_type,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'created_at': (int,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - 'is_complete': (bool,), # noqa: E501 - 'is_declined': (bool,), # noqa: E501 - 'has_error': (bool,), # noqa: E501 - 'files_url': (str,), # noqa: E501 - 'signing_url': (str, none_type,), # noqa: E501 - 'details_url': (str,), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'signing_redirect_url': (str, none_type,), # noqa: E501 - 'final_copy_uri': (str, none_type,), # noqa: E501 - 'template_ids': ([str], none_type,), # noqa: E501 - 'custom_fields': ([SignatureRequestResponseCustomFieldBase], none_type,), # noqa: E501 - 'attachments': ([SignatureRequestResponseAttachment], none_type,), # noqa: E501 - 'response_data': ([SignatureRequestResponseDataBase], none_type,), # noqa: E501 - 'signatures': ([SignatureRequestResponseSignatures],), # noqa: E501 - 'bulk_send_job_id': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponse], - _check_type=True, - ) - - attribute_map = { - 'test_mode': 'test_mode', # noqa: E501 - 'signature_request_id': 'signature_request_id', # noqa: E501 - 'requester_email_address': 'requester_email_address', # noqa: E501 - 'title': 'title', # noqa: E501 - 'original_title': 'original_title', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - 'is_complete': 'is_complete', # noqa: E501 - 'is_declined': 'is_declined', # noqa: E501 - 'has_error': 'has_error', # noqa: E501 - 'files_url': 'files_url', # noqa: E501 - 'signing_url': 'signing_url', # noqa: E501 - 'details_url': 'details_url', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'final_copy_uri': 'final_copy_uri', # noqa: E501 - 'template_ids': 'template_ids', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'response_data': 'response_data', # noqa: E501 - 'signatures': 'signatures', # noqa: E501 - 'bulk_send_job_id': 'bulk_send_job_id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def test_mode(self) -> Optional[bool]: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: Optional[bool]): - setattr(self, "test_mode", value) - - @property - def signature_request_id(self) -> str: - return self.get("signature_request_id") - - @signature_request_id.setter - def signature_request_id(self, value: str): - setattr(self, "signature_request_id", value) - - @property - def requester_email_address(self) -> str: - return self.get("requester_email_address") - - @requester_email_address.setter - def requester_email_address(self, value: str): - setattr(self, "requester_email_address", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def original_title(self) -> str: - return self.get("original_title") - - @original_title.setter - def original_title(self, value: str): - setattr(self, "original_title", value) - - @property - def subject(self) -> Optional[str]: - return self.get("subject") - - @subject.setter - def subject(self, value: Optional[str]): - setattr(self, "subject", value) - - @property - def message(self) -> Optional[str]: - return self.get("message") - - @message.setter - def message(self, value: Optional[str]): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def created_at(self) -> int: - return self.get("created_at") - - @created_at.setter - def created_at(self, value: int): - setattr(self, "created_at", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @property - def is_complete(self) -> bool: - return self.get("is_complete") - - @is_complete.setter - def is_complete(self, value: bool): - setattr(self, "is_complete", value) - - @property - def is_declined(self) -> bool: - return self.get("is_declined") - - @is_declined.setter - def is_declined(self, value: bool): - setattr(self, "is_declined", value) - - @property - def has_error(self) -> bool: - return self.get("has_error") - - @has_error.setter - def has_error(self, value: bool): - setattr(self, "has_error", value) - - @property - def files_url(self) -> str: - return self.get("files_url") - - @files_url.setter - def files_url(self, value: str): - setattr(self, "files_url", value) - - @property - def signing_url(self) -> Optional[str]: - return self.get("signing_url") - - @signing_url.setter - def signing_url(self, value: Optional[str]): - setattr(self, "signing_url", value) - - @property - def details_url(self) -> str: - return self.get("details_url") - - @details_url.setter - def details_url(self, value: str): - setattr(self, "details_url", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def signing_redirect_url(self) -> Optional[str]: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: Optional[str]): - setattr(self, "signing_redirect_url", value) - - @property - def final_copy_uri(self) -> Optional[str]: - return self.get("final_copy_uri") - - @final_copy_uri.setter - def final_copy_uri(self, value: Optional[str]): - setattr(self, "final_copy_uri", value) - - @property - def template_ids(self) -> Optional[List[str]]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: Optional[List[str]]): - setattr(self, "template_ids", value) - - @property - def custom_fields(self) -> Optional[List[SignatureRequestResponseCustomFieldBase]]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: Optional[List[SignatureRequestResponseCustomFieldBase]]): - setattr(self, "custom_fields", value) - - @property - def attachments(self) -> Optional[List[SignatureRequestResponseAttachment]]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: Optional[List[SignatureRequestResponseAttachment]]): - setattr(self, "attachments", value) - - @property - def response_data(self) -> Optional[List[SignatureRequestResponseDataBase]]: - return self.get("response_data") - - @response_data.setter - def response_data(self, value: Optional[List[SignatureRequestResponseDataBase]]): - setattr(self, "response_data", value) - - @property - def signatures(self) -> List[SignatureRequestResponseSignatures]: - return self.get("signatures") - - @signatures.setter - def signatures(self, value: List[SignatureRequestResponseSignatures]): - setattr(self, "signatures", value) - - @property - def bulk_send_job_id(self) -> Optional[str]: - return self.get("bulk_send_job_id") - - @bulk_send_job_id.setter - def bulk_send_job_id(self, value: Optional[str]): - setattr(self, "bulk_send_job_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - test_mode (bool, none_type): Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - signature_request_id (str): The id of the SignatureRequest.. [optional] # noqa: E501 - requester_email_address (str): The email address of the initiator of the SignatureRequest.. [optional] # noqa: E501 - title (str): The title the specified Account uses for the SignatureRequest.. [optional] # noqa: E501 - original_title (str): Default Label for account.. [optional] # noqa: E501 - subject (str, none_type): The subject in the email that was initially sent to the signers.. [optional] # noqa: E501 - message (str, none_type): The custom message in the email that was initially sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the signature request.. [optional] # noqa: E501 - created_at (int): Time the signature request was created.. [optional] # noqa: E501 - expires_at (int): The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - is_complete (bool): Whether or not the SignatureRequest has been fully executed by all signers.. [optional] # noqa: E501 - is_declined (bool): Whether or not the SignatureRequest has been declined by a signer.. [optional] # noqa: E501 - has_error (bool): Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).. [optional] # noqa: E501 - files_url (str): The URL where a copy of the request's documents can be downloaded.. [optional] # noqa: E501 - signing_url (str, none_type): The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.. [optional] # noqa: E501 - details_url (str): The URL where the requester and the signers can view the current status of the SignatureRequest.. [optional] # noqa: E501 - cc_email_addresses ([str]): A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want the signer redirected to after they successfully sign.. [optional] # noqa: E501 - final_copy_uri (str, none_type): The path where the completed document can be downloaded. [optional] # noqa: E501 - template_ids ([str], none_type): Templates IDs used in this SignatureRequest (if any).. [optional] # noqa: E501 - custom_fields ([SignatureRequestResponseCustomFieldBase], none_type): An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`. [optional] # noqa: E501 - attachments ([SignatureRequestResponseAttachment], none_type): Signer attachments.. [optional] # noqa: E501 - response_data ([SignatureRequestResponseDataBase], none_type): An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.. [optional] # noqa: E501 - signatures ([SignatureRequestResponseSignatures]): An array of signature objects, 1 for each signer.. [optional] # noqa: E501 - bulk_send_job_id (str, none_type): The ID of the Bulk Send job which sent the signature request, if applicable.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - test_mode (bool, none_type): Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - signature_request_id (str): The id of the SignatureRequest.. [optional] # noqa: E501 - requester_email_address (str): The email address of the initiator of the SignatureRequest.. [optional] # noqa: E501 - title (str): The title the specified Account uses for the SignatureRequest.. [optional] # noqa: E501 - original_title (str): Default Label for account.. [optional] # noqa: E501 - subject (str, none_type): The subject in the email that was initially sent to the signers.. [optional] # noqa: E501 - message (str, none_type): The custom message in the email that was initially sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the signature request.. [optional] # noqa: E501 - created_at (int): Time the signature request was created.. [optional] # noqa: E501 - expires_at (int): The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - is_complete (bool): Whether or not the SignatureRequest has been fully executed by all signers.. [optional] # noqa: E501 - is_declined (bool): Whether or not the SignatureRequest has been declined by a signer.. [optional] # noqa: E501 - has_error (bool): Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).. [optional] # noqa: E501 - files_url (str): The URL where a copy of the request's documents can be downloaded.. [optional] # noqa: E501 - signing_url (str, none_type): The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.. [optional] # noqa: E501 - details_url (str): The URL where the requester and the signers can view the current status of the SignatureRequest.. [optional] # noqa: E501 - cc_email_addresses ([str]): A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want the signer redirected to after they successfully sign.. [optional] # noqa: E501 - final_copy_uri (str, none_type): The path where the completed document can be downloaded. [optional] # noqa: E501 - template_ids ([str], none_type): Templates IDs used in this SignatureRequest (if any).. [optional] # noqa: E501 - custom_fields ([SignatureRequestResponseCustomFieldBase], none_type): An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`. [optional] # noqa: E501 - attachments ([SignatureRequestResponseAttachment], none_type): Signer attachments.. [optional] # noqa: E501 - response_data ([SignatureRequestResponseDataBase], none_type): An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.. [optional] # noqa: E501 - signatures ([SignatureRequestResponseSignatures]): An array of signature objects, 1 for each signer.. [optional] # noqa: E501 - bulk_send_job_id (str, none_type): The ID of the Bulk Send job which sent the signature request, if applicable.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_response_attachment.py b/sdks/python/dropbox_sign/model/signature_request_response_attachment.py deleted file mode 100644 index 30c68fe80..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_attachment.py +++ /dev/null @@ -1,355 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestResponseAttachment(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'instructions': (str, none_type,), # noqa: E501 - 'uploaded_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseAttachment: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseAttachment], - _check_type=True, - ) - - attribute_map = { - 'id': 'id', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - 'instructions': 'instructions', # noqa: E501 - 'uploaded_at': 'uploaded_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def id(self) -> str: - return self.get("id") - - @id.setter - def id(self, value: str): - setattr(self, "id", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def instructions(self) -> Optional[str]: - return self.get("instructions") - - @instructions.setter - def instructions(self, value: Optional[str]): - setattr(self, "instructions", value) - - @property - def uploaded_at(self) -> Optional[int]: - return self.get("uploaded_at") - - @uploaded_at.setter - def uploaded_at(self, value: Optional[int]): - setattr(self, "uploaded_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, id, signer, name, required, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseAttachment - a model defined in OpenAPI - - Args: - id (str): The unique ID for this attachment. - signer (str): The Signer this attachment is assigned to. - name (str): The name of this attachment. - required (bool): A boolean value denoting if this attachment is required. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - instructions (str, none_type): Instructions for Signer.. [optional] # noqa: E501 - uploaded_at (int, none_type): Timestamp when attachment was uploaded by Signer.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.signer = signer - self.name = name - self.required = required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, id, signer, name, required, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseAttachment - a model defined in OpenAPI - - Args: - id (str): The unique ID for this attachment. - signer (str): The Signer this attachment is assigned to. - name (str): The name of this attachment. - required (bool): A boolean value denoting if this attachment is required. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - instructions (str, none_type): Instructions for Signer.. [optional] # noqa: E501 - uploaded_at (int, none_type): Timestamp when attachment was uploaded by Signer.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.signer = signer - self.name = name - self.required = required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_response_custom_field_base.py b/sdks/python/dropbox_sign/model/signature_request_response_custom_field_base.py deleted file mode 100644 index 9ebfcc688..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_custom_field_base.py +++ /dev/null @@ -1,342 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import SignatureRequestResponseCustomFieldCheckbox - from dropbox_sign.models import SignatureRequestResponseCustomFieldText - - -def lazy_import(): - from dropbox_sign.models import SignatureRequestResponseCustomFieldCheckbox - from dropbox_sign.models import SignatureRequestResponseCustomFieldText - globals()['SignatureRequestResponseCustomFieldCheckbox'] = SignatureRequestResponseCustomFieldCheckbox - globals()['SignatureRequestResponseCustomFieldText'] = SignatureRequestResponseCustomFieldText - - -class SignatureRequestResponseCustomFieldBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'editor': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': SignatureRequestResponseCustomFieldCheckbox, - 'text': SignatureRequestResponseCustomFieldText, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'type': 'type', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'editor': 'editor', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def editor(self) -> str: - return self.get("editor") - - @editor.setter - def editor(self, value: str): - setattr(self, "editor", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, name, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldBase - a model defined in OpenAPI - - Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. - name (str): The name of the Custom Field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, name, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldBase - a model defined in OpenAPI - - Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. - name (str): The name of the Custom Field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_response_custom_field_checkbox.py b/sdks/python/dropbox_sign/model/signature_request_response_custom_field_checkbox.py deleted file mode 100644 index 59753987f..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_custom_field_checkbox.py +++ /dev/null @@ -1,401 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - globals()['SignatureRequestResponseCustomFieldBase'] = SignatureRequestResponseCustomFieldBase - - -class SignatureRequestResponseCustomFieldCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'value': (bool,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'editor': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseCustomFieldCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseCustomFieldCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'name': 'name', # noqa: E501 - 'value': 'value', # noqa: E501 - 'required': 'required', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'editor': 'editor', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def value(self) -> bool: - return self.get("value") - - @value.setter - def value(self, value: bool): - setattr(self, "value", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def editor(self) -> str: - return self.get("editor") - - @editor.setter - def editor(self, value: str): - setattr(self, "editor", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.. defaults to "checkbox" # noqa: E501 - name (str): The name of the Custom Field. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (bool): A true/false for checkbox fields. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.. defaults to "checkbox" # noqa: E501 - name (str): The name of the Custom Field. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (bool): A true/false for checkbox fields. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_custom_field_text.py b/sdks/python/dropbox_sign/model/signature_request_response_custom_field_text.py deleted file mode 100644 index bb4aecae4..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_custom_field_text.py +++ /dev/null @@ -1,401 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - globals()['SignatureRequestResponseCustomFieldBase'] = SignatureRequestResponseCustomFieldBase - - -class SignatureRequestResponseCustomFieldText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'editor': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseCustomFieldText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseCustomFieldText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'name': 'name', # noqa: E501 - 'value': 'value', # noqa: E501 - 'required': 'required', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'editor': 'editor', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def editor(self) -> str: - return self.get("editor") - - @editor.setter - def editor(self, value: str): - setattr(self, "editor", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.. defaults to "text" # noqa: E501 - name (str): The name of the Custom Field. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (str): A text string for text fields. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.. defaults to "text" # noqa: E501 - name (str): The name of the Custom Field. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (str): A text string for text fields. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_custom_field_type_enum.py b/sdks/python/dropbox_sign/model/signature_request_response_custom_field_type_enum.py deleted file mode 100644 index 5cd1755f4..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_custom_field_type_enum.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestResponseCustomFieldTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'TEXT': "text", - 'CHECKBOX': "checkbox", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseCustomFieldTypeEnum: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseCustomFieldTypeEnum], - _check_type=True, - ) - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """SignatureRequestResponseCustomFieldTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["text", "checkbox", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["text", "checkbox", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """SignatureRequestResponseCustomFieldTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["text", "checkbox", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["text", "checkbox", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_base.py b/sdks/python/dropbox_sign/model/signature_request_response_data_base.py deleted file mode 100644 index 78a0ffb69..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_base.py +++ /dev/null @@ -1,362 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import SignatureRequestResponseDataValueCheckbox - from dropbox_sign.models import SignatureRequestResponseDataValueCheckboxMerge - from dropbox_sign.models import SignatureRequestResponseDataValueDateSigned - from dropbox_sign.models import SignatureRequestResponseDataValueDropdown - from dropbox_sign.models import SignatureRequestResponseDataValueInitials - from dropbox_sign.models import SignatureRequestResponseDataValueRadio - from dropbox_sign.models import SignatureRequestResponseDataValueSignature - from dropbox_sign.models import SignatureRequestResponseDataValueText - from dropbox_sign.models import SignatureRequestResponseDataValueTextMerge - - -def lazy_import(): - from dropbox_sign.models import SignatureRequestResponseDataValueCheckbox - from dropbox_sign.models import SignatureRequestResponseDataValueCheckboxMerge - from dropbox_sign.models import SignatureRequestResponseDataValueDateSigned - from dropbox_sign.models import SignatureRequestResponseDataValueDropdown - from dropbox_sign.models import SignatureRequestResponseDataValueInitials - from dropbox_sign.models import SignatureRequestResponseDataValueRadio - from dropbox_sign.models import SignatureRequestResponseDataValueSignature - from dropbox_sign.models import SignatureRequestResponseDataValueText - from dropbox_sign.models import SignatureRequestResponseDataValueTextMerge - globals()['SignatureRequestResponseDataValueCheckbox'] = SignatureRequestResponseDataValueCheckbox - globals()['SignatureRequestResponseDataValueCheckboxMerge'] = SignatureRequestResponseDataValueCheckboxMerge - globals()['SignatureRequestResponseDataValueDateSigned'] = SignatureRequestResponseDataValueDateSigned - globals()['SignatureRequestResponseDataValueDropdown'] = SignatureRequestResponseDataValueDropdown - globals()['SignatureRequestResponseDataValueInitials'] = SignatureRequestResponseDataValueInitials - globals()['SignatureRequestResponseDataValueRadio'] = SignatureRequestResponseDataValueRadio - globals()['SignatureRequestResponseDataValueSignature'] = SignatureRequestResponseDataValueSignature - globals()['SignatureRequestResponseDataValueText'] = SignatureRequestResponseDataValueText - globals()['SignatureRequestResponseDataValueTextMerge'] = SignatureRequestResponseDataValueTextMerge - - -class SignatureRequestResponseDataBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': SignatureRequestResponseDataValueCheckbox, - 'checkbox-merge': SignatureRequestResponseDataValueCheckboxMerge, - 'date_signed': SignatureRequestResponseDataValueDateSigned, - 'dropdown': SignatureRequestResponseDataValueDropdown, - 'initials': SignatureRequestResponseDataValueInitials, - 'radio': SignatureRequestResponseDataValueRadio, - 'signature': SignatureRequestResponseDataValueSignature, - 'text': SignatureRequestResponseDataValueText, - 'text-merge': SignatureRequestResponseDataValueTextMerge, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - 'type': 'type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataBase - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataBase - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_type_enum.py b/sdks/python/dropbox_sign/model/signature_request_response_data_type_enum.py deleted file mode 100644 index 0e1e8ead4..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_type_enum.py +++ /dev/null @@ -1,310 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestResponseDataTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'TEXT': "text", - 'CHECKBOX': "checkbox", - 'DATE_SIGNED': "date_signed", - 'DROPDOWN': "dropdown", - 'INITIALS': "initials", - 'RADIO': "radio", - 'SIGNATURE': "signature", - 'TEXT-MERGE': "text-merge", - 'CHECKBOX-MERGE': "checkbox-merge", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataTypeEnum: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataTypeEnum], - _check_type=True, - ) - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """SignatureRequestResponseDataTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["text", "checkbox", "date_signed", "dropdown", "initials", "radio", "signature", "text-merge", "checkbox-merge", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["text", "checkbox", "date_signed", "dropdown", "initials", "radio", "signature", "text-merge", "checkbox-merge", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """SignatureRequestResponseDataTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["text", "checkbox", "date_signed", "dropdown", "initials", "radio", "signature", "text-merge", "checkbox-merge", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["text", "checkbox", "date_signed", "dropdown", "initials", "radio", "signature", "text-merge", "checkbox-merge", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_value_checkbox.py b/sdks/python/dropbox_sign/model/signature_request_response_data_value_checkbox.py deleted file mode 100644 index 92c8072be..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_value_checkbox.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> bool: - return self.get("value") - - @value.setter - def value(self, value: bool): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueCheckbox - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A yes/no checkbox. [optional] if omitted the server will use the default value of "checkbox" # noqa: E501 - value (bool): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueCheckbox - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A yes/no checkbox. [optional] if omitted the server will use the default value of "checkbox" # noqa: E501 - value (bool): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_value_checkbox_merge.py b/sdks/python/dropbox_sign/model/signature_request_response_data_value_checkbox_merge.py deleted file mode 100644 index 4ca142c68..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_value_checkbox_merge.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueCheckboxMerge(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueCheckboxMerge: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueCheckboxMerge], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueCheckboxMerge - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A checkbox field that has default value set by the api. [optional] if omitted the server will use the default value of "checkbox-merge" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueCheckboxMerge - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A checkbox field that has default value set by the api. [optional] if omitted the server will use the default value of "checkbox-merge" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_value_date_signed.py b/sdks/python/dropbox_sign/model/signature_request_response_data_value_date_signed.py deleted file mode 100644 index 542b950d2..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_value_date_signed.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueDateSigned(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueDateSigned: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueDateSigned], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueDateSigned - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A date. [optional] if omitted the server will use the default value of "date_signed" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueDateSigned - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A date. [optional] if omitted the server will use the default value of "date_signed" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_value_dropdown.py b/sdks/python/dropbox_sign/model/signature_request_response_data_value_dropdown.py deleted file mode 100644 index 1168e8f40..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_value_dropdown.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueDropdown(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueDropdown: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueDropdown], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueDropdown - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for dropdowns. [optional] if omitted the server will use the default value of "dropdown" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueDropdown - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for dropdowns. [optional] if omitted the server will use the default value of "dropdown" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_value_initials.py b/sdks/python/dropbox_sign/model/signature_request_response_data_value_initials.py deleted file mode 100644 index bbc7464f3..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_value_initials.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueInitials(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueInitials: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueInitials], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueInitials - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for initials. [optional] if omitted the server will use the default value of "initials" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueInitials - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for initials. [optional] if omitted the server will use the default value of "initials" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_value_radio.py b/sdks/python/dropbox_sign/model/signature_request_response_data_value_radio.py deleted file mode 100644 index 37dff05f4..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_value_radio.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueRadio(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueRadio: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueRadio], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> bool: - return self.get("value") - - @value.setter - def value(self, value: bool): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueRadio - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for radios. [optional] if omitted the server will use the default value of "radio" # noqa: E501 - value (bool): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueRadio - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for radios. [optional] if omitted the server will use the default value of "radio" # noqa: E501 - value (bool): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_value_signature.py b/sdks/python/dropbox_sign/model/signature_request_response_data_value_signature.py deleted file mode 100644 index afef513ba..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_value_signature.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueSignature(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueSignature: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueSignature], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueSignature - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A signature input field. [optional] if omitted the server will use the default value of "signature" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueSignature - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A signature input field. [optional] if omitted the server will use the default value of "signature" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_value_text.py b/sdks/python/dropbox_sign/model/signature_request_response_data_value_text.py deleted file mode 100644 index 7c2b13f35..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_value_text.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueText - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A text input field. [optional] if omitted the server will use the default value of "text" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueText - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A text input field. [optional] if omitted the server will use the default value of "text" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_data_value_text_merge.py b/sdks/python/dropbox_sign/model/signature_request_response_data_value_text_merge.py deleted file mode 100644 index 94deb01e3..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_data_value_text_merge.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueTextMerge(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueTextMerge: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueTextMerge], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueTextMerge - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A text field that has default text set by the api. [optional] if omitted the server will use the default value of "text-merge" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueTextMerge - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A text field that has default text set by the api. [optional] if omitted the server will use the default value of "text-merge" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/signature_request_response_signatures.py b/sdks/python/dropbox_sign/model/signature_request_response_signatures.py deleted file mode 100644 index e0f54cdb5..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_response_signatures.py +++ /dev/null @@ -1,499 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestResponseSignatures(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'signature_id': (str,), # noqa: E501 - 'signer_group_guid': (str, none_type,), # noqa: E501 - 'signer_email_address': (str,), # noqa: E501 - 'signer_name': (str, none_type,), # noqa: E501 - 'signer_role': (str, none_type,), # noqa: E501 - 'order': (int, none_type,), # noqa: E501 - 'status_code': (str,), # noqa: E501 - 'decline_reason': (str, none_type,), # noqa: E501 - 'signed_at': (int, none_type,), # noqa: E501 - 'last_viewed_at': (int, none_type,), # noqa: E501 - 'last_reminded_at': (int, none_type,), # noqa: E501 - 'has_pin': (bool,), # noqa: E501 - 'has_sms_auth': (bool, none_type,), # noqa: E501 - 'has_sms_delivery': (bool, none_type,), # noqa: E501 - 'sms_phone_number': (str, none_type,), # noqa: E501 - 'reassigned_by': (str, none_type,), # noqa: E501 - 'reassignment_reason': (str, none_type,), # noqa: E501 - 'reassigned_from': (str, none_type,), # noqa: E501 - 'error': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseSignatures: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseSignatures], - _check_type=True, - ) - - attribute_map = { - 'signature_id': 'signature_id', # noqa: E501 - 'signer_group_guid': 'signer_group_guid', # noqa: E501 - 'signer_email_address': 'signer_email_address', # noqa: E501 - 'signer_name': 'signer_name', # noqa: E501 - 'signer_role': 'signer_role', # noqa: E501 - 'order': 'order', # noqa: E501 - 'status_code': 'status_code', # noqa: E501 - 'decline_reason': 'decline_reason', # noqa: E501 - 'signed_at': 'signed_at', # noqa: E501 - 'last_viewed_at': 'last_viewed_at', # noqa: E501 - 'last_reminded_at': 'last_reminded_at', # noqa: E501 - 'has_pin': 'has_pin', # noqa: E501 - 'has_sms_auth': 'has_sms_auth', # noqa: E501 - 'has_sms_delivery': 'has_sms_delivery', # noqa: E501 - 'sms_phone_number': 'sms_phone_number', # noqa: E501 - 'reassigned_by': 'reassigned_by', # noqa: E501 - 'reassignment_reason': 'reassignment_reason', # noqa: E501 - 'reassigned_from': 'reassigned_from', # noqa: E501 - 'error': 'error', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def signer_group_guid(self) -> Optional[str]: - return self.get("signer_group_guid") - - @signer_group_guid.setter - def signer_group_guid(self, value: Optional[str]): - setattr(self, "signer_group_guid", value) - - @property - def signer_email_address(self) -> str: - return self.get("signer_email_address") - - @signer_email_address.setter - def signer_email_address(self, value: str): - setattr(self, "signer_email_address", value) - - @property - def signer_name(self) -> Optional[str]: - return self.get("signer_name") - - @signer_name.setter - def signer_name(self, value: Optional[str]): - setattr(self, "signer_name", value) - - @property - def signer_role(self) -> Optional[str]: - return self.get("signer_role") - - @signer_role.setter - def signer_role(self, value: Optional[str]): - setattr(self, "signer_role", value) - - @property - def order(self) -> Optional[int]: - return self.get("order") - - @order.setter - def order(self, value: Optional[int]): - setattr(self, "order", value) - - @property - def status_code(self) -> str: - return self.get("status_code") - - @status_code.setter - def status_code(self, value: str): - setattr(self, "status_code", value) - - @property - def decline_reason(self) -> Optional[str]: - return self.get("decline_reason") - - @decline_reason.setter - def decline_reason(self, value: Optional[str]): - setattr(self, "decline_reason", value) - - @property - def signed_at(self) -> Optional[int]: - return self.get("signed_at") - - @signed_at.setter - def signed_at(self, value: Optional[int]): - setattr(self, "signed_at", value) - - @property - def last_viewed_at(self) -> Optional[int]: - return self.get("last_viewed_at") - - @last_viewed_at.setter - def last_viewed_at(self, value: Optional[int]): - setattr(self, "last_viewed_at", value) - - @property - def last_reminded_at(self) -> Optional[int]: - return self.get("last_reminded_at") - - @last_reminded_at.setter - def last_reminded_at(self, value: Optional[int]): - setattr(self, "last_reminded_at", value) - - @property - def has_pin(self) -> bool: - return self.get("has_pin") - - @has_pin.setter - def has_pin(self, value: bool): - setattr(self, "has_pin", value) - - @property - def has_sms_auth(self) -> Optional[bool]: - return self.get("has_sms_auth") - - @has_sms_auth.setter - def has_sms_auth(self, value: Optional[bool]): - setattr(self, "has_sms_auth", value) - - @property - def has_sms_delivery(self) -> Optional[bool]: - return self.get("has_sms_delivery") - - @has_sms_delivery.setter - def has_sms_delivery(self, value: Optional[bool]): - setattr(self, "has_sms_delivery", value) - - @property - def sms_phone_number(self) -> Optional[str]: - return self.get("sms_phone_number") - - @sms_phone_number.setter - def sms_phone_number(self, value: Optional[str]): - setattr(self, "sms_phone_number", value) - - @property - def reassigned_by(self) -> Optional[str]: - return self.get("reassigned_by") - - @reassigned_by.setter - def reassigned_by(self, value: Optional[str]): - setattr(self, "reassigned_by", value) - - @property - def reassignment_reason(self) -> Optional[str]: - return self.get("reassignment_reason") - - @reassignment_reason.setter - def reassignment_reason(self, value: Optional[str]): - setattr(self, "reassignment_reason", value) - - @property - def reassigned_from(self) -> Optional[str]: - return self.get("reassigned_from") - - @reassigned_from.setter - def reassigned_from(self, value: Optional[str]): - setattr(self, "reassigned_from", value) - - @property - def error(self) -> Optional[str]: - return self.get("error") - - @error.setter - def error(self, value: Optional[str]): - setattr(self, "error", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseSignatures - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_id (str): Signature identifier.. [optional] # noqa: E501 - signer_group_guid (str, none_type): Signer Group GUID. [optional] # noqa: E501 - signer_email_address (str): The email address of the signer.. [optional] # noqa: E501 - signer_name (str, none_type): The name of the signer.. [optional] # noqa: E501 - signer_role (str, none_type): The role of the signer.. [optional] # noqa: E501 - order (int, none_type): If signer order is assigned this is the 0-based index for this signer.. [optional] # noqa: E501 - status_code (str): The current status of the signature. eg: awaiting_signature, signed, declined.. [optional] # noqa: E501 - decline_reason (str, none_type): The reason provided by the signer for declining the request.. [optional] # noqa: E501 - signed_at (int, none_type): Time that the document was signed or null.. [optional] # noqa: E501 - last_viewed_at (int, none_type): The time that the document was last viewed by this signer or null.. [optional] # noqa: E501 - last_reminded_at (int, none_type): The time the last reminder email was sent to the signer or null.. [optional] # noqa: E501 - has_pin (bool): Boolean to indicate whether this signature requires a PIN to access.. [optional] # noqa: E501 - has_sms_auth (bool, none_type): Boolean to indicate whether this signature has SMS authentication enabled.. [optional] # noqa: E501 - has_sms_delivery (bool, none_type): Boolean to indicate whether this signature has SMS delivery enabled.. [optional] # noqa: E501 - sms_phone_number (str, none_type): The SMS phone number used for authentication or signature request delivery.. [optional] # noqa: E501 - reassigned_by (str, none_type): Email address of original signer who reassigned to this signer.. [optional] # noqa: E501 - reassignment_reason (str, none_type): Reason provided by original signer who reassigned to this signer.. [optional] # noqa: E501 - reassigned_from (str, none_type): Previous signature identifier.. [optional] # noqa: E501 - error (str, none_type): Error message pertaining to this signer, or null.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseSignatures - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_id (str): Signature identifier.. [optional] # noqa: E501 - signer_group_guid (str, none_type): Signer Group GUID. [optional] # noqa: E501 - signer_email_address (str): The email address of the signer.. [optional] # noqa: E501 - signer_name (str, none_type): The name of the signer.. [optional] # noqa: E501 - signer_role (str, none_type): The role of the signer.. [optional] # noqa: E501 - order (int, none_type): If signer order is assigned this is the 0-based index for this signer.. [optional] # noqa: E501 - status_code (str): The current status of the signature. eg: awaiting_signature, signed, declined.. [optional] # noqa: E501 - decline_reason (str, none_type): The reason provided by the signer for declining the request.. [optional] # noqa: E501 - signed_at (int, none_type): Time that the document was signed or null.. [optional] # noqa: E501 - last_viewed_at (int, none_type): The time that the document was last viewed by this signer or null.. [optional] # noqa: E501 - last_reminded_at (int, none_type): The time the last reminder email was sent to the signer or null.. [optional] # noqa: E501 - has_pin (bool): Boolean to indicate whether this signature requires a PIN to access.. [optional] # noqa: E501 - has_sms_auth (bool, none_type): Boolean to indicate whether this signature has SMS authentication enabled.. [optional] # noqa: E501 - has_sms_delivery (bool, none_type): Boolean to indicate whether this signature has SMS delivery enabled.. [optional] # noqa: E501 - sms_phone_number (str, none_type): The SMS phone number used for authentication or signature request delivery.. [optional] # noqa: E501 - reassigned_by (str, none_type): Email address of original signer who reassigned to this signer.. [optional] # noqa: E501 - reassignment_reason (str, none_type): Reason provided by original signer who reassigned to this signer.. [optional] # noqa: E501 - reassigned_from (str, none_type): Previous signature identifier.. [optional] # noqa: E501 - error (str, none_type): Error message pertaining to this signer, or null.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_send_request.py b/sdks/python/dropbox_sign/model/signature_request_send_request.py deleted file mode 100644 index ae7860517..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_send_request.py +++ /dev/null @@ -1,626 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSignatureRequestGroupedSigners'] = SubSignatureRequestGroupedSigners - globals()['SubSignatureRequestSigner'] = SubSignatureRequestSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestSendRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestSigner],), # noqa: E501 - 'grouped_signers': ([SubSignatureRequestGroupedSigners],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'is_qualified_signature': (bool,), # noqa: E501 - 'is_eid': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestSendRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestSendRequest], - _check_type=True, - ) - - attribute_map = { - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'grouped_signers': 'grouped_signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'is_qualified_signature': 'is_qualified_signature', # noqa: E501 - 'is_eid': 'is_eid', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def signers(self) -> List[SubSignatureRequestSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestSigner]): - setattr(self, "signers", value) - - @property - def grouped_signers(self) -> List[SubSignatureRequestGroupedSigners]: - return self.get("grouped_signers") - - @grouped_signers.setter - def grouped_signers(self, value: List[SubSignatureRequestGroupedSigners]): - setattr(self, "grouped_signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def is_qualified_signature(self) -> bool: - return self.get("is_qualified_signature") - - @is_qualified_signature.setter - def is_qualified_signature(self, value: bool): - setattr(self, "is_qualified_signature", value) - - @property - def is_eid(self) -> bool: - return self.get("is_eid") - - @is_eid.setter - def is_eid(self, value: bool): - setattr(self, "is_eid", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestSendRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestSendRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_send_with_template_request.py b/sdks/python/dropbox_sign/model/signature_request_send_with_template_request.py deleted file mode 100644 index 63f38d491..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_send_with_template_request.py +++ /dev/null @@ -1,511 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - globals()['SubSignatureRequestTemplateSigner'] = SubSignatureRequestTemplateSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestSendWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestTemplateSigner],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'is_qualified_signature': (bool,), # noqa: E501 - 'is_eid': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestSendWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestSendWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'is_qualified_signature': 'is_qualified_signature', # noqa: E501 - 'is_eid': 'is_eid', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def signers(self) -> List[SubSignatureRequestTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestTemplateSigner]): - setattr(self, "signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def is_qualified_signature(self) -> bool: - return self.get("is_qualified_signature") - - @is_qualified_signature.setter - def is_qualified_signature(self, value: bool): - setattr(self, "is_qualified_signature", value) - - @property - def is_eid(self) -> bool: - return self.get("is_eid") - - @is_eid.setter - def is_eid(self, value: bool): - setattr(self, "is_eid", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestSendWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestSendWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/signature_request_update_request.py b/sdks/python/dropbox_sign/model/signature_request_update_request.py deleted file mode 100644 index 2b6f2a642..000000000 --- a/sdks/python/dropbox_sign/model/signature_request_update_request.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestUpdateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'signature_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestUpdateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestUpdateRequest], - _check_type=True, - ) - - attribute_map = { - 'signature_id': 'signature_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'name': 'name', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, signature_id, *args, **kwargs): # noqa: E501 - """SignatureRequestUpdateRequest - a model defined in OpenAPI - - Args: - signature_id (str): The signature ID for the recipient. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided.. [optional] # noqa: E501 - name (str): The new name for the recipient. **NOTE:** Optional if `email_address` is provided.. [optional] # noqa: E501 - expires_at (int, none_type): The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.signature_id = signature_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, signature_id, *args, **kwargs): # noqa: E501 - """SignatureRequestUpdateRequest - a model defined in OpenAPI - - Args: - signature_id (str): The signature ID for the recipient. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided.. [optional] # noqa: E501 - name (str): The new name for the recipient. **NOTE:** Optional if `email_address` is provided.. [optional] # noqa: E501 - expires_at (int, none_type): The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.signature_id = signature_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_attachment.py b/sdks/python/dropbox_sign/model/sub_attachment.py deleted file mode 100644 index 04ed80f51..000000000 --- a/sdks/python/dropbox_sign/model/sub_attachment.py +++ /dev/null @@ -1,327 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubAttachment(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'signer_index': (int,), # noqa: E501 - 'instructions': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubAttachment: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubAttachment], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'signer_index': 'signer_index', # noqa: E501 - 'instructions': 'instructions', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer_index(self) -> int: - return self.get("signer_index") - - @signer_index.setter - def signer_index(self, value: int): - setattr(self, "signer_index", value) - - @property - def instructions(self) -> str: - return self.get("instructions") - - @instructions.setter - def instructions(self, value: str): - setattr(self, "instructions", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, signer_index, *args, **kwargs): # noqa: E501 - """SubAttachment - a model defined in OpenAPI - - Args: - name (str): The name of attachment. - signer_index (int): The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - instructions (str): The instructions for uploading the attachment.. [optional] # noqa: E501 - required (bool): Determines if the attachment must be uploaded.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.signer_index = signer_index - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, signer_index, *args, **kwargs): # noqa: E501 - """SubAttachment - a model defined in OpenAPI - - Args: - name (str): The name of attachment. - signer_index (int): The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - instructions (str): The instructions for uploading the attachment.. [optional] # noqa: E501 - required (bool): Determines if the attachment must be uploaded.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.signer_index = signer_index - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_bulk_signer_list.py b/sdks/python/dropbox_sign/model/sub_bulk_signer_list.py deleted file mode 100644 index b4f515701..000000000 --- a/sdks/python/dropbox_sign/model/sub_bulk_signer_list.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - - -def lazy_import(): - from dropbox_sign.model.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - globals()['SubBulkSignerListCustomField'] = SubBulkSignerListCustomField - globals()['SubSignatureRequestTemplateSigner'] = SubSignatureRequestTemplateSigner - - -class SubBulkSignerList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'custom_fields': ([SubBulkSignerListCustomField],), # noqa: E501 - 'signers': ([SubSignatureRequestTemplateSigner],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubBulkSignerList: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubBulkSignerList], - _check_type=True, - ) - - attribute_map = { - 'custom_fields': 'custom_fields', # noqa: E501 - 'signers': 'signers', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def custom_fields(self) -> List[SubBulkSignerListCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubBulkSignerListCustomField]): - setattr(self, "custom_fields", value) - - @property - def signers(self) -> List[SubSignatureRequestTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestTemplateSigner]): - setattr(self, "signers", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubBulkSignerList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - custom_fields ([SubBulkSignerListCustomField]): An array of custom field values.. [optional] # noqa: E501 - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubBulkSignerList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - custom_fields ([SubBulkSignerListCustomField]): An array of custom field values.. [optional] # noqa: E501 - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_bulk_signer_list_custom_field.py b/sdks/python/dropbox_sign/model/sub_bulk_signer_list_custom_field.py deleted file mode 100644 index 994d55a67..000000000 --- a/sdks/python/dropbox_sign/model/sub_bulk_signer_list_custom_field.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubBulkSignerListCustomField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubBulkSignerListCustomField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubBulkSignerListCustomField], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'value': 'value', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, value, *args, **kwargs): # noqa: E501 - """SubBulkSignerListCustomField - a model defined in OpenAPI - - Args: - name (str): The name of the custom field. Must be the field's `name` or `api_id`. - value (str): The value of the custom field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.value = value - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, value, *args, **kwargs): # noqa: E501 - """SubBulkSignerListCustomField - a model defined in OpenAPI - - Args: - name (str): The name of the custom field. Must be the field's `name` or `api_id`. - value (str): The value of the custom field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.value = value - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_cc.py b/sdks/python/dropbox_sign/model/sub_cc.py deleted file mode 100644 index 80ffe2c0a..000000000 --- a/sdks/python/dropbox_sign/model/sub_cc.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubCC(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'role': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubCC: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubCC], - _check_type=True, - ) - - attribute_map = { - 'role': 'role', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, role, email_address, *args, **kwargs): # noqa: E501 - """SubCC - a model defined in OpenAPI - - Args: - role (str): Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. - email_address (str): The email address of the CC recipient. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, role, email_address, *args, **kwargs): # noqa: E501 - """SubCC - a model defined in OpenAPI - - Args: - role (str): Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. - email_address (str): The email address of the CC recipient. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_custom_field.py b/sdks/python/dropbox_sign/model/sub_custom_field.py deleted file mode 100644 index e6628eed5..000000000 --- a/sdks/python/dropbox_sign/model/sub_custom_field.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubCustomField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'editor': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'value': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubCustomField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubCustomField], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'editor': 'editor', # noqa: E501 - 'required': 'required', # noqa: E501 - 'value': 'value', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def editor(self) -> str: - return self.get("editor") - - @editor.setter - def editor(self, value: str): - setattr(self, "editor", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """SubCustomField - a model defined in OpenAPI - - Args: - name (str): The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - editor (str): Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable.. [optional] # noqa: E501 - required (bool): Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`.. [optional] if omitted the server will use the default value of False # noqa: E501 - value (str): The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """SubCustomField - a model defined in OpenAPI - - Args: - name (str): The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - editor (str): Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable.. [optional] # noqa: E501 - required (bool): Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`.. [optional] if omitted the server will use the default value of False # noqa: E501 - value (str): The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_editor_options.py b/sdks/python/dropbox_sign/model/sub_editor_options.py deleted file mode 100644 index 0667a7a1c..000000000 --- a/sdks/python/dropbox_sign/model/sub_editor_options.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubEditorOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'allow_edit_signers': (bool,), # noqa: E501 - 'allow_edit_documents': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubEditorOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubEditorOptions], - _check_type=True, - ) - - attribute_map = { - 'allow_edit_signers': 'allow_edit_signers', # noqa: E501 - 'allow_edit_documents': 'allow_edit_documents', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def allow_edit_signers(self) -> bool: - return self.get("allow_edit_signers") - - @allow_edit_signers.setter - def allow_edit_signers(self, value: bool): - setattr(self, "allow_edit_signers", value) - - @property - def allow_edit_documents(self) -> bool: - return self.get("allow_edit_documents") - - @allow_edit_documents.setter - def allow_edit_documents(self, value: bool): - setattr(self, "allow_edit_documents", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubEditorOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_edit_signers (bool): Allows requesters to edit the list of signers. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_edit_documents (bool): Allows requesters to edit documents, including delete and add. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubEditorOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_edit_signers (bool): Allows requesters to edit the list of signers. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_edit_documents (bool): Allows requesters to edit documents, including delete and add. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_field_options.py b/sdks/python/dropbox_sign/model/sub_field_options.py deleted file mode 100644 index 39b35c4c1..000000000 --- a/sdks/python/dropbox_sign/model/sub_field_options.py +++ /dev/null @@ -1,297 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFieldOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('date_format',): { - 'MMDDYYYY': "MM / DD / YYYY", - 'MM_DD_YYYY': "MM - DD - YYYY", - 'DDMMYYYY': "DD / MM / YYYY", - 'DD_MM_YYYY': "DD - MM - YYYY", - 'YYYYMMDD': "YYYY / MM / DD", - 'YYYY_MM_DD': "YYYY - MM - DD", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'date_format': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFieldOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFieldOptions], - _check_type=True, - ) - - attribute_map = { - 'date_format': 'date_format', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def date_format(self) -> str: - return self.get("date_format") - - @date_format.setter - def date_format(self, value: str): - setattr(self, "date_format", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, date_format, *args, **kwargs): # noqa: E501 - """SubFieldOptions - a model defined in OpenAPI - - Args: - date_format (str): Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.date_format = date_format - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, date_format, *args, **kwargs): # noqa: E501 - """SubFieldOptions - a model defined in OpenAPI - - Args: - date_format (str): Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.date_format = date_format - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_form_field_group.py b/sdks/python/dropbox_sign/model/sub_form_field_group.py deleted file mode 100644 index eee79a80a..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_field_group.py +++ /dev/null @@ -1,317 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFormFieldGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'group_id': (str,), # noqa: E501 - 'group_label': (str,), # noqa: E501 - 'requirement': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldGroup: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldGroup], - _check_type=True, - ) - - attribute_map = { - 'group_id': 'group_id', # noqa: E501 - 'group_label': 'group_label', # noqa: E501 - 'requirement': 'requirement', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def group_id(self) -> str: - return self.get("group_id") - - @group_id.setter - def group_id(self, value: str): - setattr(self, "group_id", value) - - @property - def group_label(self) -> str: - return self.get("group_label") - - @group_label.setter - def group_label(self, value: str): - setattr(self, "group_label", value) - - @property - def requirement(self) -> str: - return self.get("requirement") - - @requirement.setter - def requirement(self, value: str): - setattr(self, "requirement", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, group_id, group_label, requirement, *args, **kwargs): # noqa: E501 - """SubFormFieldGroup - a model defined in OpenAPI - - Args: - group_id (str): ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. - group_label (str): Name of the group - requirement (str): Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.group_id = group_id - self.group_label = group_label - self.requirement = requirement - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, group_id, group_label, requirement, *args, **kwargs): # noqa: E501 - """SubFormFieldGroup - a model defined in OpenAPI - - Args: - group_id (str): ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. - group_label (str): Name of the group - requirement (str): Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.group_id = group_id - self.group_label = group_label - self.requirement = requirement - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_form_field_rule.py b/sdks/python/dropbox_sign/model/sub_form_field_rule.py deleted file mode 100644 index 6b3833cea..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_field_rule.py +++ /dev/null @@ -1,351 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_field_rule_action import SubFormFieldRuleAction - from dropbox_sign.model.sub_form_field_rule_trigger import SubFormFieldRuleTrigger - - -def lazy_import(): - from dropbox_sign.model.sub_form_field_rule_action import SubFormFieldRuleAction - from dropbox_sign.model.sub_form_field_rule_trigger import SubFormFieldRuleTrigger - globals()['SubFormFieldRuleAction'] = SubFormFieldRuleAction - globals()['SubFormFieldRuleTrigger'] = SubFormFieldRuleTrigger - - -class SubFormFieldRule(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('triggers',): { - 'max_items': 1, - 'min_items': 1, - }, - ('actions',): { - 'min_items': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'id': (str,), # noqa: E501 - 'trigger_operator': (str,), # noqa: E501 - 'triggers': ([SubFormFieldRuleTrigger],), # noqa: E501 - 'actions': ([SubFormFieldRuleAction],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldRule: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldRule], - _check_type=True, - ) - - attribute_map = { - 'id': 'id', # noqa: E501 - 'trigger_operator': 'trigger_operator', # noqa: E501 - 'triggers': 'triggers', # noqa: E501 - 'actions': 'actions', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def id(self) -> str: - return self.get("id") - - @id.setter - def id(self, value: str): - setattr(self, "id", value) - - @property - def trigger_operator(self) -> str: - return self.get("trigger_operator") - - @trigger_operator.setter - def trigger_operator(self, value: str): - setattr(self, "trigger_operator", value) - - @property - def triggers(self) -> List[SubFormFieldRuleTrigger]: - return self.get("triggers") - - @triggers.setter - def triggers(self, value: List[SubFormFieldRuleTrigger]): - setattr(self, "triggers", value) - - @property - def actions(self) -> List[SubFormFieldRuleAction]: - return self.get("actions") - - @actions.setter - def actions(self, value: List[SubFormFieldRuleAction]): - setattr(self, "actions", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, id, triggers, actions, *args, **kwargs): # noqa: E501 - """SubFormFieldRule - a model defined in OpenAPI - - Args: - id (str): Must be unique across all defined rules. - triggers ([SubFormFieldRuleTrigger]): An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. - actions ([SubFormFieldRuleAction]): An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule. - - Keyword Args: - trigger_operator (str): Currently only `AND` is supported. Support for `OR` is being worked on.. defaults to "AND" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - trigger_operator = kwargs.get('trigger_operator', "AND") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.trigger_operator = trigger_operator - self.triggers = triggers - self.actions = actions - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, id, triggers, actions, *args, **kwargs): # noqa: E501 - """SubFormFieldRule - a model defined in OpenAPI - - Args: - id (str): Must be unique across all defined rules. - triggers ([SubFormFieldRuleTrigger]): An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. - actions ([SubFormFieldRuleAction]): An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule. - - Keyword Args: - trigger_operator (str): Currently only `AND` is supported. Support for `OR` is being worked on.. defaults to "AND" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - trigger_operator = kwargs.get('trigger_operator', "AND") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.trigger_operator = trigger_operator - self.triggers = triggers - self.actions = actions - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_form_field_rule_action.py b/sdks/python/dropbox_sign/model/sub_form_field_rule_action.py deleted file mode 100644 index d3b0845c0..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_field_rule_action.py +++ /dev/null @@ -1,331 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFormFieldRuleAction(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'FIELD-VISIBILITY': "change-field-visibility", - 'GROUP-VISIBILITY': "change-group-visibility", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'hidden': (bool,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'field_id': (str,), # noqa: E501 - 'group_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldRuleAction: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldRuleAction], - _check_type=True, - ) - - attribute_map = { - 'hidden': 'hidden', # noqa: E501 - 'type': 'type', # noqa: E501 - 'field_id': 'field_id', # noqa: E501 - 'group_id': 'group_id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def hidden(self) -> bool: - return self.get("hidden") - - @hidden.setter - def hidden(self, value: bool): - setattr(self, "hidden", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def field_id(self) -> str: - return self.get("field_id") - - @field_id.setter - def field_id(self, value: str): - setattr(self, "field_id", value) - - @property - def group_id(self) -> str: - return self.get("group_id") - - @group_id.setter - def group_id(self, value: str): - setattr(self, "group_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, hidden, type, *args, **kwargs): # noqa: E501 - """SubFormFieldRuleAction - a model defined in OpenAPI - - Args: - hidden (bool): `true` to hide the target field when rule is satisfied, otherwise `false`. - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - field_id (str): **field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer.. [optional] # noqa: E501 - group_id (str): **group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.hidden = hidden - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, hidden, type, *args, **kwargs): # noqa: E501 - """SubFormFieldRuleAction - a model defined in OpenAPI - - Args: - hidden (bool): `true` to hide the target field when rule is satisfied, otherwise `false`. - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - field_id (str): **field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer.. [optional] # noqa: E501 - group_id (str): **group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.hidden = hidden - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_form_field_rule_trigger.py b/sdks/python/dropbox_sign/model/sub_form_field_rule_trigger.py deleted file mode 100644 index 73e918e91..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_field_rule_trigger.py +++ /dev/null @@ -1,334 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFormFieldRuleTrigger(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('operator',): { - 'ANY': "any", - 'IS': "is", - 'MATCH': "match", - 'NONE': "none", - 'NOT': "not", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (str,), # noqa: E501 - 'operator': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'values': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldRuleTrigger: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldRuleTrigger], - _check_type=True, - ) - - attribute_map = { - 'id': 'id', # noqa: E501 - 'operator': 'operator', # noqa: E501 - 'value': 'value', # noqa: E501 - 'values': 'values', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def id(self) -> str: - return self.get("id") - - @id.setter - def id(self, value: str): - setattr(self, "id", value) - - @property - def operator(self) -> str: - return self.get("operator") - - @operator.setter - def operator(self, value: str): - setattr(self, "operator", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def values(self) -> List[str]: - return self.get("values") - - @values.setter - def values(self, value: List[str]): - setattr(self, "values", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, id, operator, *args, **kwargs): # noqa: E501 - """SubFormFieldRuleTrigger - a model defined in OpenAPI - - Args: - id (str): Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. - operator (str): Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (str): **value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1`. [optional] # noqa: E501 - values ([str]): **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.operator = operator - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, id, operator, *args, **kwargs): # noqa: E501 - """SubFormFieldRuleTrigger - a model defined in OpenAPI - - Args: - id (str): Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. - operator (str): Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (str): **value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1`. [optional] # noqa: E501 - values ([str]): **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.operator = operator - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_base.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_base.py deleted file mode 100644 index 405e8fad8..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_base.py +++ /dev/null @@ -1,460 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import SubFormFieldsPerDocumentCheckbox - from dropbox_sign.models import SubFormFieldsPerDocumentCheckboxMerge - from dropbox_sign.models import SubFormFieldsPerDocumentDateSigned - from dropbox_sign.models import SubFormFieldsPerDocumentDropdown - from dropbox_sign.models import SubFormFieldsPerDocumentHyperlink - from dropbox_sign.models import SubFormFieldsPerDocumentInitials - from dropbox_sign.models import SubFormFieldsPerDocumentRadio - from dropbox_sign.models import SubFormFieldsPerDocumentSignature - from dropbox_sign.models import SubFormFieldsPerDocumentText - from dropbox_sign.models import SubFormFieldsPerDocumentTextMerge - - -def lazy_import(): - from dropbox_sign.models import SubFormFieldsPerDocumentCheckbox - from dropbox_sign.models import SubFormFieldsPerDocumentCheckboxMerge - from dropbox_sign.models import SubFormFieldsPerDocumentDateSigned - from dropbox_sign.models import SubFormFieldsPerDocumentDropdown - from dropbox_sign.models import SubFormFieldsPerDocumentHyperlink - from dropbox_sign.models import SubFormFieldsPerDocumentInitials - from dropbox_sign.models import SubFormFieldsPerDocumentRadio - from dropbox_sign.models import SubFormFieldsPerDocumentSignature - from dropbox_sign.models import SubFormFieldsPerDocumentText - from dropbox_sign.models import SubFormFieldsPerDocumentTextMerge - globals()['SubFormFieldsPerDocumentCheckbox'] = SubFormFieldsPerDocumentCheckbox - globals()['SubFormFieldsPerDocumentCheckboxMerge'] = SubFormFieldsPerDocumentCheckboxMerge - globals()['SubFormFieldsPerDocumentDateSigned'] = SubFormFieldsPerDocumentDateSigned - globals()['SubFormFieldsPerDocumentDropdown'] = SubFormFieldsPerDocumentDropdown - globals()['SubFormFieldsPerDocumentHyperlink'] = SubFormFieldsPerDocumentHyperlink - globals()['SubFormFieldsPerDocumentInitials'] = SubFormFieldsPerDocumentInitials - globals()['SubFormFieldsPerDocumentRadio'] = SubFormFieldsPerDocumentRadio - globals()['SubFormFieldsPerDocumentSignature'] = SubFormFieldsPerDocumentSignature - globals()['SubFormFieldsPerDocumentText'] = SubFormFieldsPerDocumentText - globals()['SubFormFieldsPerDocumentTextMerge'] = SubFormFieldsPerDocumentTextMerge - - -class SubFormFieldsPerDocumentBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': SubFormFieldsPerDocumentCheckbox, - 'checkbox-merge': SubFormFieldsPerDocumentCheckboxMerge, - 'date_signed': SubFormFieldsPerDocumentDateSigned, - 'dropdown': SubFormFieldsPerDocumentDropdown, - 'hyperlink': SubFormFieldsPerDocumentHyperlink, - 'initials': SubFormFieldsPerDocumentInitials, - 'radio': SubFormFieldsPerDocumentRadio, - 'signature': SubFormFieldsPerDocumentSignature, - 'text': SubFormFieldsPerDocumentText, - 'text-merge': SubFormFieldsPerDocumentTextMerge, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'type': 'type', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, document_index, api_id, height, required, signer, type, width, x, y, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentBase - a model defined in OpenAPI - - Args: - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - type (str): - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.document_index = document_index - self.api_id = api_id - self.height = height - self.required = required - self.signer = signer - self.type = type - self.width = width - self.x = x - self.y = y - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, document_index, api_id, height, required, signer, type, width, x, y, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentBase - a model defined in OpenAPI - - Args: - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - type (str): - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.document_index = document_index - self.api_id = api_id - self.height = height - self.required = required - self.signer = signer - self.type = type - self.width = width - self.x = x - self.y = y - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_checkbox.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_checkbox.py deleted file mode 100644 index 8430d4ab2..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_checkbox.py +++ /dev/null @@ -1,485 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'is_checked': (bool,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'group': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'is_checked': 'is_checked', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'group': 'group', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def is_checked(self) -> bool: - return self.get("is_checked") - - @is_checked.setter - def is_checked(self, value: bool): - setattr(self, "is_checked", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def group(self) -> str: - return self.get("group") - - @group.setter - def group(self, value: str): - setattr(self, "group", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class.. defaults to "checkbox" # noqa: E501 - is_checked (bool): `true` for checking the checkbox field by default, otherwise `false`. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - group (str): String referencing group defined in `form_field_groups` parameter.. [optional] # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class.. defaults to "checkbox" # noqa: E501 - is_checked (bool): `true` for checking the checkbox field by default, otherwise `false`. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - group (str): String referencing group defined in `form_field_groups` parameter.. [optional] # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_checkbox_merge.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_checkbox_merge.py deleted file mode 100644 index 29263c0fc..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_checkbox_merge.py +++ /dev/null @@ -1,461 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentCheckboxMerge(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentCheckboxMerge: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentCheckboxMerge], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentCheckboxMerge - a model defined in OpenAPI - - Keyword Args: - type (str): A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class.. defaults to "checkbox-merge" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox-merge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentCheckboxMerge - a model defined in OpenAPI - - Keyword Args: - type (str): A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class.. defaults to "checkbox-merge" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox-merge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_date_signed.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_date_signed.py deleted file mode 100644 index ec103c3e8..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_date_signed.py +++ /dev/null @@ -1,503 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentDateSigned(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('font_family',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'font_size': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentDateSigned: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentDateSigned], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'font_family': 'font_family', # noqa: E501 - 'font_size': 'font_size', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def font_size(self) -> int: - return self.get("font_size") - - @font_size.setter - def font_size(self, value: int): - setattr(self, "font_size", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): A date. Use the `SubFormFieldsPerDocumentDateSigned` class.. defaults to "date_signed" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): A date. Use the `SubFormFieldsPerDocumentDateSigned` class.. defaults to "date_signed" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_dropdown.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_dropdown.py deleted file mode 100644 index 589f3b5fe..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_dropdown.py +++ /dev/null @@ -1,530 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentDropdown(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('font_family',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - ('options',): { - 'min_items': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'options': ([str],), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'content': (str,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'font_size': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentDropdown: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentDropdown], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'options': 'options', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'content': 'content', # noqa: E501 - 'font_family': 'font_family', # noqa: E501 - 'font_size': 'font_size', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def options(self) -> List[str]: - return self.get("options") - - @options.setter - def options(self, value: List[str]): - setattr(self, "options", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def content(self) -> str: - return self.get("content") - - @content.setter - def content(self, value: str): - setattr(self, "content", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def font_size(self) -> int: - return self.get("font_size") - - @font_size.setter - def font_size(self, value: int): - setattr(self, "font_size", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class.. defaults to "dropdown" # noqa: E501 - options ([str]): Array of string values representing dropdown values. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - content (str): Selected value in `options` array. Value must exist in array.. [optional] # noqa: E501 - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class.. defaults to "dropdown" # noqa: E501 - options ([str]): Array of string values representing dropdown values. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - content (str): Selected value in `options` array. Value must exist in array.. [optional] # noqa: E501 - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_font_enum.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_font_enum.py deleted file mode 100644 index 5cb12da80..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_font_enum.py +++ /dev/null @@ -1,317 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFormFieldsPerDocumentFontEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentFontEnum: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentFontEnum], - _check_type=True, - ) - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """SubFormFieldsPerDocumentFontEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """SubFormFieldsPerDocumentFontEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_hyperlink.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_hyperlink.py deleted file mode 100644 index 0de905f32..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_hyperlink.py +++ /dev/null @@ -1,527 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentHyperlink(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('font_family',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'content': (str,), # noqa: E501 - 'content_url': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'font_size': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentHyperlink: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentHyperlink], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'content': 'content', # noqa: E501 - 'content_url': 'content_url', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'font_family': 'font_family', # noqa: E501 - 'font_size': 'font_size', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def content(self) -> str: - return self.get("content") - - @content.setter - def content(self, value: str): - setattr(self, "content", value) - - @property - def content_url(self) -> str: - return self.get("content_url") - - @content_url.setter - def content_url(self, value: str): - setattr(self, "content_url", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def font_size(self) -> int: - return self.get("font_size") - - @font_size.setter - def font_size(self, value: int): - setattr(self, "font_size", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class.. defaults to "hyperlink" # noqa: E501 - content (str): Link Text. - content_url (str): Link URL. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class.. defaults to "hyperlink" # noqa: E501 - content (str): Link Text. - content_url (str): Link URL. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_initials.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_initials.py deleted file mode 100644 index 174ac3d3a..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_initials.py +++ /dev/null @@ -1,461 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentInitials(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentInitials: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentInitials], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentInitials - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class.. defaults to "initials" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentInitials - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class.. defaults to "initials" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_radio.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_radio.py deleted file mode 100644 index 8ba630df8..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_radio.py +++ /dev/null @@ -1,485 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentRadio(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'group': (str,), # noqa: E501 - 'is_checked': (bool,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentRadio: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentRadio], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'group': 'group', # noqa: E501 - 'is_checked': 'is_checked', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def group(self) -> str: - return self.get("group") - - @group.setter - def group(self, value: str): - setattr(self, "group", value) - - @property - def is_checked(self) -> bool: - return self.get("is_checked") - - @is_checked.setter - def is_checked(self, value: bool): - setattr(self, "is_checked", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentRadio - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class.. defaults to "radio" # noqa: E501 - group (str): String referencing group defined in `form_field_groups` parameter. - is_checked (bool): `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentRadio - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class.. defaults to "radio" # noqa: E501 - group (str): String referencing group defined in `form_field_groups` parameter. - is_checked (bool): `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_signature.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_signature.py deleted file mode 100644 index 6eb9fd37e..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_signature.py +++ /dev/null @@ -1,461 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentSignature(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentSignature: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentSignature], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentSignature - a model defined in OpenAPI - - Keyword Args: - type (str): A signature input field. Use the `SubFormFieldsPerDocumentSignature` class.. defaults to "signature" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentSignature - a model defined in OpenAPI - - Keyword Args: - type (str): A signature input field. Use the `SubFormFieldsPerDocumentSignature` class.. defaults to "signature" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_text.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_text.py deleted file mode 100644 index 41dc9134d..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_text.py +++ /dev/null @@ -1,611 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('validation_type',): { - 'NUMBERS_ONLY': "numbers_only", - 'LETTERS_ONLY': "letters_only", - 'PHONE_NUMBER': "phone_number", - 'BANK_ROUTING_NUMBER': "bank_routing_number", - 'BANK_ACCOUNT_NUMBER': "bank_account_number", - 'EMAIL_ADDRESS': "email_address", - 'ZIP_CODE': "zip_code", - 'SOCIAL_SECURITY_NUMBER': "social_security_number", - 'EMPLOYER_IDENTIFICATION_NUMBER': "employer_identification_number", - 'CUSTOM_REGEX': "custom_regex", - }, - ('font_family',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'placeholder': (str,), # noqa: E501 - 'auto_fill_type': (str,), # noqa: E501 - 'link_id': (str,), # noqa: E501 - 'masked': (bool,), # noqa: E501 - 'validation_type': (str,), # noqa: E501 - 'validation_custom_regex': (str,), # noqa: E501 - 'validation_custom_regex_format_label': (str,), # noqa: E501 - 'content': (str,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'font_size': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'placeholder': 'placeholder', # noqa: E501 - 'auto_fill_type': 'auto_fill_type', # noqa: E501 - 'link_id': 'link_id', # noqa: E501 - 'masked': 'masked', # noqa: E501 - 'validation_type': 'validation_type', # noqa: E501 - 'validation_custom_regex': 'validation_custom_regex', # noqa: E501 - 'validation_custom_regex_format_label': 'validation_custom_regex_format_label', # noqa: E501 - 'content': 'content', # noqa: E501 - 'font_family': 'font_family', # noqa: E501 - 'font_size': 'font_size', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def placeholder(self) -> str: - return self.get("placeholder") - - @placeholder.setter - def placeholder(self, value: str): - setattr(self, "placeholder", value) - - @property - def auto_fill_type(self) -> str: - return self.get("auto_fill_type") - - @auto_fill_type.setter - def auto_fill_type(self, value: str): - setattr(self, "auto_fill_type", value) - - @property - def link_id(self) -> str: - return self.get("link_id") - - @link_id.setter - def link_id(self, value: str): - setattr(self, "link_id", value) - - @property - def masked(self) -> bool: - return self.get("masked") - - @masked.setter - def masked(self, value: bool): - setattr(self, "masked", value) - - @property - def validation_type(self) -> str: - return self.get("validation_type") - - @validation_type.setter - def validation_type(self, value: str): - setattr(self, "validation_type", value) - - @property - def validation_custom_regex(self) -> str: - return self.get("validation_custom_regex") - - @validation_custom_regex.setter - def validation_custom_regex(self, value: str): - setattr(self, "validation_custom_regex", value) - - @property - def validation_custom_regex_format_label(self) -> str: - return self.get("validation_custom_regex_format_label") - - @validation_custom_regex_format_label.setter - def validation_custom_regex_format_label(self, value: str): - setattr(self, "validation_custom_regex_format_label", value) - - @property - def content(self) -> str: - return self.get("content") - - @content.setter - def content(self, value: str): - setattr(self, "content", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def font_size(self) -> int: - return self.get("font_size") - - @font_size.setter - def font_size(self, value: int): - setattr(self, "font_size", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentText - a model defined in OpenAPI - - Keyword Args: - type (str): A text input field. Use the `SubFormFieldsPerDocumentText` class.. defaults to "text" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - placeholder (str): Placeholder value for text field.. [optional] # noqa: E501 - auto_fill_type (str): Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values.. [optional] # noqa: E501 - link_id (str): Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields.. [optional] # noqa: E501 - masked (bool): Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`.. [optional] # noqa: E501 - validation_type (str): Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value.. [optional] # noqa: E501 - validation_custom_regex (str): [optional] # noqa: E501 - validation_custom_regex_format_label (str): [optional] # noqa: E501 - content (str): Content of a `me_now` text field. [optional] # noqa: E501 - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentText - a model defined in OpenAPI - - Keyword Args: - type (str): A text input field. Use the `SubFormFieldsPerDocumentText` class.. defaults to "text" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - placeholder (str): Placeholder value for text field.. [optional] # noqa: E501 - auto_fill_type (str): Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values.. [optional] # noqa: E501 - link_id (str): Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields.. [optional] # noqa: E501 - masked (bool): Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`.. [optional] # noqa: E501 - validation_type (str): Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value.. [optional] # noqa: E501 - validation_custom_regex (str): [optional] # noqa: E501 - validation_custom_regex_format_label (str): [optional] # noqa: E501 - content (str): Content of a `me_now` text field. [optional] # noqa: E501 - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_text_merge.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_text_merge.py deleted file mode 100644 index 28c1bdcf4..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_text_merge.py +++ /dev/null @@ -1,503 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentTextMerge(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('font_family',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'font_size': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentTextMerge: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentTextMerge], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'font_family': 'font_family', # noqa: E501 - 'font_size': 'font_size', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def font_size(self) -> int: - return self.get("font_size") - - @font_size.setter - def font_size(self, value: int): - setattr(self, "font_size", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentTextMerge - a model defined in OpenAPI - - Keyword Args: - type (str): A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class.. defaults to "text-merge" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text-merge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentTextMerge - a model defined in OpenAPI - - Keyword Args: - type (str): A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class.. defaults to "text-merge" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text-merge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_type_enum.py b/sdks/python/dropbox_sign/model/sub_form_fields_per_document_type_enum.py deleted file mode 100644 index 163d05240..000000000 --- a/sdks/python/dropbox_sign/model/sub_form_fields_per_document_type_enum.py +++ /dev/null @@ -1,311 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFormFieldsPerDocumentTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'CHECKBOX': "checkbox", - 'CHECKBOX-MERGE': "checkbox-merge", - 'DATE_SIGNED': "date_signed", - 'DROPDOWN': "dropdown", - 'HYPERLINK': "hyperlink", - 'INITIALS': "initials", - 'SIGNATURE': "signature", - 'RADIO': "radio", - 'TEXT': "text", - 'TEXT-MERGE': "text-merge", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentTypeEnum: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentTypeEnum], - _check_type=True, - ) - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """SubFormFieldsPerDocumentTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["checkbox", "checkbox-merge", "date_signed", "dropdown", "hyperlink", "initials", "signature", "radio", "text", "text-merge", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["checkbox", "checkbox-merge", "date_signed", "dropdown", "hyperlink", "initials", "signature", "radio", "text", "text-merge", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """SubFormFieldsPerDocumentTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["checkbox", "checkbox-merge", "date_signed", "dropdown", "hyperlink", "initials", "signature", "radio", "text", "text-merge", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["checkbox", "checkbox-merge", "date_signed", "dropdown", "hyperlink", "initials", "signature", "radio", "text", "text-merge", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/sdks/python/dropbox_sign/model/sub_merge_field.py b/sdks/python/dropbox_sign/model/sub_merge_field.py deleted file mode 100644 index efe798b4d..000000000 --- a/sdks/python/dropbox_sign/model/sub_merge_field.py +++ /dev/null @@ -1,307 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubMergeField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TEXT': "text", - 'CHECKBOX': "checkbox", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubMergeField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubMergeField], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'type': 'type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, type, *args, **kwargs): # noqa: E501 - """SubMergeField - a model defined in OpenAPI - - Args: - name (str): The name of the merge field. Must be unique. - type (str): The type of merge field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, type, *args, **kwargs): # noqa: E501 - """SubMergeField - a model defined in OpenAPI - - Args: - name (str): The name of the merge field. Must be unique. - type (str): The type of merge field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_o_auth.py b/sdks/python/dropbox_sign/model/sub_o_auth.py deleted file mode 100644 index bbcf95a62..000000000 --- a/sdks/python/dropbox_sign/model/sub_o_auth.py +++ /dev/null @@ -1,305 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubOAuth(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('scopes',): { - 'REQUEST_SIGNATURE': "request_signature", - 'BASIC_ACCOUNT_INFO': "basic_account_info", - 'ACCOUNT_ACCESS': "account_access", - 'SIGNATURE_REQUEST_ACCESS': "signature_request_access", - 'TEMPLATE_ACCESS': "template_access", - 'TEAM_ACCESS': "team_access", - 'API_APP_ACCESS': "api_app_access", - 'EMPTY': "", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'callback_url': (str,), # noqa: E501 - 'scopes': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubOAuth: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubOAuth], - _check_type=True, - ) - - attribute_map = { - 'callback_url': 'callback_url', # noqa: E501 - 'scopes': 'scopes', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def callback_url(self) -> str: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: str): - setattr(self, "callback_url", value) - - @property - def scopes(self) -> List[str]: - return self.get("scopes") - - @scopes.setter - def scopes(self, value: List[str]): - setattr(self, "scopes", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubOAuth - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided). [optional] # noqa: E501 - scopes ([str]): A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubOAuth - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided). [optional] # noqa: E501 - scopes ([str]): A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_options.py b/sdks/python/dropbox_sign/model/sub_options.py deleted file mode 100644 index 459b44a9a..000000000 --- a/sdks/python/dropbox_sign/model/sub_options.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'can_insert_everywhere': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubOptions], - _check_type=True, - ) - - attribute_map = { - 'can_insert_everywhere': 'can_insert_everywhere', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def can_insert_everywhere(self) -> bool: - return self.get("can_insert_everywhere") - - @can_insert_everywhere.setter - def can_insert_everywhere(self, value: bool): - setattr(self, "can_insert_everywhere", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - can_insert_everywhere (bool): Determines if signers can use \"Insert Everywhere\" when signing a document.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - can_insert_everywhere (bool): Determines if signers can use \"Insert Everywhere\" when signing a document.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_signature_request_grouped_signers.py b/sdks/python/dropbox_sign/model/sub_signature_request_grouped_signers.py deleted file mode 100644 index 168ed3273..000000000 --- a/sdks/python/dropbox_sign/model/sub_signature_request_grouped_signers.py +++ /dev/null @@ -1,323 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - - -def lazy_import(): - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - globals()['SubSignatureRequestSigner'] = SubSignatureRequestSigner - - -class SubSignatureRequestGroupedSigners(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'group': (str,), # noqa: E501 - 'signers': ([SubSignatureRequestSigner],), # noqa: E501 - 'order': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubSignatureRequestGroupedSigners: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubSignatureRequestGroupedSigners], - _check_type=True, - ) - - attribute_map = { - 'group': 'group', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'order': 'order', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def group(self) -> str: - return self.get("group") - - @group.setter - def group(self, value: str): - setattr(self, "group", value) - - @property - def signers(self) -> List[SubSignatureRequestSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestSigner]): - setattr(self, "signers", value) - - @property - def order(self) -> Optional[int]: - return self.get("order") - - @order.setter - def order(self, value: Optional[int]): - setattr(self, "order", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, group, signers, *args, **kwargs): # noqa: E501 - """SubSignatureRequestGroupedSigners - a model defined in OpenAPI - - Args: - group (str): The name of the group. - signers ([SubSignatureRequestSigner]): Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the group is required to sign in. Use this instead of Signer-level `order`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.group = group - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, group, signers, *args, **kwargs): # noqa: E501 - """SubSignatureRequestGroupedSigners - a model defined in OpenAPI - - Args: - group (str): The name of the group. - signers ([SubSignatureRequestSigner]): Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the group is required to sign in. Use this instead of Signer-level `order`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.group = group - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_signature_request_signer.py b/sdks/python/dropbox_sign/model/sub_signature_request_signer.py deleted file mode 100644 index 71ffb82f2..000000000 --- a/sdks/python/dropbox_sign/model/sub_signature_request_signer.py +++ /dev/null @@ -1,359 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubSignatureRequestSigner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('sms_phone_number_type',): { - 'AUTHENTICATION': "authentication", - 'DELIVERY': "delivery", - }, - } - - validations = { - ('pin',): { - 'max_length': 12, - 'min_length': 4, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'order': (int, none_type,), # noqa: E501 - 'pin': (str,), # noqa: E501 - 'sms_phone_number': (str,), # noqa: E501 - 'sms_phone_number_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubSignatureRequestSigner: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubSignatureRequestSigner], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'order': 'order', # noqa: E501 - 'pin': 'pin', # noqa: E501 - 'sms_phone_number': 'sms_phone_number', # noqa: E501 - 'sms_phone_number_type': 'sms_phone_number_type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def order(self) -> Optional[int]: - return self.get("order") - - @order.setter - def order(self, value: Optional[int]): - setattr(self, "order", value) - - @property - def pin(self) -> str: - return self.get("pin") - - @pin.setter - def pin(self, value: str): - setattr(self, "pin", value) - - @property - def sms_phone_number(self) -> str: - return self.get("sms_phone_number") - - @sms_phone_number.setter - def sms_phone_number(self, value: str): - setattr(self, "sms_phone_number", value) - - @property - def sms_phone_number_type(self) -> str: - return self.get("sms_phone_number_type") - - @sms_phone_number_type.setter - def sms_phone_number_type(self, value: str): - setattr(self, "sms_phone_number_type", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, email_address, *args, **kwargs): # noqa: E501 - """SubSignatureRequestSigner - a model defined in OpenAPI - - Args: - name (str): The name of the signer. - email_address (str): The email address of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the signer is required to sign in.. [optional] # noqa: E501 - pin (str): The 4- to 12-character access code that will secure this signer's signature page.. [optional] # noqa: E501 - sms_phone_number (str): An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.. [optional] # noqa: E501 - sms_phone_number_type (str): Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, email_address, *args, **kwargs): # noqa: E501 - """SubSignatureRequestSigner - a model defined in OpenAPI - - Args: - name (str): The name of the signer. - email_address (str): The email address of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the signer is required to sign in.. [optional] # noqa: E501 - pin (str): The 4- to 12-character access code that will secure this signer's signature page.. [optional] # noqa: E501 - sms_phone_number (str): An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.. [optional] # noqa: E501 - sms_phone_number_type (str): Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_signature_request_template_signer.py b/sdks/python/dropbox_sign/model/sub_signature_request_template_signer.py deleted file mode 100644 index 5d9b3ac49..000000000 --- a/sdks/python/dropbox_sign/model/sub_signature_request_template_signer.py +++ /dev/null @@ -1,361 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubSignatureRequestTemplateSigner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('sms_phone_number_type',): { - 'AUTHENTICATION': "authentication", - 'DELIVERY': "delivery", - }, - } - - validations = { - ('pin',): { - 'max_length': 12, - 'min_length': 4, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'role': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'pin': (str,), # noqa: E501 - 'sms_phone_number': (str,), # noqa: E501 - 'sms_phone_number_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubSignatureRequestTemplateSigner: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubSignatureRequestTemplateSigner], - _check_type=True, - ) - - attribute_map = { - 'role': 'role', # noqa: E501 - 'name': 'name', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'pin': 'pin', # noqa: E501 - 'sms_phone_number': 'sms_phone_number', # noqa: E501 - 'sms_phone_number_type': 'sms_phone_number_type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def pin(self) -> str: - return self.get("pin") - - @pin.setter - def pin(self, value: str): - setattr(self, "pin", value) - - @property - def sms_phone_number(self) -> str: - return self.get("sms_phone_number") - - @sms_phone_number.setter - def sms_phone_number(self, value: str): - setattr(self, "sms_phone_number", value) - - @property - def sms_phone_number_type(self) -> str: - return self.get("sms_phone_number_type") - - @sms_phone_number_type.setter - def sms_phone_number_type(self, value: str): - setattr(self, "sms_phone_number_type", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, role, name, email_address, *args, **kwargs): # noqa: E501 - """SubSignatureRequestTemplateSigner - a model defined in OpenAPI - - Args: - role (str): Must match an existing role in chosen Template(s). It's case-sensitive. - name (str): The name of the signer. - email_address (str): The email address of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pin (str): The 4- to 12-character access code that will secure this signer's signature page.. [optional] # noqa: E501 - sms_phone_number (str): An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.. [optional] # noqa: E501 - sms_phone_number_type (str): Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, role, name, email_address, *args, **kwargs): # noqa: E501 - """SubSignatureRequestTemplateSigner - a model defined in OpenAPI - - Args: - role (str): Must match an existing role in chosen Template(s). It's case-sensitive. - name (str): The name of the signer. - email_address (str): The email address of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pin (str): The 4- to 12-character access code that will secure this signer's signature page.. [optional] # noqa: E501 - sms_phone_number (str): An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.. [optional] # noqa: E501 - sms_phone_number_type (str): Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_signing_options.py b/sdks/python/dropbox_sign/model/sub_signing_options.py deleted file mode 100644 index 9b47da993..000000000 --- a/sdks/python/dropbox_sign/model/sub_signing_options.py +++ /dev/null @@ -1,343 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubSigningOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('default_type',): { - 'DRAW': "draw", - 'PHONE': "phone", - 'TYPE': "type", - 'UPLOAD': "upload", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'default_type': (str,), # noqa: E501 - 'draw': (bool,), # noqa: E501 - 'phone': (bool,), # noqa: E501 - 'type': (bool,), # noqa: E501 - 'upload': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubSigningOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubSigningOptions], - _check_type=True, - ) - - attribute_map = { - 'default_type': 'default_type', # noqa: E501 - 'draw': 'draw', # noqa: E501 - 'phone': 'phone', # noqa: E501 - 'type': 'type', # noqa: E501 - 'upload': 'upload', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def default_type(self) -> str: - return self.get("default_type") - - @default_type.setter - def default_type(self, value: str): - setattr(self, "default_type", value) - - @property - def draw(self) -> bool: - return self.get("draw") - - @draw.setter - def draw(self, value: bool): - setattr(self, "draw", value) - - @property - def phone(self) -> bool: - return self.get("phone") - - @phone.setter - def phone(self, value: bool): - setattr(self, "phone", value) - - @property - def type(self) -> bool: - return self.get("type") - - @type.setter - def type(self, value: bool): - setattr(self, "type", value) - - @property - def upload(self) -> bool: - return self.get("upload") - - @upload.setter - def upload(self, value: bool): - setattr(self, "upload", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, default_type, *args, **kwargs): # noqa: E501 - """SubSigningOptions - a model defined in OpenAPI - - Args: - default_type (str): The default type shown (limited to the listed types) - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - draw (bool): Allows drawing the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - phone (bool): Allows using a smartphone to email the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - type (bool): Allows typing the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - upload (bool): Allows uploading the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.default_type = default_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, default_type, *args, **kwargs): # noqa: E501 - """SubSigningOptions - a model defined in OpenAPI - - Args: - default_type (str): The default type shown (limited to the listed types) - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - draw (bool): Allows drawing the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - phone (bool): Allows using a smartphone to email the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - type (bool): Allows typing the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - upload (bool): Allows uploading the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.default_type = default_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_team_response.py b/sdks/python/dropbox_sign/model/sub_team_response.py deleted file mode 100644 index af12a9059..000000000 --- a/sdks/python/dropbox_sign/model/sub_team_response.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubTeamResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'team_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubTeamResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubTeamResponse], - _check_type=True, - ) - - attribute_map = { - 'team_id': 'team_id', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team_id(self) -> str: - return self.get("team_id") - - @team_id.setter - def team_id(self, value: str): - setattr(self, "team_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubTeamResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubTeamResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_template_role.py b/sdks/python/dropbox_sign/model/sub_template_role.py deleted file mode 100644 index 5062cc46d..000000000 --- a/sdks/python/dropbox_sign/model/sub_template_role.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubTemplateRole(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'order': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubTemplateRole: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubTemplateRole], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'order': 'order', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def order(self) -> Optional[int]: - return self.get("order") - - @order.setter - def order(self, value: Optional[int]): - setattr(self, "order", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubTemplateRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The role name of the signer that will be displayed when the template is used to create a signature request.. [optional] # noqa: E501 - order (int, none_type): The order in which this signer role is required to sign.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubTemplateRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The role name of the signer that will be displayed when the template is used to create a signature request.. [optional] # noqa: E501 - order (int, none_type): The order in which this signer role is required to sign.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_unclaimed_draft_signer.py b/sdks/python/dropbox_sign/model/sub_unclaimed_draft_signer.py deleted file mode 100644 index 02a354407..000000000 --- a/sdks/python/dropbox_sign/model/sub_unclaimed_draft_signer.py +++ /dev/null @@ -1,315 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubUnclaimedDraftSigner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'order': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubUnclaimedDraftSigner: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubUnclaimedDraftSigner], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - 'name': 'name', # noqa: E501 - 'order': 'order', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def order(self) -> Optional[int]: - return self.get("order") - - @order.setter - def order(self, value: Optional[int]): - setattr(self, "order", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email_address, name, *args, **kwargs): # noqa: E501 - """SubUnclaimedDraftSigner - a model defined in OpenAPI - - Args: - email_address (str): The email address of the signer. - name (str): The name of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the signer is required to sign in.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, email_address, name, *args, **kwargs): # noqa: E501 - """SubUnclaimedDraftSigner - a model defined in OpenAPI - - Args: - email_address (str): The email address of the signer. - name (str): The name of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the signer is required to sign in.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_unclaimed_draft_template_signer.py b/sdks/python/dropbox_sign/model/sub_unclaimed_draft_template_signer.py deleted file mode 100644 index a3730017d..000000000 --- a/sdks/python/dropbox_sign/model/sub_unclaimed_draft_template_signer.py +++ /dev/null @@ -1,317 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubUnclaimedDraftTemplateSigner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'role': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubUnclaimedDraftTemplateSigner: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubUnclaimedDraftTemplateSigner], - _check_type=True, - ) - - attribute_map = { - 'role': 'role', # noqa: E501 - 'name': 'name', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, role, name, email_address, *args, **kwargs): # noqa: E501 - """SubUnclaimedDraftTemplateSigner - a model defined in OpenAPI - - Args: - role (str): Must match an existing role in chosen Template(s). - name (str): The name of the signer filling the role of `role`. - email_address (str): The email address of the signer filling the role of `role`. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, role, name, email_address, *args, **kwargs): # noqa: E501 - """SubUnclaimedDraftTemplateSigner - a model defined in OpenAPI - - Args: - role (str): Must match an existing role in chosen Template(s). - name (str): The name of the signer filling the role of `role`. - email_address (str): The email address of the signer filling the role of `role`. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/sub_white_labeling_options.py b/sdks/python/dropbox_sign/model/sub_white_labeling_options.py deleted file mode 100644 index aff5078ce..000000000 --- a/sdks/python/dropbox_sign/model/sub_white_labeling_options.py +++ /dev/null @@ -1,455 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubWhiteLabelingOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('legal_version',): { - 'TERMS1': "terms1", - 'TERMS2': "terms2", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'header_background_color': (str,), # noqa: E501 - 'legal_version': (str,), # noqa: E501 - 'link_color': (str,), # noqa: E501 - 'page_background_color': (str,), # noqa: E501 - 'primary_button_color': (str,), # noqa: E501 - 'primary_button_color_hover': (str,), # noqa: E501 - 'primary_button_text_color': (str,), # noqa: E501 - 'primary_button_text_color_hover': (str,), # noqa: E501 - 'secondary_button_color': (str,), # noqa: E501 - 'secondary_button_color_hover': (str,), # noqa: E501 - 'secondary_button_text_color': (str,), # noqa: E501 - 'secondary_button_text_color_hover': (str,), # noqa: E501 - 'text_color1': (str,), # noqa: E501 - 'text_color2': (str,), # noqa: E501 - 'reset_to_default': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubWhiteLabelingOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubWhiteLabelingOptions], - _check_type=True, - ) - - attribute_map = { - 'header_background_color': 'header_background_color', # noqa: E501 - 'legal_version': 'legal_version', # noqa: E501 - 'link_color': 'link_color', # noqa: E501 - 'page_background_color': 'page_background_color', # noqa: E501 - 'primary_button_color': 'primary_button_color', # noqa: E501 - 'primary_button_color_hover': 'primary_button_color_hover', # noqa: E501 - 'primary_button_text_color': 'primary_button_text_color', # noqa: E501 - 'primary_button_text_color_hover': 'primary_button_text_color_hover', # noqa: E501 - 'secondary_button_color': 'secondary_button_color', # noqa: E501 - 'secondary_button_color_hover': 'secondary_button_color_hover', # noqa: E501 - 'secondary_button_text_color': 'secondary_button_text_color', # noqa: E501 - 'secondary_button_text_color_hover': 'secondary_button_text_color_hover', # noqa: E501 - 'text_color1': 'text_color1', # noqa: E501 - 'text_color2': 'text_color2', # noqa: E501 - 'reset_to_default': 'reset_to_default', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def header_background_color(self) -> str: - return self.get("header_background_color") - - @header_background_color.setter - def header_background_color(self, value: str): - setattr(self, "header_background_color", value) - - @property - def legal_version(self) -> str: - return self.get("legal_version") - - @legal_version.setter - def legal_version(self, value: str): - setattr(self, "legal_version", value) - - @property - def link_color(self) -> str: - return self.get("link_color") - - @link_color.setter - def link_color(self, value: str): - setattr(self, "link_color", value) - - @property - def page_background_color(self) -> str: - return self.get("page_background_color") - - @page_background_color.setter - def page_background_color(self, value: str): - setattr(self, "page_background_color", value) - - @property - def primary_button_color(self) -> str: - return self.get("primary_button_color") - - @primary_button_color.setter - def primary_button_color(self, value: str): - setattr(self, "primary_button_color", value) - - @property - def primary_button_color_hover(self) -> str: - return self.get("primary_button_color_hover") - - @primary_button_color_hover.setter - def primary_button_color_hover(self, value: str): - setattr(self, "primary_button_color_hover", value) - - @property - def primary_button_text_color(self) -> str: - return self.get("primary_button_text_color") - - @primary_button_text_color.setter - def primary_button_text_color(self, value: str): - setattr(self, "primary_button_text_color", value) - - @property - def primary_button_text_color_hover(self) -> str: - return self.get("primary_button_text_color_hover") - - @primary_button_text_color_hover.setter - def primary_button_text_color_hover(self, value: str): - setattr(self, "primary_button_text_color_hover", value) - - @property - def secondary_button_color(self) -> str: - return self.get("secondary_button_color") - - @secondary_button_color.setter - def secondary_button_color(self, value: str): - setattr(self, "secondary_button_color", value) - - @property - def secondary_button_color_hover(self) -> str: - return self.get("secondary_button_color_hover") - - @secondary_button_color_hover.setter - def secondary_button_color_hover(self, value: str): - setattr(self, "secondary_button_color_hover", value) - - @property - def secondary_button_text_color(self) -> str: - return self.get("secondary_button_text_color") - - @secondary_button_text_color.setter - def secondary_button_text_color(self, value: str): - setattr(self, "secondary_button_text_color", value) - - @property - def secondary_button_text_color_hover(self) -> str: - return self.get("secondary_button_text_color_hover") - - @secondary_button_text_color_hover.setter - def secondary_button_text_color_hover(self, value: str): - setattr(self, "secondary_button_text_color_hover", value) - - @property - def text_color1(self) -> str: - return self.get("text_color1") - - @text_color1.setter - def text_color1(self, value: str): - setattr(self, "text_color1", value) - - @property - def text_color2(self) -> str: - return self.get("text_color2") - - @text_color2.setter - def text_color2(self, value: str): - setattr(self, "text_color2", value) - - @property - def reset_to_default(self) -> bool: - return self.get("reset_to_default") - - @reset_to_default.setter - def reset_to_default(self, value: bool): - setattr(self, "reset_to_default", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubWhiteLabelingOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - header_background_color (str): [optional] if omitted the server will use the default value of "#1A1A1A" # noqa: E501 - legal_version (str): [optional] if omitted the server will use the default value of "terms1" # noqa: E501 - link_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - page_background_color (str): [optional] if omitted the server will use the default value of "#F7F8F9" # noqa: E501 - primary_button_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - primary_button_color_hover (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - primary_button_text_color (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - primary_button_text_color_hover (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_color (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_color_hover (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_text_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - secondary_button_text_color_hover (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - text_color1 (str): [optional] if omitted the server will use the default value of "#808080" # noqa: E501 - text_color2 (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - reset_to_default (bool): Resets white labeling options to defaults. Only useful when updating an API App.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubWhiteLabelingOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - header_background_color (str): [optional] if omitted the server will use the default value of "#1A1A1A" # noqa: E501 - legal_version (str): [optional] if omitted the server will use the default value of "terms1" # noqa: E501 - link_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - page_background_color (str): [optional] if omitted the server will use the default value of "#F7F8F9" # noqa: E501 - primary_button_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - primary_button_color_hover (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - primary_button_text_color (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - primary_button_text_color_hover (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_color (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_color_hover (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_text_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - secondary_button_text_color_hover (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - text_color1 (str): [optional] if omitted the server will use the default value of "#808080" # noqa: E501 - text_color2 (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - reset_to_default (bool): Resets white labeling options to defaults. Only useful when updating an API App.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_add_member_request.py b/sdks/python/dropbox_sign/model/team_add_member_request.py deleted file mode 100644 index 97fbf846d..000000000 --- a/sdks/python/dropbox_sign/model/team_add_member_request.py +++ /dev/null @@ -1,313 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamAddMemberRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('role',): { - 'MEMBER': "Member", - 'DEVELOPER': "Developer", - 'TEAM_MANAGER': "Team Manager", - 'ADMIN': "Admin", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'role': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamAddMemberRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamAddMemberRequest], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'role': 'role', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamAddMemberRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): `account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team.. [optional] # noqa: E501 - email_address (str): `account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team.. [optional] # noqa: E501 - role (str): A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamAddMemberRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): `account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team.. [optional] # noqa: E501 - email_address (str): `account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team.. [optional] # noqa: E501 - role (str): A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_create_request.py b/sdks/python/dropbox_sign/model/team_create_request.py deleted file mode 100644 index 699ad65b6..000000000 --- a/sdks/python/dropbox_sign/model/team_create_request.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamCreateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team.. [optional] if omitted the server will use the default value of "Untitled Team" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamCreateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team.. [optional] if omitted the server will use the default value of "Untitled Team" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_get_info_response.py b/sdks/python/dropbox_sign/model/team_get_info_response.py deleted file mode 100644 index c09088981..000000000 --- a/sdks/python/dropbox_sign/model/team_get_info_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.team_info_response import TeamInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.team_info_response import TeamInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['TeamInfoResponse'] = TeamInfoResponse - globals()['WarningResponse'] = WarningResponse - - -class TeamGetInfoResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'team': (TeamInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamGetInfoResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamGetInfoResponse], - _check_type=True, - ) - - attribute_map = { - 'team': 'team', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team(self) -> TeamInfoResponse: - return self.get("team") - - @team.setter - def team(self, value: TeamInfoResponse): - setattr(self, "team", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamGetInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team (TeamInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamGetInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team (TeamInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_get_response.py b/sdks/python/dropbox_sign/model/team_get_response.py deleted file mode 100644 index a3e160d9e..000000000 --- a/sdks/python/dropbox_sign/model/team_get_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.team_response import TeamResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.team_response import TeamResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['TeamResponse'] = TeamResponse - globals()['WarningResponse'] = WarningResponse - - -class TeamGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'team': (TeamResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamGetResponse], - _check_type=True, - ) - - attribute_map = { - 'team': 'team', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team(self) -> TeamResponse: - return self.get("team") - - @team.setter - def team(self, value: TeamResponse): - setattr(self, "team", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team (TeamResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team (TeamResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_info_response.py b/sdks/python/dropbox_sign/model/team_info_response.py deleted file mode 100644 index 218af993e..000000000 --- a/sdks/python/dropbox_sign/model/team_info_response.py +++ /dev/null @@ -1,339 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.team_parent_response import TeamParentResponse - - -def lazy_import(): - from dropbox_sign.model.team_parent_response import TeamParentResponse - globals()['TeamParentResponse'] = TeamParentResponse - - -class TeamInfoResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'team_id': (str,), # noqa: E501 - 'team_parent': (TeamParentResponse,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'num_members': (int,), # noqa: E501 - 'num_sub_teams': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamInfoResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamInfoResponse], - _check_type=True, - ) - - attribute_map = { - 'team_id': 'team_id', # noqa: E501 - 'team_parent': 'team_parent', # noqa: E501 - 'name': 'name', # noqa: E501 - 'num_members': 'num_members', # noqa: E501 - 'num_sub_teams': 'num_sub_teams', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team_id(self) -> str: - return self.get("team_id") - - @team_id.setter - def team_id(self, value: str): - setattr(self, "team_id", value) - - @property - def team_parent(self) -> TeamParentResponse: - return self.get("team_parent") - - @team_parent.setter - def team_parent(self, value: TeamParentResponse): - setattr(self, "team_parent", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def num_members(self) -> int: - return self.get("num_members") - - @num_members.setter - def num_members(self, value: int): - setattr(self, "num_members", value) - - @property - def num_sub_teams(self) -> int: - return self.get("num_sub_teams") - - @num_sub_teams.setter - def num_sub_teams(self, value: int): - setattr(self, "num_sub_teams", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - team_parent (TeamParentResponse): [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - num_members (int): Number of members within a team. [optional] # noqa: E501 - num_sub_teams (int): Number of sub teams within a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - team_parent (TeamParentResponse): [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - num_members (int): Number of members within a team. [optional] # noqa: E501 - num_sub_teams (int): Number of sub teams within a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_invite_response.py b/sdks/python/dropbox_sign/model/team_invite_response.py deleted file mode 100644 index 80d67d43a..000000000 --- a/sdks/python/dropbox_sign/model/team_invite_response.py +++ /dev/null @@ -1,343 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamInviteResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - 'team_id': (str,), # noqa: E501 - 'role': (str,), # noqa: E501 - 'sent_at': (int,), # noqa: E501 - 'redeemed_at': (int,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamInviteResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamInviteResponse], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - 'team_id': 'team_id', # noqa: E501 - 'role': 'role', # noqa: E501 - 'sent_at': 'sent_at', # noqa: E501 - 'redeemed_at': 'redeemed_at', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def team_id(self) -> str: - return self.get("team_id") - - @team_id.setter - def team_id(self, value: str): - setattr(self, "team_id", value) - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @property - def sent_at(self) -> int: - return self.get("sent_at") - - @sent_at.setter - def sent_at(self, value: int): - setattr(self, "sent_at", value) - - @property - def redeemed_at(self) -> int: - return self.get("redeemed_at") - - @redeemed_at.setter - def redeemed_at(self, value: int): - setattr(self, "redeemed_at", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamInviteResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): Email address of the user invited to this team.. [optional] # noqa: E501 - team_id (str): Id of the team.. [optional] # noqa: E501 - role (str): Role of the user invited to this team.. [optional] # noqa: E501 - sent_at (int): Timestamp when the invitation was sent.. [optional] # noqa: E501 - redeemed_at (int): Timestamp when the invitation was redeemed.. [optional] # noqa: E501 - expires_at (int): Timestamp when the invitation is expiring.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamInviteResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): Email address of the user invited to this team.. [optional] # noqa: E501 - team_id (str): Id of the team.. [optional] # noqa: E501 - role (str): Role of the user invited to this team.. [optional] # noqa: E501 - sent_at (int): Timestamp when the invitation was sent.. [optional] # noqa: E501 - redeemed_at (int): Timestamp when the invitation was redeemed.. [optional] # noqa: E501 - expires_at (int): Timestamp when the invitation is expiring.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_invites_response.py b/sdks/python/dropbox_sign/model/team_invites_response.py deleted file mode 100644 index a8cecf03c..000000000 --- a/sdks/python/dropbox_sign/model/team_invites_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.team_invite_response import TeamInviteResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.team_invite_response import TeamInviteResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['TeamInviteResponse'] = TeamInviteResponse - globals()['WarningResponse'] = WarningResponse - - -class TeamInvitesResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'team_invites': ([TeamInviteResponse],), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamInvitesResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamInvitesResponse], - _check_type=True, - ) - - attribute_map = { - 'team_invites': 'team_invites', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team_invites(self) -> List[TeamInviteResponse]: - return self.get("team_invites") - - @team_invites.setter - def team_invites(self, value: List[TeamInviteResponse]): - setattr(self, "team_invites", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamInvitesResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_invites ([TeamInviteResponse]): Contains a list of team invites and their roles.. [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamInvitesResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_invites ([TeamInviteResponse]): Contains a list of team invites and their roles.. [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_member_response.py b/sdks/python/dropbox_sign/model/team_member_response.py deleted file mode 100644 index d30026580..000000000 --- a/sdks/python/dropbox_sign/model/team_member_response.py +++ /dev/null @@ -1,307 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamMemberResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'role': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamMemberResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamMemberResponse], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'role': 'role', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamMemberResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): Account id of the team member.. [optional] # noqa: E501 - email_address (str): Email address of the team member.. [optional] # noqa: E501 - role (str): The specific role a member has on the team.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamMemberResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): Account id of the team member.. [optional] # noqa: E501 - email_address (str): Email address of the team member.. [optional] # noqa: E501 - role (str): The specific role a member has on the team.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_members_response.py b/sdks/python/dropbox_sign/model/team_members_response.py deleted file mode 100644 index 0ff0600cb..000000000 --- a/sdks/python/dropbox_sign/model/team_members_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.team_member_response import TeamMemberResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.team_member_response import TeamMemberResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['TeamMemberResponse'] = TeamMemberResponse - globals()['WarningResponse'] = WarningResponse - - -class TeamMembersResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'team_members': ([TeamMemberResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamMembersResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamMembersResponse], - _check_type=True, - ) - - attribute_map = { - 'team_members': 'team_members', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team_members(self) -> List[TeamMemberResponse]: - return self.get("team_members") - - @team_members.setter - def team_members(self, value: List[TeamMemberResponse]): - setattr(self, "team_members", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamMembersResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_members ([TeamMemberResponse]): Contains a list of team members and their roles for a specific team.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamMembersResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_members ([TeamMemberResponse]): Contains a list of team members and their roles for a specific team.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_parent_response.py b/sdks/python/dropbox_sign/model/team_parent_response.py deleted file mode 100644 index bacfe3aaa..000000000 --- a/sdks/python/dropbox_sign/model/team_parent_response.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamParentResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'team_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamParentResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamParentResponse], - _check_type=True, - ) - - attribute_map = { - 'team_id': 'team_id', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team_id(self) -> str: - return self.get("team_id") - - @team_id.setter - def team_id(self, value: str): - setattr(self, "team_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamParentResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamParentResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_remove_member_request.py b/sdks/python/dropbox_sign/model/team_remove_member_request.py deleted file mode 100644 index 6f7f9e206..000000000 --- a/sdks/python/dropbox_sign/model/team_remove_member_request.py +++ /dev/null @@ -1,337 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamRemoveMemberRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('new_role',): { - 'MEMBER': "Member", - 'DEVELOPER': "Developer", - 'TEAM_MANAGER': "Team Manager", - 'ADMIN': "Admin", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'new_owner_email_address': (str,), # noqa: E501 - 'new_team_id': (str,), # noqa: E501 - 'new_role': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamRemoveMemberRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamRemoveMemberRequest], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'new_owner_email_address': 'new_owner_email_address', # noqa: E501 - 'new_team_id': 'new_team_id', # noqa: E501 - 'new_role': 'new_role', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def new_owner_email_address(self) -> str: - return self.get("new_owner_email_address") - - @new_owner_email_address.setter - def new_owner_email_address(self, value: str): - setattr(self, "new_owner_email_address", value) - - @property - def new_team_id(self) -> str: - return self.get("new_team_id") - - @new_team_id.setter - def new_team_id(self, value: str): - setattr(self, "new_team_id", value) - - @property - def new_role(self) -> str: - return self.get("new_role") - - @new_role.setter - def new_role(self, value: str): - setattr(self, "new_role", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamRemoveMemberRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): **account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team.. [optional] # noqa: E501 - email_address (str): **account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team.. [optional] # noqa: E501 - new_owner_email_address (str): The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans.. [optional] # noqa: E501 - new_team_id (str): Id of the new Team.. [optional] # noqa: E501 - new_role (str): A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamRemoveMemberRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): **account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team.. [optional] # noqa: E501 - email_address (str): **account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team.. [optional] # noqa: E501 - new_owner_email_address (str): The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans.. [optional] # noqa: E501 - new_team_id (str): Id of the new Team.. [optional] # noqa: E501 - new_role (str): A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_response.py b/sdks/python/dropbox_sign/model/team_response.py deleted file mode 100644 index 88e2dd590..000000000 --- a/sdks/python/dropbox_sign/model/team_response.py +++ /dev/null @@ -1,327 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_response import AccountResponse - - -def lazy_import(): - from dropbox_sign.model.account_response import AccountResponse - globals()['AccountResponse'] = AccountResponse - - -class TeamResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'accounts': ([AccountResponse],), # noqa: E501 - 'invited_accounts': ([AccountResponse],), # noqa: E501 - 'invited_emails': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamResponse], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'accounts': 'accounts', # noqa: E501 - 'invited_accounts': 'invited_accounts', # noqa: E501 - 'invited_emails': 'invited_emails', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def accounts(self) -> List[AccountResponse]: - return self.get("accounts") - - @accounts.setter - def accounts(self, value: List[AccountResponse]): - setattr(self, "accounts", value) - - @property - def invited_accounts(self) -> List[AccountResponse]: - return self.get("invited_accounts") - - @invited_accounts.setter - def invited_accounts(self, value: List[AccountResponse]): - setattr(self, "invited_accounts", value) - - @property - def invited_emails(self) -> List[str]: - return self.get("invited_emails") - - @invited_emails.setter - def invited_emails(self, value: List[str]): - setattr(self, "invited_emails", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team. [optional] # noqa: E501 - accounts ([AccountResponse]): [optional] # noqa: E501 - invited_accounts ([AccountResponse]): A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`.. [optional] # noqa: E501 - invited_emails ([str]): A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team. [optional] # noqa: E501 - accounts ([AccountResponse]): [optional] # noqa: E501 - invited_accounts ([AccountResponse]): A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`.. [optional] # noqa: E501 - invited_emails ([str]): A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_sub_teams_response.py b/sdks/python/dropbox_sign/model/team_sub_teams_response.py deleted file mode 100644 index 4cad1d428..000000000 --- a/sdks/python/dropbox_sign/model/team_sub_teams_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.sub_team_response import SubTeamResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.sub_team_response import SubTeamResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['SubTeamResponse'] = SubTeamResponse - globals()['WarningResponse'] = WarningResponse - - -class TeamSubTeamsResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'sub_teams': ([SubTeamResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamSubTeamsResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamSubTeamsResponse], - _check_type=True, - ) - - attribute_map = { - 'sub_teams': 'sub_teams', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def sub_teams(self) -> List[SubTeamResponse]: - return self.get("sub_teams") - - @sub_teams.setter - def sub_teams(self, value: List[SubTeamResponse]): - setattr(self, "sub_teams", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamSubTeamsResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sub_teams ([SubTeamResponse]): Contains a list with sub teams.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamSubTeamsResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sub_teams ([SubTeamResponse]): Contains a list with sub teams.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/team_update_request.py b/sdks/python/dropbox_sign/model/team_update_request.py deleted file mode 100644 index be6ca9193..000000000 --- a/sdks/python/dropbox_sign/model/team_update_request.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamUpdateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamUpdateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamUpdateRequest], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_add_user_request.py b/sdks/python/dropbox_sign/model/template_add_user_request.py deleted file mode 100644 index b742574df..000000000 --- a/sdks/python/dropbox_sign/model/template_add_user_request.py +++ /dev/null @@ -1,307 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateAddUserRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'skip_notification': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateAddUserRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateAddUserRequest], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'skip_notification': 'skip_notification', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def skip_notification(self) -> bool: - return self.get("skip_notification") - - @skip_notification.setter - def skip_notification(self, value: bool): - setattr(self, "skip_notification", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateAddUserRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided.. [optional] # noqa: E501 - email_address (str): The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided.. [optional] # noqa: E501 - skip_notification (bool): If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateAddUserRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided.. [optional] # noqa: E501 - email_address (str): The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided.. [optional] # noqa: E501 - skip_notification (bool): If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_create_embedded_draft_request.py b/sdks/python/dropbox_sign/model/template_create_embedded_draft_request.py deleted file mode 100644 index b78a53f12..000000000 --- a/sdks/python/dropbox_sign/model/template_create_embedded_draft_request.py +++ /dev/null @@ -1,614 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_merge_field import SubMergeField - from dropbox_sign.model.sub_template_role import SubTemplateRole - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_merge_field import SubMergeField - from dropbox_sign.model.sub_template_role import SubTemplateRole - globals()['SubAttachment'] = SubAttachment - globals()['SubEditorOptions'] = SubEditorOptions - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubMergeField'] = SubMergeField - globals()['SubTemplateRole'] = SubTemplateRole - - -class TemplateCreateEmbeddedDraftRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 200, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'allow_ccs': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_roles': ([str],), # noqa: E501 - 'editor_options': (SubEditorOptions,), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'force_signer_roles': (bool,), # noqa: E501 - 'force_subject_message': (bool,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'merge_fields': ([SubMergeField],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'show_preview': (bool,), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'signer_roles': ([SubTemplateRole],), # noqa: E501 - 'skip_me_now': (bool,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_preexisting_fields': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateEmbeddedDraftRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateEmbeddedDraftRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'allow_ccs': 'allow_ccs', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_roles': 'cc_roles', # noqa: E501 - 'editor_options': 'editor_options', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'force_signer_roles': 'force_signer_roles', # noqa: E501 - 'force_subject_message': 'force_subject_message', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'merge_fields': 'merge_fields', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'show_preview': 'show_preview', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'signer_roles': 'signer_roles', # noqa: E501 - 'skip_me_now': 'skip_me_now', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_preexisting_fields': 'use_preexisting_fields', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def allow_ccs(self) -> bool: - return self.get("allow_ccs") - - @allow_ccs.setter - def allow_ccs(self, value: bool): - setattr(self, "allow_ccs", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_roles(self) -> List[str]: - return self.get("cc_roles") - - @cc_roles.setter - def cc_roles(self, value: List[str]): - setattr(self, "cc_roles", value) - - @property - def editor_options(self) -> SubEditorOptions: - return self.get("editor_options") - - @editor_options.setter - def editor_options(self, value: SubEditorOptions): - setattr(self, "editor_options", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def force_signer_roles(self) -> bool: - return self.get("force_signer_roles") - - @force_signer_roles.setter - def force_signer_roles(self, value: bool): - setattr(self, "force_signer_roles", value) - - @property - def force_subject_message(self) -> bool: - return self.get("force_subject_message") - - @force_subject_message.setter - def force_subject_message(self, value: bool): - setattr(self, "force_subject_message", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def merge_fields(self) -> List[SubMergeField]: - return self.get("merge_fields") - - @merge_fields.setter - def merge_fields(self, value: List[SubMergeField]): - setattr(self, "merge_fields", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def show_preview(self) -> bool: - return self.get("show_preview") - - @show_preview.setter - def show_preview(self, value: bool): - setattr(self, "show_preview", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def signer_roles(self) -> List[SubTemplateRole]: - return self.get("signer_roles") - - @signer_roles.setter - def signer_roles(self, value: List[SubTemplateRole]): - setattr(self, "signer_roles", value) - - @property - def skip_me_now(self) -> bool: - return self.get("skip_me_now") - - @skip_me_now.setter - def skip_me_now(self, value: bool): - setattr(self, "skip_me_now", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_preexisting_fields(self) -> bool: - return self.get("use_preexisting_fields") - - @use_preexisting_fields.setter - def use_preexisting_fields(self, value: bool): - setattr(self, "use_preexisting_fields", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template.. [optional] if omitted the server will use the default value of True # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - merge_fields ([SubMergeField]): Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.. [optional] # noqa: E501 - message (str): The default template email message.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signer_roles ([SubTemplateRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The template title (alias).. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_preexisting_fields (bool): Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template.. [optional] if omitted the server will use the default value of True # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - merge_fields ([SubMergeField]): Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.. [optional] # noqa: E501 - message (str): The default template email message.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signer_roles ([SubTemplateRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The template title (alias).. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_preexisting_fields (bool): Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_create_embedded_draft_response.py b/sdks/python/dropbox_sign/model/template_create_embedded_draft_response.py deleted file mode 100644 index bbc88b1f2..000000000 --- a/sdks/python/dropbox_sign/model/template_create_embedded_draft_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate - from dropbox_sign.model.warning_response import WarningResponse - globals()['TemplateCreateEmbeddedDraftResponseTemplate'] = TemplateCreateEmbeddedDraftResponseTemplate - globals()['WarningResponse'] = WarningResponse - - -class TemplateCreateEmbeddedDraftResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template': (TemplateCreateEmbeddedDraftResponseTemplate,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateEmbeddedDraftResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateEmbeddedDraftResponse], - _check_type=True, - ) - - attribute_map = { - 'template': 'template', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template(self) -> TemplateCreateEmbeddedDraftResponseTemplate: - return self.get("template") - - @template.setter - def template(self, value: TemplateCreateEmbeddedDraftResponseTemplate): - setattr(self, "template", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateCreateEmbeddedDraftResponseTemplate): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateCreateEmbeddedDraftResponseTemplate): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_create_embedded_draft_response_template.py b/sdks/python/dropbox_sign/model/template_create_embedded_draft_response_template.py deleted file mode 100644 index cf02872aa..000000000 --- a/sdks/python/dropbox_sign/model/template_create_embedded_draft_response_template.py +++ /dev/null @@ -1,327 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.warning_response import WarningResponse - globals()['WarningResponse'] = WarningResponse - - -class TemplateCreateEmbeddedDraftResponseTemplate(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_id': (str,), # noqa: E501 - 'edit_url': (str,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateEmbeddedDraftResponseTemplate: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateEmbeddedDraftResponseTemplate], - _check_type=True, - ) - - attribute_map = { - 'template_id': 'template_id', # noqa: E501 - 'edit_url': 'edit_url', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_id(self) -> str: - return self.get("template_id") - - @template_id.setter - def template_id(self, value: str): - setattr(self, "template_id", value) - - @property - def edit_url(self) -> str: - return self.get("edit_url") - - @edit_url.setter - def edit_url(self, value: str): - setattr(self, "edit_url", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - edit_url (str): Link to edit the template.. [optional] # noqa: E501 - expires_at (int): When the link expires.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - edit_url (str): Link to edit the template.. [optional] # noqa: E501 - expires_at (int): When the link expires.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_create_request.py b/sdks/python/dropbox_sign/model/template_create_request.py deleted file mode 100644 index 8c9c8e6ac..000000000 --- a/sdks/python/dropbox_sign/model/template_create_request.py +++ /dev/null @@ -1,529 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_merge_field import SubMergeField - from dropbox_sign.model.sub_template_role import SubTemplateRole - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_merge_field import SubMergeField - from dropbox_sign.model.sub_template_role import SubTemplateRole - globals()['SubAttachment'] = SubAttachment - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubMergeField'] = SubMergeField - globals()['SubTemplateRole'] = SubTemplateRole - - -class TemplateCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 200, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'signer_roles': ([SubTemplateRole],), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_roles': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'merge_fields': ([SubMergeField],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_preexisting_fields': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'signer_roles': 'signer_roles', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_roles': 'cc_roles', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'merge_fields': 'merge_fields', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_preexisting_fields': 'use_preexisting_fields', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def signer_roles(self) -> List[SubTemplateRole]: - return self.get("signer_roles") - - @signer_roles.setter - def signer_roles(self, value: List[SubTemplateRole]): - setattr(self, "signer_roles", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_roles(self) -> List[str]: - return self.get("cc_roles") - - @cc_roles.setter - def cc_roles(self, value: List[str]): - setattr(self, "cc_roles", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def merge_fields(self) -> List[SubMergeField]: - return self.get("merge_fields") - - @merge_fields.setter - def merge_fields(self, value: List[SubMergeField]): - setattr(self, "merge_fields", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_preexisting_fields(self) -> bool: - return self.get("use_preexisting_fields") - - @use_preexisting_fields.setter - def use_preexisting_fields(self, value: bool): - setattr(self, "use_preexisting_fields", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, form_fields_per_document, signer_roles, *args, **kwargs): # noqa: E501 - """TemplateCreateRequest - a model defined in OpenAPI - - Args: - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` - signer_roles ([SubTemplateRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. [optional] # noqa: E501 - client_id (str): Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - merge_fields ([SubMergeField]): Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.. [optional] # noqa: E501 - message (str): The default template email message.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - subject (str): The template title (alias).. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_preexisting_fields (bool): Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.form_fields_per_document = form_fields_per_document - self.signer_roles = signer_roles - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, form_fields_per_document, signer_roles, *args, **kwargs): # noqa: E501 - """TemplateCreateRequest - a model defined in OpenAPI - - Args: - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` - signer_roles ([SubTemplateRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. [optional] # noqa: E501 - client_id (str): Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - merge_fields ([SubMergeField]): Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.. [optional] # noqa: E501 - message (str): The default template email message.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - subject (str): The template title (alias).. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_preexisting_fields (bool): Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.form_fields_per_document = form_fields_per_document - self.signer_roles = signer_roles - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_create_response.py b/sdks/python/dropbox_sign/model/template_create_response.py deleted file mode 100644 index 46e4df027..000000000 --- a/sdks/python/dropbox_sign/model/template_create_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_create_response_template import TemplateCreateResponseTemplate - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.template_create_response_template import TemplateCreateResponseTemplate - from dropbox_sign.model.warning_response import WarningResponse - globals()['TemplateCreateResponseTemplate'] = TemplateCreateResponseTemplate - globals()['WarningResponse'] = WarningResponse - - -class TemplateCreateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template': (TemplateCreateResponseTemplate,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateResponse], - _check_type=True, - ) - - attribute_map = { - 'template': 'template', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template(self) -> TemplateCreateResponseTemplate: - return self.get("template") - - @template.setter - def template(self, value: TemplateCreateResponseTemplate): - setattr(self, "template", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateCreateResponseTemplate): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateCreateResponseTemplate): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_create_response_template.py b/sdks/python/dropbox_sign/model/template_create_response_template.py deleted file mode 100644 index d80f694f0..000000000 --- a/sdks/python/dropbox_sign/model/template_create_response_template.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateCreateResponseTemplate(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'template_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateResponseTemplate: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateResponseTemplate], - _check_type=True, - ) - - attribute_map = { - 'template_id': 'template_id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_id(self) -> str: - return self.get("template_id") - - @template_id.setter - def template_id(self, value: str): - setattr(self, "template_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateCreateResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateCreateResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_edit_response.py b/sdks/python/dropbox_sign/model/template_edit_response.py deleted file mode 100644 index 793e9afba..000000000 --- a/sdks/python/dropbox_sign/model/template_edit_response.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateEditResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'template_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateEditResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateEditResponse], - _check_type=True, - ) - - attribute_map = { - 'template_id': 'template_id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_id(self) -> str: - return self.get("template_id") - - @template_id.setter - def template_id(self, value: str): - setattr(self, "template_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateEditResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateEditResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_get_response.py b/sdks/python/dropbox_sign/model/template_get_response.py deleted file mode 100644 index 7e56c8214..000000000 --- a/sdks/python/dropbox_sign/model/template_get_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response import TemplateResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.template_response import TemplateResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['TemplateResponse'] = TemplateResponse - globals()['WarningResponse'] = WarningResponse - - -class TemplateGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template': (TemplateResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateGetResponse], - _check_type=True, - ) - - attribute_map = { - 'template': 'template', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template(self) -> TemplateResponse: - return self.get("template") - - @template.setter - def template(self, value: TemplateResponse): - setattr(self, "template", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_list_response.py b/sdks/python/dropbox_sign/model/template_list_response.py deleted file mode 100644 index 3c4e01cc4..000000000 --- a/sdks/python/dropbox_sign/model/template_list_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.template_response import TemplateResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.template_response import TemplateResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['TemplateResponse'] = TemplateResponse - globals()['WarningResponse'] = WarningResponse - - -class TemplateListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'templates': ([TemplateResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateListResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateListResponse], - _check_type=True, - ) - - attribute_map = { - 'templates': 'templates', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def templates(self) -> List[TemplateResponse]: - return self.get("templates") - - @templates.setter - def templates(self, value: List[TemplateResponse]): - setattr(self, "templates", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - templates ([TemplateResponse]): List of templates that the API caller has access to.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - templates ([TemplateResponse]): List of templates that the API caller has access to.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_remove_user_request.py b/sdks/python/dropbox_sign/model/template_remove_user_request.py deleted file mode 100644 index b3e192757..000000000 --- a/sdks/python/dropbox_sign/model/template_remove_user_request.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateRemoveUserRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateRemoveUserRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateRemoveUserRequest], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateRemoveUserRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.. [optional] # noqa: E501 - email_address (str): The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateRemoveUserRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.. [optional] # noqa: E501 - email_address (str): The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response.py b/sdks/python/dropbox_sign/model/template_response.py deleted file mode 100644 index 8a661f48f..000000000 --- a/sdks/python/dropbox_sign/model/template_response.py +++ /dev/null @@ -1,474 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_account import TemplateResponseAccount - from dropbox_sign.model.template_response_cc_role import TemplateResponseCCRole - from dropbox_sign.model.template_response_document import TemplateResponseDocument - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_signer_role import TemplateResponseSignerRole - - -def lazy_import(): - from dropbox_sign.model.template_response_account import TemplateResponseAccount - from dropbox_sign.model.template_response_cc_role import TemplateResponseCCRole - from dropbox_sign.model.template_response_document import TemplateResponseDocument - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_signer_role import TemplateResponseSignerRole - globals()['TemplateResponseAccount'] = TemplateResponseAccount - globals()['TemplateResponseCCRole'] = TemplateResponseCCRole - globals()['TemplateResponseDocument'] = TemplateResponseDocument - globals()['TemplateResponseDocumentCustomFieldBase'] = TemplateResponseDocumentCustomFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseSignerRole'] = TemplateResponseSignerRole - - -class TemplateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_id': (str,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'updated_at': (int,), # noqa: E501 - 'is_embedded': (bool, none_type,), # noqa: E501 - 'is_creator': (bool, none_type,), # noqa: E501 - 'can_edit': (bool, none_type,), # noqa: E501 - 'is_locked': (bool, none_type,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signer_roles': ([TemplateResponseSignerRole],), # noqa: E501 - 'cc_roles': ([TemplateResponseCCRole],), # noqa: E501 - 'documents': ([TemplateResponseDocument],), # noqa: E501 - 'custom_fields': ([TemplateResponseDocumentCustomFieldBase], none_type,), # noqa: E501 - 'named_form_fields': ([TemplateResponseDocumentFormFieldBase], none_type,), # noqa: E501 - 'accounts': ([TemplateResponseAccount], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponse], - _check_type=True, - ) - - attribute_map = { - 'template_id': 'template_id', # noqa: E501 - 'title': 'title', # noqa: E501 - 'message': 'message', # noqa: E501 - 'updated_at': 'updated_at', # noqa: E501 - 'is_embedded': 'is_embedded', # noqa: E501 - 'is_creator': 'is_creator', # noqa: E501 - 'can_edit': 'can_edit', # noqa: E501 - 'is_locked': 'is_locked', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signer_roles': 'signer_roles', # noqa: E501 - 'cc_roles': 'cc_roles', # noqa: E501 - 'documents': 'documents', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'named_form_fields': 'named_form_fields', # noqa: E501 - 'accounts': 'accounts', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_id(self) -> str: - return self.get("template_id") - - @template_id.setter - def template_id(self, value: str): - setattr(self, "template_id", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def updated_at(self) -> int: - return self.get("updated_at") - - @updated_at.setter - def updated_at(self, value: int): - setattr(self, "updated_at", value) - - @property - def is_embedded(self) -> Optional[bool]: - return self.get("is_embedded") - - @is_embedded.setter - def is_embedded(self, value: Optional[bool]): - setattr(self, "is_embedded", value) - - @property - def is_creator(self) -> Optional[bool]: - return self.get("is_creator") - - @is_creator.setter - def is_creator(self, value: Optional[bool]): - setattr(self, "is_creator", value) - - @property - def can_edit(self) -> Optional[bool]: - return self.get("can_edit") - - @can_edit.setter - def can_edit(self, value: Optional[bool]): - setattr(self, "can_edit", value) - - @property - def is_locked(self) -> Optional[bool]: - return self.get("is_locked") - - @is_locked.setter - def is_locked(self, value: Optional[bool]): - setattr(self, "is_locked", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signer_roles(self) -> List[TemplateResponseSignerRole]: - return self.get("signer_roles") - - @signer_roles.setter - def signer_roles(self, value: List[TemplateResponseSignerRole]): - setattr(self, "signer_roles", value) - - @property - def cc_roles(self) -> List[TemplateResponseCCRole]: - return self.get("cc_roles") - - @cc_roles.setter - def cc_roles(self, value: List[TemplateResponseCCRole]): - setattr(self, "cc_roles", value) - - @property - def documents(self) -> List[TemplateResponseDocument]: - return self.get("documents") - - @documents.setter - def documents(self, value: List[TemplateResponseDocument]): - setattr(self, "documents", value) - - @property - def custom_fields(self) -> Optional[List[TemplateResponseDocumentCustomFieldBase]]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: Optional[List[TemplateResponseDocumentCustomFieldBase]]): - setattr(self, "custom_fields", value) - - @property - def named_form_fields(self) -> Optional[List[TemplateResponseDocumentFormFieldBase]]: - return self.get("named_form_fields") - - @named_form_fields.setter - def named_form_fields(self, value: Optional[List[TemplateResponseDocumentFormFieldBase]]): - setattr(self, "named_form_fields", value) - - @property - def accounts(self) -> Optional[List[TemplateResponseAccount]]: - return self.get("accounts") - - @accounts.setter - def accounts(self, value: Optional[List[TemplateResponseAccount]]): - setattr(self, "accounts", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - title (str): The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.. [optional] # noqa: E501 - message (str): The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.. [optional] # noqa: E501 - updated_at (int): Time the template was last updated.. [optional] # noqa: E501 - is_embedded (bool, none_type): `true` if this template was created using an embedded flow, `false` if it was created on our website.. [optional] # noqa: E501 - is_creator (bool, none_type): `true` if you are the owner of this template, `false` if it's been shared with you by a team member.. [optional] # noqa: E501 - can_edit (bool, none_type): Indicates whether edit rights have been granted to you by the owner (always `true` if that's you).. [optional] # noqa: E501 - is_locked (bool, none_type): Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the template.. [optional] # noqa: E501 - signer_roles ([TemplateResponseSignerRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - cc_roles ([TemplateResponseCCRole]): An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - documents ([TemplateResponseDocument]): An array describing each document associated with this Template. Includes form field data for each document.. [optional] # noqa: E501 - custom_fields ([TemplateResponseDocumentCustomFieldBase], none_type): Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - named_form_fields ([TemplateResponseDocumentFormFieldBase], none_type): Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - accounts ([TemplateResponseAccount], none_type): An array of the Accounts that can use this Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - title (str): The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.. [optional] # noqa: E501 - message (str): The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.. [optional] # noqa: E501 - updated_at (int): Time the template was last updated.. [optional] # noqa: E501 - is_embedded (bool, none_type): `true` if this template was created using an embedded flow, `false` if it was created on our website.. [optional] # noqa: E501 - is_creator (bool, none_type): `true` if you are the owner of this template, `false` if it's been shared with you by a team member.. [optional] # noqa: E501 - can_edit (bool, none_type): Indicates whether edit rights have been granted to you by the owner (always `true` if that's you).. [optional] # noqa: E501 - is_locked (bool, none_type): Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the template.. [optional] # noqa: E501 - signer_roles ([TemplateResponseSignerRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - cc_roles ([TemplateResponseCCRole]): An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - documents ([TemplateResponseDocument]): An array describing each document associated with this Template. Includes form field data for each document.. [optional] # noqa: E501 - custom_fields ([TemplateResponseDocumentCustomFieldBase], none_type): Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - named_form_fields ([TemplateResponseDocumentFormFieldBase], none_type): Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - accounts ([TemplateResponseAccount], none_type): An array of the Accounts that can use this Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_account.py b/sdks/python/dropbox_sign/model/template_response_account.py deleted file mode 100644 index 311842c25..000000000 --- a/sdks/python/dropbox_sign/model/template_response_account.py +++ /dev/null @@ -1,351 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_account_quota import TemplateResponseAccountQuota - - -def lazy_import(): - from dropbox_sign.model.template_response_account_quota import TemplateResponseAccountQuota - globals()['TemplateResponseAccountQuota'] = TemplateResponseAccountQuota - - -class TemplateResponseAccount(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'is_locked': (bool,), # noqa: E501 - 'is_paid_hs': (bool,), # noqa: E501 - 'is_paid_hf': (bool,), # noqa: E501 - 'quotas': (TemplateResponseAccountQuota,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseAccount: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseAccount], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'is_locked': 'is_locked', # noqa: E501 - 'is_paid_hs': 'is_paid_hs', # noqa: E501 - 'is_paid_hf': 'is_paid_hf', # noqa: E501 - 'quotas': 'quotas', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def is_locked(self) -> bool: - return self.get("is_locked") - - @is_locked.setter - def is_locked(self, value: bool): - setattr(self, "is_locked", value) - - @property - def is_paid_hs(self) -> bool: - return self.get("is_paid_hs") - - @is_paid_hs.setter - def is_paid_hs(self, value: bool): - setattr(self, "is_paid_hs", value) - - @property - def is_paid_hf(self) -> bool: - return self.get("is_paid_hf") - - @is_paid_hf.setter - def is_paid_hf(self, value: bool): - setattr(self, "is_paid_hf", value) - - @property - def quotas(self) -> TemplateResponseAccountQuota: - return self.get("quotas") - - @quotas.setter - def quotas(self, value: TemplateResponseAccountQuota): - setattr(self, "quotas", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id of the Account.. [optional] # noqa: E501 - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - is_locked (bool): Returns `true` if the user has been locked out of their account by a team admin.. [optional] # noqa: E501 - is_paid_hs (bool): Returns `true` if the user has a paid Dropbox Sign account.. [optional] # noqa: E501 - is_paid_hf (bool): Returns `true` if the user has a paid HelloFax account.. [optional] # noqa: E501 - quotas (TemplateResponseAccountQuota): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id of the Account.. [optional] # noqa: E501 - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - is_locked (bool): Returns `true` if the user has been locked out of their account by a team admin.. [optional] # noqa: E501 - is_paid_hs (bool): Returns `true` if the user has a paid Dropbox Sign account.. [optional] # noqa: E501 - is_paid_hf (bool): Returns `true` if the user has a paid HelloFax account.. [optional] # noqa: E501 - quotas (TemplateResponseAccountQuota): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_account_quota.py b/sdks/python/dropbox_sign/model/template_response_account_quota.py deleted file mode 100644 index 4df5055cf..000000000 --- a/sdks/python/dropbox_sign/model/template_response_account_quota.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseAccountQuota(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'templates_left': (int,), # noqa: E501 - 'api_signature_requests_left': (int,), # noqa: E501 - 'documents_left': (int,), # noqa: E501 - 'sms_verifications_left': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseAccountQuota: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseAccountQuota], - _check_type=True, - ) - - attribute_map = { - 'templates_left': 'templates_left', # noqa: E501 - 'api_signature_requests_left': 'api_signature_requests_left', # noqa: E501 - 'documents_left': 'documents_left', # noqa: E501 - 'sms_verifications_left': 'sms_verifications_left', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def templates_left(self) -> int: - return self.get("templates_left") - - @templates_left.setter - def templates_left(self, value: int): - setattr(self, "templates_left", value) - - @property - def api_signature_requests_left(self) -> int: - return self.get("api_signature_requests_left") - - @api_signature_requests_left.setter - def api_signature_requests_left(self, value: int): - setattr(self, "api_signature_requests_left", value) - - @property - def documents_left(self) -> int: - return self.get("documents_left") - - @documents_left.setter - def documents_left(self, value: int): - setattr(self, "documents_left", value) - - @property - def sms_verifications_left(self) -> int: - return self.get("sms_verifications_left") - - @sms_verifications_left.setter - def sms_verifications_left(self, value: int): - setattr(self, "sms_verifications_left", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseAccountQuota - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - templates_left (int): API templates remaining.. [optional] # noqa: E501 - api_signature_requests_left (int): API signature requests remaining.. [optional] # noqa: E501 - documents_left (int): Signature requests remaining.. [optional] # noqa: E501 - sms_verifications_left (int): SMS verifications remaining.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseAccountQuota - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - templates_left (int): API templates remaining.. [optional] # noqa: E501 - api_signature_requests_left (int): API signature requests remaining.. [optional] # noqa: E501 - documents_left (int): Signature requests remaining.. [optional] # noqa: E501 - sms_verifications_left (int): SMS verifications remaining.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_cc_role.py b/sdks/python/dropbox_sign/model/template_response_cc_role.py deleted file mode 100644 index cdec27200..000000000 --- a/sdks/python/dropbox_sign/model/template_response_cc_role.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseCCRole(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseCCRole: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseCCRole], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseCCRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Role.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseCCRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Role.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_custom_field.py b/sdks/python/dropbox_sign/model/template_response_custom_field.py deleted file mode 100644 index 5402cb417..000000000 --- a/sdks/python/dropbox_sign/model/template_response_custom_field.py +++ /dev/null @@ -1,301 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import TemplateResponseDocumentCustomFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentCustomFieldText - - -def lazy_import(): - from dropbox_sign.models import TemplateResponseDocumentCustomFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentCustomFieldText - globals()['TemplateResponseDocumentCustomFieldCheckbox'] = TemplateResponseDocumentCustomFieldCheckbox - globals()['TemplateResponseDocumentCustomFieldText'] = TemplateResponseDocumentCustomFieldText - - -class TemplateResponseCustomField(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'value': (TemplateResponseDocumentCustomFieldBase,), - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': TemplateResponseDocumentCustomFieldCheckbox, - 'text': TemplateResponseDocumentCustomFieldText, - } - if not val: - return None - return {'type': val} - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """TemplateResponseCustomField - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (TemplateResponseDocumentCustomFieldBase): # noqa: E501 - - Keyword Args: - value (TemplateResponseDocumentCustomFieldBase): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """TemplateResponseCustomField - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (TemplateResponseDocumentCustomFieldBase): # noqa: E501 - - Keyword Args: - value (TemplateResponseDocumentCustomFieldBase): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/sdks/python/dropbox_sign/model/template_response_document.py b/sdks/python/dropbox_sign/model/template_response_document.py deleted file mode 100644 index f4043f385..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document.py +++ /dev/null @@ -1,360 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_document_field_group import TemplateResponseDocumentFieldGroup - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_document_field_group import TemplateResponseDocumentFieldGroup - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentCustomFieldBase'] = TemplateResponseDocumentCustomFieldBase - globals()['TemplateResponseDocumentFieldGroup'] = TemplateResponseDocumentFieldGroup - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocument(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'index': (int,), # noqa: E501 - 'field_groups': ([TemplateResponseDocumentFieldGroup],), # noqa: E501 - 'form_fields': ([TemplateResponseDocumentFormFieldBase],), # noqa: E501 - 'custom_fields': ([TemplateResponseDocumentCustomFieldBase],), # noqa: E501 - 'static_fields': ([TemplateResponseDocumentStaticFieldBase], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocument: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocument], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'index': 'index', # noqa: E501 - 'field_groups': 'field_groups', # noqa: E501 - 'form_fields': 'form_fields', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'static_fields': 'static_fields', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def index(self) -> int: - return self.get("index") - - @index.setter - def index(self, value: int): - setattr(self, "index", value) - - @property - def field_groups(self) -> List[TemplateResponseDocumentFieldGroup]: - return self.get("field_groups") - - @field_groups.setter - def field_groups(self, value: List[TemplateResponseDocumentFieldGroup]): - setattr(self, "field_groups", value) - - @property - def form_fields(self) -> List[TemplateResponseDocumentFormFieldBase]: - return self.get("form_fields") - - @form_fields.setter - def form_fields(self, value: List[TemplateResponseDocumentFormFieldBase]): - setattr(self, "form_fields", value) - - @property - def custom_fields(self) -> List[TemplateResponseDocumentCustomFieldBase]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[TemplateResponseDocumentCustomFieldBase]): - setattr(self, "custom_fields", value) - - @property - def static_fields(self) -> Optional[List[TemplateResponseDocumentStaticFieldBase]]: - return self.get("static_fields") - - @static_fields.setter - def static_fields(self, value: Optional[List[TemplateResponseDocumentStaticFieldBase]]): - setattr(self, "static_fields", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocument - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Name of the associated file.. [optional] # noqa: E501 - index (int): Document ordering, the lowest index is displayed first and the highest last (0-based indexing).. [optional] # noqa: E501 - field_groups ([TemplateResponseDocumentFieldGroup]): An array of Form Field Group objects.. [optional] # noqa: E501 - form_fields ([TemplateResponseDocumentFormFieldBase]): An array of Form Field objects containing the name and type of each named field.. [optional] # noqa: E501 - custom_fields ([TemplateResponseDocumentCustomFieldBase]): An array of Form Field objects containing the name and type of each named field.. [optional] # noqa: E501 - static_fields ([TemplateResponseDocumentStaticFieldBase], none_type): An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocument - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Name of the associated file.. [optional] # noqa: E501 - index (int): Document ordering, the lowest index is displayed first and the highest last (0-based indexing).. [optional] # noqa: E501 - field_groups ([TemplateResponseDocumentFieldGroup]): An array of Form Field Group objects.. [optional] # noqa: E501 - form_fields ([TemplateResponseDocumentFormFieldBase]): An array of Form Field objects containing the name and type of each named field.. [optional] # noqa: E501 - custom_fields ([TemplateResponseDocumentCustomFieldBase]): An array of Form Field objects containing the name and type of each named field.. [optional] # noqa: E501 - static_fields ([TemplateResponseDocumentStaticFieldBase], none_type): An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_document_custom_field.py b/sdks/python/dropbox_sign/model/template_response_document_custom_field.py deleted file mode 100644 index 6a5721e2c..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_custom_field.py +++ /dev/null @@ -1,475 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - - -def lazy_import(): - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - globals()['TemplateResponseFieldAvgTextLength'] = TemplateResponseFieldAvgTextLength - - -class TemplateResponseDocumentCustomField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TEXT': "text", - 'CHECKBOX': "checkbox", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - 'avg_text_length': (TemplateResponseFieldAvgTextLength,), # noqa: E501 - 'is_multiline': (bool, none_type,), # noqa: E501 - 'original_font_size': (int, none_type,), # noqa: E501 - 'font_family': (str, none_type,), # noqa: E501 - 'named_form_fields': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 - 'reusable_form_id': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentCustomField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentCustomField], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'type': 'type', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'group': 'group', # noqa: E501 - 'avg_text_length': 'avg_text_length', # noqa: E501 - 'is_multiline': 'isMultiline', # noqa: E501 - 'original_font_size': 'originalFontSize', # noqa: E501 - 'font_family': 'fontFamily', # noqa: E501 - 'named_form_fields': 'named_form_fields', # noqa: E501 - 'reusable_form_id': 'reusable_form_id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @property - def avg_text_length(self) -> TemplateResponseFieldAvgTextLength: - return self.get("avg_text_length") - - @avg_text_length.setter - def avg_text_length(self, value: TemplateResponseFieldAvgTextLength): - setattr(self, "avg_text_length", value) - - @property - def is_multiline(self) -> Optional[bool]: - return self.get("is_multiline") - - @is_multiline.setter - def is_multiline(self, value: Optional[bool]): - setattr(self, "is_multiline", value) - - @property - def original_font_size(self) -> Optional[int]: - return self.get("original_font_size") - - @original_font_size.setter - def original_font_size(self, value: Optional[int]): - setattr(self, "original_font_size", value) - - @property - def font_family(self) -> Optional[str]: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: Optional[str]): - setattr(self, "font_family", value) - - @property - def named_form_fields(self) -> Optional[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]: - return self.get("named_form_fields") - - @named_form_fields.setter - def named_form_fields(self, value: Optional[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]): - setattr(self, "named_form_fields", value) - - @property - def reusable_form_id(self) -> Optional[str]: - return self.get("reusable_form_id") - - @reusable_form_id.setter - def reusable_form_id(self, value: Optional[str]): - setattr(self, "reusable_form_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Custom Field.. [optional] # noqa: E501 - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported.. [optional] # noqa: E501 - signer (str): The signer of the Custom Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool, none_type): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int, none_type): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str, none_type): Font family used in this form field's text.. [optional] # noqa: E501 - named_form_fields ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - reusable_form_id (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Custom Field.. [optional] # noqa: E501 - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported.. [optional] # noqa: E501 - signer (str): The signer of the Custom Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool, none_type): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int, none_type): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str, none_type): Font family used in this form field's text.. [optional] # noqa: E501 - named_form_fields ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - reusable_form_id (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_document_custom_field_base.py b/sdks/python/dropbox_sign/model/template_response_document_custom_field_base.py deleted file mode 100644 index c27673023..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_custom_field_base.py +++ /dev/null @@ -1,400 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import TemplateResponseDocumentCustomFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentCustomFieldText - - -def lazy_import(): - from dropbox_sign.models import TemplateResponseDocumentCustomFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentCustomFieldText - globals()['TemplateResponseDocumentCustomFieldCheckbox'] = TemplateResponseDocumentCustomFieldCheckbox - globals()['TemplateResponseDocumentCustomFieldText'] = TemplateResponseDocumentCustomFieldText - - -class TemplateResponseDocumentCustomFieldBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str, none_type,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': TemplateResponseDocumentCustomFieldCheckbox, - 'text': TemplateResponseDocumentCustomFieldText, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> Optional[str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Optional[str]): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_document_custom_field_checkbox.py b/sdks/python/dropbox_sign/model/template_response_document_custom_field_checkbox.py deleted file mode 100644 index f69ab917d..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_custom_field_checkbox.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - globals()['TemplateResponseDocumentCustomFieldBase'] = TemplateResponseDocumentCustomFieldBase - - -class TemplateResponseDocumentCustomFieldCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str, none_type,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentCustomFieldCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentCustomFieldCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> Optional[str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Optional[str]): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_custom_field_text.py b/sdks/python/dropbox_sign/model/template_response_document_custom_field_text.py deleted file mode 100644 index 6989c1db4..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_custom_field_text.py +++ /dev/null @@ -1,500 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - - -def lazy_import(): - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - globals()['TemplateResponseDocumentCustomFieldBase'] = TemplateResponseDocumentCustomFieldBase - globals()['TemplateResponseFieldAvgTextLength'] = TemplateResponseFieldAvgTextLength - - -class TemplateResponseDocumentCustomFieldText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'avg_text_length': (TemplateResponseFieldAvgTextLength,), # noqa: E501 - 'is_multiline': (bool,), # noqa: E501 - 'original_font_size': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str, none_type,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentCustomFieldText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentCustomFieldText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'avg_text_length': 'avg_text_length', # noqa: E501 - 'is_multiline': 'isMultiline', # noqa: E501 - 'original_font_size': 'originalFontSize', # noqa: E501 - 'font_family': 'fontFamily', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def avg_text_length(self) -> TemplateResponseFieldAvgTextLength: - return self.get("avg_text_length") - - @avg_text_length.setter - def avg_text_length(self, value: TemplateResponseFieldAvgTextLength): - setattr(self, "avg_text_length", value) - - @property - def is_multiline(self) -> bool: - return self.get("is_multiline") - - @is_multiline.setter - def is_multiline(self, value: bool): - setattr(self, "is_multiline", value) - - @property - def original_font_size(self) -> int: - return self.get("original_font_size") - - @original_font_size.setter - def original_font_size(self, value: int): - setattr(self, "original_font_size", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> Optional[str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Optional[str]): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_field_group.py b/sdks/python/dropbox_sign/model/template_response_document_field_group.py deleted file mode 100644 index 675fd8771..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_field_group.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule - - -def lazy_import(): - from dropbox_sign.model.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule - globals()['TemplateResponseDocumentFieldGroupRule'] = TemplateResponseDocumentFieldGroupRule - - -class TemplateResponseDocumentFieldGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'rule': (TemplateResponseDocumentFieldGroupRule,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFieldGroup: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFieldGroup], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'rule': 'rule', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def rule(self) -> TemplateResponseDocumentFieldGroupRule: - return self.get("rule") - - @rule.setter - def rule(self, value: TemplateResponseDocumentFieldGroupRule): - setattr(self, "rule", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFieldGroup - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the form field group.. [optional] # noqa: E501 - rule (TemplateResponseDocumentFieldGroupRule): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFieldGroup - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the form field group.. [optional] # noqa: E501 - rule (TemplateResponseDocumentFieldGroupRule): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_document_field_group_rule.py b/sdks/python/dropbox_sign/model/template_response_document_field_group_rule.py deleted file mode 100644 index a542c3135..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_field_group_rule.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseDocumentFieldGroupRule(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'requirement': (str,), # noqa: E501 - 'group_label': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFieldGroupRule: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFieldGroupRule], - _check_type=True, - ) - - attribute_map = { - 'requirement': 'requirement', # noqa: E501 - 'group_label': 'groupLabel', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def requirement(self) -> str: - return self.get("requirement") - - @requirement.setter - def requirement(self, value: str): - setattr(self, "requirement", value) - - @property - def group_label(self) -> str: - return self.get("group_label") - - @group_label.setter - def group_label(self, value: str): - setattr(self, "group_label", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFieldGroupRule - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - requirement (str): Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.. [optional] # noqa: E501 - group_label (str): Name of the group. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFieldGroupRule - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - requirement (str): Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.. [optional] # noqa: E501 - group_label (str): Name of the group. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_document_form_field.py b/sdks/python/dropbox_sign/model/template_response_document_form_field.py deleted file mode 100644 index e1d4c0a3f..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_form_field.py +++ /dev/null @@ -1,459 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - - -def lazy_import(): - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - globals()['TemplateResponseFieldAvgTextLength'] = TemplateResponseFieldAvgTextLength - - -class TemplateResponseDocumentFormField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'CHECKBOX': "checkbox", - 'CHECKBOX-MERGE': "checkbox-merge", - 'DATE_SIGNED': "date_signed", - 'DROPDOWN': "dropdown", - 'HYPERLINK': "hyperlink", - 'INITIALS': "initials", - 'SIGNATURE': "signature", - 'RADIO': "radio", - 'TEXT': "text", - 'TEXT-MERGE': "text-merge", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - 'avg_text_length': (TemplateResponseFieldAvgTextLength,), # noqa: E501 - 'is_multiline': (bool, none_type,), # noqa: E501 - 'original_font_size': (int, none_type,), # noqa: E501 - 'font_family': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormField], - _check_type=True, - ) - - attribute_map = { - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'type': 'type', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - 'avg_text_length': 'avg_text_length', # noqa: E501 - 'is_multiline': 'isMultiline', # noqa: E501 - 'original_font_size': 'originalFontSize', # noqa: E501 - 'font_family': 'fontFamily', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @property - def avg_text_length(self) -> TemplateResponseFieldAvgTextLength: - return self.get("avg_text_length") - - @avg_text_length.setter - def avg_text_length(self, value: TemplateResponseFieldAvgTextLength): - setattr(self, "avg_text_length", value) - - @property - def is_multiline(self) -> Optional[bool]: - return self.get("is_multiline") - - @is_multiline.setter - def is_multiline(self, value: Optional[bool]): - setattr(self, "is_multiline", value) - - @property - def original_font_size(self) -> Optional[int]: - return self.get("original_font_size") - - @original_font_size.setter - def original_font_size(self, value: Optional[int]): - setattr(self, "original_font_size", value) - - @property - def font_family(self) -> Optional[str]: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: Optional[str]): - setattr(self, "font_family", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types).. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool, none_type): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int, none_type): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str, none_type): Font family used in this form field's text.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types).. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool, none_type): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int, none_type): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str, none_type): Font family used in this form field's text.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_document_form_field_base.py b/sdks/python/dropbox_sign/model/template_response_document_form_field_base.py deleted file mode 100644 index 41fcb3222..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_form_field_base.py +++ /dev/null @@ -1,424 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import TemplateResponseDocumentFormFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentFormFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentFormFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentFormFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentFormFieldInitials - from dropbox_sign.models import TemplateResponseDocumentFormFieldRadio - from dropbox_sign.models import TemplateResponseDocumentFormFieldSignature - from dropbox_sign.models import TemplateResponseDocumentFormFieldText - - -def lazy_import(): - from dropbox_sign.models import TemplateResponseDocumentFormFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentFormFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentFormFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentFormFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentFormFieldInitials - from dropbox_sign.models import TemplateResponseDocumentFormFieldRadio - from dropbox_sign.models import TemplateResponseDocumentFormFieldSignature - from dropbox_sign.models import TemplateResponseDocumentFormFieldText - globals()['TemplateResponseDocumentFormFieldCheckbox'] = TemplateResponseDocumentFormFieldCheckbox - globals()['TemplateResponseDocumentFormFieldDateSigned'] = TemplateResponseDocumentFormFieldDateSigned - globals()['TemplateResponseDocumentFormFieldDropdown'] = TemplateResponseDocumentFormFieldDropdown - globals()['TemplateResponseDocumentFormFieldHyperlink'] = TemplateResponseDocumentFormFieldHyperlink - globals()['TemplateResponseDocumentFormFieldInitials'] = TemplateResponseDocumentFormFieldInitials - globals()['TemplateResponseDocumentFormFieldRadio'] = TemplateResponseDocumentFormFieldRadio - globals()['TemplateResponseDocumentFormFieldSignature'] = TemplateResponseDocumentFormFieldSignature - globals()['TemplateResponseDocumentFormFieldText'] = TemplateResponseDocumentFormFieldText - - -class TemplateResponseDocumentFormFieldBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': TemplateResponseDocumentFormFieldCheckbox, - 'date_signed': TemplateResponseDocumentFormFieldDateSigned, - 'dropdown': TemplateResponseDocumentFormFieldDropdown, - 'hyperlink': TemplateResponseDocumentFormFieldHyperlink, - 'initials': TemplateResponseDocumentFormFieldInitials, - 'radio': TemplateResponseDocumentFormFieldRadio, - 'signature': TemplateResponseDocumentFormFieldSignature, - 'text': TemplateResponseDocumentFormFieldText, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_document_form_field_checkbox.py b/sdks/python/dropbox_sign/model/template_response_document_form_field_checkbox.py deleted file mode 100644 index 732d93e97..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_form_field_checkbox.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_form_field_date_signed.py b/sdks/python/dropbox_sign/model/template_response_document_form_field_date_signed.py deleted file mode 100644 index e6b00a11a..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_form_field_date_signed.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldDateSigned(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldDateSigned: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldDateSigned], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "date_signed" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "date_signed" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_form_field_dropdown.py b/sdks/python/dropbox_sign/model/template_response_document_form_field_dropdown.py deleted file mode 100644 index 148a53f46..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_form_field_dropdown.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldDropdown(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldDropdown: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldDropdown], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "dropdown" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "dropdown" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_form_field_hyperlink.py b/sdks/python/dropbox_sign/model/template_response_document_form_field_hyperlink.py deleted file mode 100644 index 28905138e..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_form_field_hyperlink.py +++ /dev/null @@ -1,500 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseFieldAvgTextLength'] = TemplateResponseFieldAvgTextLength - - -class TemplateResponseDocumentFormFieldHyperlink(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'avg_text_length': (TemplateResponseFieldAvgTextLength,), # noqa: E501 - 'is_multiline': (bool,), # noqa: E501 - 'original_font_size': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldHyperlink: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldHyperlink], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'avg_text_length': 'avg_text_length', # noqa: E501 - 'is_multiline': 'isMultiline', # noqa: E501 - 'original_font_size': 'originalFontSize', # noqa: E501 - 'font_family': 'fontFamily', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def avg_text_length(self) -> TemplateResponseFieldAvgTextLength: - return self.get("avg_text_length") - - @avg_text_length.setter - def avg_text_length(self, value: TemplateResponseFieldAvgTextLength): - setattr(self, "avg_text_length", value) - - @property - def is_multiline(self) -> bool: - return self.get("is_multiline") - - @is_multiline.setter - def is_multiline(self, value: bool): - setattr(self, "is_multiline", value) - - @property - def original_font_size(self) -> int: - return self.get("original_font_size") - - @original_font_size.setter - def original_font_size(self, value: int): - setattr(self, "original_font_size", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "hyperlink" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "hyperlink" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_form_field_initials.py b/sdks/python/dropbox_sign/model/template_response_document_form_field_initials.py deleted file mode 100644 index 63e941b1f..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_form_field_initials.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldInitials(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldInitials: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldInitials], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldInitials - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "initials" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldInitials - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "initials" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_form_field_radio.py b/sdks/python/dropbox_sign/model/template_response_document_form_field_radio.py deleted file mode 100644 index fd0889178..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_form_field_radio.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldRadio(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldRadio: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldRadio], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'group': 'group', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldRadio - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "radio" # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldRadio - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "radio" # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_form_field_signature.py b/sdks/python/dropbox_sign/model/template_response_document_form_field_signature.py deleted file mode 100644 index 8c8383368..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_form_field_signature.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldSignature(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldSignature: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldSignature], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldSignature - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "signature" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldSignature - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "signature" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_form_field_text.py b/sdks/python/dropbox_sign/model/template_response_document_form_field_text.py deleted file mode 100644 index 228cd748a..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_form_field_text.py +++ /dev/null @@ -1,525 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseFieldAvgTextLength'] = TemplateResponseFieldAvgTextLength - - -class TemplateResponseDocumentFormFieldText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('validation_type',): { - 'None': None, - 'NUMBERS_ONLY': "numbers_only", - 'LETTERS_ONLY': "letters_only", - 'PHONE_NUMBER': "phone_number", - 'BANK_ROUTING_NUMBER': "bank_routing_number", - 'BANK_ACCOUNT_NUMBER': "bank_account_number", - 'EMAIL_ADDRESS': "email_address", - 'ZIP_CODE': "zip_code", - 'SOCIAL_SECURITY_NUMBER': "social_security_number", - 'EMPLOYER_IDENTIFICATION_NUMBER': "employer_identification_number", - 'CUSTOM_REGEX': "custom_regex", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'avg_text_length': (TemplateResponseFieldAvgTextLength,), # noqa: E501 - 'is_multiline': (bool,), # noqa: E501 - 'original_font_size': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'validation_type': (str, none_type,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'avg_text_length': 'avg_text_length', # noqa: E501 - 'is_multiline': 'isMultiline', # noqa: E501 - 'original_font_size': 'originalFontSize', # noqa: E501 - 'font_family': 'fontFamily', # noqa: E501 - 'validation_type': 'validation_type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def avg_text_length(self) -> TemplateResponseFieldAvgTextLength: - return self.get("avg_text_length") - - @avg_text_length.setter - def avg_text_length(self, value: TemplateResponseFieldAvgTextLength): - setattr(self, "avg_text_length", value) - - @property - def is_multiline(self) -> bool: - return self.get("is_multiline") - - @is_multiline.setter - def is_multiline(self, value: bool): - setattr(self, "is_multiline", value) - - @property - def original_font_size(self) -> int: - return self.get("original_font_size") - - @original_font_size.setter - def original_font_size(self, value: int): - setattr(self, "original_font_size", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def validation_type(self) -> Optional[str]: - return self.get("validation_type") - - @validation_type.setter - def validation_type(self, value: Optional[str]): - setattr(self, "validation_type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - validation_type (str, none_type): Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.. [optional] # noqa: E501 - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - validation_type (str, none_type): Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.. [optional] # noqa: E501 - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_static_field.py b/sdks/python/dropbox_sign/model/template_response_document_static_field.py deleted file mode 100644 index 1339f042b..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_static_field.py +++ /dev/null @@ -1,391 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseDocumentStaticField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticField], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'type': 'type', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the static field.. [optional] # noqa: E501 - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types).. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the static field.. [optional] # noqa: E501 - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types).. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_document_static_field_base.py b/sdks/python/dropbox_sign/model/template_response_document_static_field_base.py deleted file mode 100644 index e6d4889be..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_static_field_base.py +++ /dev/null @@ -1,424 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import TemplateResponseDocumentStaticFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentStaticFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentStaticFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentStaticFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentStaticFieldInitials - from dropbox_sign.models import TemplateResponseDocumentStaticFieldRadio - from dropbox_sign.models import TemplateResponseDocumentStaticFieldSignature - from dropbox_sign.models import TemplateResponseDocumentStaticFieldText - - -def lazy_import(): - from dropbox_sign.models import TemplateResponseDocumentStaticFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentStaticFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentStaticFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentStaticFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentStaticFieldInitials - from dropbox_sign.models import TemplateResponseDocumentStaticFieldRadio - from dropbox_sign.models import TemplateResponseDocumentStaticFieldSignature - from dropbox_sign.models import TemplateResponseDocumentStaticFieldText - globals()['TemplateResponseDocumentStaticFieldCheckbox'] = TemplateResponseDocumentStaticFieldCheckbox - globals()['TemplateResponseDocumentStaticFieldDateSigned'] = TemplateResponseDocumentStaticFieldDateSigned - globals()['TemplateResponseDocumentStaticFieldDropdown'] = TemplateResponseDocumentStaticFieldDropdown - globals()['TemplateResponseDocumentStaticFieldHyperlink'] = TemplateResponseDocumentStaticFieldHyperlink - globals()['TemplateResponseDocumentStaticFieldInitials'] = TemplateResponseDocumentStaticFieldInitials - globals()['TemplateResponseDocumentStaticFieldRadio'] = TemplateResponseDocumentStaticFieldRadio - globals()['TemplateResponseDocumentStaticFieldSignature'] = TemplateResponseDocumentStaticFieldSignature - globals()['TemplateResponseDocumentStaticFieldText'] = TemplateResponseDocumentStaticFieldText - - -class TemplateResponseDocumentStaticFieldBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': TemplateResponseDocumentStaticFieldCheckbox, - 'date_signed': TemplateResponseDocumentStaticFieldDateSigned, - 'dropdown': TemplateResponseDocumentStaticFieldDropdown, - 'hyperlink': TemplateResponseDocumentStaticFieldHyperlink, - 'initials': TemplateResponseDocumentStaticFieldInitials, - 'radio': TemplateResponseDocumentStaticFieldRadio, - 'signature': TemplateResponseDocumentStaticFieldSignature, - 'text': TemplateResponseDocumentStaticFieldText, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_document_static_field_checkbox.py b/sdks/python/dropbox_sign/model/template_response_document_static_field_checkbox.py deleted file mode 100644 index c2ef91014..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_static_field_checkbox.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_static_field_date_signed.py b/sdks/python/dropbox_sign/model/template_response_document_static_field_date_signed.py deleted file mode 100644 index a4dcac48c..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_static_field_date_signed.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldDateSigned(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldDateSigned: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldDateSigned], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "date_signed" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "date_signed" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_static_field_dropdown.py b/sdks/python/dropbox_sign/model/template_response_document_static_field_dropdown.py deleted file mode 100644 index 666c01c70..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_static_field_dropdown.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldDropdown(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldDropdown: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldDropdown], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "dropdown" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "dropdown" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_static_field_hyperlink.py b/sdks/python/dropbox_sign/model/template_response_document_static_field_hyperlink.py deleted file mode 100644 index 0b25b795e..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_static_field_hyperlink.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldHyperlink(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldHyperlink: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldHyperlink], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "hyperlink" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "hyperlink" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_static_field_initials.py b/sdks/python/dropbox_sign/model/template_response_document_static_field_initials.py deleted file mode 100644 index c9a85a8a5..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_static_field_initials.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldInitials(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldInitials: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldInitials], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldInitials - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "initials" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldInitials - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "initials" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_static_field_radio.py b/sdks/python/dropbox_sign/model/template_response_document_static_field_radio.py deleted file mode 100644 index ac524bf90..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_static_field_radio.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldRadio(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldRadio: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldRadio], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldRadio - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "radio" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldRadio - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "radio" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_static_field_signature.py b/sdks/python/dropbox_sign/model/template_response_document_static_field_signature.py deleted file mode 100644 index f395397fd..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_static_field_signature.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldSignature(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldSignature: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldSignature], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldSignature - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "signature" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldSignature - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "signature" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_document_static_field_text.py b/sdks/python/dropbox_sign/model/template_response_document_static_field_text.py deleted file mode 100644 index 88f4e4607..000000000 --- a/sdks/python/dropbox_sign/model/template_response_document_static_field_text.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/sdks/python/dropbox_sign/model/template_response_field_avg_text_length.py b/sdks/python/dropbox_sign/model/template_response_field_avg_text_length.py deleted file mode 100644 index f5474c70c..000000000 --- a/sdks/python/dropbox_sign/model/template_response_field_avg_text_length.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseFieldAvgTextLength(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'num_lines': (int,), # noqa: E501 - 'num_chars_per_line': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseFieldAvgTextLength: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseFieldAvgTextLength], - _check_type=True, - ) - - attribute_map = { - 'num_lines': 'num_lines', # noqa: E501 - 'num_chars_per_line': 'num_chars_per_line', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def num_lines(self) -> int: - return self.get("num_lines") - - @num_lines.setter - def num_lines(self, value: int): - setattr(self, "num_lines", value) - - @property - def num_chars_per_line(self) -> int: - return self.get("num_chars_per_line") - - @num_chars_per_line.setter - def num_chars_per_line(self, value: int): - setattr(self, "num_chars_per_line", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseFieldAvgTextLength - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - num_lines (int): Number of lines.. [optional] # noqa: E501 - num_chars_per_line (int): Number of characters per line.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseFieldAvgTextLength - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - num_lines (int): Number of lines.. [optional] # noqa: E501 - num_chars_per_line (int): Number of characters per line.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_response_named_form_field.py b/sdks/python/dropbox_sign/model/template_response_named_form_field.py deleted file mode 100644 index 87e474753..000000000 --- a/sdks/python/dropbox_sign/model/template_response_named_form_field.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import TemplateResponseDocumentFormFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentFormFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentFormFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentFormFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentFormFieldInitials - from dropbox_sign.models import TemplateResponseDocumentFormFieldRadio - from dropbox_sign.models import TemplateResponseDocumentFormFieldSignature - from dropbox_sign.models import TemplateResponseDocumentFormFieldText - - -def lazy_import(): - from dropbox_sign.models import TemplateResponseDocumentFormFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentFormFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentFormFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentFormFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentFormFieldInitials - from dropbox_sign.models import TemplateResponseDocumentFormFieldRadio - from dropbox_sign.models import TemplateResponseDocumentFormFieldSignature - from dropbox_sign.models import TemplateResponseDocumentFormFieldText - globals()['TemplateResponseDocumentFormFieldCheckbox'] = TemplateResponseDocumentFormFieldCheckbox - globals()['TemplateResponseDocumentFormFieldDateSigned'] = TemplateResponseDocumentFormFieldDateSigned - globals()['TemplateResponseDocumentFormFieldDropdown'] = TemplateResponseDocumentFormFieldDropdown - globals()['TemplateResponseDocumentFormFieldHyperlink'] = TemplateResponseDocumentFormFieldHyperlink - globals()['TemplateResponseDocumentFormFieldInitials'] = TemplateResponseDocumentFormFieldInitials - globals()['TemplateResponseDocumentFormFieldRadio'] = TemplateResponseDocumentFormFieldRadio - globals()['TemplateResponseDocumentFormFieldSignature'] = TemplateResponseDocumentFormFieldSignature - globals()['TemplateResponseDocumentFormFieldText'] = TemplateResponseDocumentFormFieldText - - -class TemplateResponseNamedFormField(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'value': (TemplateResponseDocumentFormFieldBase,), - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': TemplateResponseDocumentFormFieldCheckbox, - 'date_signed': TemplateResponseDocumentFormFieldDateSigned, - 'dropdown': TemplateResponseDocumentFormFieldDropdown, - 'hyperlink': TemplateResponseDocumentFormFieldHyperlink, - 'initials': TemplateResponseDocumentFormFieldInitials, - 'radio': TemplateResponseDocumentFormFieldRadio, - 'signature': TemplateResponseDocumentFormFieldSignature, - 'text': TemplateResponseDocumentFormFieldText, - } - if not val: - return None - return {'type': val} - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """TemplateResponseNamedFormField - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (TemplateResponseDocumentFormFieldBase): # noqa: E501 - - Keyword Args: - value (TemplateResponseDocumentFormFieldBase): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """TemplateResponseNamedFormField - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (TemplateResponseDocumentFormFieldBase): # noqa: E501 - - Keyword Args: - value (TemplateResponseDocumentFormFieldBase): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/sdks/python/dropbox_sign/model/template_response_signer_role.py b/sdks/python/dropbox_sign/model/template_response_signer_role.py deleted file mode 100644 index d2588795e..000000000 --- a/sdks/python/dropbox_sign/model/template_response_signer_role.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseSignerRole(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'order': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseSignerRole: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseSignerRole], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'order': 'order', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def order(self) -> int: - return self.get("order") - - @order.setter - def order(self, value: int): - setattr(self, "order", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseSignerRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Role.. [optional] # noqa: E501 - order (int): If signer order is assigned this is the 0-based index for this role.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseSignerRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Role.. [optional] # noqa: E501 - order (int): If signer order is assigned this is the 0-based index for this role.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_update_files_request.py b/sdks/python/dropbox_sign/model/template_update_files_request.py deleted file mode 100644 index cb7439b48..000000000 --- a/sdks/python/dropbox_sign/model/template_update_files_request.py +++ /dev/null @@ -1,349 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateUpdateFilesRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('subject',): { - 'max_length': 100, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'client_id': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateUpdateFilesRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateUpdateFilesRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'message': 'message', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client_id (str): Client id of the app you're using to update this template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The new default template email message.. [optional] # noqa: E501 - subject (str): The new default template email subject.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client_id (str): Client id of the app you're using to update this template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The new default template email message.. [optional] # noqa: E501 - subject (str): The new default template email subject.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_update_files_response.py b/sdks/python/dropbox_sign/model/template_update_files_response.py deleted file mode 100644 index 7bd63545a..000000000 --- a/sdks/python/dropbox_sign/model/template_update_files_response.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_update_files_response_template import TemplateUpdateFilesResponseTemplate - - -def lazy_import(): - from dropbox_sign.model.template_update_files_response_template import TemplateUpdateFilesResponseTemplate - globals()['TemplateUpdateFilesResponseTemplate'] = TemplateUpdateFilesResponseTemplate - - -class TemplateUpdateFilesResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template': (TemplateUpdateFilesResponseTemplate,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateUpdateFilesResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateUpdateFilesResponse], - _check_type=True, - ) - - attribute_map = { - 'template': 'template', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template(self) -> TemplateUpdateFilesResponseTemplate: - return self.get("template") - - @template.setter - def template(self, value: TemplateUpdateFilesResponseTemplate): - setattr(self, "template", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateUpdateFilesResponseTemplate): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateUpdateFilesResponseTemplate): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/template_update_files_response_template.py b/sdks/python/dropbox_sign/model/template_update_files_response_template.py deleted file mode 100644 index fca68302b..000000000 --- a/sdks/python/dropbox_sign/model/template_update_files_response_template.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.warning_response import WarningResponse - globals()['WarningResponse'] = WarningResponse - - -class TemplateUpdateFilesResponseTemplate(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_id': (str,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateUpdateFilesResponseTemplate: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateUpdateFilesResponseTemplate], - _check_type=True, - ) - - attribute_map = { - 'template_id': 'template_id', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_id(self) -> str: - return self.get("template_id") - - @template_id.setter - def template_id(self, value: str): - setattr(self, "template_id", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/unclaimed_draft_create_embedded_request.py b/sdks/python/dropbox_sign/model/unclaimed_draft_create_embedded_request.py deleted file mode 100644 index 5aba8dbb2..000000000 --- a/sdks/python/dropbox_sign/model/unclaimed_draft_create_embedded_request.py +++ /dev/null @@ -1,755 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubEditorOptions'] = SubEditorOptions - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSigningOptions'] = SubSigningOptions - globals()['SubUnclaimedDraftSigner'] = SubUnclaimedDraftSigner - - -class UnclaimedDraftCreateEmbeddedRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'SEND_DOCUMENT': "send_document", - 'REQUEST_SIGNATURE': "request_signature", - }, - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 200, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'requester_email_address': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'allow_ccs': (bool,), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'editor_options': (SubEditorOptions,), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'force_signer_page': (bool,), # noqa: E501 - 'force_subject_message': (bool,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'hold_request': (bool,), # noqa: E501 - 'is_for_embedded_signing': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'requesting_redirect_url': (str,), # noqa: E501 - 'show_preview': (bool,), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'signers': ([SubUnclaimedDraftSigner],), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'skip_me_now': (bool,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'use_preexisting_fields': (bool,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftCreateEmbeddedRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftCreateEmbeddedRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'requester_email_address': 'requester_email_address', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'allow_ccs': 'allow_ccs', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'editor_options': 'editor_options', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'force_signer_page': 'force_signer_page', # noqa: E501 - 'force_subject_message': 'force_subject_message', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'hold_request': 'hold_request', # noqa: E501 - 'is_for_embedded_signing': 'is_for_embedded_signing', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'requesting_redirect_url': 'requesting_redirect_url', # noqa: E501 - 'show_preview': 'show_preview', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'skip_me_now': 'skip_me_now', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'type': 'type', # noqa: E501 - 'use_preexisting_fields': 'use_preexisting_fields', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def requester_email_address(self) -> str: - return self.get("requester_email_address") - - @requester_email_address.setter - def requester_email_address(self, value: str): - setattr(self, "requester_email_address", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def allow_ccs(self) -> bool: - return self.get("allow_ccs") - - @allow_ccs.setter - def allow_ccs(self, value: bool): - setattr(self, "allow_ccs", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def editor_options(self) -> SubEditorOptions: - return self.get("editor_options") - - @editor_options.setter - def editor_options(self, value: SubEditorOptions): - setattr(self, "editor_options", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def force_signer_page(self) -> bool: - return self.get("force_signer_page") - - @force_signer_page.setter - def force_signer_page(self, value: bool): - setattr(self, "force_signer_page", value) - - @property - def force_subject_message(self) -> bool: - return self.get("force_subject_message") - - @force_subject_message.setter - def force_subject_message(self, value: bool): - setattr(self, "force_subject_message", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def hold_request(self) -> bool: - return self.get("hold_request") - - @hold_request.setter - def hold_request(self, value: bool): - setattr(self, "hold_request", value) - - @property - def is_for_embedded_signing(self) -> bool: - return self.get("is_for_embedded_signing") - - @is_for_embedded_signing.setter - def is_for_embedded_signing(self, value: bool): - setattr(self, "is_for_embedded_signing", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def requesting_redirect_url(self) -> str: - return self.get("requesting_redirect_url") - - @requesting_redirect_url.setter - def requesting_redirect_url(self, value: str): - setattr(self, "requesting_redirect_url", value) - - @property - def show_preview(self) -> bool: - return self.get("show_preview") - - @show_preview.setter - def show_preview(self, value: bool): - setattr(self, "show_preview", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def signers(self) -> List[SubUnclaimedDraftSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubUnclaimedDraftSigner]): - setattr(self, "signers", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def skip_me_now(self) -> bool: - return self.get("skip_me_now") - - @skip_me_now.setter - def skip_me_now(self, value: bool): - setattr(self, "skip_me_now", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def use_preexisting_fields(self) -> bool: - return self.get("use_preexisting_fields") - - @use_preexisting_fields.setter - def use_preexisting_fields(self, value: bool): - setattr(self, "use_preexisting_fields", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, requester_email_address, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - requester_email_address (str): The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.. [optional] if omitted the server will use the default value of True # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - force_signer_page (bool): Provide users the ability to review/edit the signers.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.. [optional] if omitted the server will use the default value of False # noqa: E501 - hold_request (bool): The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftSigner]): Add Signers to your Unclaimed Draft Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - type (str): The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it.. [optional] if omitted the server will use the default value of "request_signature" # noqa: E501 - use_preexisting_fields (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_text_tags (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.requester_email_address = requester_email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, requester_email_address, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - requester_email_address (str): The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.. [optional] if omitted the server will use the default value of True # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - force_signer_page (bool): Provide users the ability to review/edit the signers.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.. [optional] if omitted the server will use the default value of False # noqa: E501 - hold_request (bool): The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftSigner]): Add Signers to your Unclaimed Draft Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - type (str): The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it.. [optional] if omitted the server will use the default value of "request_signature" # noqa: E501 - use_preexisting_fields (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_text_tags (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.requester_email_address = requester_email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/unclaimed_draft_create_embedded_with_template_request.py b/sdks/python/dropbox_sign/model/unclaimed_draft_create_embedded_with_template_request.py deleted file mode 100644 index 6c3a935d2..000000000 --- a/sdks/python/dropbox_sign/model/unclaimed_draft_create_embedded_with_template_request.py +++ /dev/null @@ -1,675 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner - - -def lazy_import(): - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - globals()['SubEditorOptions'] = SubEditorOptions - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubSigningOptions'] = SubSigningOptions - globals()['SubUnclaimedDraftTemplateSigner'] = SubUnclaimedDraftTemplateSigner - - -class UnclaimedDraftCreateEmbeddedWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'requester_email_address': (str,), # noqa: E501 - 'template_ids': ([str],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'editor_options': (SubEditorOptions,), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'force_signer_roles': (bool,), # noqa: E501 - 'force_subject_message': (bool,), # noqa: E501 - 'hold_request': (bool,), # noqa: E501 - 'is_for_embedded_signing': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'preview_only': (bool,), # noqa: E501 - 'requesting_redirect_url': (str,), # noqa: E501 - 'show_preview': (bool,), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'signers': ([SubUnclaimedDraftTemplateSigner],), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'skip_me_now': (bool,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - 'allow_ccs': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftCreateEmbeddedWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftCreateEmbeddedWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'requester_email_address': 'requester_email_address', # noqa: E501 - 'template_ids': 'template_ids', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'editor_options': 'editor_options', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'force_signer_roles': 'force_signer_roles', # noqa: E501 - 'force_subject_message': 'force_subject_message', # noqa: E501 - 'hold_request': 'hold_request', # noqa: E501 - 'is_for_embedded_signing': 'is_for_embedded_signing', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'preview_only': 'preview_only', # noqa: E501 - 'requesting_redirect_url': 'requesting_redirect_url', # noqa: E501 - 'show_preview': 'show_preview', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'skip_me_now': 'skip_me_now', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - 'allow_ccs': 'allow_ccs', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def requester_email_address(self) -> str: - return self.get("requester_email_address") - - @requester_email_address.setter - def requester_email_address(self, value: str): - setattr(self, "requester_email_address", value) - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def editor_options(self) -> SubEditorOptions: - return self.get("editor_options") - - @editor_options.setter - def editor_options(self, value: SubEditorOptions): - setattr(self, "editor_options", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def force_signer_roles(self) -> bool: - return self.get("force_signer_roles") - - @force_signer_roles.setter - def force_signer_roles(self, value: bool): - setattr(self, "force_signer_roles", value) - - @property - def force_subject_message(self) -> bool: - return self.get("force_subject_message") - - @force_subject_message.setter - def force_subject_message(self, value: bool): - setattr(self, "force_subject_message", value) - - @property - def hold_request(self) -> bool: - return self.get("hold_request") - - @hold_request.setter - def hold_request(self, value: bool): - setattr(self, "hold_request", value) - - @property - def is_for_embedded_signing(self) -> bool: - return self.get("is_for_embedded_signing") - - @is_for_embedded_signing.setter - def is_for_embedded_signing(self, value: bool): - setattr(self, "is_for_embedded_signing", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def preview_only(self) -> bool: - return self.get("preview_only") - - @preview_only.setter - def preview_only(self, value: bool): - setattr(self, "preview_only", value) - - @property - def requesting_redirect_url(self) -> str: - return self.get("requesting_redirect_url") - - @requesting_redirect_url.setter - def requesting_redirect_url(self, value: str): - setattr(self, "requesting_redirect_url", value) - - @property - def show_preview(self) -> bool: - return self.get("show_preview") - - @show_preview.setter - def show_preview(self, value: bool): - setattr(self, "show_preview", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def signers(self) -> List[SubUnclaimedDraftTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubUnclaimedDraftTemplateSigner]): - setattr(self, "signers", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def skip_me_now(self) -> bool: - return self.get("skip_me_now") - - @skip_me_now.setter - def skip_me_now(self, value: bool): - setattr(self, "skip_me_now", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @property - def allow_ccs(self) -> bool: - return self.get("allow_ccs") - - @allow_ccs.setter - def allow_ccs(self, value: bool): - setattr(self, "allow_ccs", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, requester_email_address, template_ids, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - requester_email_address (str): The email address of the user that should be designated as the requester of this draft. - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - files ([file_type]): Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.. [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - hold_request (bool): The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - preview_only (bool): This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set).. [optional] if omitted the server will use the default value of False # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftTemplateSigner]): Add Signers to your Templated-based Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.requester_email_address = requester_email_address - self.template_ids = template_ids - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, requester_email_address, template_ids, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - requester_email_address (str): The email address of the user that should be designated as the requester of this draft. - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - files ([file_type]): Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.. [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - hold_request (bool): The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - preview_only (bool): This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set).. [optional] if omitted the server will use the default value of False # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftTemplateSigner]): Add Signers to your Templated-based Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.requester_email_address = requester_email_address - self.template_ids = template_ids - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/unclaimed_draft_create_request.py b/sdks/python/dropbox_sign/model/unclaimed_draft_create_request.py deleted file mode 100644 index 960d727c9..000000000 --- a/sdks/python/dropbox_sign/model/unclaimed_draft_create_request.py +++ /dev/null @@ -1,606 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSigningOptions'] = SubSigningOptions - globals()['SubUnclaimedDraftSigner'] = SubUnclaimedDraftSigner - - -class UnclaimedDraftCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'SEND_DOCUMENT': "send_document", - 'REQUEST_SIGNATURE': "request_signature", - }, - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 200, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'signers': ([SubUnclaimedDraftSigner],), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'use_preexisting_fields': (bool,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'type': 'type', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'use_preexisting_fields': 'use_preexisting_fields', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def signers(self) -> List[SubUnclaimedDraftSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubUnclaimedDraftSigner]): - setattr(self, "signers", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def use_preexisting_fields(self) -> bool: - return self.get("use_preexisting_fields") - - @use_preexisting_fields.setter - def use_preexisting_fields(self, value: bool): - setattr(self, "use_preexisting_fields", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateRequest - a model defined in OpenAPI - - Args: - type (str): The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftSigner]): Add Signers to your Unclaimed Draft Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_preexisting_fields (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_text_tags (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateRequest - a model defined in OpenAPI - - Args: - type (str): The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftSigner]): Add Signers to your Unclaimed Draft Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_preexisting_fields (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_text_tags (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/unclaimed_draft_create_response.py b/sdks/python/dropbox_sign/model/unclaimed_draft_create_response.py deleted file mode 100644 index d2c585e42..000000000 --- a/sdks/python/dropbox_sign/model/unclaimed_draft_create_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.unclaimed_draft_response import UnclaimedDraftResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.unclaimed_draft_response import UnclaimedDraftResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['UnclaimedDraftResponse'] = UnclaimedDraftResponse - globals()['WarningResponse'] = WarningResponse - - -class UnclaimedDraftCreateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'unclaimed_draft': (UnclaimedDraftResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftCreateResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftCreateResponse], - _check_type=True, - ) - - attribute_map = { - 'unclaimed_draft': 'unclaimed_draft', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def unclaimed_draft(self) -> UnclaimedDraftResponse: - return self.get("unclaimed_draft") - - @unclaimed_draft.setter - def unclaimed_draft(self, value: UnclaimedDraftResponse): - setattr(self, "unclaimed_draft", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - unclaimed_draft (UnclaimedDraftResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - unclaimed_draft (UnclaimedDraftResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/unclaimed_draft_edit_and_resend_request.py b/sdks/python/dropbox_sign/model/unclaimed_draft_edit_and_resend_request.py deleted file mode 100644 index 3ddf62f69..000000000 --- a/sdks/python/dropbox_sign/model/unclaimed_draft_edit_and_resend_request.py +++ /dev/null @@ -1,381 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_editor_options import SubEditorOptions - - -def lazy_import(): - from dropbox_sign.model.sub_editor_options import SubEditorOptions - globals()['SubEditorOptions'] = SubEditorOptions - - -class UnclaimedDraftEditAndResendRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'editor_options': (SubEditorOptions,), # noqa: E501 - 'is_for_embedded_signing': (bool,), # noqa: E501 - 'requester_email_address': (str,), # noqa: E501 - 'requesting_redirect_url': (str,), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftEditAndResendRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftEditAndResendRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'editor_options': 'editor_options', # noqa: E501 - 'is_for_embedded_signing': 'is_for_embedded_signing', # noqa: E501 - 'requester_email_address': 'requester_email_address', # noqa: E501 - 'requesting_redirect_url': 'requesting_redirect_url', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def editor_options(self) -> SubEditorOptions: - return self.get("editor_options") - - @editor_options.setter - def editor_options(self, value: SubEditorOptions): - setattr(self, "editor_options", value) - - @property - def is_for_embedded_signing(self) -> bool: - return self.get("is_for_embedded_signing") - - @is_for_embedded_signing.setter - def is_for_embedded_signing(self, value: bool): - setattr(self, "is_for_embedded_signing", value) - - @property - def requester_email_address(self) -> str: - return self.get("requester_email_address") - - @requester_email_address.setter - def requester_email_address(self, value: str): - setattr(self, "requester_email_address", value) - - @property - def requesting_redirect_url(self) -> str: - return self.get("requesting_redirect_url") - - @requesting_redirect_url.setter - def requesting_redirect_url(self, value: str): - setattr(self, "requesting_redirect_url", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, *args, **kwargs): # noqa: E501 - """UnclaimedDraftEditAndResendRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - editor_options (SubEditorOptions): [optional] # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`.. [optional] # noqa: E501 - requester_email_address (str): The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used.. [optional] # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, *args, **kwargs): # noqa: E501 - """UnclaimedDraftEditAndResendRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - editor_options (SubEditorOptions): [optional] # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`.. [optional] # noqa: E501 - requester_email_address (str): The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used.. [optional] # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/unclaimed_draft_response.py b/sdks/python/dropbox_sign/model/unclaimed_draft_response.py deleted file mode 100644 index 158e96f0d..000000000 --- a/sdks/python/dropbox_sign/model/unclaimed_draft_response.py +++ /dev/null @@ -1,343 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class UnclaimedDraftResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'signature_request_id': (str, none_type,), # noqa: E501 - 'claim_url': (str,), # noqa: E501 - 'signing_redirect_url': (str, none_type,), # noqa: E501 - 'requesting_redirect_url': (str, none_type,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftResponse], - _check_type=True, - ) - - attribute_map = { - 'signature_request_id': 'signature_request_id', # noqa: E501 - 'claim_url': 'claim_url', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'requesting_redirect_url': 'requesting_redirect_url', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def signature_request_id(self) -> Optional[str]: - return self.get("signature_request_id") - - @signature_request_id.setter - def signature_request_id(self, value: Optional[str]): - setattr(self, "signature_request_id", value) - - @property - def claim_url(self) -> str: - return self.get("claim_url") - - @claim_url.setter - def claim_url(self, value: str): - setattr(self, "claim_url", value) - - @property - def signing_redirect_url(self) -> Optional[str]: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: Optional[str]): - setattr(self, "signing_redirect_url", value) - - @property - def requesting_redirect_url(self) -> Optional[str]: - return self.get("requesting_redirect_url") - - @requesting_redirect_url.setter - def requesting_redirect_url(self, value: Optional[str]): - setattr(self, "requesting_redirect_url", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """UnclaimedDraftResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_request_id (str, none_type): The ID of the signature request that is represented by this UnclaimedDraft.. [optional] # noqa: E501 - claim_url (str): The URL to be used to claim this UnclaimedDraft.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - requesting_redirect_url (str, none_type): The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.).. [optional] # noqa: E501 - expires_at (int, none_type): When the link expires.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test draft. Signature requests made from test drafts have no legal value.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """UnclaimedDraftResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_request_id (str, none_type): The ID of the signature request that is represented by this UnclaimedDraft.. [optional] # noqa: E501 - claim_url (str): The URL to be used to claim this UnclaimedDraft.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - requesting_redirect_url (str, none_type): The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.).. [optional] # noqa: E501 - expires_at (int, none_type): When the link expires.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test draft. Signature requests made from test drafts have no legal value.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model/warning_response.py b/sdks/python/dropbox_sign/model/warning_response.py deleted file mode 100644 index eb6276670..000000000 --- a/sdks/python/dropbox_sign/model/warning_response.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class WarningResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'warning_msg': (str,), # noqa: E501 - 'warning_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> WarningResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[WarningResponse], - _check_type=True, - ) - - attribute_map = { - 'warning_msg': 'warning_msg', # noqa: E501 - 'warning_name': 'warning_name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def warning_msg(self) -> str: - return self.get("warning_msg") - - @warning_msg.setter - def warning_msg(self, value: str): - setattr(self, "warning_msg", value) - - @property - def warning_name(self) -> str: - return self.get("warning_name") - - @warning_name.setter - def warning_name(self, value: str): - setattr(self, "warning_name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, warning_msg, warning_name, *args, **kwargs): # noqa: E501 - """WarningResponse - a model defined in OpenAPI - - Args: - warning_msg (str): Warning message - warning_name (str): Warning name - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.warning_msg = warning_msg - self.warning_name = warning_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, warning_msg, warning_name, *args, **kwargs): # noqa: E501 - """WarningResponse - a model defined in OpenAPI - - Args: - warning_msg (str): Warning message - warning_name (str): Warning name - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.warning_msg = warning_msg - self.warning_name = warning_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/sdks/python/dropbox_sign/model_utils.py b/sdks/python/dropbox_sign/model_utils.py deleted file mode 100644 index 7b89acc17..000000000 --- a/sdks/python/dropbox_sign/model_utils.py +++ /dev/null @@ -1,2042 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile - -from dateutil.parser import parse - -from dropbox_sign.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return new_cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst - - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - return None - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - return None - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - # leave ints as-is - if type(current_item) is int and required_type_class_simplified == current_type_simple: - results_classes.append(int) - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - - # allow casting int to string - if type(current_item) is int: - results_classes.append(str) - - if type(current_item) is none_type: - results_classes.append(none_type) - return results_classes - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - elif data is None: - # This SDK does not support nullable params unless they are explicitly marked as nullable - return data - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - if input_value is None: - return input_value - - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if configuration: - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item - - model_instances = [model_instance] - if model_instance._composed_schemas: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - result[attr] = model_to_dict_recursive(value, serialize, extract_item) - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def model_to_dict_recursive(value, serialize, extract_item): - if isinstance(value, list): - res = [] - - for v in value: - res.append(model_to_dict_recursive(v, serialize, extract_item)) - - return res - elif isinstance(value, dict): - return dict(map( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - return value.value - elif hasattr(value, '_data_store'): - return model_to_dict(value, serialize=serialize) - elif isinstance(value, io.BufferedReader): - return value.name - else: - return value - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - if 'allOf' in self._composed_schemas.keys(): - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data(**model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data(model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + composed_instances - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] \ No newline at end of file diff --git a/sdks/python/dropbox_sign/models/__init__.py b/sdks/python/dropbox_sign/models/__init__.py index 81a97b084..ed9579770 100644 --- a/sdks/python/dropbox_sign/models/__init__.py +++ b/sdks/python/dropbox_sign/models/__init__.py @@ -1,183 +1,200 @@ +# coding: utf-8 + # flake8: noqa +""" + 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 all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from dropbox_sign.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) -from dropbox_sign.model.account_create_request import AccountCreateRequest -from dropbox_sign.model.account_create_response import AccountCreateResponse -from dropbox_sign.model.account_get_response import AccountGetResponse -from dropbox_sign.model.account_response import AccountResponse -from dropbox_sign.model.account_response_quotas import AccountResponseQuotas -from dropbox_sign.model.account_response_usage import AccountResponseUsage -from dropbox_sign.model.account_update_request import AccountUpdateRequest -from dropbox_sign.model.account_verify_request import AccountVerifyRequest -from dropbox_sign.model.account_verify_response import AccountVerifyResponse -from dropbox_sign.model.account_verify_response_account import AccountVerifyResponseAccount -from dropbox_sign.model.api_app_create_request import ApiAppCreateRequest -from dropbox_sign.model.api_app_get_response import ApiAppGetResponse -from dropbox_sign.model.api_app_list_response import ApiAppListResponse -from dropbox_sign.model.api_app_response import ApiAppResponse -from dropbox_sign.model.api_app_response_o_auth import ApiAppResponseOAuth -from dropbox_sign.model.api_app_response_options import ApiAppResponseOptions -from dropbox_sign.model.api_app_response_owner_account import ApiAppResponseOwnerAccount -from dropbox_sign.model.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions -from dropbox_sign.model.api_app_update_request import ApiAppUpdateRequest -from dropbox_sign.model.bulk_send_job_get_response import BulkSendJobGetResponse -from dropbox_sign.model.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests -from dropbox_sign.model.bulk_send_job_list_response import BulkSendJobListResponse -from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse -from dropbox_sign.model.bulk_send_job_send_response import BulkSendJobSendResponse -from dropbox_sign.model.embedded_edit_url_request import EmbeddedEditUrlRequest -from dropbox_sign.model.embedded_edit_url_response import EmbeddedEditUrlResponse -from dropbox_sign.model.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded -from dropbox_sign.model.embedded_sign_url_response import EmbeddedSignUrlResponse -from dropbox_sign.model.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.error_response_error import ErrorResponseError -from dropbox_sign.model.event_callback_request import EventCallbackRequest -from dropbox_sign.model.event_callback_request_event import EventCallbackRequestEvent -from dropbox_sign.model.event_callback_request_event_metadata import EventCallbackRequestEventMetadata -from dropbox_sign.model.file_response import FileResponse -from dropbox_sign.model.file_response_data_uri import FileResponseDataUri -from dropbox_sign.model.list_info_response import ListInfoResponse -from dropbox_sign.model.o_auth_token_generate_request import OAuthTokenGenerateRequest -from dropbox_sign.model.o_auth_token_refresh_request import OAuthTokenRefreshRequest -from dropbox_sign.model.o_auth_token_response import OAuthTokenResponse -from dropbox_sign.model.report_create_request import ReportCreateRequest -from dropbox_sign.model.report_create_response import ReportCreateResponse -from dropbox_sign.model.report_response import ReportResponse -from dropbox_sign.model.signature_request_bulk_create_embedded_with_template_request import SignatureRequestBulkCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.signature_request_bulk_send_with_template_request import SignatureRequestBulkSendWithTemplateRequest -from dropbox_sign.model.signature_request_create_embedded_request import SignatureRequestCreateEmbeddedRequest -from dropbox_sign.model.signature_request_create_embedded_with_template_request import SignatureRequestCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.signature_request_get_response import SignatureRequestGetResponse -from dropbox_sign.model.signature_request_list_response import SignatureRequestListResponse -from dropbox_sign.model.signature_request_remind_request import SignatureRequestRemindRequest -from dropbox_sign.model.signature_request_response import SignatureRequestResponse -from dropbox_sign.model.signature_request_response_attachment import SignatureRequestResponseAttachment -from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase -from dropbox_sign.model.signature_request_response_custom_field_checkbox import SignatureRequestResponseCustomFieldCheckbox -from dropbox_sign.model.signature_request_response_custom_field_text import SignatureRequestResponseCustomFieldText -from dropbox_sign.model.signature_request_response_custom_field_type_enum import SignatureRequestResponseCustomFieldTypeEnum -from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase -from dropbox_sign.model.signature_request_response_data_type_enum import SignatureRequestResponseDataTypeEnum -from dropbox_sign.model.signature_request_response_data_value_checkbox import SignatureRequestResponseDataValueCheckbox -from dropbox_sign.model.signature_request_response_data_value_checkbox_merge import SignatureRequestResponseDataValueCheckboxMerge -from dropbox_sign.model.signature_request_response_data_value_date_signed import SignatureRequestResponseDataValueDateSigned -from dropbox_sign.model.signature_request_response_data_value_dropdown import SignatureRequestResponseDataValueDropdown -from dropbox_sign.model.signature_request_response_data_value_initials import SignatureRequestResponseDataValueInitials -from dropbox_sign.model.signature_request_response_data_value_radio import SignatureRequestResponseDataValueRadio -from dropbox_sign.model.signature_request_response_data_value_signature import SignatureRequestResponseDataValueSignature -from dropbox_sign.model.signature_request_response_data_value_text import SignatureRequestResponseDataValueText -from dropbox_sign.model.signature_request_response_data_value_text_merge import SignatureRequestResponseDataValueTextMerge -from dropbox_sign.model.signature_request_response_signatures import SignatureRequestResponseSignatures -from dropbox_sign.model.signature_request_send_request import SignatureRequestSendRequest -from dropbox_sign.model.signature_request_send_with_template_request import SignatureRequestSendWithTemplateRequest -from dropbox_sign.model.signature_request_update_request import SignatureRequestUpdateRequest -from dropbox_sign.model.sub_attachment import SubAttachment -from dropbox_sign.model.sub_bulk_signer_list import SubBulkSignerList -from dropbox_sign.model.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField -from dropbox_sign.model.sub_cc import SubCC -from dropbox_sign.model.sub_custom_field import SubCustomField -from dropbox_sign.model.sub_editor_options import SubEditorOptions -from dropbox_sign.model.sub_field_options import SubFieldOptions -from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup -from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule -from dropbox_sign.model.sub_form_field_rule_action import SubFormFieldRuleAction -from dropbox_sign.model.sub_form_field_rule_trigger import SubFormFieldRuleTrigger -from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase -from dropbox_sign.model.sub_form_fields_per_document_checkbox import SubFormFieldsPerDocumentCheckbox -from dropbox_sign.model.sub_form_fields_per_document_checkbox_merge import SubFormFieldsPerDocumentCheckboxMerge -from dropbox_sign.model.sub_form_fields_per_document_date_signed import SubFormFieldsPerDocumentDateSigned -from dropbox_sign.model.sub_form_fields_per_document_dropdown import SubFormFieldsPerDocumentDropdown -from dropbox_sign.model.sub_form_fields_per_document_font_enum import SubFormFieldsPerDocumentFontEnum -from dropbox_sign.model.sub_form_fields_per_document_hyperlink import SubFormFieldsPerDocumentHyperlink -from dropbox_sign.model.sub_form_fields_per_document_initials import SubFormFieldsPerDocumentInitials -from dropbox_sign.model.sub_form_fields_per_document_radio import SubFormFieldsPerDocumentRadio -from dropbox_sign.model.sub_form_fields_per_document_signature import SubFormFieldsPerDocumentSignature -from dropbox_sign.model.sub_form_fields_per_document_text import SubFormFieldsPerDocumentText -from dropbox_sign.model.sub_form_fields_per_document_text_merge import SubFormFieldsPerDocumentTextMerge -from dropbox_sign.model.sub_form_fields_per_document_type_enum import SubFormFieldsPerDocumentTypeEnum -from dropbox_sign.model.sub_merge_field import SubMergeField -from dropbox_sign.model.sub_o_auth import SubOAuth -from dropbox_sign.model.sub_options import SubOptions -from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners -from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner -from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner -from dropbox_sign.model.sub_signing_options import SubSigningOptions -from dropbox_sign.model.sub_team_response import SubTeamResponse -from dropbox_sign.model.sub_template_role import SubTemplateRole -from dropbox_sign.model.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner -from dropbox_sign.model.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner -from dropbox_sign.model.sub_white_labeling_options import SubWhiteLabelingOptions -from dropbox_sign.model.team_add_member_request import TeamAddMemberRequest -from dropbox_sign.model.team_create_request import TeamCreateRequest -from dropbox_sign.model.team_get_info_response import TeamGetInfoResponse -from dropbox_sign.model.team_get_response import TeamGetResponse -from dropbox_sign.model.team_info_response import TeamInfoResponse -from dropbox_sign.model.team_invite_response import TeamInviteResponse -from dropbox_sign.model.team_invites_response import TeamInvitesResponse -from dropbox_sign.model.team_member_response import TeamMemberResponse -from dropbox_sign.model.team_members_response import TeamMembersResponse -from dropbox_sign.model.team_parent_response import TeamParentResponse -from dropbox_sign.model.team_remove_member_request import TeamRemoveMemberRequest -from dropbox_sign.model.team_response import TeamResponse -from dropbox_sign.model.team_sub_teams_response import TeamSubTeamsResponse -from dropbox_sign.model.team_update_request import TeamUpdateRequest -from dropbox_sign.model.template_add_user_request import TemplateAddUserRequest -from dropbox_sign.model.template_create_embedded_draft_request import TemplateCreateEmbeddedDraftRequest -from dropbox_sign.model.template_create_embedded_draft_response import TemplateCreateEmbeddedDraftResponse -from dropbox_sign.model.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate -from dropbox_sign.model.template_create_request import TemplateCreateRequest -from dropbox_sign.model.template_create_response import TemplateCreateResponse -from dropbox_sign.model.template_create_response_template import TemplateCreateResponseTemplate -from dropbox_sign.model.template_edit_response import TemplateEditResponse -from dropbox_sign.model.template_get_response import TemplateGetResponse -from dropbox_sign.model.template_list_response import TemplateListResponse -from dropbox_sign.model.template_remove_user_request import TemplateRemoveUserRequest -from dropbox_sign.model.template_response import TemplateResponse -from dropbox_sign.model.template_response_account import TemplateResponseAccount -from dropbox_sign.model.template_response_account_quota import TemplateResponseAccountQuota -from dropbox_sign.model.template_response_cc_role import TemplateResponseCCRole -from dropbox_sign.model.template_response_document import TemplateResponseDocument -from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase -from dropbox_sign.model.template_response_document_custom_field_checkbox import TemplateResponseDocumentCustomFieldCheckbox -from dropbox_sign.model.template_response_document_custom_field_text import TemplateResponseDocumentCustomFieldText -from dropbox_sign.model.template_response_document_field_group import TemplateResponseDocumentFieldGroup -from dropbox_sign.model.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule -from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase -from dropbox_sign.model.template_response_document_form_field_checkbox import TemplateResponseDocumentFormFieldCheckbox -from dropbox_sign.model.template_response_document_form_field_date_signed import TemplateResponseDocumentFormFieldDateSigned -from dropbox_sign.model.template_response_document_form_field_dropdown import TemplateResponseDocumentFormFieldDropdown -from dropbox_sign.model.template_response_document_form_field_hyperlink import TemplateResponseDocumentFormFieldHyperlink -from dropbox_sign.model.template_response_document_form_field_initials import TemplateResponseDocumentFormFieldInitials -from dropbox_sign.model.template_response_document_form_field_radio import TemplateResponseDocumentFormFieldRadio -from dropbox_sign.model.template_response_document_form_field_signature import TemplateResponseDocumentFormFieldSignature -from dropbox_sign.model.template_response_document_form_field_text import TemplateResponseDocumentFormFieldText -from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase -from dropbox_sign.model.template_response_document_static_field_checkbox import TemplateResponseDocumentStaticFieldCheckbox -from dropbox_sign.model.template_response_document_static_field_date_signed import TemplateResponseDocumentStaticFieldDateSigned -from dropbox_sign.model.template_response_document_static_field_dropdown import TemplateResponseDocumentStaticFieldDropdown -from dropbox_sign.model.template_response_document_static_field_hyperlink import TemplateResponseDocumentStaticFieldHyperlink -from dropbox_sign.model.template_response_document_static_field_initials import TemplateResponseDocumentStaticFieldInitials -from dropbox_sign.model.template_response_document_static_field_radio import TemplateResponseDocumentStaticFieldRadio -from dropbox_sign.model.template_response_document_static_field_signature import TemplateResponseDocumentStaticFieldSignature -from dropbox_sign.model.template_response_document_static_field_text import TemplateResponseDocumentStaticFieldText -from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength -from dropbox_sign.model.template_response_signer_role import TemplateResponseSignerRole -from dropbox_sign.model.template_update_files_request import TemplateUpdateFilesRequest -from dropbox_sign.model.template_update_files_response import TemplateUpdateFilesResponse -from dropbox_sign.model.template_update_files_response_template import TemplateUpdateFilesResponseTemplate -from dropbox_sign.model.unclaimed_draft_create_embedded_request import UnclaimedDraftCreateEmbeddedRequest -from dropbox_sign.model.unclaimed_draft_create_embedded_with_template_request import UnclaimedDraftCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.unclaimed_draft_create_request import UnclaimedDraftCreateRequest -from dropbox_sign.model.unclaimed_draft_create_response import UnclaimedDraftCreateResponse -from dropbox_sign.model.unclaimed_draft_edit_and_resend_request import UnclaimedDraftEditAndResendRequest -from dropbox_sign.model.unclaimed_draft_response import UnclaimedDraftResponse -from dropbox_sign.model.warning_response import WarningResponse +# import models into model package +from dropbox_sign.models.account_create_request import AccountCreateRequest +from dropbox_sign.models.account_create_response import AccountCreateResponse +from dropbox_sign.models.account_get_response import AccountGetResponse +from dropbox_sign.models.account_response import AccountResponse +from dropbox_sign.models.account_response_quotas import AccountResponseQuotas +from dropbox_sign.models.account_response_usage import AccountResponseUsage +from dropbox_sign.models.account_update_request import AccountUpdateRequest +from dropbox_sign.models.account_verify_request import AccountVerifyRequest +from dropbox_sign.models.account_verify_response import AccountVerifyResponse +from dropbox_sign.models.account_verify_response_account import AccountVerifyResponseAccount +from dropbox_sign.models.api_app_create_request import ApiAppCreateRequest +from dropbox_sign.models.api_app_get_response import ApiAppGetResponse +from dropbox_sign.models.api_app_list_response import ApiAppListResponse +from dropbox_sign.models.api_app_response import ApiAppResponse +from dropbox_sign.models.api_app_response_o_auth import ApiAppResponseOAuth +from dropbox_sign.models.api_app_response_options import ApiAppResponseOptions +from dropbox_sign.models.api_app_response_owner_account import ApiAppResponseOwnerAccount +from dropbox_sign.models.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions +from dropbox_sign.models.api_app_update_request import ApiAppUpdateRequest +from dropbox_sign.models.bulk_send_job_get_response import BulkSendJobGetResponse +from dropbox_sign.models.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests +from dropbox_sign.models.bulk_send_job_list_response import BulkSendJobListResponse +from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse +from dropbox_sign.models.bulk_send_job_send_response import BulkSendJobSendResponse +from dropbox_sign.models.embedded_edit_url_request import EmbeddedEditUrlRequest +from dropbox_sign.models.embedded_edit_url_response import EmbeddedEditUrlResponse +from dropbox_sign.models.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded +from dropbox_sign.models.embedded_sign_url_response import EmbeddedSignUrlResponse +from dropbox_sign.models.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded +from dropbox_sign.models.error_response import ErrorResponse +from dropbox_sign.models.error_response_error import ErrorResponseError +from dropbox_sign.models.event_callback_request import EventCallbackRequest +from dropbox_sign.models.event_callback_request_event import EventCallbackRequestEvent +from dropbox_sign.models.event_callback_request_event_metadata import EventCallbackRequestEventMetadata +from dropbox_sign.models.fax_line_add_user_request import FaxLineAddUserRequest +from dropbox_sign.models.fax_line_area_code_get_country_enum import FaxLineAreaCodeGetCountryEnum +from dropbox_sign.models.fax_line_area_code_get_province_enum import FaxLineAreaCodeGetProvinceEnum +from dropbox_sign.models.fax_line_area_code_get_response import FaxLineAreaCodeGetResponse +from dropbox_sign.models.fax_line_area_code_get_state_enum import FaxLineAreaCodeGetStateEnum +from dropbox_sign.models.fax_line_create_request import FaxLineCreateRequest +from dropbox_sign.models.fax_line_delete_request import FaxLineDeleteRequest +from dropbox_sign.models.fax_line_list_response import FaxLineListResponse +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.file_response import FileResponse +from dropbox_sign.models.file_response_data_uri import FileResponseDataUri +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.o_auth_token_generate_request import OAuthTokenGenerateRequest +from dropbox_sign.models.o_auth_token_refresh_request import OAuthTokenRefreshRequest +from dropbox_sign.models.o_auth_token_response import OAuthTokenResponse +from dropbox_sign.models.report_create_request import ReportCreateRequest +from dropbox_sign.models.report_create_response import ReportCreateResponse +from dropbox_sign.models.report_response import ReportResponse +from dropbox_sign.models.signature_request_bulk_create_embedded_with_template_request import SignatureRequestBulkCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_bulk_send_with_template_request import SignatureRequestBulkSendWithTemplateRequest +from dropbox_sign.models.signature_request_create_embedded_request import SignatureRequestCreateEmbeddedRequest +from dropbox_sign.models.signature_request_create_embedded_with_template_request import SignatureRequestCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_get_response import SignatureRequestGetResponse +from dropbox_sign.models.signature_request_list_response import SignatureRequestListResponse +from dropbox_sign.models.signature_request_remind_request import SignatureRequestRemindRequest +from dropbox_sign.models.signature_request_response import SignatureRequestResponse +from dropbox_sign.models.signature_request_response_attachment import SignatureRequestResponseAttachment +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from dropbox_sign.models.signature_request_response_custom_field_checkbox import SignatureRequestResponseCustomFieldCheckbox +from dropbox_sign.models.signature_request_response_custom_field_text import SignatureRequestResponseCustomFieldText +from dropbox_sign.models.signature_request_response_custom_field_type_enum import SignatureRequestResponseCustomFieldTypeEnum +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from dropbox_sign.models.signature_request_response_data_type_enum import SignatureRequestResponseDataTypeEnum +from dropbox_sign.models.signature_request_response_data_value_checkbox import SignatureRequestResponseDataValueCheckbox +from dropbox_sign.models.signature_request_response_data_value_checkbox_merge import SignatureRequestResponseDataValueCheckboxMerge +from dropbox_sign.models.signature_request_response_data_value_date_signed import SignatureRequestResponseDataValueDateSigned +from dropbox_sign.models.signature_request_response_data_value_dropdown import SignatureRequestResponseDataValueDropdown +from dropbox_sign.models.signature_request_response_data_value_initials import SignatureRequestResponseDataValueInitials +from dropbox_sign.models.signature_request_response_data_value_radio import SignatureRequestResponseDataValueRadio +from dropbox_sign.models.signature_request_response_data_value_signature import SignatureRequestResponseDataValueSignature +from dropbox_sign.models.signature_request_response_data_value_text import SignatureRequestResponseDataValueText +from dropbox_sign.models.signature_request_response_data_value_text_merge import SignatureRequestResponseDataValueTextMerge +from dropbox_sign.models.signature_request_response_signatures import SignatureRequestResponseSignatures +from dropbox_sign.models.signature_request_send_request import SignatureRequestSendRequest +from dropbox_sign.models.signature_request_send_with_template_request import SignatureRequestSendWithTemplateRequest +from dropbox_sign.models.signature_request_update_request import SignatureRequestUpdateRequest +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_bulk_signer_list import SubBulkSignerList +from dropbox_sign.models.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_field_rule_action import SubFormFieldRuleAction +from dropbox_sign.models.sub_form_field_rule_trigger import SubFormFieldRuleTrigger +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_form_fields_per_document_checkbox import SubFormFieldsPerDocumentCheckbox +from dropbox_sign.models.sub_form_fields_per_document_checkbox_merge import SubFormFieldsPerDocumentCheckboxMerge +from dropbox_sign.models.sub_form_fields_per_document_date_signed import SubFormFieldsPerDocumentDateSigned +from dropbox_sign.models.sub_form_fields_per_document_dropdown import SubFormFieldsPerDocumentDropdown +from dropbox_sign.models.sub_form_fields_per_document_font_enum import SubFormFieldsPerDocumentFontEnum +from dropbox_sign.models.sub_form_fields_per_document_hyperlink import SubFormFieldsPerDocumentHyperlink +from dropbox_sign.models.sub_form_fields_per_document_initials import SubFormFieldsPerDocumentInitials +from dropbox_sign.models.sub_form_fields_per_document_radio import SubFormFieldsPerDocumentRadio +from dropbox_sign.models.sub_form_fields_per_document_signature import SubFormFieldsPerDocumentSignature +from dropbox_sign.models.sub_form_fields_per_document_text import SubFormFieldsPerDocumentText +from dropbox_sign.models.sub_form_fields_per_document_text_merge import SubFormFieldsPerDocumentTextMerge +from dropbox_sign.models.sub_form_fields_per_document_type_enum import SubFormFieldsPerDocumentTypeEnum +from dropbox_sign.models.sub_merge_field import SubMergeField +from dropbox_sign.models.sub_o_auth import SubOAuth +from dropbox_sign.models.sub_options import SubOptions +from dropbox_sign.models.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from dropbox_sign.models.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from dropbox_sign.models.sub_team_response import SubTeamResponse +from dropbox_sign.models.sub_template_role import SubTemplateRole +from dropbox_sign.models.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner +from dropbox_sign.models.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner +from dropbox_sign.models.sub_white_labeling_options import SubWhiteLabelingOptions +from dropbox_sign.models.team_add_member_request import TeamAddMemberRequest +from dropbox_sign.models.team_create_request import TeamCreateRequest +from dropbox_sign.models.team_get_info_response import TeamGetInfoResponse +from dropbox_sign.models.team_get_response import TeamGetResponse +from dropbox_sign.models.team_info_response import TeamInfoResponse +from dropbox_sign.models.team_invite_response import TeamInviteResponse +from dropbox_sign.models.team_invites_response import TeamInvitesResponse +from dropbox_sign.models.team_member_response import TeamMemberResponse +from dropbox_sign.models.team_members_response import TeamMembersResponse +from dropbox_sign.models.team_parent_response import TeamParentResponse +from dropbox_sign.models.team_remove_member_request import TeamRemoveMemberRequest +from dropbox_sign.models.team_response import TeamResponse +from dropbox_sign.models.team_sub_teams_response import TeamSubTeamsResponse +from dropbox_sign.models.team_update_request import TeamUpdateRequest +from dropbox_sign.models.template_add_user_request import TemplateAddUserRequest +from dropbox_sign.models.template_create_embedded_draft_request import TemplateCreateEmbeddedDraftRequest +from dropbox_sign.models.template_create_embedded_draft_response import TemplateCreateEmbeddedDraftResponse +from dropbox_sign.models.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate +from dropbox_sign.models.template_create_request import TemplateCreateRequest +from dropbox_sign.models.template_create_response import TemplateCreateResponse +from dropbox_sign.models.template_create_response_template import TemplateCreateResponseTemplate +from dropbox_sign.models.template_edit_response import TemplateEditResponse +from dropbox_sign.models.template_get_response import TemplateGetResponse +from dropbox_sign.models.template_list_response import TemplateListResponse +from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest +from dropbox_sign.models.template_response import TemplateResponse +from dropbox_sign.models.template_response_account import TemplateResponseAccount +from dropbox_sign.models.template_response_account_quota import TemplateResponseAccountQuota +from dropbox_sign.models.template_response_cc_role import TemplateResponseCCRole +from dropbox_sign.models.template_response_document import TemplateResponseDocument +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from dropbox_sign.models.template_response_document_custom_field_checkbox import TemplateResponseDocumentCustomFieldCheckbox +from dropbox_sign.models.template_response_document_custom_field_text import TemplateResponseDocumentCustomFieldText +from dropbox_sign.models.template_response_document_field_group import TemplateResponseDocumentFieldGroup +from dropbox_sign.models.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_document_form_field_checkbox import TemplateResponseDocumentFormFieldCheckbox +from dropbox_sign.models.template_response_document_form_field_date_signed import TemplateResponseDocumentFormFieldDateSigned +from dropbox_sign.models.template_response_document_form_field_dropdown import TemplateResponseDocumentFormFieldDropdown +from dropbox_sign.models.template_response_document_form_field_hyperlink import TemplateResponseDocumentFormFieldHyperlink +from dropbox_sign.models.template_response_document_form_field_initials import TemplateResponseDocumentFormFieldInitials +from dropbox_sign.models.template_response_document_form_field_radio import TemplateResponseDocumentFormFieldRadio +from dropbox_sign.models.template_response_document_form_field_signature import TemplateResponseDocumentFormFieldSignature +from dropbox_sign.models.template_response_document_form_field_text import TemplateResponseDocumentFormFieldText +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from dropbox_sign.models.template_response_document_static_field_checkbox import TemplateResponseDocumentStaticFieldCheckbox +from dropbox_sign.models.template_response_document_static_field_date_signed import TemplateResponseDocumentStaticFieldDateSigned +from dropbox_sign.models.template_response_document_static_field_dropdown import TemplateResponseDocumentStaticFieldDropdown +from dropbox_sign.models.template_response_document_static_field_hyperlink import TemplateResponseDocumentStaticFieldHyperlink +from dropbox_sign.models.template_response_document_static_field_initials import TemplateResponseDocumentStaticFieldInitials +from dropbox_sign.models.template_response_document_static_field_radio import TemplateResponseDocumentStaticFieldRadio +from dropbox_sign.models.template_response_document_static_field_signature import TemplateResponseDocumentStaticFieldSignature +from dropbox_sign.models.template_response_document_static_field_text import TemplateResponseDocumentStaticFieldText +from dropbox_sign.models.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength +from dropbox_sign.models.template_response_signer_role import TemplateResponseSignerRole +from dropbox_sign.models.template_update_files_request import TemplateUpdateFilesRequest +from dropbox_sign.models.template_update_files_response import TemplateUpdateFilesResponse +from dropbox_sign.models.template_update_files_response_template import TemplateUpdateFilesResponseTemplate +from dropbox_sign.models.unclaimed_draft_create_embedded_request import UnclaimedDraftCreateEmbeddedRequest +from dropbox_sign.models.unclaimed_draft_create_embedded_with_template_request import UnclaimedDraftCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.unclaimed_draft_create_request import UnclaimedDraftCreateRequest +from dropbox_sign.models.unclaimed_draft_create_response import UnclaimedDraftCreateResponse +from dropbox_sign.models.unclaimed_draft_edit_and_resend_request import UnclaimedDraftEditAndResendRequest +from dropbox_sign.models.unclaimed_draft_response import UnclaimedDraftResponse +from dropbox_sign.models.warning_response import WarningResponse diff --git a/sdks/python/dropbox_sign/models/account_create_request.py b/sdks/python/dropbox_sign/models/account_create_request.py new file mode 100644 index 000000000..698d4ba18 --- /dev/null +++ b/sdks/python/dropbox_sign/models/account_create_request.py @@ -0,0 +1,130 @@ +# 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 AccountCreateRequest(BaseModel): + """ + AccountCreateRequest + """ # noqa: E501 + email_address: StrictStr = Field(description="The email address which will be associated with the new Account.") + client_id: Optional[StrictStr] = Field(default=None, description="Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization)") + client_secret: Optional[StrictStr] = Field(default=None, description="Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization)") + locale: Optional[StrictStr] = Field(default=None, description="The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") + __properties: ClassVar[List[str]] = ["email_address", "client_id", "client_secret", "locale"] + + 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 AccountCreateRequest 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 AccountCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address"), + "client_id": obj.get("client_id"), + "client_secret": obj.get("client_secret"), + "locale": obj.get("locale") + }) + 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 { + "email_address": "(str,)", + "client_id": "(str,)", + "client_secret": "(str,)", + "locale": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/account_create_response.py b/sdks/python/dropbox_sign/models/account_create_response.py new file mode 100644 index 000000000..d25a2adc9 --- /dev/null +++ b/sdks/python/dropbox_sign/models/account_create_response.py @@ -0,0 +1,144 @@ +# 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.account_response import AccountResponse +from dropbox_sign.models.o_auth_token_response import OAuthTokenResponse +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 AccountCreateResponse(BaseModel): + """ + AccountCreateResponse + """ # noqa: E501 + account: AccountResponse + oauth_data: Optional[OAuthTokenResponse] = None + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["account", "oauth_data", "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 AccountCreateResponse 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 account + if self.account: + _dict['account'] = self.account.to_dict() + # override the default output from pydantic by calling `to_dict()` of oauth_data + if self.oauth_data: + _dict['oauth_data'] = self.oauth_data.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 AccountCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account": AccountResponse.from_dict(obj["account"]) if obj.get("account") is not None else None, + "oauth_data": OAuthTokenResponse.from_dict(obj["oauth_data"]) if obj.get("oauth_data") 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 { + "account": "(AccountResponse,)", + "oauth_data": "(OAuthTokenResponse,)", + "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/account_get_response.py b/sdks/python/dropbox_sign/models/account_get_response.py new file mode 100644 index 000000000..6f21ab6e9 --- /dev/null +++ b/sdks/python/dropbox_sign/models/account_get_response.py @@ -0,0 +1,137 @@ +# 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.account_response import AccountResponse +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 AccountGetResponse(BaseModel): + """ + AccountGetResponse + """ # noqa: E501 + account: AccountResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["account", "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 AccountGetResponse 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 account + if self.account: + _dict['account'] = self.account.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 AccountGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account": AccountResponse.from_dict(obj["account"]) if obj.get("account") 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 { + "account": "(AccountResponse,)", + "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/account_response.py b/sdks/python/dropbox_sign/models/account_response.py new file mode 100644 index 000000000..48fc371ac --- /dev/null +++ b/sdks/python/dropbox_sign/models/account_response.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.account_response_quotas import AccountResponseQuotas +from dropbox_sign.models.account_response_usage import AccountResponseUsage +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountResponse(BaseModel): + """ + AccountResponse + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The ID of the Account") + email_address: Optional[StrictStr] = Field(default=None, description="The email address associated with the Account.") + is_locked: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has been locked out of their account by a team admin.") + is_paid_hs: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has a paid Dropbox Sign account.") + is_paid_hf: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has a paid HelloFax account.") + quotas: Optional[AccountResponseQuotas] = None + callback_url: Optional[StrictStr] = Field(default=None, description="The URL that Dropbox Sign events will `POST` to.") + role_code: Optional[StrictStr] = Field(default=None, description="The membership role for the team.") + team_id: Optional[StrictStr] = Field(default=None, description="The id of the team account belongs to.") + locale: Optional[StrictStr] = Field(default=None, description="The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") + usage: Optional[AccountResponseUsage] = None + __properties: ClassVar[List[str]] = ["account_id", "email_address", "is_locked", "is_paid_hs", "is_paid_hf", "quotas", "callback_url", "role_code", "team_id", "locale", "usage"] + + 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 AccountResponse 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 quotas + if self.quotas: + _dict['quotas'] = self.quotas.to_dict() + # override the default output from pydantic by calling `to_dict()` of usage + if self.usage: + _dict['usage'] = self.usage.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "is_locked": obj.get("is_locked"), + "is_paid_hs": obj.get("is_paid_hs"), + "is_paid_hf": obj.get("is_paid_hf"), + "quotas": AccountResponseQuotas.from_dict(obj["quotas"]) if obj.get("quotas") is not None else None, + "callback_url": obj.get("callback_url"), + "role_code": obj.get("role_code"), + "team_id": obj.get("team_id"), + "locale": obj.get("locale"), + "usage": AccountResponseUsage.from_dict(obj["usage"]) if obj.get("usage") 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 { + "account_id": "(str,)", + "email_address": "(str,)", + "is_locked": "(bool,)", + "is_paid_hs": "(bool,)", + "is_paid_hf": "(bool,)", + "quotas": "(AccountResponseQuotas,)", + "callback_url": "(str,)", + "role_code": "(str,)", + "team_id": "(str,)", + "locale": "(str,)", + "usage": "(AccountResponseUsage,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/account_response_quotas.py b/sdks/python/dropbox_sign/models/account_response_quotas.py new file mode 100644 index 000000000..b67e442bb --- /dev/null +++ b/sdks/python/dropbox_sign/models/account_response_quotas.py @@ -0,0 +1,136 @@ +# 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 +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 AccountResponseQuotas(BaseModel): + """ + Details concerning remaining monthly quotas. + """ # noqa: E501 + api_signature_requests_left: Optional[StrictInt] = Field(default=None, description="API signature requests remaining.") + documents_left: Optional[StrictInt] = Field(default=None, description="Signature requests remaining.") + templates_total: Optional[StrictInt] = Field(default=None, description="Total API templates allowed.") + templates_left: Optional[StrictInt] = Field(default=None, description="API templates remaining.") + sms_verifications_left: Optional[StrictInt] = Field(default=None, description="SMS verifications remaining.") + num_fax_pages_left: Optional[StrictInt] = Field(default=None, description="Number of fax pages left") + __properties: ClassVar[List[str]] = ["api_signature_requests_left", "documents_left", "templates_total", "templates_left", "sms_verifications_left", "num_fax_pages_left"] + + 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 AccountResponseQuotas 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 AccountResponseQuotas from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_signature_requests_left": obj.get("api_signature_requests_left"), + "documents_left": obj.get("documents_left"), + "templates_total": obj.get("templates_total"), + "templates_left": obj.get("templates_left"), + "sms_verifications_left": obj.get("sms_verifications_left"), + "num_fax_pages_left": obj.get("num_fax_pages_left") + }) + 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 { + "api_signature_requests_left": "(int,)", + "documents_left": "(int,)", + "templates_total": "(int,)", + "templates_left": "(int,)", + "sms_verifications_left": "(int,)", + "num_fax_pages_left": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/account_response_usage.py b/sdks/python/dropbox_sign/models/account_response_usage.py new file mode 100644 index 000000000..72bf13210 --- /dev/null +++ b/sdks/python/dropbox_sign/models/account_response_usage.py @@ -0,0 +1,121 @@ +# 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 +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 AccountResponseUsage(BaseModel): + """ + Details concerning monthly usage + """ # noqa: E501 + fax_pages_sent: Optional[StrictInt] = Field(default=None, description="Number of fax pages sent") + __properties: ClassVar[List[str]] = ["fax_pages_sent"] + + 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 AccountResponseUsage 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 AccountResponseUsage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fax_pages_sent": obj.get("fax_pages_sent") + }) + 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_pages_sent": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/account_update_request.py b/sdks/python/dropbox_sign/models/account_update_request.py new file mode 100644 index 000000000..4165071bb --- /dev/null +++ b/sdks/python/dropbox_sign/models/account_update_request.py @@ -0,0 +1,127 @@ +# 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 AccountUpdateRequest(BaseModel): + """ + AccountUpdateRequest + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The ID of the Account") + callback_url: Optional[StrictStr] = Field(default=None, description="The URL that Dropbox Sign should POST events to.") + locale: Optional[StrictStr] = Field(default=None, description="The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") + __properties: ClassVar[List[str]] = ["account_id", "callback_url", "locale"] + + 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 AccountUpdateRequest 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 AccountUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "callback_url": obj.get("callback_url"), + "locale": obj.get("locale") + }) + 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 { + "account_id": "(str,)", + "callback_url": "(str,)", + "locale": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/account_verify_request.py b/sdks/python/dropbox_sign/models/account_verify_request.py new file mode 100644 index 000000000..5d018cd3c --- /dev/null +++ b/sdks/python/dropbox_sign/models/account_verify_request.py @@ -0,0 +1,121 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountVerifyRequest(BaseModel): + """ + AccountVerifyRequest + """ # noqa: E501 + email_address: StrictStr = Field(description="Email address to run the verification for.") + __properties: ClassVar[List[str]] = ["email_address"] + + 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 AccountVerifyRequest 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 AccountVerifyRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address") + }) + 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 { + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/account_verify_response.py b/sdks/python/dropbox_sign/models/account_verify_response.py new file mode 100644 index 000000000..7c3e5ccd2 --- /dev/null +++ b/sdks/python/dropbox_sign/models/account_verify_response.py @@ -0,0 +1,137 @@ +# 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.account_verify_response_account import AccountVerifyResponseAccount +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 AccountVerifyResponse(BaseModel): + """ + AccountVerifyResponse + """ # noqa: E501 + account: Optional[AccountVerifyResponseAccount] = None + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["account", "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 AccountVerifyResponse 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 account + if self.account: + _dict['account'] = self.account.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 AccountVerifyResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account": AccountVerifyResponseAccount.from_dict(obj["account"]) if obj.get("account") 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 { + "account": "(AccountVerifyResponseAccount,)", + "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/account_verify_response_account.py b/sdks/python/dropbox_sign/models/account_verify_response_account.py new file mode 100644 index 000000000..112abc2cd --- /dev/null +++ b/sdks/python/dropbox_sign/models/account_verify_response_account.py @@ -0,0 +1,121 @@ +# 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 AccountVerifyResponseAccount(BaseModel): + """ + AccountVerifyResponseAccount + """ # noqa: E501 + email_address: Optional[StrictStr] = Field(default=None, description="The email address associated with the Account.") + __properties: ClassVar[List[str]] = ["email_address"] + + 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 AccountVerifyResponseAccount 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 AccountVerifyResponseAccount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address") + }) + 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 { + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/api_app_create_request.py b/sdks/python/dropbox_sign/models/api_app_create_request.py new file mode 100644 index 000000000..e9319cc9c --- /dev/null +++ b/sdks/python/dropbox_sign/models/api_app_create_request.py @@ -0,0 +1,153 @@ +# 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, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_o_auth import SubOAuth +from dropbox_sign.models.sub_options import SubOptions +from dropbox_sign.models.sub_white_labeling_options import SubWhiteLabelingOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppCreateRequest(BaseModel): + """ + ApiAppCreateRequest + """ # noqa: E501 + domains: Annotated[List[StrictStr], Field(min_length=1, max_length=2)] = Field(description="The domain names the ApiApp will be associated with.") + name: StrictStr = Field(description="The name you want to assign to the ApiApp.") + callback_url: Optional[StrictStr] = Field(default=None, description="The URL at which the ApiApp should receive event callbacks.") + custom_logo_file: Optional[Union[StrictBytes, StrictStr, io.IOBase]] = Field(default=None, description="An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)") + oauth: Optional[SubOAuth] = None + options: Optional[SubOptions] = None + white_labeling_options: Optional[SubWhiteLabelingOptions] = None + __properties: ClassVar[List[str]] = ["domains", "name", "callback_url", "custom_logo_file", "oauth", "options", "white_labeling_options"] + + 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 ApiAppCreateRequest 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 oauth + if self.oauth: + _dict['oauth'] = self.oauth.to_dict() + # override the default output from pydantic by calling `to_dict()` of options + if self.options: + _dict['options'] = self.options.to_dict() + # override the default output from pydantic by calling `to_dict()` of white_labeling_options + if self.white_labeling_options: + _dict['white_labeling_options'] = self.white_labeling_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "domains": obj.get("domains"), + "name": obj.get("name"), + "callback_url": obj.get("callback_url"), + "custom_logo_file": obj.get("custom_logo_file"), + "oauth": SubOAuth.from_dict(obj["oauth"]) if obj.get("oauth") is not None else None, + "options": SubOptions.from_dict(obj["options"]) if obj.get("options") is not None else None, + "white_labeling_options": SubWhiteLabelingOptions.from_dict(obj["white_labeling_options"]) if obj.get("white_labeling_options") 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 { + "domains": "(List[str],)", + "name": "(str,)", + "callback_url": "(str,)", + "custom_logo_file": "(io.IOBase,)", + "oauth": "(SubOAuth,)", + "options": "(SubOptions,)", + "white_labeling_options": "(SubWhiteLabelingOptions,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "domains", + ] + diff --git a/sdks/python/dropbox_sign/models/api_app_get_response.py b/sdks/python/dropbox_sign/models/api_app_get_response.py new file mode 100644 index 000000000..ce0317d9b --- /dev/null +++ b/sdks/python/dropbox_sign/models/api_app_get_response.py @@ -0,0 +1,137 @@ +# 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.api_app_response import ApiAppResponse +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 ApiAppGetResponse(BaseModel): + """ + ApiAppGetResponse + """ # noqa: E501 + api_app: ApiAppResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["api_app", "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 ApiAppGetResponse 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 api_app + if self.api_app: + _dict['api_app'] = self.api_app.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 ApiAppGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_app": ApiAppResponse.from_dict(obj["api_app"]) if obj.get("api_app") 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 { + "api_app": "(ApiAppResponse,)", + "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/api_app_list_response.py b/sdks/python/dropbox_sign/models/api_app_list_response.py new file mode 100644 index 000000000..970e69d11 --- /dev/null +++ b/sdks/python/dropbox_sign/models/api_app_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, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.api_app_response import ApiAppResponse +from dropbox_sign.models.list_info_response import ListInfoResponse +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 ApiAppListResponse(BaseModel): + """ + ApiAppListResponse + """ # noqa: E501 + api_apps: List[ApiAppResponse] = Field(description="Contains information about API Apps.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["api_apps", "list_info", "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 ApiAppListResponse 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 api_apps (list) + _items = [] + if self.api_apps: + for _item_api_apps in self.api_apps: + if _item_api_apps: + _items.append(_item_api_apps.to_dict()) + _dict['api_apps'] = _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() + # 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 ApiAppListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_apps": [ApiAppResponse.from_dict(_item) for _item in obj["api_apps"]] if obj.get("api_apps") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") 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 { + "api_apps": "(List[ApiAppResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "api_apps", + "warnings", + ] + diff --git a/sdks/python/dropbox_sign/models/api_app_response.py b/sdks/python/dropbox_sign/models/api_app_response.py new file mode 100644 index 000000000..b45d59bb6 --- /dev/null +++ b/sdks/python/dropbox_sign/models/api_app_response.py @@ -0,0 +1,165 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.api_app_response_o_auth import ApiAppResponseOAuth +from dropbox_sign.models.api_app_response_options import ApiAppResponseOptions +from dropbox_sign.models.api_app_response_owner_account import ApiAppResponseOwnerAccount +from dropbox_sign.models.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppResponse(BaseModel): + """ + Contains information about an API App. + """ # noqa: E501 + callback_url: Optional[StrictStr] = Field(default=None, description="The app's callback URL (for events)") + client_id: Optional[StrictStr] = Field(default=None, description="The app's client id") + created_at: Optional[StrictInt] = Field(default=None, description="The time that the app was created") + domains: Optional[List[StrictStr]] = Field(default=None, description="The domain name(s) associated with the app") + name: Optional[StrictStr] = Field(default=None, description="The name of the app") + is_approved: Optional[StrictBool] = Field(default=None, description="Boolean to indicate if the app has been approved") + oauth: Optional[ApiAppResponseOAuth] = None + options: Optional[ApiAppResponseOptions] = None + owner_account: Optional[ApiAppResponseOwnerAccount] = None + white_labeling_options: Optional[ApiAppResponseWhiteLabelingOptions] = None + __properties: ClassVar[List[str]] = ["callback_url", "client_id", "created_at", "domains", "name", "is_approved", "oauth", "options", "owner_account", "white_labeling_options"] + + 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 ApiAppResponse 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 oauth + if self.oauth: + _dict['oauth'] = self.oauth.to_dict() + # override the default output from pydantic by calling `to_dict()` of options + if self.options: + _dict['options'] = self.options.to_dict() + # override the default output from pydantic by calling `to_dict()` of owner_account + if self.owner_account: + _dict['owner_account'] = self.owner_account.to_dict() + # override the default output from pydantic by calling `to_dict()` of white_labeling_options + if self.white_labeling_options: + _dict['white_labeling_options'] = self.white_labeling_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callback_url": obj.get("callback_url"), + "client_id": obj.get("client_id"), + "created_at": obj.get("created_at"), + "domains": obj.get("domains"), + "name": obj.get("name"), + "is_approved": obj.get("is_approved"), + "oauth": ApiAppResponseOAuth.from_dict(obj["oauth"]) if obj.get("oauth") is not None else None, + "options": ApiAppResponseOptions.from_dict(obj["options"]) if obj.get("options") is not None else None, + "owner_account": ApiAppResponseOwnerAccount.from_dict(obj["owner_account"]) if obj.get("owner_account") is not None else None, + "white_labeling_options": ApiAppResponseWhiteLabelingOptions.from_dict(obj["white_labeling_options"]) if obj.get("white_labeling_options") 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 { + "callback_url": "(str,)", + "client_id": "(str,)", + "created_at": "(int,)", + "domains": "(List[str],)", + "name": "(str,)", + "is_approved": "(bool,)", + "oauth": "(ApiAppResponseOAuth,)", + "options": "(ApiAppResponseOptions,)", + "owner_account": "(ApiAppResponseOwnerAccount,)", + "white_labeling_options": "(ApiAppResponseWhiteLabelingOptions,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "domains", + ] + diff --git a/sdks/python/dropbox_sign/models/api_app_response_o_auth.py b/sdks/python/dropbox_sign/models/api_app_response_o_auth.py new file mode 100644 index 000000000..554bb05bd --- /dev/null +++ b/sdks/python/dropbox_sign/models/api_app_response_o_auth.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppResponseOAuth(BaseModel): + """ + An object describing the app's OAuth properties, or null if OAuth is not configured for the app. + """ # noqa: E501 + callback_url: Optional[StrictStr] = Field(default=None, description="The app's OAuth callback URL.") + secret: Optional[StrictStr] = Field(default=None, description="The app's OAuth secret, or null if the app does not belong to user.") + scopes: Optional[List[StrictStr]] = Field(default=None, description="Array of OAuth scopes used by the app.") + charges_users: Optional[StrictBool] = Field(default=None, description="Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests.") + __properties: ClassVar[List[str]] = ["callback_url", "secret", "scopes", "charges_users"] + + 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 ApiAppResponseOAuth 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 ApiAppResponseOAuth from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callback_url": obj.get("callback_url"), + "secret": obj.get("secret"), + "scopes": obj.get("scopes"), + "charges_users": obj.get("charges_users") + }) + 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 { + "callback_url": "(str,)", + "secret": "(str,)", + "scopes": "(List[str],)", + "charges_users": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "scopes", + ] + diff --git a/sdks/python/dropbox_sign/models/api_app_response_options.py b/sdks/python/dropbox_sign/models/api_app_response_options.py new file mode 100644 index 000000000..effa7a15d --- /dev/null +++ b/sdks/python/dropbox_sign/models/api_app_response_options.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppResponseOptions(BaseModel): + """ + An object with options that override account settings. + """ # noqa: E501 + can_insert_everywhere: Optional[StrictBool] = Field(default=None, description="Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document") + __properties: ClassVar[List[str]] = ["can_insert_everywhere"] + + 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 ApiAppResponseOptions 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 ApiAppResponseOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "can_insert_everywhere": obj.get("can_insert_everywhere") + }) + 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 { + "can_insert_everywhere": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/api_app_response_owner_account.py b/sdks/python/dropbox_sign/models/api_app_response_owner_account.py new file mode 100644 index 000000000..325b6f72b --- /dev/null +++ b/sdks/python/dropbox_sign/models/api_app_response_owner_account.py @@ -0,0 +1,124 @@ +# 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 ApiAppResponseOwnerAccount(BaseModel): + """ + An object describing the app's owner + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The owner account's ID") + email_address: Optional[StrictStr] = Field(default=None, description="The owner account's email address") + __properties: ClassVar[List[str]] = ["account_id", "email_address"] + + 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 ApiAppResponseOwnerAccount 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 ApiAppResponseOwnerAccount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address") + }) + 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 { + "account_id": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/api_app_response_white_labeling_options.py b/sdks/python/dropbox_sign/models/api_app_response_white_labeling_options.py new file mode 100644 index 000000000..7934751ed --- /dev/null +++ b/sdks/python/dropbox_sign/models/api_app_response_white_labeling_options.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, 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 ApiAppResponseWhiteLabelingOptions(BaseModel): + """ + An object with options to customize the app's signer page + """ # noqa: E501 + header_background_color: Optional[StrictStr] = None + legal_version: Optional[StrictStr] = None + link_color: Optional[StrictStr] = None + page_background_color: Optional[StrictStr] = None + primary_button_color: Optional[StrictStr] = None + primary_button_color_hover: Optional[StrictStr] = None + primary_button_text_color: Optional[StrictStr] = None + primary_button_text_color_hover: Optional[StrictStr] = None + secondary_button_color: Optional[StrictStr] = None + secondary_button_color_hover: Optional[StrictStr] = None + secondary_button_text_color: Optional[StrictStr] = None + secondary_button_text_color_hover: Optional[StrictStr] = None + text_color1: Optional[StrictStr] = None + text_color2: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["header_background_color", "legal_version", "link_color", "page_background_color", "primary_button_color", "primary_button_color_hover", "primary_button_text_color", "primary_button_text_color_hover", "secondary_button_color", "secondary_button_color_hover", "secondary_button_text_color", "secondary_button_text_color_hover", "text_color1", "text_color2"] + + 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 ApiAppResponseWhiteLabelingOptions 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 ApiAppResponseWhiteLabelingOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "header_background_color": obj.get("header_background_color"), + "legal_version": obj.get("legal_version"), + "link_color": obj.get("link_color"), + "page_background_color": obj.get("page_background_color"), + "primary_button_color": obj.get("primary_button_color"), + "primary_button_color_hover": obj.get("primary_button_color_hover"), + "primary_button_text_color": obj.get("primary_button_text_color"), + "primary_button_text_color_hover": obj.get("primary_button_text_color_hover"), + "secondary_button_color": obj.get("secondary_button_color"), + "secondary_button_color_hover": obj.get("secondary_button_color_hover"), + "secondary_button_text_color": obj.get("secondary_button_text_color"), + "secondary_button_text_color_hover": obj.get("secondary_button_text_color_hover"), + "text_color1": obj.get("text_color1"), + "text_color2": obj.get("text_color2") + }) + 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 { + "header_background_color": "(str,)", + "legal_version": "(str,)", + "link_color": "(str,)", + "page_background_color": "(str,)", + "primary_button_color": "(str,)", + "primary_button_color_hover": "(str,)", + "primary_button_text_color": "(str,)", + "primary_button_text_color_hover": "(str,)", + "secondary_button_color": "(str,)", + "secondary_button_color_hover": "(str,)", + "secondary_button_text_color": "(str,)", + "secondary_button_text_color_hover": "(str,)", + "text_color1": "(str,)", + "text_color2": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/api_app_update_request.py b/sdks/python/dropbox_sign/models/api_app_update_request.py new file mode 100644 index 000000000..649ad361a --- /dev/null +++ b/sdks/python/dropbox_sign/models/api_app_update_request.py @@ -0,0 +1,153 @@ +# 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, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_o_auth import SubOAuth +from dropbox_sign.models.sub_options import SubOptions +from dropbox_sign.models.sub_white_labeling_options import SubWhiteLabelingOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppUpdateRequest(BaseModel): + """ + ApiAppUpdateRequest + """ # noqa: E501 + callback_url: Optional[StrictStr] = Field(default=None, description="The URL at which the API App should receive event callbacks.") + custom_logo_file: Optional[Union[StrictBytes, StrictStr, io.IOBase]] = Field(default=None, description="An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)") + domains: Optional[Annotated[List[StrictStr], Field(max_length=2)]] = Field(default=None, description="The domain names the ApiApp will be associated with.") + name: Optional[StrictStr] = Field(default=None, description="The name you want to assign to the ApiApp.") + oauth: Optional[SubOAuth] = None + options: Optional[SubOptions] = None + white_labeling_options: Optional[SubWhiteLabelingOptions] = None + __properties: ClassVar[List[str]] = ["callback_url", "custom_logo_file", "domains", "name", "oauth", "options", "white_labeling_options"] + + 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 ApiAppUpdateRequest 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 oauth + if self.oauth: + _dict['oauth'] = self.oauth.to_dict() + # override the default output from pydantic by calling `to_dict()` of options + if self.options: + _dict['options'] = self.options.to_dict() + # override the default output from pydantic by calling `to_dict()` of white_labeling_options + if self.white_labeling_options: + _dict['white_labeling_options'] = self.white_labeling_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callback_url": obj.get("callback_url"), + "custom_logo_file": obj.get("custom_logo_file"), + "domains": obj.get("domains"), + "name": obj.get("name"), + "oauth": SubOAuth.from_dict(obj["oauth"]) if obj.get("oauth") is not None else None, + "options": SubOptions.from_dict(obj["options"]) if obj.get("options") is not None else None, + "white_labeling_options": SubWhiteLabelingOptions.from_dict(obj["white_labeling_options"]) if obj.get("white_labeling_options") 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 { + "callback_url": "(str,)", + "custom_logo_file": "(io.IOBase,)", + "domains": "(List[str],)", + "name": "(str,)", + "oauth": "(SubOAuth,)", + "options": "(SubOptions,)", + "white_labeling_options": "(SubWhiteLabelingOptions,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "domains", + ] + diff --git a/sdks/python/dropbox_sign/models/bulk_send_job_get_response.py b/sdks/python/dropbox_sign/models/bulk_send_job_get_response.py new file mode 100644 index 000000000..8811323e5 --- /dev/null +++ b/sdks/python/dropbox_sign/models/bulk_send_job_get_response.py @@ -0,0 +1,156 @@ +# 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.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests +from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse +from dropbox_sign.models.list_info_response import ListInfoResponse +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 BulkSendJobGetResponse(BaseModel): + """ + BulkSendJobGetResponse + """ # noqa: E501 + bulk_send_job: BulkSendJobResponse + list_info: ListInfoResponse + signature_requests: List[BulkSendJobGetResponseSignatureRequests] = Field(description="Contains information about the Signature Requests sent in bulk.") + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["bulk_send_job", "list_info", "signature_requests", "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 BulkSendJobGetResponse 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 bulk_send_job + if self.bulk_send_job: + _dict['bulk_send_job'] = self.bulk_send_job.to_dict() + # 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() + # override the default output from pydantic by calling `to_dict()` of each item in signature_requests (list) + _items = [] + if self.signature_requests: + for _item_signature_requests in self.signature_requests: + if _item_signature_requests: + _items.append(_item_signature_requests.to_dict()) + _dict['signature_requests'] = _items + # 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 BulkSendJobGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bulk_send_job": BulkSendJobResponse.from_dict(obj["bulk_send_job"]) if obj.get("bulk_send_job") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") is not None else None, + "signature_requests": [BulkSendJobGetResponseSignatureRequests.from_dict(_item) for _item in obj["signature_requests"]] if obj.get("signature_requests") 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 { + "bulk_send_job": "(BulkSendJobResponse,)", + "list_info": "(ListInfoResponse,)", + "signature_requests": "(List[BulkSendJobGetResponseSignatureRequests],)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "signature_requests", + "warnings", + ] + diff --git a/sdks/python/dropbox_sign/models/bulk_send_job_get_response_signature_requests.py b/sdks/python/dropbox_sign/models/bulk_send_job_get_response_signature_requests.py new file mode 100644 index 000000000..71bdd8157 --- /dev/null +++ b/sdks/python/dropbox_sign/models/bulk_send_job_get_response_signature_requests.py @@ -0,0 +1,231 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_attachment import SignatureRequestResponseAttachment +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from dropbox_sign.models.signature_request_response_signatures import SignatureRequestResponseSignatures +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class BulkSendJobGetResponseSignatureRequests(BaseModel): + """ + BulkSendJobGetResponseSignatureRequests + """ # noqa: E501 + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.") + signature_request_id: Optional[StrictStr] = Field(default=None, description="The id of the SignatureRequest.") + requester_email_address: Optional[StrictStr] = Field(default=None, description="The email address of the initiator of the SignatureRequest.") + title: Optional[StrictStr] = Field(default=None, description="The title the specified Account uses for the SignatureRequest.") + original_title: Optional[StrictStr] = Field(default=None, description="Default Label for account.") + subject: Optional[StrictStr] = Field(default=None, description="The subject in the email that was initially sent to the signers.") + message: Optional[StrictStr] = Field(default=None, description="The custom message in the email that was initially sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata attached to the signature request.") + created_at: Optional[StrictInt] = Field(default=None, description="Time the signature request was created.") + expires_at: Optional[StrictInt] = Field(default=None, description="The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") + is_complete: Optional[StrictBool] = Field(default=None, description="Whether or not the SignatureRequest has been fully executed by all signers.") + is_declined: Optional[StrictBool] = Field(default=None, description="Whether or not the SignatureRequest has been declined by a signer.") + has_error: Optional[StrictBool] = Field(default=None, description="Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).") + files_url: Optional[StrictStr] = Field(default=None, description="The URL where a copy of the request's documents can be downloaded.") + signing_url: Optional[StrictStr] = Field(default=None, description="The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.") + details_url: Optional[StrictStr] = Field(default=None, description="The URL where the requester and the signers can view the current status of the SignatureRequest.") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want the signer redirected to after they successfully sign.") + final_copy_uri: Optional[StrictStr] = Field(default=None, description="The path where the completed document can be downloaded") + template_ids: Optional[List[StrictStr]] = Field(default=None, description="Templates IDs used in this SignatureRequest (if any).") + custom_fields: Optional[List[SignatureRequestResponseCustomFieldBase]] = Field(default=None, description="An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") + attachments: Optional[List[SignatureRequestResponseAttachment]] = Field(default=None, description="Signer attachments.") + response_data: Optional[List[SignatureRequestResponseDataBase]] = Field(default=None, description="An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") + signatures: Optional[List[SignatureRequestResponseSignatures]] = Field(default=None, description="An array of signature objects, 1 for each signer.") + bulk_send_job_id: Optional[StrictStr] = Field(default=None, description="The id of the BulkSendJob.") + __properties: ClassVar[List[str]] = ["test_mode", "signature_request_id", "requester_email_address", "title", "original_title", "subject", "message", "metadata", "created_at", "expires_at", "is_complete", "is_declined", "has_error", "files_url", "signing_url", "details_url", "cc_email_addresses", "signing_redirect_url", "final_copy_uri", "template_ids", "custom_fields", "attachments", "response_data", "signatures", "bulk_send_job_id"] + + 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 BulkSendJobGetResponseSignatureRequests 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 custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in response_data (list) + _items = [] + if self.response_data: + for _item_response_data in self.response_data: + if _item_response_data: + _items.append(_item_response_data.to_dict()) + _dict['response_data'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signatures (list) + _items = [] + if self.signatures: + for _item_signatures in self.signatures: + if _item_signatures: + _items.append(_item_signatures.to_dict()) + _dict['signatures'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkSendJobGetResponseSignatureRequests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "signature_request_id": obj.get("signature_request_id"), + "requester_email_address": obj.get("requester_email_address"), + "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"), + "expires_at": obj.get("expires_at"), + "is_complete": obj.get("is_complete"), + "is_declined": obj.get("is_declined"), + "has_error": obj.get("has_error"), + "files_url": obj.get("files_url"), + "signing_url": obj.get("signing_url"), + "details_url": obj.get("details_url"), + "cc_email_addresses": obj.get("cc_email_addresses"), + "signing_redirect_url": obj.get("signing_redirect_url"), + "final_copy_uri": obj.get("final_copy_uri"), + "template_ids": obj.get("template_ids"), + "custom_fields": [SignatureRequestResponseCustomFieldBase.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "attachments": [SignatureRequestResponseAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "response_data": [SignatureRequestResponseDataBase.from_dict(_item) for _item in obj["response_data"]] if obj.get("response_data") is not None else None, + "signatures": [SignatureRequestResponseSignatures.from_dict(_item) for _item in obj["signatures"]] if obj.get("signatures") is not None else None, + "bulk_send_job_id": obj.get("bulk_send_job_id") + }) + 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 { + "test_mode": "(bool,)", + "signature_request_id": "(str,)", + "requester_email_address": "(str,)", + "title": "(str,)", + "original_title": "(str,)", + "subject": "(str,)", + "message": "(str,)", + "metadata": "(object,)", + "created_at": "(int,)", + "expires_at": "(int,)", + "is_complete": "(bool,)", + "is_declined": "(bool,)", + "has_error": "(bool,)", + "files_url": "(str,)", + "signing_url": "(str,)", + "details_url": "(str,)", + "cc_email_addresses": "(List[str],)", + "signing_redirect_url": "(str,)", + "final_copy_uri": "(str,)", + "template_ids": "(List[str],)", + "custom_fields": "(List[SignatureRequestResponseCustomFieldBase],)", + "attachments": "(List[SignatureRequestResponseAttachment],)", + "response_data": "(List[SignatureRequestResponseDataBase],)", + "signatures": "(List[SignatureRequestResponseSignatures],)", + "bulk_send_job_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "cc_email_addresses", + "template_ids", + "custom_fields", + "attachments", + "response_data", + "signatures", + ] + diff --git a/sdks/python/dropbox_sign/models/bulk_send_job_list_response.py b/sdks/python/dropbox_sign/models/bulk_send_job_list_response.py new file mode 100644 index 000000000..05ae51983 --- /dev/null +++ b/sdks/python/dropbox_sign/models/bulk_send_job_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, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse +from dropbox_sign.models.list_info_response import ListInfoResponse +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 BulkSendJobListResponse(BaseModel): + """ + BulkSendJobListResponse + """ # noqa: E501 + bulk_send_jobs: List[BulkSendJobResponse] = Field(description="Contains a list of BulkSendJobs that the API caller has access to.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["bulk_send_jobs", "list_info", "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 BulkSendJobListResponse 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 bulk_send_jobs (list) + _items = [] + if self.bulk_send_jobs: + for _item_bulk_send_jobs in self.bulk_send_jobs: + if _item_bulk_send_jobs: + _items.append(_item_bulk_send_jobs.to_dict()) + _dict['bulk_send_jobs'] = _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() + # 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 BulkSendJobListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bulk_send_jobs": [BulkSendJobResponse.from_dict(_item) for _item in obj["bulk_send_jobs"]] if obj.get("bulk_send_jobs") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") 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 { + "bulk_send_jobs": "(List[BulkSendJobResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "bulk_send_jobs", + "warnings", + ] + diff --git a/sdks/python/dropbox_sign/models/bulk_send_job_response.py b/sdks/python/dropbox_sign/models/bulk_send_job_response.py new file mode 100644 index 000000000..164d399e5 --- /dev/null +++ b/sdks/python/dropbox_sign/models/bulk_send_job_response.py @@ -0,0 +1,130 @@ +# 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, 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 BulkSendJobResponse(BaseModel): + """ + Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. + """ # noqa: E501 + bulk_send_job_id: Optional[StrictStr] = Field(default=None, description="The id of the BulkSendJob.") + total: Optional[StrictInt] = Field(default=None, description="The total amount of Signature Requests queued for sending.") + is_creator: Optional[StrictBool] = Field(default=None, description="True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member.") + created_at: Optional[StrictInt] = Field(default=None, description="Time that the BulkSendJob was created.") + __properties: ClassVar[List[str]] = ["bulk_send_job_id", "total", "is_creator", "created_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 BulkSendJobResponse 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 BulkSendJobResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bulk_send_job_id": obj.get("bulk_send_job_id"), + "total": obj.get("total"), + "is_creator": obj.get("is_creator"), + "created_at": obj.get("created_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 { + "bulk_send_job_id": "(str,)", + "total": "(int,)", + "is_creator": "(bool,)", + "created_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/bulk_send_job_send_response.py b/sdks/python/dropbox_sign/models/bulk_send_job_send_response.py new file mode 100644 index 000000000..932b0963e --- /dev/null +++ b/sdks/python/dropbox_sign/models/bulk_send_job_send_response.py @@ -0,0 +1,137 @@ +# 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.bulk_send_job_response import BulkSendJobResponse +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 BulkSendJobSendResponse(BaseModel): + """ + BulkSendJobSendResponse + """ # noqa: E501 + bulk_send_job: BulkSendJobResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["bulk_send_job", "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 BulkSendJobSendResponse 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 bulk_send_job + if self.bulk_send_job: + _dict['bulk_send_job'] = self.bulk_send_job.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 BulkSendJobSendResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bulk_send_job": BulkSendJobResponse.from_dict(obj["bulk_send_job"]) if obj.get("bulk_send_job") 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 { + "bulk_send_job": "(BulkSendJobResponse,)", + "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/embedded_edit_url_request.py b/sdks/python/dropbox_sign/models/embedded_edit_url_request.py new file mode 100644 index 000000000..4eadf9c9e --- /dev/null +++ b/sdks/python/dropbox_sign/models/embedded_edit_url_request.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_merge_field import SubMergeField +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EmbeddedEditUrlRequest(BaseModel): + """ + EmbeddedEditUrlRequest + """ # noqa: E501 + allow_edit_ccs: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable/disable to add or change CC roles when editing the template.") + cc_roles: Optional[List[StrictStr]] = Field(default=None, description="The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request.") + editor_options: Optional[SubEditorOptions] = None + force_signer_roles: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template signer roles.") + force_subject_message: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template subject and message.") + merge_fields: Optional[List[SubMergeField]] = Field(default=None, description="Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`.") + preview_only: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set).") + show_preview: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable the editor/preview experience.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`.") + __properties: ClassVar[List[str]] = ["allow_edit_ccs", "cc_roles", "editor_options", "force_signer_roles", "force_subject_message", "merge_fields", "preview_only", "show_preview", "show_progress_stepper", "test_mode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EmbeddedEditUrlRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of editor_options + if self.editor_options: + _dict['editor_options'] = self.editor_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in merge_fields (list) + _items = [] + if self.merge_fields: + for _item_merge_fields in self.merge_fields: + if _item_merge_fields: + _items.append(_item_merge_fields.to_dict()) + _dict['merge_fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EmbeddedEditUrlRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow_edit_ccs": obj.get("allow_edit_ccs") if obj.get("allow_edit_ccs") is not None else False, + "cc_roles": obj.get("cc_roles"), + "editor_options": SubEditorOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None else None, + "force_signer_roles": obj.get("force_signer_roles") if obj.get("force_signer_roles") is not None else False, + "force_subject_message": obj.get("force_subject_message") if obj.get("force_subject_message") is not None else False, + "merge_fields": [SubMergeField.from_dict(_item) for _item in obj["merge_fields"]] if obj.get("merge_fields") is not None else None, + "preview_only": obj.get("preview_only") if obj.get("preview_only") is not None else False, + "show_preview": obj.get("show_preview") if obj.get("show_preview") is not None else False, + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "allow_edit_ccs": "(bool,)", + "cc_roles": "(List[str],)", + "editor_options": "(SubEditorOptions,)", + "force_signer_roles": "(bool,)", + "force_subject_message": "(bool,)", + "merge_fields": "(List[SubMergeField],)", + "preview_only": "(bool,)", + "show_preview": "(bool,)", + "show_progress_stepper": "(bool,)", + "test_mode": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "cc_roles", + "merge_fields", + ] + diff --git a/sdks/python/dropbox_sign/models/embedded_edit_url_response.py b/sdks/python/dropbox_sign/models/embedded_edit_url_response.py new file mode 100644 index 000000000..e77e06f9a --- /dev/null +++ b/sdks/python/dropbox_sign/models/embedded_edit_url_response.py @@ -0,0 +1,137 @@ +# 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.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded +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 EmbeddedEditUrlResponse(BaseModel): + """ + EmbeddedEditUrlResponse + """ # noqa: E501 + embedded: EmbeddedEditUrlResponseEmbedded + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["embedded", "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 EmbeddedEditUrlResponse 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 embedded + if self.embedded: + _dict['embedded'] = self.embedded.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 EmbeddedEditUrlResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "embedded": EmbeddedEditUrlResponseEmbedded.from_dict(obj["embedded"]) if obj.get("embedded") 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 { + "embedded": "(EmbeddedEditUrlResponseEmbedded,)", + "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/embedded_edit_url_response_embedded.py b/sdks/python/dropbox_sign/models/embedded_edit_url_response_embedded.py new file mode 100644 index 000000000..74e23aa0c --- /dev/null +++ b/sdks/python/dropbox_sign/models/embedded_edit_url_response_embedded.py @@ -0,0 +1,124 @@ +# 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 EmbeddedEditUrlResponseEmbedded(BaseModel): + """ + An embedded template object. + """ # noqa: E501 + edit_url: Optional[StrictStr] = Field(default=None, description="A template url that can be opened in an iFrame.") + expires_at: Optional[StrictInt] = Field(default=None, description="The specific time that the the `edit_url` link expires, in epoch.") + __properties: ClassVar[List[str]] = ["edit_url", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EmbeddedEditUrlResponseEmbedded 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 EmbeddedEditUrlResponseEmbedded from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "edit_url": obj.get("edit_url"), + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "edit_url": "(str,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/embedded_sign_url_response.py b/sdks/python/dropbox_sign/models/embedded_sign_url_response.py new file mode 100644 index 000000000..db473f231 --- /dev/null +++ b/sdks/python/dropbox_sign/models/embedded_sign_url_response.py @@ -0,0 +1,137 @@ +# 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.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded +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 EmbeddedSignUrlResponse(BaseModel): + """ + EmbeddedSignUrlResponse + """ # noqa: E501 + embedded: EmbeddedSignUrlResponseEmbedded + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["embedded", "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 EmbeddedSignUrlResponse 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 embedded + if self.embedded: + _dict['embedded'] = self.embedded.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 EmbeddedSignUrlResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "embedded": EmbeddedSignUrlResponseEmbedded.from_dict(obj["embedded"]) if obj.get("embedded") 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 { + "embedded": "(EmbeddedSignUrlResponseEmbedded,)", + "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/embedded_sign_url_response_embedded.py b/sdks/python/dropbox_sign/models/embedded_sign_url_response_embedded.py new file mode 100644 index 000000000..fd3eebaf2 --- /dev/null +++ b/sdks/python/dropbox_sign/models/embedded_sign_url_response_embedded.py @@ -0,0 +1,124 @@ +# 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 EmbeddedSignUrlResponseEmbedded(BaseModel): + """ + An object that contains necessary information to set up embedded signing. + """ # noqa: E501 + sign_url: Optional[StrictStr] = Field(default=None, description="A signature url that can be opened in an iFrame.") + expires_at: Optional[StrictInt] = Field(default=None, description="The specific time that the the `sign_url` link expires, in epoch.") + __properties: ClassVar[List[str]] = ["sign_url", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EmbeddedSignUrlResponseEmbedded 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 EmbeddedSignUrlResponseEmbedded from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sign_url": obj.get("sign_url"), + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "sign_url": "(str,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/error_response.py b/sdks/python/dropbox_sign/models/error_response.py new file mode 100644 index 000000000..adfda3ef1 --- /dev/null +++ b/sdks/python/dropbox_sign/models/error_response.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 +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.error_response_error import ErrorResponseError +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ErrorResponse(BaseModel): + """ + ErrorResponse + """ # noqa: E501 + error: ErrorResponseError + __properties: ClassVar[List[str]] = ["error"] + + 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 ErrorResponse 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 error + if self.error: + _dict['error'] = self.error.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": ErrorResponseError.from_dict(obj["error"]) if obj.get("error") 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 { + "error": "(ErrorResponseError,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/error_response_error.py b/sdks/python/dropbox_sign/models/error_response_error.py new file mode 100644 index 000000000..d5bf7fc62 --- /dev/null +++ b/sdks/python/dropbox_sign/models/error_response_error.py @@ -0,0 +1,127 @@ +# 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 ErrorResponseError(BaseModel): + """ + Contains information about an error that occurred. + """ # noqa: E501 + error_msg: StrictStr = Field(description="Message describing an error.") + error_name: StrictStr = Field(description="Name of the error.") + error_path: Optional[StrictStr] = Field(default=None, description="Path at which an error occurred.") + __properties: ClassVar[List[str]] = ["error_msg", "error_name", "error_path"] + + 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 ErrorResponseError 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 ErrorResponseError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error_msg": obj.get("error_msg"), + "error_name": obj.get("error_name"), + "error_path": obj.get("error_path") + }) + 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 { + "error_msg": "(str,)", + "error_name": "(str,)", + "error_path": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/event_callback_request.py b/sdks/python/dropbox_sign/models/event_callback_request.py new file mode 100644 index 000000000..ad851fbd6 --- /dev/null +++ b/sdks/python/dropbox_sign/models/event_callback_request.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 +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.account_response import AccountResponse +from dropbox_sign.models.event_callback_request_event import EventCallbackRequestEvent +from dropbox_sign.models.signature_request_response import SignatureRequestResponse +from dropbox_sign.models.template_response import TemplateResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EventCallbackRequest(BaseModel): + """ + EventCallbackRequest + """ # noqa: E501 + event: EventCallbackRequestEvent + account: Optional[AccountResponse] = None + signature_request: Optional[SignatureRequestResponse] = None + template: Optional[TemplateResponse] = None + __properties: ClassVar[List[str]] = ["event", "account", "signature_request", "template"] + + 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 EventCallbackRequest 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 event + if self.event: + _dict['event'] = self.event.to_dict() + # override the default output from pydantic by calling `to_dict()` of account + if self.account: + _dict['account'] = self.account.to_dict() + # override the default output from pydantic by calling `to_dict()` of signature_request + if self.signature_request: + _dict['signature_request'] = self.signature_request.to_dict() + # override the default output from pydantic by calling `to_dict()` of template + if self.template: + _dict['template'] = self.template.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventCallbackRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "event": EventCallbackRequestEvent.from_dict(obj["event"]) if obj.get("event") is not None else None, + "account": AccountResponse.from_dict(obj["account"]) if obj.get("account") is not None else None, + "signature_request": SignatureRequestResponse.from_dict(obj["signature_request"]) if obj.get("signature_request") is not None else None, + "template": TemplateResponse.from_dict(obj["template"]) if obj.get("template") 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 { + "event": "(EventCallbackRequestEvent,)", + "account": "(AccountResponse,)", + "signature_request": "(SignatureRequestResponse,)", + "template": "(TemplateResponse,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/event_callback_request_event.py b/sdks/python/dropbox_sign/models/event_callback_request_event.py new file mode 100644 index 000000000..ad57d9dc1 --- /dev/null +++ b/sdks/python/dropbox_sign/models/event_callback_request_event.py @@ -0,0 +1,141 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.event_callback_request_event_metadata import EventCallbackRequestEventMetadata +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EventCallbackRequestEvent(BaseModel): + """ + Basic information about the event that occurred. + """ # noqa: E501 + event_time: StrictStr = Field(description="Time the event was created (using Unix time).") + event_type: StrictStr = Field(description="Type of callback event that was triggered.") + event_hash: StrictStr = Field(description="Generated hash used to verify source of event data.") + event_metadata: Optional[EventCallbackRequestEventMetadata] = None + __properties: ClassVar[List[str]] = ["event_time", "event_type", "event_hash", "event_metadata"] + + @field_validator('event_type') + def event_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['account_confirmed', 'unknown_error', 'file_error', 'sign_url_invalid', 'signature_request_viewed', 'signature_request_signed', 'signature_request_sent', 'signature_request_all_signed', 'signature_request_email_bounce', 'signature_request_remind', 'signature_request_incomplete_qes', 'signature_request_destroyed', 'signature_request_canceled', 'signature_request_downloadable', 'signature_request_declined', 'signature_request_reassigned', 'signature_request_invalid', 'signature_request_prepared', 'signature_request_expired', 'template_created', 'template_error', 'callback_test', 'signature_request_signer_removed']): + raise ValueError("must be one of enum values ('account_confirmed', 'unknown_error', 'file_error', 'sign_url_invalid', 'signature_request_viewed', 'signature_request_signed', 'signature_request_sent', 'signature_request_all_signed', 'signature_request_email_bounce', 'signature_request_remind', 'signature_request_incomplete_qes', 'signature_request_destroyed', 'signature_request_canceled', 'signature_request_downloadable', 'signature_request_declined', 'signature_request_reassigned', 'signature_request_invalid', 'signature_request_prepared', 'signature_request_expired', 'template_created', 'template_error', 'callback_test', 'signature_request_signer_removed')") + 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 EventCallbackRequestEvent 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 event_metadata + if self.event_metadata: + _dict['event_metadata'] = self.event_metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventCallbackRequestEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "event_time": obj.get("event_time"), + "event_type": obj.get("event_type"), + "event_hash": obj.get("event_hash"), + "event_metadata": EventCallbackRequestEventMetadata.from_dict(obj["event_metadata"]) if obj.get("event_metadata") 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 { + "event_time": "(str,)", + "event_type": "(str,)", + "event_hash": "(str,)", + "event_metadata": "(EventCallbackRequestEventMetadata,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/event_callback_request_event_metadata.py b/sdks/python/dropbox_sign/models/event_callback_request_event_metadata.py new file mode 100644 index 000000000..79a90dc3c --- /dev/null +++ b/sdks/python/dropbox_sign/models/event_callback_request_event_metadata.py @@ -0,0 +1,130 @@ +# 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 EventCallbackRequestEventMetadata(BaseModel): + """ + Specific metadata about the event. + """ # noqa: E501 + related_signature_id: Optional[StrictStr] = Field(default=None, description="Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events.") + reported_for_account_id: Optional[StrictStr] = Field(default=None, description="Account ID the event was reported for.") + reported_for_app_id: Optional[StrictStr] = Field(default=None, description="App ID the event was reported for.") + event_message: Optional[StrictStr] = Field(default=None, description="Message about a declined or failed (due to error) signature flow.") + __properties: ClassVar[List[str]] = ["related_signature_id", "reported_for_account_id", "reported_for_app_id", "event_message"] + + 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 EventCallbackRequestEventMetadata 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 EventCallbackRequestEventMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "related_signature_id": obj.get("related_signature_id"), + "reported_for_account_id": obj.get("reported_for_account_id"), + "reported_for_app_id": obj.get("reported_for_app_id"), + "event_message": obj.get("event_message") + }) + 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 { + "related_signature_id": "(str,)", + "reported_for_account_id": "(str,)", + "reported_for_app_id": "(str,)", + "event_message": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/fax_line_add_user_request.py b/sdks/python/dropbox_sign/models/fax_line_add_user_request.py new file mode 100644 index 000000000..9afd9eeeb --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_add_user_request.py @@ -0,0 +1,127 @@ +# 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 FaxLineAddUserRequest(BaseModel): + """ + FaxLineAddUserRequest + """ # noqa: E501 + number: StrictStr = Field(description="The Fax Line number.") + account_id: Optional[StrictStr] = Field(default=None, description="Account ID") + email_address: Optional[StrictStr] = Field(default=None, description="Email address") + __properties: ClassVar[List[str]] = ["number", "account_id", "email_address"] + + 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 FaxLineAddUserRequest 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 FaxLineAddUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "number": obj.get("number"), + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address") + }) + 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 { + "number": "(str,)", + "account_id": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/fax_line_area_code_get_country_enum.py b/sdks/python/dropbox_sign/models/fax_line_area_code_get_country_enum.py new file mode 100644 index 000000000..f76331e63 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_area_code_get_country_enum.py @@ -0,0 +1,39 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class FaxLineAreaCodeGetCountryEnum(str, Enum): + """ + FaxLineAreaCodeGetCountryEnum + """ + + """ + allowed enum values + """ + CA = 'CA' + US = 'US' + UK = 'UK' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaxLineAreaCodeGetCountryEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/sdks/python/dropbox_sign/models/fax_line_area_code_get_province_enum.py b/sdks/python/dropbox_sign/models/fax_line_area_code_get_province_enum.py new file mode 100644 index 000000000..cb6625d7d --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_area_code_get_province_enum.py @@ -0,0 +1,49 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class FaxLineAreaCodeGetProvinceEnum(str, Enum): + """ + FaxLineAreaCodeGetProvinceEnum + """ + + """ + allowed enum values + """ + AB = 'AB' + BC = 'BC' + MB = 'MB' + NB = 'NB' + NL = 'NL' + NT = 'NT' + NS = 'NS' + NU = 'NU' + ON = 'ON' + PE = 'PE' + QC = 'QC' + SK = 'SK' + YT = 'YT' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaxLineAreaCodeGetProvinceEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/sdks/python/dropbox_sign/models/fax_line_area_code_get_response.py b/sdks/python/dropbox_sign/models/fax_line_area_code_get_response.py new file mode 100644 index 000000000..ca071fa2a --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_area_code_get_response.py @@ -0,0 +1,122 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineAreaCodeGetResponse(BaseModel): + """ + FaxLineAreaCodeGetResponse + """ # noqa: E501 + area_codes: List[StrictInt] + __properties: ClassVar[List[str]] = ["area_codes"] + + 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 FaxLineAreaCodeGetResponse 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 FaxLineAreaCodeGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "area_codes": obj.get("area_codes") + }) + 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 { + "area_codes": "(List[int],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "area_codes", + ] + diff --git a/sdks/python/dropbox_sign/models/fax_line_area_code_get_state_enum.py b/sdks/python/dropbox_sign/models/fax_line_area_code_get_state_enum.py new file mode 100644 index 000000000..29b8f70ff --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_area_code_get_state_enum.py @@ -0,0 +1,87 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class FaxLineAreaCodeGetStateEnum(str, Enum): + """ + FaxLineAreaCodeGetStateEnum + """ + + """ + allowed enum values + """ + AK = 'AK' + AL = 'AL' + AR = 'AR' + AZ = 'AZ' + CA = 'CA' + CO = 'CO' + CT = 'CT' + DC = 'DC' + DE = 'DE' + FL = 'FL' + GA = 'GA' + HI = 'HI' + IA = 'IA' + ID = 'ID' + IL = 'IL' + IN = 'IN' + KS = 'KS' + KY = 'KY' + LA = 'LA' + MA = 'MA' + MD = 'MD' + ME = 'ME' + MI = 'MI' + MN = 'MN' + MO = 'MO' + MS = 'MS' + MT = 'MT' + NC = 'NC' + ND = 'ND' + NE = 'NE' + NH = 'NH' + NJ = 'NJ' + NM = 'NM' + NV = 'NV' + NY = 'NY' + OH = 'OH' + OK = 'OK' + OR = 'OR' + PA = 'PA' + RI = 'RI' + SC = 'SC' + SD = 'SD' + TN = 'TN' + TX = 'TX' + UT = 'UT' + VA = 'VA' + VT = 'VT' + WA = 'WA' + WI = 'WI' + WV = 'WV' + WY = 'WY' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaxLineAreaCodeGetStateEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/sdks/python/dropbox_sign/models/fax_line_create_request.py b/sdks/python/dropbox_sign/models/fax_line_create_request.py new file mode 100644 index 000000000..aa27a9bc6 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_create_request.py @@ -0,0 +1,137 @@ +# 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 FaxLineCreateRequest(BaseModel): + """ + FaxLineCreateRequest + """ # noqa: E501 + area_code: StrictInt = Field(description="Area code") + country: StrictStr = Field(description="Country") + city: Optional[StrictStr] = Field(default=None, description="City") + account_id: Optional[StrictStr] = Field(default=None, description="Account ID") + __properties: ClassVar[List[str]] = ["area_code", "country", "city", "account_id"] + + @field_validator('country') + def country_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CA', 'US', 'UK']): + raise ValueError("must be one of enum values ('CA', 'US', 'UK')") + 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 FaxLineCreateRequest 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 FaxLineCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "area_code": obj.get("area_code"), + "country": obj.get("country"), + "city": obj.get("city"), + "account_id": obj.get("account_id") + }) + 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 { + "area_code": "(int,)", + "country": "(str,)", + "city": "(str,)", + "account_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/fax_line_delete_request.py b/sdks/python/dropbox_sign/models/fax_line_delete_request.py new file mode 100644 index 000000000..f52880d49 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_delete_request.py @@ -0,0 +1,121 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineDeleteRequest(BaseModel): + """ + FaxLineDeleteRequest + """ # noqa: E501 + number: StrictStr = Field(description="The Fax Line number.") + __properties: ClassVar[List[str]] = ["number"] + + 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 FaxLineDeleteRequest 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 FaxLineDeleteRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "number": obj.get("number") + }) + 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 { + "number": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/fax_line_list_response.py b/sdks/python/dropbox_sign/models/fax_line_list_response.py new file mode 100644 index 000000000..6f090675c --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_list_response.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.fax_line_response_fax_line import FaxLineResponseFaxLine +from dropbox_sign.models.list_info_response import ListInfoResponse +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 FaxLineListResponse(BaseModel): + """ + FaxLineListResponse + """ # noqa: E501 + list_info: ListInfoResponse + fax_lines: List[FaxLineResponseFaxLine] + warnings: Optional[WarningResponse] = None + __properties: ClassVar[List[str]] = ["list_info", "fax_lines", "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 FaxLineListResponse 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 list_info + if self.list_info: + _dict['list_info'] = self.list_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in fax_lines (list) + _items = [] + if self.fax_lines: + for _item_fax_lines in self.fax_lines: + if _item_fax_lines: + _items.append(_item_fax_lines.to_dict()) + _dict['fax_lines'] = _items + # override the default output from pydantic by calling `to_dict()` of warnings + if self.warnings: + _dict['warnings'] = self.warnings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") is not None else None, + "fax_lines": [FaxLineResponseFaxLine.from_dict(_item) for _item in obj["fax_lines"]] if obj.get("fax_lines") is not None else None, + "warnings": WarningResponse.from_dict(obj["warnings"]) if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "list_info": "(ListInfoResponse,)", + "fax_lines": "(List[FaxLineResponseFaxLine],)", + "warnings": "(WarningResponse,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "fax_lines", + ] + diff --git a/sdks/python/dropbox_sign/models/fax_line_remove_user_request.py b/sdks/python/dropbox_sign/models/fax_line_remove_user_request.py new file mode 100644 index 000000000..e4c10045e --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_remove_user_request.py @@ -0,0 +1,127 @@ +# 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 FaxLineRemoveUserRequest(BaseModel): + """ + FaxLineRemoveUserRequest + """ # noqa: E501 + number: StrictStr = Field(description="The Fax Line number.") + account_id: Optional[StrictStr] = Field(default=None, description="Account ID") + email_address: Optional[StrictStr] = Field(default=None, description="Email address") + __properties: ClassVar[List[str]] = ["number", "account_id", "email_address"] + + 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 FaxLineRemoveUserRequest 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 FaxLineRemoveUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "number": obj.get("number"), + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address") + }) + 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 { + "number": "(str,)", + "account_id": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/fax_line_response.py b/sdks/python/dropbox_sign/models/fax_line_response.py new file mode 100644 index 000000000..b3e16131b --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_response.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.fax_line_response_fax_line import FaxLineResponseFaxLine +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 FaxLineResponse(BaseModel): + """ + FaxLineResponse + """ # noqa: E501 + fax_line: FaxLineResponseFaxLine + warnings: Optional[WarningResponse] = None + __properties: ClassVar[List[str]] = ["fax_line", "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 FaxLineResponse 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_line + if self.fax_line: + _dict['fax_line'] = self.fax_line.to_dict() + # override the default output from pydantic by calling `to_dict()` of warnings + if self.warnings: + _dict['warnings'] = self.warnings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fax_line": FaxLineResponseFaxLine.from_dict(obj["fax_line"]) if obj.get("fax_line") is not None else None, + "warnings": WarningResponse.from_dict(obj["warnings"]) if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "fax_line": "(FaxLineResponseFaxLine,)", + "warnings": "(WarningResponse,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/fax_line_response_fax_line.py b/sdks/python/dropbox_sign/models/fax_line_response_fax_line.py new file mode 100644 index 000000000..cedc50d83 --- /dev/null +++ b/sdks/python/dropbox_sign/models/fax_line_response_fax_line.py @@ -0,0 +1,139 @@ +# 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.account_response import AccountResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineResponseFaxLine(BaseModel): + """ + FaxLineResponseFaxLine + """ # noqa: E501 + number: Optional[StrictStr] = Field(default=None, description="Number") + created_at: Optional[StrictInt] = Field(default=None, description="Created at") + updated_at: Optional[StrictInt] = Field(default=None, description="Updated at") + accounts: Optional[List[AccountResponse]] = None + __properties: ClassVar[List[str]] = ["number", "created_at", "updated_at", "accounts"] + + 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 FaxLineResponseFaxLine 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 accounts (list) + _items = [] + if self.accounts: + for _item_accounts in self.accounts: + if _item_accounts: + _items.append(_item_accounts.to_dict()) + _dict['accounts'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineResponseFaxLine from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "number": obj.get("number"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "accounts": [AccountResponse.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") 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 { + "number": "(str,)", + "created_at": "(int,)", + "updated_at": "(int,)", + "accounts": "(List[AccountResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "accounts", + ] + diff --git a/sdks/python/dropbox_sign/models/file_response.py b/sdks/python/dropbox_sign/models/file_response.py new file mode 100644 index 000000000..8e7fe3c3f --- /dev/null +++ b/sdks/python/dropbox_sign/models/file_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FileResponse(BaseModel): + """ + FileResponse + """ # noqa: E501 + file_url: StrictStr = Field(description="URL to the file.") + expires_at: StrictInt = Field(description="When the link expires.") + __properties: ClassVar[List[str]] = ["file_url", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FileResponse 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 FileResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file_url": obj.get("file_url"), + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "file_url": "(str,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/file_response_data_uri.py b/sdks/python/dropbox_sign/models/file_response_data_uri.py new file mode 100644 index 000000000..012bc8318 --- /dev/null +++ b/sdks/python/dropbox_sign/models/file_response_data_uri.py @@ -0,0 +1,121 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FileResponseDataUri(BaseModel): + """ + FileResponseDataUri + """ # noqa: E501 + data_uri: StrictStr = Field(description="File as base64 encoded string.") + __properties: ClassVar[List[str]] = ["data_uri"] + + 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 FileResponseDataUri 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 FileResponseDataUri from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_uri": obj.get("data_uri") + }) + 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 { + "data_uri": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/list_info_response.py b/sdks/python/dropbox_sign/models/list_info_response.py new file mode 100644 index 000000000..816accbda --- /dev/null +++ b/sdks/python/dropbox_sign/models/list_info_response.py @@ -0,0 +1,130 @@ +# 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 +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 ListInfoResponse(BaseModel): + """ + Contains pagination information about the data returned. + """ # noqa: E501 + num_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages available.") + num_results: Optional[StrictInt] = Field(default=None, description="Total number of objects available.") + page: Optional[StrictInt] = Field(default=None, description="Number of the page being returned.") + page_size: Optional[StrictInt] = Field(default=None, description="Objects returned per page.") + __properties: ClassVar[List[str]] = ["num_pages", "num_results", "page", "page_size"] + + 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 ListInfoResponse 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 ListInfoResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "num_pages": obj.get("num_pages"), + "num_results": obj.get("num_results"), + "page": obj.get("page"), + "page_size": obj.get("page_size") + }) + 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 { + "num_pages": "(int,)", + "num_results": "(int,)", + "page": "(int,)", + "page_size": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/o_auth_token_generate_request.py b/sdks/python/dropbox_sign/models/o_auth_token_generate_request.py new file mode 100644 index 000000000..0f2f0ae78 --- /dev/null +++ b/sdks/python/dropbox_sign/models/o_auth_token_generate_request.py @@ -0,0 +1,133 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class OAuthTokenGenerateRequest(BaseModel): + """ + OAuthTokenGenerateRequest + """ # noqa: E501 + client_id: StrictStr = Field(description="The client id of the app requesting authorization.") + client_secret: StrictStr = Field(description="The secret token of your app.") + code: StrictStr = Field(description="The code passed to your callback when the user granted access.") + grant_type: StrictStr = Field(description="When generating a new token use `authorization_code`.") + state: StrictStr = Field(description="Same as the state you specified earlier.") + __properties: ClassVar[List[str]] = ["client_id", "client_secret", "code", "grant_type", "state"] + + 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 OAuthTokenGenerateRequest 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 OAuthTokenGenerateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "client_secret": obj.get("client_secret"), + "code": obj.get("code"), + "grant_type": obj.get("grant_type") if obj.get("grant_type") is not None else 'authorization_code', + "state": obj.get("state") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "client_secret": "(str,)", + "code": "(str,)", + "grant_type": "(str,)", + "state": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/o_auth_token_refresh_request.py b/sdks/python/dropbox_sign/models/o_auth_token_refresh_request.py new file mode 100644 index 000000000..7b4ee8b41 --- /dev/null +++ b/sdks/python/dropbox_sign/models/o_auth_token_refresh_request.py @@ -0,0 +1,124 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class OAuthTokenRefreshRequest(BaseModel): + """ + OAuthTokenRefreshRequest + """ # noqa: E501 + grant_type: StrictStr = Field(description="When refreshing an existing token use `refresh_token`.") + refresh_token: StrictStr = Field(description="The token provided when you got the expired access token.") + __properties: ClassVar[List[str]] = ["grant_type", "refresh_token"] + + 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 OAuthTokenRefreshRequest 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 OAuthTokenRefreshRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "grant_type": obj.get("grant_type") if obj.get("grant_type") is not None else 'refresh_token', + "refresh_token": obj.get("refresh_token") + }) + 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 { + "grant_type": "(str,)", + "refresh_token": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/o_auth_token_response.py b/sdks/python/dropbox_sign/models/o_auth_token_response.py new file mode 100644 index 000000000..6ababb429 --- /dev/null +++ b/sdks/python/dropbox_sign/models/o_auth_token_response.py @@ -0,0 +1,133 @@ +# 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 OAuthTokenResponse(BaseModel): + """ + OAuthTokenResponse + """ # noqa: E501 + access_token: Optional[StrictStr] = None + token_type: Optional[StrictStr] = None + refresh_token: Optional[StrictStr] = None + expires_in: Optional[StrictInt] = Field(default=None, description="Number of seconds until the `access_token` expires. Uses epoch time.") + state: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["access_token", "token_type", "refresh_token", "expires_in", "state"] + + 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 OAuthTokenResponse 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 OAuthTokenResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "access_token": obj.get("access_token"), + "token_type": obj.get("token_type"), + "refresh_token": obj.get("refresh_token"), + "expires_in": obj.get("expires_in"), + "state": obj.get("state") + }) + 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 { + "access_token": "(str,)", + "token_type": "(str,)", + "refresh_token": "(str,)", + "expires_in": "(int,)", + "state": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/report_create_request.py b/sdks/python/dropbox_sign/models/report_create_request.py new file mode 100644 index 000000000..3276ff25b --- /dev/null +++ b/sdks/python/dropbox_sign/models/report_create_request.py @@ -0,0 +1,137 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ReportCreateRequest(BaseModel): + """ + ReportCreateRequest + """ # noqa: E501 + end_date: StrictStr = Field(description="The (inclusive) end date for the report data in `MM/DD/YYYY` format.") + report_type: Annotated[List[StrictStr], Field(min_length=1, max_length=2)] = Field(description="The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).") + start_date: StrictStr = Field(description="The (inclusive) start date for the report data in `MM/DD/YYYY` format.") + __properties: ClassVar[List[str]] = ["end_date", "report_type", "start_date"] + + @field_validator('report_type') + def report_type_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['user_activity', 'document_status']): + raise ValueError("each list item must be one of ('user_activity', 'document_status')") + 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 ReportCreateRequest 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 ReportCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "end_date": obj.get("end_date"), + "report_type": obj.get("report_type"), + "start_date": obj.get("start_date") + }) + 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 { + "end_date": "(str,)", + "report_type": "(List[str],)", + "start_date": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "report_type", + ] + diff --git a/sdks/python/dropbox_sign/models/report_create_response.py b/sdks/python/dropbox_sign/models/report_create_response.py new file mode 100644 index 000000000..99a5f33c1 --- /dev/null +++ b/sdks/python/dropbox_sign/models/report_create_response.py @@ -0,0 +1,137 @@ +# 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.report_response import ReportResponse +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 ReportCreateResponse(BaseModel): + """ + ReportCreateResponse + """ # noqa: E501 + report: ReportResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["report", "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 ReportCreateResponse 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 report + if self.report: + _dict['report'] = self.report.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 ReportCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "report": ReportResponse.from_dict(obj["report"]) if obj.get("report") 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 { + "report": "(ReportResponse,)", + "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/report_response.py b/sdks/python/dropbox_sign/models/report_response.py new file mode 100644 index 000000000..b801a3021 --- /dev/null +++ b/sdks/python/dropbox_sign/models/report_response.py @@ -0,0 +1,142 @@ +# 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, 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 ReportResponse(BaseModel): + """ + Contains information about the report request. + """ # noqa: E501 + success: Optional[StrictStr] = Field(default=None, description="A message indicating the requested operation's success") + start_date: Optional[StrictStr] = Field(default=None, description="The (inclusive) start date for the report data in MM/DD/YYYY format.") + end_date: Optional[StrictStr] = Field(default=None, description="The (inclusive) end date for the report data in MM/DD/YYYY format.") + report_type: Optional[List[StrictStr]] = Field(default=None, description="The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).") + __properties: ClassVar[List[str]] = ["success", "start_date", "end_date", "report_type"] + + @field_validator('report_type') + def report_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['user_activity', 'document_status']): + raise ValueError("each list item must be one of ('user_activity', 'document_status')") + 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 ReportResponse 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 ReportResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "success": obj.get("success"), + "start_date": obj.get("start_date"), + "end_date": obj.get("end_date"), + "report_type": obj.get("report_type") + }) + 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 { + "success": "(str,)", + "start_date": "(str,)", + "end_date": "(str,)", + "report_type": "(List[str],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "report_type", + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py b/sdks/python/dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py new file mode 100644 index 000000000..f6be2bb63 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_bulk_signer_list import SubBulkSignerList +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestBulkCreateEmbeddedWithTemplateRequest(BaseModel): + """ + SignatureRequestBulkCreateEmbeddedWithTemplateRequest + """ # noqa: E501 + template_ids: List[StrictStr] = Field(description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") + client_id: StrictStr = Field(description="Client id of the app you're using to create this embedded signature request. Used for security purposes.") + signer_file: Optional[Union[StrictBytes, StrictStr, io.IOBase]] = Field(default=None, description="`signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```") + signer_list: Optional[List[SubBulkSignerList]] = Field(default=None, description="`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + ccs: Optional[List[SubCC]] = Field(default=None, description="Add CC email recipients. Required when a CC role exists for the Template.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + __properties: ClassVar[List[str]] = ["template_ids", "client_id", "signer_file", "signer_list", "allow_decline", "ccs", "custom_fields", "message", "metadata", "signing_redirect_url", "subject", "test_mode", "title"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestBulkCreateEmbeddedWithTemplateRequest 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 signer_list (list) + _items = [] + if self.signer_list: + for _item_signer_list in self.signer_list: + if _item_signer_list: + _items.append(_item_signer_list.to_dict()) + _dict['signer_list'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict['ccs'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestBulkCreateEmbeddedWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_ids": obj.get("template_ids"), + "client_id": obj.get("client_id"), + "signer_file": obj.get("signer_file"), + "signer_list": [SubBulkSignerList.from_dict(_item) for _item in obj["signer_list"]] if obj.get("signer_list") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "ccs": [SubCC.from_dict(_item) for _item in obj["ccs"]] if obj.get("ccs") is not None else None, + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_ids": "(List[str],)", + "client_id": "(str,)", + "signer_file": "(io.IOBase,)", + "signer_list": "(List[SubBulkSignerList],)", + "allow_decline": "(bool,)", + "ccs": "(List[SubCC],)", + "custom_fields": "(List[SubCustomField],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "signer_list", + "ccs", + "custom_fields", + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_bulk_send_with_template_request.py b/sdks/python/dropbox_sign/models/signature_request_bulk_send_with_template_request.py new file mode 100644 index 000000000..4e4abf801 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_bulk_send_with_template_request.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_bulk_signer_list import SubBulkSignerList +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestBulkSendWithTemplateRequest(BaseModel): + """ + SignatureRequestBulkSendWithTemplateRequest + """ # noqa: E501 + template_ids: List[StrictStr] = Field(description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") + signer_file: Optional[Union[StrictBytes, StrictStr, io.IOBase]] = Field(default=None, description="`signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```") + signer_list: Optional[List[SubBulkSignerList]] = Field(default=None, description="`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + ccs: Optional[List[SubCC]] = Field(default=None, description="Add CC email recipients. Required when a CC role exists for the Template.") + client_id: Optional[StrictStr] = Field(default=None, description="The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + __properties: ClassVar[List[str]] = ["template_ids", "signer_file", "signer_list", "allow_decline", "ccs", "client_id", "custom_fields", "message", "metadata", "signing_redirect_url", "subject", "test_mode", "title"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestBulkSendWithTemplateRequest 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 signer_list (list) + _items = [] + if self.signer_list: + for _item_signer_list in self.signer_list: + if _item_signer_list: + _items.append(_item_signer_list.to_dict()) + _dict['signer_list'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict['ccs'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestBulkSendWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_ids": obj.get("template_ids"), + "signer_file": obj.get("signer_file"), + "signer_list": [SubBulkSignerList.from_dict(_item) for _item in obj["signer_list"]] if obj.get("signer_list") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "ccs": [SubCC.from_dict(_item) for _item in obj["ccs"]] if obj.get("ccs") is not None else None, + "client_id": obj.get("client_id"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_ids": "(List[str],)", + "signer_file": "(io.IOBase,)", + "signer_list": "(List[SubBulkSignerList],)", + "allow_decline": "(bool,)", + "ccs": "(List[SubCC],)", + "client_id": "(str,)", + "custom_fields": "(List[SubCustomField],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "signer_list", + "ccs", + "custom_fields", + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_create_embedded_request.py b/sdks/python/dropbox_sign/models/signature_request_create_embedded_request.py new file mode 100644 index 000000000..f4474c5c1 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_create_embedded_request.py @@ -0,0 +1,265 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestCreateEmbeddedRequest(BaseModel): + """ + SignatureRequestCreateEmbeddedRequest + """ # noqa: E501 + client_id: StrictStr = Field(description="Client id of the app you're using to create this embedded signature request. Used for security purposes.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + signers: Optional[List[SubSignatureRequestSigner]] = Field(default=None, description="Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") + grouped_signers: Optional[List[SubSignatureRequestGroupedSigners]] = Field(default=None, description="Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="The email addresses that should be CCed.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + field_options: Optional[SubFieldOptions] = None + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field(default=None, description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + hide_text_tags: Optional[StrictBool] = Field(default=False, description="Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_options: Optional[SubSigningOptions] = None + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + use_text_tags: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.") + populate_auto_fill_fields: Optional[StrictBool] = Field(default=False, description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") + expires_at: Optional[StrictInt] = Field(default=None, description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") + __properties: ClassVar[List[str]] = ["client_id", "files", "file_urls", "signers", "grouped_signers", "allow_decline", "allow_reassign", "attachments", "cc_email_addresses", "custom_fields", "field_options", "form_field_groups", "form_field_rules", "form_fields_per_document", "hide_text_tags", "message", "metadata", "signing_options", "subject", "test_mode", "title", "use_text_tags", "populate_auto_fill_fields", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestCreateEmbeddedRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in grouped_signers (list) + _items = [] + if self.grouped_signers: + for _item_grouped_signers in self.grouped_signers: + if _item_grouped_signers: + _items.append(_item_grouped_signers.to_dict()) + _dict['grouped_signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestCreateEmbeddedRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "signers": [SubSignatureRequestSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "grouped_signers": [SubSignatureRequestGroupedSigners.from_dict(_item) for _item in obj["grouped_signers"]] if obj.get("grouped_signers") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_email_addresses": obj.get("cc_email_addresses"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "hide_text_tags": obj.get("hide_text_tags") if obj.get("hide_text_tags") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "use_text_tags": obj.get("use_text_tags") if obj.get("use_text_tags") is not None else False, + "populate_auto_fill_fields": obj.get("populate_auto_fill_fields") if obj.get("populate_auto_fill_fields") is not None else False, + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "signers": "(List[SubSignatureRequestSigner],)", + "grouped_signers": "(List[SubSignatureRequestGroupedSigners],)", + "allow_decline": "(bool,)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_email_addresses": "(List[str],)", + "custom_fields": "(List[SubCustomField],)", + "field_options": "(SubFieldOptions,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "hide_text_tags": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "use_text_tags": "(bool,)", + "populate_auto_fill_fields": "(bool,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "signers", + "grouped_signers", + "attachments", + "cc_email_addresses", + "custom_fields", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_create_embedded_with_template_request.py b/sdks/python/dropbox_sign/models/signature_request_create_embedded_with_template_request.py new file mode 100644 index 000000000..d99187212 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_create_embedded_with_template_request.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestCreateEmbeddedWithTemplateRequest(BaseModel): + """ + SignatureRequestCreateEmbeddedWithTemplateRequest + """ # noqa: E501 + template_ids: List[StrictStr] = Field(description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") + client_id: StrictStr = Field(description="Client id of the app you're using to create this embedded signature request. Used for security purposes.") + signers: List[SubSignatureRequestTemplateSigner] = Field(description="Add Signers to your Templated-based Signature Request.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + ccs: Optional[List[SubCC]] = Field(default=None, description="Add CC email recipients. Required when a CC role exists for the Template.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="An array defining values and options for custom fields. Required when a custom field exists in the Template.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_options: Optional[SubSigningOptions] = None + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + populate_auto_fill_fields: Optional[StrictBool] = Field(default=False, description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") + __properties: ClassVar[List[str]] = ["template_ids", "client_id", "signers", "allow_decline", "ccs", "custom_fields", "files", "file_urls", "message", "metadata", "signing_options", "subject", "test_mode", "title", "populate_auto_fill_fields"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestCreateEmbeddedWithTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict['ccs'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestCreateEmbeddedWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_ids": obj.get("template_ids"), + "client_id": obj.get("client_id"), + "signers": [SubSignatureRequestTemplateSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "ccs": [SubCC.from_dict(_item) for _item in obj["ccs"]] if obj.get("ccs") is not None else None, + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "populate_auto_fill_fields": obj.get("populate_auto_fill_fields") if obj.get("populate_auto_fill_fields") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_ids": "(List[str],)", + "client_id": "(str,)", + "signers": "(List[SubSignatureRequestTemplateSigner],)", + "allow_decline": "(bool,)", + "ccs": "(List[SubCC],)", + "custom_fields": "(List[SubCustomField],)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "populate_auto_fill_fields": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "signers", + "ccs", + "custom_fields", + "files", + "file_urls", + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_get_response.py b/sdks/python/dropbox_sign/models/signature_request_get_response.py new file mode 100644 index 000000000..4a950cc3b --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_get_response.py @@ -0,0 +1,137 @@ +# 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.signature_request_response import SignatureRequestResponse +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 SignatureRequestGetResponse(BaseModel): + """ + SignatureRequestGetResponse + """ # noqa: E501 + signature_request: SignatureRequestResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["signature_request", "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 SignatureRequestGetResponse 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 signature_request + if self.signature_request: + _dict['signature_request'] = self.signature_request.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 SignatureRequestGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature_request": SignatureRequestResponse.from_dict(obj["signature_request"]) if obj.get("signature_request") 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 { + "signature_request": "(SignatureRequestResponse,)", + "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/signature_request_list_response.py b/sdks/python/dropbox_sign/models/signature_request_list_response.py new file mode 100644 index 000000000..4b9c3a607 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_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, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.signature_request_response import SignatureRequestResponse +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 SignatureRequestListResponse(BaseModel): + """ + SignatureRequestListResponse + """ # noqa: E501 + signature_requests: List[SignatureRequestResponse] = Field(description="Contains information about signature requests.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["signature_requests", "list_info", "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 SignatureRequestListResponse 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 signature_requests (list) + _items = [] + if self.signature_requests: + for _item_signature_requests in self.signature_requests: + if _item_signature_requests: + _items.append(_item_signature_requests.to_dict()) + _dict['signature_requests'] = _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() + # 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 SignatureRequestListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature_requests": [SignatureRequestResponse.from_dict(_item) for _item in obj["signature_requests"]] if obj.get("signature_requests") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") 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 { + "signature_requests": "(List[SignatureRequestResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "signature_requests", + "warnings", + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_remind_request.py b/sdks/python/dropbox_sign/models/signature_request_remind_request.py new file mode 100644 index 000000000..5b7c9a27a --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_remind_request.py @@ -0,0 +1,124 @@ +# 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 SignatureRequestRemindRequest(BaseModel): + """ + SignatureRequestRemindRequest + """ # noqa: E501 + email_address: StrictStr = Field(description="The email address of the signer to send a reminder to.") + name: Optional[StrictStr] = Field(default=None, description="The name of the signer to send a reminder to. Include if two or more signers share an email address.") + __properties: ClassVar[List[str]] = ["email_address", "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 SignatureRequestRemindRequest 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 SignatureRequestRemindRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address"), + "name": obj.get("name") + }) + 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 { + "email_address": "(str,)", + "name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response.py b/sdks/python/dropbox_sign/models/signature_request_response.py new file mode 100644 index 000000000..08cf1cf26 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response.py @@ -0,0 +1,231 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_attachment import SignatureRequestResponseAttachment +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from dropbox_sign.models.signature_request_response_signatures import SignatureRequestResponseSignatures +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponse(BaseModel): + """ + Contains information about a signature request. + """ # noqa: E501 + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.") + signature_request_id: Optional[StrictStr] = Field(default=None, description="The id of the SignatureRequest.") + requester_email_address: Optional[StrictStr] = Field(default=None, description="The email address of the initiator of the SignatureRequest.") + title: Optional[StrictStr] = Field(default=None, description="The title the specified Account uses for the SignatureRequest.") + original_title: Optional[StrictStr] = Field(default=None, description="Default Label for account.") + subject: Optional[StrictStr] = Field(default=None, description="The subject in the email that was initially sent to the signers.") + message: Optional[StrictStr] = Field(default=None, description="The custom message in the email that was initially sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata attached to the signature request.") + created_at: Optional[StrictInt] = Field(default=None, description="Time the signature request was created.") + expires_at: Optional[StrictInt] = Field(default=None, description="The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") + is_complete: Optional[StrictBool] = Field(default=None, description="Whether or not the SignatureRequest has been fully executed by all signers.") + is_declined: Optional[StrictBool] = Field(default=None, description="Whether or not the SignatureRequest has been declined by a signer.") + has_error: Optional[StrictBool] = Field(default=None, description="Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).") + files_url: Optional[StrictStr] = Field(default=None, description="The URL where a copy of the request's documents can be downloaded.") + signing_url: Optional[StrictStr] = Field(default=None, description="The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.") + details_url: Optional[StrictStr] = Field(default=None, description="The URL where the requester and the signers can view the current status of the SignatureRequest.") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want the signer redirected to after they successfully sign.") + final_copy_uri: Optional[StrictStr] = Field(default=None, description="The path where the completed document can be downloaded") + template_ids: Optional[List[StrictStr]] = Field(default=None, description="Templates IDs used in this SignatureRequest (if any).") + custom_fields: Optional[List[SignatureRequestResponseCustomFieldBase]] = Field(default=None, description="An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") + attachments: Optional[List[SignatureRequestResponseAttachment]] = Field(default=None, description="Signer attachments.") + response_data: Optional[List[SignatureRequestResponseDataBase]] = Field(default=None, description="An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") + signatures: Optional[List[SignatureRequestResponseSignatures]] = Field(default=None, description="An array of signature objects, 1 for each signer.") + bulk_send_job_id: Optional[StrictStr] = Field(default=None, description="The ID of the Bulk Send job which sent the signature request, if applicable.") + __properties: ClassVar[List[str]] = ["test_mode", "signature_request_id", "requester_email_address", "title", "original_title", "subject", "message", "metadata", "created_at", "expires_at", "is_complete", "is_declined", "has_error", "files_url", "signing_url", "details_url", "cc_email_addresses", "signing_redirect_url", "final_copy_uri", "template_ids", "custom_fields", "attachments", "response_data", "signatures", "bulk_send_job_id"] + + 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 SignatureRequestResponse 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 custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in response_data (list) + _items = [] + if self.response_data: + for _item_response_data in self.response_data: + if _item_response_data: + _items.append(_item_response_data.to_dict()) + _dict['response_data'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signatures (list) + _items = [] + if self.signatures: + for _item_signatures in self.signatures: + if _item_signatures: + _items.append(_item_signatures.to_dict()) + _dict['signatures'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "signature_request_id": obj.get("signature_request_id"), + "requester_email_address": obj.get("requester_email_address"), + "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"), + "expires_at": obj.get("expires_at"), + "is_complete": obj.get("is_complete"), + "is_declined": obj.get("is_declined"), + "has_error": obj.get("has_error"), + "files_url": obj.get("files_url"), + "signing_url": obj.get("signing_url"), + "details_url": obj.get("details_url"), + "cc_email_addresses": obj.get("cc_email_addresses"), + "signing_redirect_url": obj.get("signing_redirect_url"), + "final_copy_uri": obj.get("final_copy_uri"), + "template_ids": obj.get("template_ids"), + "custom_fields": [SignatureRequestResponseCustomFieldBase.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "attachments": [SignatureRequestResponseAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "response_data": [SignatureRequestResponseDataBase.from_dict(_item) for _item in obj["response_data"]] if obj.get("response_data") is not None else None, + "signatures": [SignatureRequestResponseSignatures.from_dict(_item) for _item in obj["signatures"]] if obj.get("signatures") is not None else None, + "bulk_send_job_id": obj.get("bulk_send_job_id") + }) + 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 { + "test_mode": "(bool,)", + "signature_request_id": "(str,)", + "requester_email_address": "(str,)", + "title": "(str,)", + "original_title": "(str,)", + "subject": "(str,)", + "message": "(str,)", + "metadata": "(object,)", + "created_at": "(int,)", + "expires_at": "(int,)", + "is_complete": "(bool,)", + "is_declined": "(bool,)", + "has_error": "(bool,)", + "files_url": "(str,)", + "signing_url": "(str,)", + "details_url": "(str,)", + "cc_email_addresses": "(List[str],)", + "signing_redirect_url": "(str,)", + "final_copy_uri": "(str,)", + "template_ids": "(List[str],)", + "custom_fields": "(List[SignatureRequestResponseCustomFieldBase],)", + "attachments": "(List[SignatureRequestResponseAttachment],)", + "response_data": "(List[SignatureRequestResponseDataBase],)", + "signatures": "(List[SignatureRequestResponseSignatures],)", + "bulk_send_job_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "cc_email_addresses", + "template_ids", + "custom_fields", + "attachments", + "response_data", + "signatures", + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_attachment.py b/sdks/python/dropbox_sign/models/signature_request_response_attachment.py new file mode 100644 index 000000000..6c833fd3e --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_attachment.py @@ -0,0 +1,136 @@ +# 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, 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 SignatureRequestResponseAttachment(BaseModel): + """ + Signer attachments. + """ # noqa: E501 + id: StrictStr = Field(description="The unique ID for this attachment.") + signer: Union[StrictStr, StrictInt] = Field(description="The Signer this attachment is assigned to.") + name: StrictStr = Field(description="The name of this attachment.") + required: StrictBool = Field(description="A boolean value denoting if this attachment is required.") + instructions: Optional[StrictStr] = Field(default=None, description="Instructions for Signer.") + uploaded_at: Optional[StrictInt] = Field(default=None, description="Timestamp when attachment was uploaded by Signer.") + __properties: ClassVar[List[str]] = ["id", "signer", "name", "required", "instructions", "uploaded_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 SignatureRequestResponseAttachment 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 SignatureRequestResponseAttachment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "signer": obj.get("signer"), + "name": obj.get("name"), + "required": obj.get("required"), + "instructions": obj.get("instructions"), + "uploaded_at": obj.get("uploaded_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 { + "id": "(str,)", + "signer": "(int, str,)", + "name": "(str,)", + "required": "(bool,)", + "instructions": "(str,)", + "uploaded_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/signature_request_response_custom_field_base.py b/sdks/python/dropbox_sign/models/signature_request_response_custom_field_base.py new file mode 100644 index 000000000..4f320f394 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_custom_field_base.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, 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 + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.signature_request_response_custom_field_checkbox import SignatureRequestResponseCustomFieldCheckbox + from dropbox_sign.models.signature_request_response_custom_field_text import SignatureRequestResponseCustomFieldText + +class SignatureRequestResponseCustomFieldBase(BaseModel): + """ + An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") + name: StrictStr = Field(description="The name of the Custom Field.") + required: Optional[StrictBool] = Field(default=None, description="A boolean value denoting if this field is required.") + api_id: Optional[StrictStr] = Field(default=None, description="The unique ID for this field.") + editor: Optional[StrictStr] = Field(default=None, description="The name of the Role that is able to edit this field.") + __properties: ClassVar[List[str]] = ["type", "name", "required", "api_id", "editor"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'SignatureRequestResponseCustomFieldCheckbox','text': 'SignatureRequestResponseCustomFieldText' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + 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[Union[SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText]]: + """Create an instance of SignatureRequestResponseCustomFieldBase 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: Dict[str, Any]) -> Optional[Union[SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText]]: + """Create an instance of SignatureRequestResponseCustomFieldBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'SignatureRequestResponseCustomFieldCheckbox': + return import_module("dropbox_sign.models.signature_request_response_custom_field_checkbox").SignatureRequestResponseCustomFieldCheckbox.from_dict(obj) + if object_type == 'SignatureRequestResponseCustomFieldText': + return import_module("dropbox_sign.models.signature_request_response_custom_field_text").SignatureRequestResponseCustomFieldText.from_dict(obj) + + raise ValueError("SignatureRequestResponseCustomFieldBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "name": "(str,)", + "required": "(bool,)", + "api_id": "(str,)", + "editor": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_custom_field_checkbox.py b/sdks/python/dropbox_sign/models/signature_request_response_custom_field_checkbox.py new file mode 100644 index 000000000..e0ca67386 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_custom_field_checkbox.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseCustomFieldCheckbox(SignatureRequestResponseCustomFieldBase): + """ + This class extends `SignatureRequestResponseCustomFieldBase`. + """ # noqa: E501 + type: StrictStr = Field(description="The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") + value: Optional[StrictBool] = Field(default=None, description="A true/false for checkbox fields") + __properties: ClassVar[List[str]] = ["type", "name", "required", "api_id", "editor", "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 SignatureRequestResponseCustomFieldCheckbox 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 SignatureRequestResponseCustomFieldCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "name": obj.get("name"), + "required": obj.get("required"), + "api_id": obj.get("api_id"), + "editor": obj.get("editor"), + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "name": "(str,)", + "value": "(bool,)", + "required": "(bool,)", + "api_id": "(str,)", + "editor": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_custom_field_text.py b/sdks/python/dropbox_sign/models/signature_request_response_custom_field_text.py new file mode 100644 index 000000000..7ee2fe800 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_custom_field_text.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseCustomFieldText(SignatureRequestResponseCustomFieldBase): + """ + This class extends `SignatureRequestResponseCustomFieldBase`. + """ # noqa: E501 + type: StrictStr = Field(description="The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") + value: Optional[StrictStr] = Field(default=None, description="A text string for text fields") + __properties: ClassVar[List[str]] = ["type", "name", "required", "api_id", "editor", "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 SignatureRequestResponseCustomFieldText 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 SignatureRequestResponseCustomFieldText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'text', + "name": obj.get("name"), + "required": obj.get("required"), + "api_id": obj.get("api_id"), + "editor": obj.get("editor"), + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "name": "(str,)", + "value": "(str,)", + "required": "(bool,)", + "api_id": "(str,)", + "editor": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_custom_field_type_enum.py b/sdks/python/dropbox_sign/models/signature_request_response_custom_field_type_enum.py new file mode 100644 index 000000000..b8cd0e748 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_custom_field_type_enum.py @@ -0,0 +1,38 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class SignatureRequestResponseCustomFieldTypeEnum(str, Enum): + """ + SignatureRequestResponseCustomFieldTypeEnum + """ + + """ + allowed enum values + """ + TEXT = 'text' + CHECKBOX = 'checkbox' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SignatureRequestResponseCustomFieldTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_base.py b/sdks/python/dropbox_sign/models/signature_request_response_data_base.py new file mode 100644 index 000000000..4e9f139f2 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_base.py @@ -0,0 +1,164 @@ +# 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 importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, 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 + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.signature_request_response_data_value_checkbox import SignatureRequestResponseDataValueCheckbox + from dropbox_sign.models.signature_request_response_data_value_checkbox_merge import SignatureRequestResponseDataValueCheckboxMerge + from dropbox_sign.models.signature_request_response_data_value_date_signed import SignatureRequestResponseDataValueDateSigned + from dropbox_sign.models.signature_request_response_data_value_dropdown import SignatureRequestResponseDataValueDropdown + from dropbox_sign.models.signature_request_response_data_value_initials import SignatureRequestResponseDataValueInitials + from dropbox_sign.models.signature_request_response_data_value_radio import SignatureRequestResponseDataValueRadio + from dropbox_sign.models.signature_request_response_data_value_signature import SignatureRequestResponseDataValueSignature + from dropbox_sign.models.signature_request_response_data_value_text import SignatureRequestResponseDataValueText + from dropbox_sign.models.signature_request_response_data_value_text_merge import SignatureRequestResponseDataValueTextMerge + +class SignatureRequestResponseDataBase(BaseModel): + """ + An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. + """ # noqa: E501 + api_id: Optional[StrictStr] = Field(default=None, description="The unique ID for this field.") + signature_id: Optional[StrictStr] = Field(default=None, description="The ID of the signature to which this response is linked.") + name: Optional[StrictStr] = Field(default=None, description="The name of the form field.") + required: Optional[StrictBool] = Field(default=None, description="A boolean value denoting if this field is required.") + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'SignatureRequestResponseDataValueCheckbox','checkbox-merge': 'SignatureRequestResponseDataValueCheckboxMerge','date_signed': 'SignatureRequestResponseDataValueDateSigned','dropdown': 'SignatureRequestResponseDataValueDropdown','initials': 'SignatureRequestResponseDataValueInitials','radio': 'SignatureRequestResponseDataValueRadio','signature': 'SignatureRequestResponseDataValueSignature','text': 'SignatureRequestResponseDataValueText','text-merge': 'SignatureRequestResponseDataValueTextMerge' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + 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[Union[SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge]]: + """Create an instance of SignatureRequestResponseDataBase 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: Dict[str, Any]) -> Optional[Union[SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge]]: + """Create an instance of SignatureRequestResponseDataBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'SignatureRequestResponseDataValueCheckbox': + return import_module("dropbox_sign.models.signature_request_response_data_value_checkbox").SignatureRequestResponseDataValueCheckbox.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueCheckboxMerge': + return import_module("dropbox_sign.models.signature_request_response_data_value_checkbox_merge").SignatureRequestResponseDataValueCheckboxMerge.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueDateSigned': + return import_module("dropbox_sign.models.signature_request_response_data_value_date_signed").SignatureRequestResponseDataValueDateSigned.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueDropdown': + return import_module("dropbox_sign.models.signature_request_response_data_value_dropdown").SignatureRequestResponseDataValueDropdown.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueInitials': + return import_module("dropbox_sign.models.signature_request_response_data_value_initials").SignatureRequestResponseDataValueInitials.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueRadio': + return import_module("dropbox_sign.models.signature_request_response_data_value_radio").SignatureRequestResponseDataValueRadio.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueSignature': + return import_module("dropbox_sign.models.signature_request_response_data_value_signature").SignatureRequestResponseDataValueSignature.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueText': + return import_module("dropbox_sign.models.signature_request_response_data_value_text").SignatureRequestResponseDataValueText.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueTextMerge': + return import_module("dropbox_sign.models.signature_request_response_data_value_text_merge").SignatureRequestResponseDataValueTextMerge.from_dict(obj) + + raise ValueError("SignatureRequestResponseDataBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + "type": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_type_enum.py b/sdks/python/dropbox_sign/models/signature_request_response_data_type_enum.py new file mode 100644 index 000000000..17f8831e8 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_type_enum.py @@ -0,0 +1,45 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class SignatureRequestResponseDataTypeEnum(str, Enum): + """ + SignatureRequestResponseDataTypeEnum + """ + + """ + allowed enum values + """ + TEXT = 'text' + CHECKBOX = 'checkbox' + DATE_SIGNED = 'date_signed' + DROPDOWN = 'dropdown' + INITIALS = 'initials' + RADIO = 'radio' + SIGNATURE = 'signature' + TEXT_MINUS_MERGE = 'text-merge' + CHECKBOX_MINUS_MERGE = 'checkbox-merge' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SignatureRequestResponseDataTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_value_checkbox.py b/sdks/python/dropbox_sign/models/signature_request_response_data_value_checkbox.py new file mode 100644 index 000000000..658f9179f --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_value_checkbox.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueCheckbox(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueCheckbox + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='checkbox', description="A yes/no checkbox") + value: Optional[StrictBool] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "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 SignatureRequestResponseDataValueCheckbox 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 SignatureRequestResponseDataValueCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "value": "(bool,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_value_checkbox_merge.py b/sdks/python/dropbox_sign/models/signature_request_response_data_value_checkbox_merge.py new file mode 100644 index 000000000..e391d75ba --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_value_checkbox_merge.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueCheckboxMerge(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueCheckboxMerge + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='checkbox-merge', description="A checkbox field that has default value set by the api") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "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 SignatureRequestResponseDataValueCheckboxMerge 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 SignatureRequestResponseDataValueCheckboxMerge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'checkbox-merge', + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_value_date_signed.py b/sdks/python/dropbox_sign/models/signature_request_response_data_value_date_signed.py new file mode 100644 index 000000000..e7508f97d --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_value_date_signed.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueDateSigned(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueDateSigned + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='date_signed', description="A date") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "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 SignatureRequestResponseDataValueDateSigned 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 SignatureRequestResponseDataValueDateSigned from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'date_signed', + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_value_dropdown.py b/sdks/python/dropbox_sign/models/signature_request_response_data_value_dropdown.py new file mode 100644 index 000000000..bf79e05c0 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_value_dropdown.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueDropdown(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueDropdown + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='dropdown', description="An input field for dropdowns") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "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 SignatureRequestResponseDataValueDropdown 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 SignatureRequestResponseDataValueDropdown from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'dropdown', + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_value_initials.py b/sdks/python/dropbox_sign/models/signature_request_response_data_value_initials.py new file mode 100644 index 000000000..eb8b8ac2e --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_value_initials.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueInitials(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueInitials + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='initials', description="An input field for initials") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "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 SignatureRequestResponseDataValueInitials 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 SignatureRequestResponseDataValueInitials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'initials', + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_value_radio.py b/sdks/python/dropbox_sign/models/signature_request_response_data_value_radio.py new file mode 100644 index 000000000..8c7c734fd --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_value_radio.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueRadio(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueRadio + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='radio', description="An input field for radios") + value: Optional[StrictBool] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "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 SignatureRequestResponseDataValueRadio 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 SignatureRequestResponseDataValueRadio from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'radio', + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "value": "(bool,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_value_signature.py b/sdks/python/dropbox_sign/models/signature_request_response_data_value_signature.py new file mode 100644 index 000000000..589801d69 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_value_signature.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueSignature(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueSignature + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='signature', description="A signature input field") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "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 SignatureRequestResponseDataValueSignature 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 SignatureRequestResponseDataValueSignature from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'signature', + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_value_text.py b/sdks/python/dropbox_sign/models/signature_request_response_data_value_text.py new file mode 100644 index 000000000..2bfb27d52 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_value_text.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueText(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueText + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='text', description="A text input field") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "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 SignatureRequestResponseDataValueText 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 SignatureRequestResponseDataValueText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'text', + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_data_value_text_merge.py b/sdks/python/dropbox_sign/models/signature_request_response_data_value_text_merge.py new file mode 100644 index 000000000..518dc2c3e --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_data_value_text_merge.py @@ -0,0 +1,133 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueTextMerge(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueTextMerge + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='text-merge', description="A text field that has default text set by the api") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "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 SignatureRequestResponseDataValueTextMerge 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 SignatureRequestResponseDataValueTextMerge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'text-merge', + "value": obj.get("value") + }) + 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 { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_response_signatures.py b/sdks/python/dropbox_sign/models/signature_request_response_signatures.py new file mode 100644 index 000000000..da2db2e20 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_response_signatures.py @@ -0,0 +1,175 @@ +# 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, 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 SignatureRequestResponseSignatures(BaseModel): + """ + An array of signature objects, 1 for each signer. + """ # noqa: E501 + signature_id: Optional[StrictStr] = Field(default=None, description="Signature identifier.") + signer_group_guid: Optional[StrictStr] = Field(default=None, description="Signer Group GUID") + signer_email_address: Optional[StrictStr] = Field(default=None, description="The email address of the signer.") + signer_name: Optional[StrictStr] = Field(default=None, description="The name of the signer.") + signer_role: Optional[StrictStr] = Field(default=None, description="The role of the signer.") + order: Optional[StrictInt] = Field(default=None, description="If signer order is assigned this is the 0-based index for this signer.") + status_code: Optional[StrictStr] = Field(default=None, description="The current status of the signature. eg: awaiting_signature, signed, declined.") + decline_reason: Optional[StrictStr] = Field(default=None, description="The reason provided by the signer for declining the request.") + signed_at: Optional[StrictInt] = Field(default=None, description="Time that the document was signed or null.") + last_viewed_at: Optional[StrictInt] = Field(default=None, description="The time that the document was last viewed by this signer or null.") + last_reminded_at: Optional[StrictInt] = Field(default=None, description="The time the last reminder email was sent to the signer or null.") + has_pin: Optional[StrictBool] = Field(default=None, description="Boolean to indicate whether this signature requires a PIN to access.") + has_sms_auth: Optional[StrictBool] = Field(default=None, description="Boolean to indicate whether this signature has SMS authentication enabled.") + has_sms_delivery: Optional[StrictBool] = Field(default=None, description="Boolean to indicate whether this signature has SMS delivery enabled.") + sms_phone_number: Optional[StrictStr] = Field(default=None, description="The SMS phone number used for authentication or signature request delivery.") + reassigned_by: Optional[StrictStr] = Field(default=None, description="Email address of original signer who reassigned to this signer.") + reassignment_reason: Optional[StrictStr] = Field(default=None, description="Reason provided by original signer who reassigned to this signer.") + reassigned_from: Optional[StrictStr] = Field(default=None, description="Previous signature identifier.") + error: Optional[StrictStr] = Field(default=None, description="Error message pertaining to this signer, or null.") + __properties: ClassVar[List[str]] = ["signature_id", "signer_group_guid", "signer_email_address", "signer_name", "signer_role", "order", "status_code", "decline_reason", "signed_at", "last_viewed_at", "last_reminded_at", "has_pin", "has_sms_auth", "has_sms_delivery", "sms_phone_number", "reassigned_by", "reassignment_reason", "reassigned_from", "error"] + + 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 SignatureRequestResponseSignatures 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 SignatureRequestResponseSignatures from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature_id": obj.get("signature_id"), + "signer_group_guid": obj.get("signer_group_guid"), + "signer_email_address": obj.get("signer_email_address"), + "signer_name": obj.get("signer_name"), + "signer_role": obj.get("signer_role"), + "order": obj.get("order"), + "status_code": obj.get("status_code"), + "decline_reason": obj.get("decline_reason"), + "signed_at": obj.get("signed_at"), + "last_viewed_at": obj.get("last_viewed_at"), + "last_reminded_at": obj.get("last_reminded_at"), + "has_pin": obj.get("has_pin"), + "has_sms_auth": obj.get("has_sms_auth"), + "has_sms_delivery": obj.get("has_sms_delivery"), + "sms_phone_number": obj.get("sms_phone_number"), + "reassigned_by": obj.get("reassigned_by"), + "reassignment_reason": obj.get("reassignment_reason"), + "reassigned_from": obj.get("reassigned_from"), + "error": obj.get("error") + }) + 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 { + "signature_id": "(str,)", + "signer_group_guid": "(str,)", + "signer_email_address": "(str,)", + "signer_name": "(str,)", + "signer_role": "(str,)", + "order": "(int,)", + "status_code": "(str,)", + "decline_reason": "(str,)", + "signed_at": "(int,)", + "last_viewed_at": "(int,)", + "last_reminded_at": "(int,)", + "has_pin": "(bool,)", + "has_sms_auth": "(bool,)", + "has_sms_delivery": "(bool,)", + "sms_phone_number": "(str,)", + "reassigned_by": "(str,)", + "reassignment_reason": "(str,)", + "reassigned_from": "(str,)", + "error": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_send_request.py b/sdks/python/dropbox_sign/models/signature_request_send_request.py new file mode 100644 index 000000000..a6744fa97 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_send_request.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestSendRequest(BaseModel): + """ + SignatureRequestSendRequest + """ # noqa: E501 + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + signers: Optional[List[SubSignatureRequestSigner]] = Field(default=None, description="Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") + grouped_signers: Optional[List[SubSignatureRequestGroupedSigners]] = Field(default=None, description="Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="The email addresses that should be CCed.") + client_id: Optional[StrictStr] = Field(default=None, description="The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + field_options: Optional[SubFieldOptions] = None + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field(default=None, description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + hide_text_tags: Optional[StrictBool] = Field(default=False, description="Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.") + is_qualified_signature: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.") + is_eid: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + use_text_tags: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.") + expires_at: Optional[StrictInt] = Field(default=None, description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") + __properties: ClassVar[List[str]] = ["files", "file_urls", "signers", "grouped_signers", "allow_decline", "allow_reassign", "attachments", "cc_email_addresses", "client_id", "custom_fields", "field_options", "form_field_groups", "form_field_rules", "form_fields_per_document", "hide_text_tags", "is_qualified_signature", "is_eid", "message", "metadata", "signing_options", "signing_redirect_url", "subject", "test_mode", "title", "use_text_tags", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestSendRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in grouped_signers (list) + _items = [] + if self.grouped_signers: + for _item_grouped_signers in self.grouped_signers: + if _item_grouped_signers: + _items.append(_item_grouped_signers.to_dict()) + _dict['grouped_signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestSendRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "signers": [SubSignatureRequestSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "grouped_signers": [SubSignatureRequestGroupedSigners.from_dict(_item) for _item in obj["grouped_signers"]] if obj.get("grouped_signers") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_email_addresses": obj.get("cc_email_addresses"), + "client_id": obj.get("client_id"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "hide_text_tags": obj.get("hide_text_tags") if obj.get("hide_text_tags") is not None else False, + "is_qualified_signature": obj.get("is_qualified_signature") if obj.get("is_qualified_signature") is not None else False, + "is_eid": obj.get("is_eid") if obj.get("is_eid") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "use_text_tags": obj.get("use_text_tags") if obj.get("use_text_tags") is not None else False, + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "signers": "(List[SubSignatureRequestSigner],)", + "grouped_signers": "(List[SubSignatureRequestGroupedSigners],)", + "allow_decline": "(bool,)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_email_addresses": "(List[str],)", + "client_id": "(str,)", + "custom_fields": "(List[SubCustomField],)", + "field_options": "(SubFieldOptions,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "hide_text_tags": "(bool,)", + "is_qualified_signature": "(bool,)", + "is_eid": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "use_text_tags": "(bool,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "signers", + "grouped_signers", + "attachments", + "cc_email_addresses", + "custom_fields", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_send_with_template_request.py b/sdks/python/dropbox_sign/models/signature_request_send_with_template_request.py new file mode 100644 index 000000000..36e806aa0 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_send_with_template_request.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestSendWithTemplateRequest(BaseModel): + """ + + """ # noqa: E501 + template_ids: List[StrictStr] = Field(description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") + signers: List[SubSignatureRequestTemplateSigner] = Field(description="Add Signers to your Templated-based Signature Request.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + ccs: Optional[List[SubCC]] = Field(default=None, description="Add CC email recipients. Required when a CC role exists for the Template.") + client_id: Optional[StrictStr] = Field(default=None, description="Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="An array defining values and options for custom fields. Required when a custom field exists in the Template.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + is_qualified_signature: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.") + is_eid: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + __properties: ClassVar[List[str]] = ["template_ids", "signers", "allow_decline", "ccs", "client_id", "custom_fields", "files", "file_urls", "is_qualified_signature", "is_eid", "message", "metadata", "signing_options", "signing_redirect_url", "subject", "test_mode", "title"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestSendWithTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict['ccs'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestSendWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_ids": obj.get("template_ids"), + "signers": [SubSignatureRequestTemplateSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "ccs": [SubCC.from_dict(_item) for _item in obj["ccs"]] if obj.get("ccs") is not None else None, + "client_id": obj.get("client_id"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "is_qualified_signature": obj.get("is_qualified_signature") if obj.get("is_qualified_signature") is not None else False, + "is_eid": obj.get("is_eid") if obj.get("is_eid") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_ids": "(List[str],)", + "signers": "(List[SubSignatureRequestTemplateSigner],)", + "allow_decline": "(bool,)", + "ccs": "(List[SubCC],)", + "client_id": "(str,)", + "custom_fields": "(List[SubCustomField],)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "is_qualified_signature": "(bool,)", + "is_eid": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "signers", + "ccs", + "custom_fields", + "files", + "file_urls", + ] + diff --git a/sdks/python/dropbox_sign/models/signature_request_update_request.py b/sdks/python/dropbox_sign/models/signature_request_update_request.py new file mode 100644 index 000000000..0f9b554b7 --- /dev/null +++ b/sdks/python/dropbox_sign/models/signature_request_update_request.py @@ -0,0 +1,130 @@ +# 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 SignatureRequestUpdateRequest(BaseModel): + """ + SignatureRequestUpdateRequest + """ # noqa: E501 + signature_id: StrictStr = Field(description="The signature ID for the recipient.") + email_address: Optional[StrictStr] = Field(default=None, description="The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided.") + name: Optional[StrictStr] = Field(default=None, description="The new name for the recipient. **NOTE:** Optional if `email_address` is provided.") + expires_at: Optional[StrictInt] = Field(default=None, description="The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") + __properties: ClassVar[List[str]] = ["signature_id", "email_address", "name", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestUpdateRequest 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 SignatureRequestUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature_id": obj.get("signature_id"), + "email_address": obj.get("email_address"), + "name": obj.get("name"), + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "signature_id": "(str,)", + "email_address": "(str,)", + "name": "(str,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_attachment.py b/sdks/python/dropbox_sign/models/sub_attachment.py new file mode 100644 index 000000000..200c6a5ab --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_attachment.py @@ -0,0 +1,130 @@ +# 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, 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 SubAttachment(BaseModel): + """ + SubAttachment + """ # noqa: E501 + name: StrictStr = Field(description="The name of attachment.") + signer_index: StrictInt = Field(description="The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment.") + instructions: Optional[StrictStr] = Field(default=None, description="The instructions for uploading the attachment.") + required: Optional[StrictBool] = Field(default=False, description="Determines if the attachment must be uploaded.") + __properties: ClassVar[List[str]] = ["name", "signer_index", "instructions", "required"] + + 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 SubAttachment 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 SubAttachment 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"), + "signer_index": obj.get("signer_index"), + "instructions": obj.get("instructions"), + "required": obj.get("required") if obj.get("required") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "signer_index": "(int,)", + "instructions": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_bulk_signer_list.py b/sdks/python/dropbox_sign/models/sub_bulk_signer_list.py new file mode 100644 index 000000000..06991dbe2 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_bulk_signer_list.py @@ -0,0 +1,142 @@ +# 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.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField +from dropbox_sign.models.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubBulkSignerList(BaseModel): + """ + SubBulkSignerList + """ # noqa: E501 + custom_fields: Optional[List[SubBulkSignerListCustomField]] = Field(default=None, description="An array of custom field values.") + signers: Optional[List[SubSignatureRequestTemplateSigner]] = Field(default=None, description="Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value.") + __properties: ClassVar[List[str]] = ["custom_fields", "signers"] + + 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 SubBulkSignerList 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 custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubBulkSignerList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "custom_fields": [SubBulkSignerListCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "signers": [SubSignatureRequestTemplateSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") 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 { + "custom_fields": "(List[SubBulkSignerListCustomField],)", + "signers": "(List[SubSignatureRequestTemplateSigner],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "custom_fields", + "signers", + ] + diff --git a/sdks/python/dropbox_sign/models/sub_bulk_signer_list_custom_field.py b/sdks/python/dropbox_sign/models/sub_bulk_signer_list_custom_field.py new file mode 100644 index 000000000..2a171a16e --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_bulk_signer_list_custom_field.py @@ -0,0 +1,124 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubBulkSignerListCustomField(BaseModel): + """ + SubBulkSignerListCustomField + """ # noqa: E501 + name: StrictStr = Field(description="The name of the custom field. Must be the field's `name` or `api_id`.") + value: StrictStr = Field(description="The value of the custom field.") + __properties: ClassVar[List[str]] = ["name", "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 SubBulkSignerListCustomField 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 SubBulkSignerListCustomField 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"), + "value": obj.get("value") + }) + 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,)", + "value": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_cc.py b/sdks/python/dropbox_sign/models/sub_cc.py new file mode 100644 index 000000000..840897e19 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_cc.py @@ -0,0 +1,124 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubCC(BaseModel): + """ + SubCC + """ # noqa: E501 + role: StrictStr = Field(description="Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role.") + email_address: StrictStr = Field(description="The email address of the CC recipient.") + __properties: ClassVar[List[str]] = ["role", "email_address"] + + 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 SubCC 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 SubCC from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role": obj.get("role"), + "email_address": obj.get("email_address") + }) + 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 { + "role": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_custom_field.py b/sdks/python/dropbox_sign/models/sub_custom_field.py new file mode 100644 index 000000000..ac22b9896 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_custom_field.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubCustomField(BaseModel): + """ + When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + """ # noqa: E501 + name: StrictStr = Field(description="The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing.") + editor: Optional[StrictStr] = Field(default=None, description="Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable.") + required: Optional[StrictBool] = Field(default=False, description="Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`.") + value: Optional[StrictStr] = Field(default=None, description="The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing.") + __properties: ClassVar[List[str]] = ["name", "editor", "required", "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 SubCustomField 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 SubCustomField 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"), + "editor": obj.get("editor"), + "required": obj.get("required") if obj.get("required") is not None else False, + "value": obj.get("value") + }) + 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,)", + "editor": "(str,)", + "required": "(bool,)", + "value": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_editor_options.py b/sdks/python/dropbox_sign/models/sub_editor_options.py new file mode 100644 index 000000000..fbe6ecb95 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_editor_options.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubEditorOptions(BaseModel): + """ + This allows the requester to specify editor options when a preparing a document + """ # noqa: E501 + allow_edit_signers: Optional[StrictBool] = Field(default=False, description="Allows requesters to edit the list of signers") + allow_edit_documents: Optional[StrictBool] = Field(default=False, description="Allows requesters to edit documents, including delete and add") + __properties: ClassVar[List[str]] = ["allow_edit_signers", "allow_edit_documents"] + + 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 SubEditorOptions 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 SubEditorOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow_edit_signers": obj.get("allow_edit_signers") if obj.get("allow_edit_signers") is not None else False, + "allow_edit_documents": obj.get("allow_edit_documents") if obj.get("allow_edit_documents") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "allow_edit_signers": "(bool,)", + "allow_edit_documents": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_field_options.py b/sdks/python/dropbox_sign/models/sub_field_options.py new file mode 100644 index 000000000..15413583c --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_field_options.py @@ -0,0 +1,128 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFieldOptions(BaseModel): + """ + This allows the requester to specify field options for a signature request. + """ # noqa: E501 + date_format: StrictStr = Field(description="Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher.") + __properties: ClassVar[List[str]] = ["date_format"] + + @field_validator('date_format') + def date_format_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['MM / DD / YYYY', 'MM - DD - YYYY', 'DD / MM / YYYY', 'DD - MM - YYYY', 'YYYY / MM / DD', 'YYYY - MM - DD']): + raise ValueError("must be one of enum values ('MM / DD / YYYY', 'MM - DD - YYYY', 'DD / MM / YYYY', 'DD - MM - YYYY', 'YYYY / MM / DD', 'YYYY - MM - DD')") + 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 SubFieldOptions 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 SubFieldOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date_format": obj.get("date_format") + }) + 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 { + "date_format": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_field_group.py b/sdks/python/dropbox_sign/models/sub_form_field_group.py new file mode 100644 index 000000000..ee3dcb964 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_field_group.py @@ -0,0 +1,127 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldGroup(BaseModel): + """ + SubFormFieldGroup + """ # noqa: E501 + group_id: StrictStr = Field(description="ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`.") + group_label: StrictStr = Field(description="Name of the group") + requirement: StrictStr = Field(description="Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.") + __properties: ClassVar[List[str]] = ["group_id", "group_label", "requirement"] + + 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 SubFormFieldGroup 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 SubFormFieldGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "group_id": obj.get("group_id"), + "group_label": obj.get("group_label"), + "requirement": obj.get("requirement") + }) + 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 { + "group_id": "(str,)", + "group_label": "(str,)", + "requirement": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_field_rule.py b/sdks/python/dropbox_sign/models/sub_form_field_rule.py new file mode 100644 index 000000000..bd2680277 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_field_rule.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, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from dropbox_sign.models.sub_form_field_rule_action import SubFormFieldRuleAction +from dropbox_sign.models.sub_form_field_rule_trigger import SubFormFieldRuleTrigger +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldRule(BaseModel): + """ + SubFormFieldRule + """ # noqa: E501 + id: StrictStr = Field(description="Must be unique across all defined rules.") + trigger_operator: StrictStr = Field(description="Currently only `AND` is supported. Support for `OR` is being worked on.") + triggers: Annotated[List[SubFormFieldRuleTrigger], Field(min_length=1, max_length=1)] = Field(description="An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed.") + actions: Annotated[List[SubFormFieldRuleAction], Field(min_length=1)] = Field(description="An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule.") + __properties: ClassVar[List[str]] = ["id", "trigger_operator", "triggers", "actions"] + + 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 SubFormFieldRule 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 triggers (list) + _items = [] + if self.triggers: + for _item_triggers in self.triggers: + if _item_triggers: + _items.append(_item_triggers.to_dict()) + _dict['triggers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + _items = [] + if self.actions: + for _item_actions in self.actions: + if _item_actions: + _items.append(_item_actions.to_dict()) + _dict['actions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldRule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "trigger_operator": obj.get("trigger_operator") if obj.get("trigger_operator") is not None else 'AND', + "triggers": [SubFormFieldRuleTrigger.from_dict(_item) for _item in obj["triggers"]] if obj.get("triggers") is not None else None, + "actions": [SubFormFieldRuleAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") 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 { + "id": "(str,)", + "trigger_operator": "(str,)", + "triggers": "(List[SubFormFieldRuleTrigger],)", + "actions": "(List[SubFormFieldRuleAction],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "triggers", + "actions", + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_field_rule_action.py b/sdks/python/dropbox_sign/models/sub_form_field_rule_action.py new file mode 100644 index 000000000..b9deef4e4 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_field_rule_action.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, 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 SubFormFieldRuleAction(BaseModel): + """ + SubFormFieldRuleAction + """ # noqa: E501 + hidden: StrictBool = Field(description="`true` to hide the target field when rule is satisfied, otherwise `false`.") + type: StrictStr + field_id: Optional[StrictStr] = Field(default=None, description="**field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer.") + group_id: Optional[StrictStr] = Field(default=None, description="**group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer.") + __properties: ClassVar[List[str]] = ["hidden", "type", "field_id", "group_id"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['change-field-visibility', 'change-group-visibility']): + raise ValueError("must be one of enum values ('change-field-visibility', 'change-group-visibility')") + 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 SubFormFieldRuleAction 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 SubFormFieldRuleAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hidden": obj.get("hidden"), + "type": obj.get("type"), + "field_id": obj.get("field_id"), + "group_id": obj.get("group_id") + }) + 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 { + "hidden": "(bool,)", + "type": "(str,)", + "field_id": "(str,)", + "group_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_field_rule_trigger.py b/sdks/python/dropbox_sign/models/sub_form_field_rule_trigger.py new file mode 100644 index 000000000..888fc01f5 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_field_rule_trigger.py @@ -0,0 +1,138 @@ +# 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, 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 SubFormFieldRuleTrigger(BaseModel): + """ + SubFormFieldRuleTrigger + """ # noqa: E501 + id: StrictStr = Field(description="Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer.") + operator: StrictStr = Field(description="Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value") + value: Optional[StrictStr] = Field(default=None, description="**value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1`") + values: Optional[List[StrictStr]] = Field(default=None, description="**values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`") + __properties: ClassVar[List[str]] = ["id", "operator", "value", "values"] + + @field_validator('operator') + def operator_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['any', 'is', 'match', 'none', 'not']): + raise ValueError("must be one of enum values ('any', 'is', 'match', 'none', 'not')") + 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 SubFormFieldRuleTrigger 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 SubFormFieldRuleTrigger from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "operator": obj.get("operator"), + "value": obj.get("value"), + "values": obj.get("values") + }) + 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 { + "id": "(str,)", + "operator": "(str,)", + "value": "(str,)", + "values": "(List[str],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "values", + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_base.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_base.py new file mode 100644 index 000000000..3209cd0a4 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_base.py @@ -0,0 +1,179 @@ +# 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 importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, 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 + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.sub_form_fields_per_document_checkbox import SubFormFieldsPerDocumentCheckbox + from dropbox_sign.models.sub_form_fields_per_document_checkbox_merge import SubFormFieldsPerDocumentCheckboxMerge + from dropbox_sign.models.sub_form_fields_per_document_date_signed import SubFormFieldsPerDocumentDateSigned + from dropbox_sign.models.sub_form_fields_per_document_dropdown import SubFormFieldsPerDocumentDropdown + from dropbox_sign.models.sub_form_fields_per_document_hyperlink import SubFormFieldsPerDocumentHyperlink + from dropbox_sign.models.sub_form_fields_per_document_initials import SubFormFieldsPerDocumentInitials + from dropbox_sign.models.sub_form_fields_per_document_radio import SubFormFieldsPerDocumentRadio + from dropbox_sign.models.sub_form_fields_per_document_signature import SubFormFieldsPerDocumentSignature + from dropbox_sign.models.sub_form_fields_per_document_text import SubFormFieldsPerDocumentText + from dropbox_sign.models.sub_form_fields_per_document_text_merge import SubFormFieldsPerDocumentTextMerge + +class SubFormFieldsPerDocumentBase(BaseModel): + """ + The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + """ # noqa: E501 + document_index: StrictInt = Field(description="Represents the integer index of the `file` or `file_url` document the field should be attached to.") + api_id: StrictStr = Field(description="An identifier for the field that is unique across all documents in the request.") + height: StrictInt = Field(description="Size of the field in pixels.") + required: StrictBool = Field(description="Whether this field is required.") + signer: Union[StrictStr, StrictInt] = Field(description="Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data.") + type: StrictStr + width: StrictInt = Field(description="Size of the field in pixels.") + x: StrictInt = Field(description="Location coordinates of the field in pixels.") + y: StrictInt = Field(description="Location coordinates of the field in pixels.") + name: Optional[StrictStr] = Field(default=None, description="Display name for the field.") + page: Optional[StrictInt] = Field(default=None, description="Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'SubFormFieldsPerDocumentCheckbox','checkbox-merge': 'SubFormFieldsPerDocumentCheckboxMerge','date_signed': 'SubFormFieldsPerDocumentDateSigned','dropdown': 'SubFormFieldsPerDocumentDropdown','hyperlink': 'SubFormFieldsPerDocumentHyperlink','initials': 'SubFormFieldsPerDocumentInitials','radio': 'SubFormFieldsPerDocumentRadio','signature': 'SubFormFieldsPerDocumentSignature','text': 'SubFormFieldsPerDocumentText','text-merge': 'SubFormFieldsPerDocumentTextMerge' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + 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[Union[SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge]]: + """Create an instance of SubFormFieldsPerDocumentBase 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: Dict[str, Any]) -> Optional[Union[SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge]]: + """Create an instance of SubFormFieldsPerDocumentBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'SubFormFieldsPerDocumentCheckbox': + return import_module("dropbox_sign.models.sub_form_fields_per_document_checkbox").SubFormFieldsPerDocumentCheckbox.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentCheckboxMerge': + return import_module("dropbox_sign.models.sub_form_fields_per_document_checkbox_merge").SubFormFieldsPerDocumentCheckboxMerge.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentDateSigned': + return import_module("dropbox_sign.models.sub_form_fields_per_document_date_signed").SubFormFieldsPerDocumentDateSigned.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentDropdown': + return import_module("dropbox_sign.models.sub_form_fields_per_document_dropdown").SubFormFieldsPerDocumentDropdown.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentHyperlink': + return import_module("dropbox_sign.models.sub_form_fields_per_document_hyperlink").SubFormFieldsPerDocumentHyperlink.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentInitials': + return import_module("dropbox_sign.models.sub_form_fields_per_document_initials").SubFormFieldsPerDocumentInitials.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentRadio': + return import_module("dropbox_sign.models.sub_form_fields_per_document_radio").SubFormFieldsPerDocumentRadio.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentSignature': + return import_module("dropbox_sign.models.sub_form_fields_per_document_signature").SubFormFieldsPerDocumentSignature.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentText': + return import_module("dropbox_sign.models.sub_form_fields_per_document_text").SubFormFieldsPerDocumentText.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentTextMerge': + return import_module("dropbox_sign.models.sub_form_fields_per_document_text_merge").SubFormFieldsPerDocumentTextMerge.from_dict(obj) + + raise ValueError("SubFormFieldsPerDocumentBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "type": "(str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_checkbox.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_checkbox.py new file mode 100644 index 000000000..b134fd0a0 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_checkbox.py @@ -0,0 +1,148 @@ +# 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 ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentCheckbox(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class.") + is_checked: StrictBool = Field(description="`true` for checking the checkbox field by default, otherwise `false`.") + group: Optional[StrictStr] = Field(default=None, description="String referencing group defined in `form_field_groups` parameter.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "is_checked", "name", "page", "group"] + + 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 SubFormFieldsPerDocumentCheckbox 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 SubFormFieldsPerDocumentCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "is_checked": obj.get("is_checked"), + "name": obj.get("name"), + "page": obj.get("page"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "is_checked": "(bool,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "group": "(str,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_checkbox_merge.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_checkbox_merge.py new file mode 100644 index 000000000..f63525f4d --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_checkbox_merge.py @@ -0,0 +1,142 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentCheckboxMerge(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentCheckboxMerge 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 SubFormFieldsPerDocumentCheckboxMerge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'checkbox-merge', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page") + }) + 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 { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_date_signed.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_date_signed.py new file mode 100644 index 000000000..291c4ef8a --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_date_signed.py @@ -0,0 +1,158 @@ +# 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 ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentDateSigned(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A date. Use the `SubFormFieldsPerDocumentDateSigned` class.") + font_family: Optional[StrictStr] = Field(default=None, description="Font family for the field.") + font_size: Optional[StrictInt] = Field(default=12, description="The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page", "font_family", "font_size"] + + @field_validator('font_family') + def font_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged']): + raise ValueError("must be one of enum values ('helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged')") + 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 SubFormFieldsPerDocumentDateSigned 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 SubFormFieldsPerDocumentDateSigned from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'date_signed', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page"), + "font_family": obj.get("font_family"), + "font_size": obj.get("font_size") if obj.get("font_size") is not None else 12 + }) + 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 { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "font_family": "(str,)", + "font_size": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_dropdown.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_dropdown.py new file mode 100644 index 000000000..7a1d38433 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_dropdown.py @@ -0,0 +1,166 @@ +# 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 ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentDropdown(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class.") + options: Annotated[List[StrictStr], Field(min_length=1)] = Field(description="Array of string values representing dropdown values.") + content: Optional[StrictStr] = Field(default=None, description="Selected value in `options` array. Value must exist in array.") + font_family: Optional[StrictStr] = Field(default=None, description="Font family for the field.") + font_size: Optional[StrictInt] = Field(default=12, description="The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "options", "name", "page", "content", "font_family", "font_size"] + + @field_validator('font_family') + def font_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged']): + raise ValueError("must be one of enum values ('helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged')") + 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 SubFormFieldsPerDocumentDropdown 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 SubFormFieldsPerDocumentDropdown from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'dropdown', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "options": obj.get("options"), + "name": obj.get("name"), + "page": obj.get("page"), + "content": obj.get("content"), + "font_family": obj.get("font_family"), + "font_size": obj.get("font_size") if obj.get("font_size") is not None else 12 + }) + 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 { + "type": "(str,)", + "options": "(List[str],)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "content": "(str,)", + "font_family": "(str,)", + "font_size": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "options", + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_font_enum.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_font_enum.py new file mode 100644 index 000000000..3b95a6b6b --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_font_enum.py @@ -0,0 +1,52 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class SubFormFieldsPerDocumentFontEnum(str, Enum): + """ + SubFormFieldsPerDocumentFontEnum + """ + + """ + allowed enum values + """ + HELVETICA = 'helvetica' + ARIAL = 'arial' + COURIER = 'courier' + CALIBRI = 'calibri' + CAMBRIA = 'cambria' + GEORGIA = 'georgia' + TIMES = 'times' + TREBUCHET = 'trebuchet' + VERDANA = 'verdana' + ROBOTO = 'roboto' + ROBOTOMONO = 'robotoMono' + NOTOSANS = 'notoSans' + NOTOSERIF = 'notoSerif' + NOTO_CJK_MINUS_JP_MINUS_REGULAR = 'notoCJK-JP-Regular' + NOTO_HEBREW_MINUS_REGULAR = 'notoHebrew-Regular' + NOTOSANTHAIMERGED = 'notoSanThaiMerged' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SubFormFieldsPerDocumentFontEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_hyperlink.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_hyperlink.py new file mode 100644 index 000000000..9526b36fb --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_hyperlink.py @@ -0,0 +1,164 @@ +# 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 ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentHyperlink(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class.") + content: StrictStr = Field(description="Link Text.") + content_url: StrictStr = Field(description="Link URL.") + font_family: Optional[StrictStr] = Field(default=None, description="Font family for the field.") + font_size: Optional[StrictInt] = Field(default=12, description="The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "content", "content_url", "name", "page", "font_family", "font_size"] + + @field_validator('font_family') + def font_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged']): + raise ValueError("must be one of enum values ('helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged')") + 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 SubFormFieldsPerDocumentHyperlink 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 SubFormFieldsPerDocumentHyperlink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'hyperlink', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "content": obj.get("content"), + "content_url": obj.get("content_url"), + "name": obj.get("name"), + "page": obj.get("page"), + "font_family": obj.get("font_family"), + "font_size": obj.get("font_size") if obj.get("font_size") is not None else 12 + }) + 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 { + "type": "(str,)", + "content": "(str,)", + "content_url": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "font_family": "(str,)", + "font_size": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_initials.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_initials.py new file mode 100644 index 000000000..45b2f1914 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_initials.py @@ -0,0 +1,142 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentInitials(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentInitials 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 SubFormFieldsPerDocumentInitials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'initials', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page") + }) + 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 { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_radio.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_radio.py new file mode 100644 index 000000000..a40731c01 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_radio.py @@ -0,0 +1,148 @@ +# 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 ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentRadio(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class.") + group: StrictStr = Field(description="String referencing group defined in `form_field_groups` parameter.") + is_checked: StrictBool = Field(description="`true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "group", "is_checked", "name", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentRadio 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 SubFormFieldsPerDocumentRadio from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'radio', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "group": obj.get("group"), + "is_checked": obj.get("is_checked"), + "name": obj.get("name"), + "page": obj.get("page") + }) + 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 { + "type": "(str,)", + "group": "(str,)", + "is_checked": "(bool,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_signature.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_signature.py new file mode 100644 index 000000000..86806693c --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_signature.py @@ -0,0 +1,142 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentSignature(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A signature input field. Use the `SubFormFieldsPerDocumentSignature` class.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentSignature 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 SubFormFieldsPerDocumentSignature from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'signature', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page") + }) + 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 { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_text.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_text.py new file mode 100644 index 000000000..7e569bcfb --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_text.py @@ -0,0 +1,192 @@ +# 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 ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentText(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A text input field. Use the `SubFormFieldsPerDocumentText` class.") + placeholder: Optional[StrictStr] = Field(default=None, description="Placeholder value for text field.") + auto_fill_type: Optional[StrictStr] = Field(default=None, description="Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values.") + link_id: Optional[StrictStr] = Field(default=None, description="Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields.") + masked: Optional[StrictBool] = Field(default=None, description="Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`.") + validation_type: Optional[StrictStr] = Field(default=None, description="Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value.") + validation_custom_regex: Optional[StrictStr] = None + validation_custom_regex_format_label: Optional[StrictStr] = None + content: Optional[StrictStr] = Field(default=None, description="Content of a `me_now` text field") + font_family: Optional[StrictStr] = Field(default=None, description="Font family for the field.") + font_size: Optional[StrictInt] = Field(default=12, description="The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page", "placeholder", "auto_fill_type", "link_id", "masked", "validation_type", "validation_custom_regex", "validation_custom_regex_format_label", "content", "font_family", "font_size"] + + @field_validator('validation_type') + def validation_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['numbers_only', 'letters_only', 'phone_number', 'bank_routing_number', 'bank_account_number', 'email_address', 'zip_code', 'social_security_number', 'employer_identification_number', 'custom_regex']): + raise ValueError("must be one of enum values ('numbers_only', 'letters_only', 'phone_number', 'bank_routing_number', 'bank_account_number', 'email_address', 'zip_code', 'social_security_number', 'employer_identification_number', 'custom_regex')") + return value + + @field_validator('font_family') + def font_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged']): + raise ValueError("must be one of enum values ('helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged')") + 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 SubFormFieldsPerDocumentText 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 SubFormFieldsPerDocumentText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'text', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page"), + "placeholder": obj.get("placeholder"), + "auto_fill_type": obj.get("auto_fill_type"), + "link_id": obj.get("link_id"), + "masked": obj.get("masked"), + "validation_type": obj.get("validation_type"), + "validation_custom_regex": obj.get("validation_custom_regex"), + "validation_custom_regex_format_label": obj.get("validation_custom_regex_format_label"), + "content": obj.get("content"), + "font_family": obj.get("font_family"), + "font_size": obj.get("font_size") if obj.get("font_size") is not None else 12 + }) + 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 { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "placeholder": "(str,)", + "auto_fill_type": "(str,)", + "link_id": "(str,)", + "masked": "(bool,)", + "validation_type": "(str,)", + "validation_custom_regex": "(str,)", + "validation_custom_regex_format_label": "(str,)", + "content": "(str,)", + "font_family": "(str,)", + "font_size": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_text_merge.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_text_merge.py new file mode 100644 index 000000000..a60f04b44 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_text_merge.py @@ -0,0 +1,158 @@ +# 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 ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentTextMerge(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class.") + font_family: Optional[StrictStr] = Field(default=None, description="Font family for the field.") + font_size: Optional[StrictInt] = Field(default=12, description="The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page", "font_family", "font_size"] + + @field_validator('font_family') + def font_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged']): + raise ValueError("must be one of enum values ('helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged')") + 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 SubFormFieldsPerDocumentTextMerge 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 SubFormFieldsPerDocumentTextMerge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'text-merge', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page"), + "font_family": obj.get("font_family"), + "font_size": obj.get("font_size") if obj.get("font_size") is not None else 12 + }) + 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 { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "font_family": "(str,)", + "font_size": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_form_fields_per_document_type_enum.py b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_type_enum.py new file mode 100644 index 000000000..3ad73f880 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_form_fields_per_document_type_enum.py @@ -0,0 +1,46 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class SubFormFieldsPerDocumentTypeEnum(str, Enum): + """ + SubFormFieldsPerDocumentTypeEnum + """ + + """ + allowed enum values + """ + CHECKBOX = 'checkbox' + CHECKBOX_MINUS_MERGE = 'checkbox-merge' + DATE_SIGNED = 'date_signed' + DROPDOWN = 'dropdown' + HYPERLINK = 'hyperlink' + INITIALS = 'initials' + SIGNATURE = 'signature' + RADIO = 'radio' + TEXT = 'text' + TEXT_MINUS_MERGE = 'text-merge' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SubFormFieldsPerDocumentTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/sdks/python/dropbox_sign/models/sub_merge_field.py b/sdks/python/dropbox_sign/models/sub_merge_field.py new file mode 100644 index 000000000..9e24d5584 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_merge_field.py @@ -0,0 +1,131 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubMergeField(BaseModel): + """ + SubMergeField + """ # noqa: E501 + name: StrictStr = Field(description="The name of the merge field. Must be unique.") + type: StrictStr = Field(description="The type of merge field.") + __properties: ClassVar[List[str]] = ["name", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['text', 'checkbox']): + raise ValueError("must be one of enum values ('text', 'checkbox')") + 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 SubMergeField 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 SubMergeField 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"), + "type": obj.get("type") + }) + 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,)", + "type": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_o_auth.py b/sdks/python/dropbox_sign/models/sub_o_auth.py new file mode 100644 index 000000000..d3860181c --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_o_auth.py @@ -0,0 +1,136 @@ +# 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, 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 SubOAuth(BaseModel): + """ + OAuth related parameters. + """ # noqa: E501 + callback_url: Optional[StrictStr] = Field(default=None, description="The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided)") + scopes: Optional[List[StrictStr]] = Field(default=None, description="A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided).") + __properties: ClassVar[List[str]] = ["callback_url", "scopes"] + + @field_validator('scopes') + def scopes_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['request_signature', 'basic_account_info', 'account_access', 'signature_request_access', 'template_access', 'team_access', 'api_app_access', '']): + raise ValueError("each list item must be one of ('request_signature', 'basic_account_info', 'account_access', 'signature_request_access', 'template_access', 'team_access', 'api_app_access', '')") + 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 SubOAuth 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 SubOAuth from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callback_url": obj.get("callback_url"), + "scopes": obj.get("scopes") + }) + 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 { + "callback_url": "(str,)", + "scopes": "(List[str],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "scopes", + ] + diff --git a/sdks/python/dropbox_sign/models/sub_options.py b/sdks/python/dropbox_sign/models/sub_options.py new file mode 100644 index 000000000..1f80f2a4b --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_options.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubOptions(BaseModel): + """ + Additional options supported by API App. + """ # noqa: E501 + can_insert_everywhere: Optional[StrictBool] = Field(default=False, description="Determines if signers can use \"Insert Everywhere\" when signing a document.") + __properties: ClassVar[List[str]] = ["can_insert_everywhere"] + + 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 SubOptions 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 SubOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "can_insert_everywhere": obj.get("can_insert_everywhere") if obj.get("can_insert_everywhere") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "can_insert_everywhere": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_signature_request_grouped_signers.py b/sdks/python/dropbox_sign/models/sub_signature_request_grouped_signers.py new file mode 100644 index 000000000..b0734b9dc --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_signature_request_grouped_signers.py @@ -0,0 +1,136 @@ +# 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.sub_signature_request_signer import SubSignatureRequestSigner +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubSignatureRequestGroupedSigners(BaseModel): + """ + SubSignatureRequestGroupedSigners + """ # noqa: E501 + group: StrictStr = Field(description="The name of the group.") + signers: List[SubSignatureRequestSigner] = Field(description="Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below.") + order: Optional[StrictInt] = Field(default=None, description="The order the group is required to sign in. Use this instead of Signer-level `order`.") + __properties: ClassVar[List[str]] = ["group", "signers", "order"] + + 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 SubSignatureRequestGroupedSigners from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubSignatureRequestGroupedSigners from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "group": obj.get("group"), + "signers": [SubSignatureRequestSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "order": obj.get("order") + }) + 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 { + "group": "(str,)", + "signers": "(List[SubSignatureRequestSigner],)", + "order": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "signers", + ] + diff --git a/sdks/python/dropbox_sign/models/sub_signature_request_signer.py b/sdks/python/dropbox_sign/models/sub_signature_request_signer.py new file mode 100644 index 000000000..ff4091a46 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_signature_request_signer.py @@ -0,0 +1,147 @@ +# 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_extensions import Annotated +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubSignatureRequestSigner(BaseModel): + """ + SubSignatureRequestSigner + """ # noqa: E501 + name: StrictStr = Field(description="The name of the signer.") + email_address: StrictStr = Field(description="The email address of the signer.") + order: Optional[StrictInt] = Field(default=None, description="The order the signer is required to sign in.") + pin: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=12)]] = Field(default=None, description="The 4- to 12-character access code that will secure this signer's signature page.") + sms_phone_number: Optional[StrictStr] = Field(default=None, description="An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.") + sms_phone_number_type: Optional[StrictStr] = Field(default=None, description="Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).") + __properties: ClassVar[List[str]] = ["name", "email_address", "order", "pin", "sms_phone_number", "sms_phone_number_type"] + + @field_validator('sms_phone_number_type') + def sms_phone_number_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['authentication', 'delivery']): + raise ValueError("must be one of enum values ('authentication', 'delivery')") + 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 SubSignatureRequestSigner 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 SubSignatureRequestSigner 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"), + "email_address": obj.get("email_address"), + "order": obj.get("order"), + "pin": obj.get("pin"), + "sms_phone_number": obj.get("sms_phone_number"), + "sms_phone_number_type": obj.get("sms_phone_number_type") + }) + 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,)", + "email_address": "(str,)", + "order": "(int,)", + "pin": "(str,)", + "sms_phone_number": "(str,)", + "sms_phone_number_type": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_signature_request_template_signer.py b/sdks/python/dropbox_sign/models/sub_signature_request_template_signer.py new file mode 100644 index 000000000..d5affd2e9 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_signature_request_template_signer.py @@ -0,0 +1,147 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubSignatureRequestTemplateSigner(BaseModel): + """ + SubSignatureRequestTemplateSigner + """ # noqa: E501 + role: StrictStr = Field(description="Must match an existing role in chosen Template(s). It's case-sensitive.") + name: StrictStr = Field(description="The name of the signer.") + email_address: StrictStr = Field(description="The email address of the signer.") + pin: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=12)]] = Field(default=None, description="The 4- to 12-character access code that will secure this signer's signature page.") + sms_phone_number: Optional[StrictStr] = Field(default=None, description="An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.") + sms_phone_number_type: Optional[StrictStr] = Field(default=None, description="Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).") + __properties: ClassVar[List[str]] = ["role", "name", "email_address", "pin", "sms_phone_number", "sms_phone_number_type"] + + @field_validator('sms_phone_number_type') + def sms_phone_number_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['authentication', 'delivery']): + raise ValueError("must be one of enum values ('authentication', 'delivery')") + 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 SubSignatureRequestTemplateSigner 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 SubSignatureRequestTemplateSigner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role": obj.get("role"), + "name": obj.get("name"), + "email_address": obj.get("email_address"), + "pin": obj.get("pin"), + "sms_phone_number": obj.get("sms_phone_number"), + "sms_phone_number_type": obj.get("sms_phone_number_type") + }) + 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 { + "role": "(str,)", + "name": "(str,)", + "email_address": "(str,)", + "pin": "(str,)", + "sms_phone_number": "(str,)", + "sms_phone_number_type": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_signing_options.py b/sdks/python/dropbox_sign/models/sub_signing_options.py new file mode 100644 index 000000000..eec7baf9c --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_signing_options.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, 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 SubSigningOptions(BaseModel): + """ + This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings. + """ # noqa: E501 + default_type: StrictStr = Field(description="The default type shown (limited to the listed types)") + draw: Optional[StrictBool] = Field(default=False, description="Allows drawing the signature") + phone: Optional[StrictBool] = Field(default=False, description="Allows using a smartphone to email the signature") + type: Optional[StrictBool] = Field(default=False, description="Allows typing the signature") + upload: Optional[StrictBool] = Field(default=False, description="Allows uploading the signature") + __properties: ClassVar[List[str]] = ["default_type", "draw", "phone", "type", "upload"] + + @field_validator('default_type') + def default_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['draw', 'phone', 'type', 'upload']): + raise ValueError("must be one of enum values ('draw', 'phone', 'type', 'upload')") + 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 SubSigningOptions 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 SubSigningOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "default_type": obj.get("default_type"), + "draw": obj.get("draw") if obj.get("draw") is not None else False, + "phone": obj.get("phone") if obj.get("phone") is not None else False, + "type": obj.get("type") if obj.get("type") is not None else False, + "upload": obj.get("upload") if obj.get("upload") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "default_type": "(str,)", + "draw": "(bool,)", + "phone": "(bool,)", + "type": "(bool,)", + "upload": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_team_response.py b/sdks/python/dropbox_sign/models/sub_team_response.py new file mode 100644 index 000000000..8cd9ad5db --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_team_response.py @@ -0,0 +1,124 @@ +# 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 SubTeamResponse(BaseModel): + """ + SubTeamResponse + """ # noqa: E501 + team_id: Optional[StrictStr] = Field(default=None, description="The id of a team") + name: Optional[StrictStr] = Field(default=None, description="The name of a team") + __properties: ClassVar[List[str]] = ["team_id", "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 SubTeamResponse 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 SubTeamResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_id": obj.get("team_id"), + "name": obj.get("name") + }) + 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 { + "team_id": "(str,)", + "name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_template_role.py b/sdks/python/dropbox_sign/models/sub_template_role.py new file mode 100644 index 000000000..95eda3741 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_template_role.py @@ -0,0 +1,124 @@ +# 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 SubTemplateRole(BaseModel): + """ + SubTemplateRole + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The role name of the signer that will be displayed when the template is used to create a signature request.") + order: Optional[StrictInt] = Field(default=None, description="The order in which this signer role is required to sign.") + __properties: ClassVar[List[str]] = ["name", "order"] + + 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 SubTemplateRole 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 SubTemplateRole 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"), + "order": obj.get("order") + }) + 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,)", + "order": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_unclaimed_draft_signer.py b/sdks/python/dropbox_sign/models/sub_unclaimed_draft_signer.py new file mode 100644 index 000000000..9f705a09a --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_unclaimed_draft_signer.py @@ -0,0 +1,127 @@ +# 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 SubUnclaimedDraftSigner(BaseModel): + """ + SubUnclaimedDraftSigner + """ # noqa: E501 + email_address: StrictStr = Field(description="The email address of the signer.") + name: StrictStr = Field(description="The name of the signer.") + order: Optional[StrictInt] = Field(default=None, description="The order the signer is required to sign in.") + __properties: ClassVar[List[str]] = ["email_address", "name", "order"] + + 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 SubUnclaimedDraftSigner 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 SubUnclaimedDraftSigner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address"), + "name": obj.get("name"), + "order": obj.get("order") + }) + 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 { + "email_address": "(str,)", + "name": "(str,)", + "order": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_unclaimed_draft_template_signer.py b/sdks/python/dropbox_sign/models/sub_unclaimed_draft_template_signer.py new file mode 100644 index 000000000..fbe77604b --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_unclaimed_draft_template_signer.py @@ -0,0 +1,127 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubUnclaimedDraftTemplateSigner(BaseModel): + """ + SubUnclaimedDraftTemplateSigner + """ # noqa: E501 + role: StrictStr = Field(description="Must match an existing role in chosen Template(s).") + name: StrictStr = Field(description="The name of the signer filling the role of `role`.") + email_address: StrictStr = Field(description="The email address of the signer filling the role of `role`.") + __properties: ClassVar[List[str]] = ["role", "name", "email_address"] + + 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 SubUnclaimedDraftTemplateSigner 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 SubUnclaimedDraftTemplateSigner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role": obj.get("role"), + "name": obj.get("name"), + "email_address": obj.get("email_address") + }) + 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 { + "role": "(str,)", + "name": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/sub_white_labeling_options.py b/sdks/python/dropbox_sign/models/sub_white_labeling_options.py new file mode 100644 index 000000000..d6e722663 --- /dev/null +++ b/sdks/python/dropbox_sign/models/sub_white_labeling_options.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, 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 SubWhiteLabelingOptions(BaseModel): + """ + An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. + """ # noqa: E501 + header_background_color: Optional[StrictStr] = '#1A1A1A' + legal_version: Optional[StrictStr] = 'terms1' + link_color: Optional[StrictStr] = '#00B3E6' + page_background_color: Optional[StrictStr] = '#F7F8F9' + primary_button_color: Optional[StrictStr] = '#00B3E6' + primary_button_color_hover: Optional[StrictStr] = '#00B3E6' + primary_button_text_color: Optional[StrictStr] = '#FFFFFF' + primary_button_text_color_hover: Optional[StrictStr] = '#FFFFFF' + secondary_button_color: Optional[StrictStr] = '#FFFFFF' + secondary_button_color_hover: Optional[StrictStr] = '#FFFFFF' + secondary_button_text_color: Optional[StrictStr] = '#00B3E6' + secondary_button_text_color_hover: Optional[StrictStr] = '#00B3E6' + text_color1: Optional[StrictStr] = '#808080' + text_color2: Optional[StrictStr] = '#FFFFFF' + reset_to_default: Optional[StrictBool] = Field(default=None, description="Resets white labeling options to defaults. Only useful when updating an API App.") + __properties: ClassVar[List[str]] = ["header_background_color", "legal_version", "link_color", "page_background_color", "primary_button_color", "primary_button_color_hover", "primary_button_text_color", "primary_button_text_color_hover", "secondary_button_color", "secondary_button_color_hover", "secondary_button_text_color", "secondary_button_text_color_hover", "text_color1", "text_color2", "reset_to_default"] + + @field_validator('legal_version') + def legal_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['terms1', 'terms2']): + raise ValueError("must be one of enum values ('terms1', 'terms2')") + 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 SubWhiteLabelingOptions 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 SubWhiteLabelingOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "header_background_color": obj.get("header_background_color") if obj.get("header_background_color") is not None else '#1A1A1A', + "legal_version": obj.get("legal_version") if obj.get("legal_version") is not None else 'terms1', + "link_color": obj.get("link_color") if obj.get("link_color") is not None else '#00B3E6', + "page_background_color": obj.get("page_background_color") if obj.get("page_background_color") is not None else '#F7F8F9', + "primary_button_color": obj.get("primary_button_color") if obj.get("primary_button_color") is not None else '#00B3E6', + "primary_button_color_hover": obj.get("primary_button_color_hover") if obj.get("primary_button_color_hover") is not None else '#00B3E6', + "primary_button_text_color": obj.get("primary_button_text_color") if obj.get("primary_button_text_color") is not None else '#FFFFFF', + "primary_button_text_color_hover": obj.get("primary_button_text_color_hover") if obj.get("primary_button_text_color_hover") is not None else '#FFFFFF', + "secondary_button_color": obj.get("secondary_button_color") if obj.get("secondary_button_color") is not None else '#FFFFFF', + "secondary_button_color_hover": obj.get("secondary_button_color_hover") if obj.get("secondary_button_color_hover") is not None else '#FFFFFF', + "secondary_button_text_color": obj.get("secondary_button_text_color") if obj.get("secondary_button_text_color") is not None else '#00B3E6', + "secondary_button_text_color_hover": obj.get("secondary_button_text_color_hover") if obj.get("secondary_button_text_color_hover") is not None else '#00B3E6', + "text_color1": obj.get("text_color1") if obj.get("text_color1") is not None else '#808080', + "text_color2": obj.get("text_color2") if obj.get("text_color2") is not None else '#FFFFFF', + "reset_to_default": obj.get("reset_to_default") + }) + 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 { + "header_background_color": "(str,)", + "legal_version": "(str,)", + "link_color": "(str,)", + "page_background_color": "(str,)", + "primary_button_color": "(str,)", + "primary_button_color_hover": "(str,)", + "primary_button_text_color": "(str,)", + "primary_button_text_color_hover": "(str,)", + "secondary_button_color": "(str,)", + "secondary_button_color_hover": "(str,)", + "secondary_button_text_color": "(str,)", + "secondary_button_text_color_hover": "(str,)", + "text_color1": "(str,)", + "text_color2": "(str,)", + "reset_to_default": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/team_add_member_request.py b/sdks/python/dropbox_sign/models/team_add_member_request.py new file mode 100644 index 000000000..3358304f7 --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_add_member_request.py @@ -0,0 +1,137 @@ +# 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, 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 TeamAddMemberRequest(BaseModel): + """ + TeamAddMemberRequest + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="`account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team.") + email_address: Optional[StrictStr] = Field(default=None, description="`account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team.") + role: Optional[StrictStr] = Field(default=None, description="A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided.") + __properties: ClassVar[List[str]] = ["account_id", "email_address", "role"] + + @field_validator('role') + def role_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Member', 'Developer', 'Team Manager', 'Admin']): + raise ValueError("must be one of enum values ('Member', 'Developer', 'Team Manager', 'Admin')") + 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 TeamAddMemberRequest 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 TeamAddMemberRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "role": obj.get("role") + }) + 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 { + "account_id": "(str,)", + "email_address": "(str,)", + "role": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/team_create_request.py b/sdks/python/dropbox_sign/models/team_create_request.py new file mode 100644 index 000000000..6ffdbbe0f --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_create_request.py @@ -0,0 +1,121 @@ +# 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 TeamCreateRequest(BaseModel): + """ + TeamCreateRequest + """ # noqa: E501 + name: Optional[StrictStr] = Field(default='Untitled Team', description="The name of your Team.") + __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 TeamCreateRequest 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 TeamCreateRequest 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 'Untitled Team' + }) + 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/python/dropbox_sign/models/team_get_info_response.py b/sdks/python/dropbox_sign/models/team_get_info_response.py new file mode 100644 index 000000000..553e0388f --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_get_info_response.py @@ -0,0 +1,137 @@ +# 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.team_info_response import TeamInfoResponse +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 TeamGetInfoResponse(BaseModel): + """ + TeamGetInfoResponse + """ # noqa: E501 + team: TeamInfoResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["team", "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 TeamGetInfoResponse 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 team + if self.team: + _dict['team'] = self.team.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 TeamGetInfoResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team": TeamInfoResponse.from_dict(obj["team"]) if obj.get("team") 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 { + "team": "(TeamInfoResponse,)", + "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/team_get_response.py b/sdks/python/dropbox_sign/models/team_get_response.py new file mode 100644 index 000000000..fcb6fb9f9 --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_get_response.py @@ -0,0 +1,137 @@ +# 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.team_response import TeamResponse +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 TeamGetResponse(BaseModel): + """ + TeamGetResponse + """ # noqa: E501 + team: TeamResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["team", "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 TeamGetResponse 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 team + if self.team: + _dict['team'] = self.team.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 TeamGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team": TeamResponse.from_dict(obj["team"]) if obj.get("team") 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 { + "team": "(TeamResponse,)", + "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/team_info_response.py b/sdks/python/dropbox_sign/models/team_info_response.py new file mode 100644 index 000000000..533d3eba1 --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_info_response.py @@ -0,0 +1,137 @@ +# 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.team_parent_response import TeamParentResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamInfoResponse(BaseModel): + """ + TeamInfoResponse + """ # noqa: E501 + team_id: Optional[StrictStr] = Field(default=None, description="The id of a team") + team_parent: Optional[TeamParentResponse] = None + name: Optional[StrictStr] = Field(default=None, description="The name of a team") + num_members: Optional[StrictInt] = Field(default=None, description="Number of members within a team") + num_sub_teams: Optional[StrictInt] = Field(default=None, description="Number of sub teams within a team") + __properties: ClassVar[List[str]] = ["team_id", "team_parent", "name", "num_members", "num_sub_teams"] + + 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 TeamInfoResponse 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 team_parent + if self.team_parent: + _dict['team_parent'] = self.team_parent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamInfoResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_id": obj.get("team_id"), + "team_parent": TeamParentResponse.from_dict(obj["team_parent"]) if obj.get("team_parent") is not None else None, + "name": obj.get("name"), + "num_members": obj.get("num_members"), + "num_sub_teams": obj.get("num_sub_teams") + }) + 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 { + "team_id": "(str,)", + "team_parent": "(TeamParentResponse,)", + "name": "(str,)", + "num_members": "(int,)", + "num_sub_teams": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/team_invite_response.py b/sdks/python/dropbox_sign/models/team_invite_response.py new file mode 100644 index 000000000..5a5068b00 --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_invite_response.py @@ -0,0 +1,136 @@ +# 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 TeamInviteResponse(BaseModel): + """ + TeamInviteResponse + """ # noqa: E501 + email_address: Optional[StrictStr] = Field(default=None, description="Email address of the user invited to this team.") + team_id: Optional[StrictStr] = Field(default=None, description="Id of the team.") + role: Optional[StrictStr] = Field(default=None, description="Role of the user invited to this team.") + sent_at: Optional[StrictInt] = Field(default=None, description="Timestamp when the invitation was sent.") + redeemed_at: Optional[StrictInt] = Field(default=None, description="Timestamp when the invitation was redeemed.") + expires_at: Optional[StrictInt] = Field(default=None, description="Timestamp when the invitation is expiring.") + __properties: ClassVar[List[str]] = ["email_address", "team_id", "role", "sent_at", "redeemed_at", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamInviteResponse 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 TeamInviteResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address"), + "team_id": obj.get("team_id"), + "role": obj.get("role"), + "sent_at": obj.get("sent_at"), + "redeemed_at": obj.get("redeemed_at"), + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "email_address": "(str,)", + "team_id": "(str,)", + "role": "(str,)", + "sent_at": "(int,)", + "redeemed_at": "(int,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/team_invites_response.py b/sdks/python/dropbox_sign/models/team_invites_response.py new file mode 100644 index 000000000..e54721b1a --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_invites_response.py @@ -0,0 +1,142 @@ +# 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.team_invite_response import TeamInviteResponse +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 TeamInvitesResponse(BaseModel): + """ + TeamInvitesResponse + """ # noqa: E501 + team_invites: List[TeamInviteResponse] = Field(description="Contains a list of team invites and their roles.") + warnings: Optional[List[WarningResponse]] = None + __properties: ClassVar[List[str]] = ["team_invites", "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 TeamInvitesResponse 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 team_invites (list) + _items = [] + if self.team_invites: + for _item_team_invites in self.team_invites: + if _item_team_invites: + _items.append(_item_team_invites.to_dict()) + _dict['team_invites'] = _items + # 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 TeamInvitesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_invites": [TeamInviteResponse.from_dict(_item) for _item in obj["team_invites"]] if obj.get("team_invites") 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 { + "team_invites": "(List[TeamInviteResponse],)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "team_invites", + "warnings", + ] + diff --git a/sdks/python/dropbox_sign/models/team_member_response.py b/sdks/python/dropbox_sign/models/team_member_response.py new file mode 100644 index 000000000..d880c3cc0 --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_member_response.py @@ -0,0 +1,127 @@ +# 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 TeamMemberResponse(BaseModel): + """ + TeamMemberResponse + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="Account id of the team member.") + email_address: Optional[StrictStr] = Field(default=None, description="Email address of the team member.") + role: Optional[StrictStr] = Field(default=None, description="The specific role a member has on the team.") + __properties: ClassVar[List[str]] = ["account_id", "email_address", "role"] + + 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 TeamMemberResponse 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 TeamMemberResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "role": obj.get("role") + }) + 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 { + "account_id": "(str,)", + "email_address": "(str,)", + "role": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/team_members_response.py b/sdks/python/dropbox_sign/models/team_members_response.py new file mode 100644 index 000000000..5ad4aaae1 --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_members_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, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.team_member_response import TeamMemberResponse +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 TeamMembersResponse(BaseModel): + """ + TeamMembersResponse + """ # noqa: E501 + team_members: List[TeamMemberResponse] = Field(description="Contains a list of team members and their roles for a specific team.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = None + __properties: ClassVar[List[str]] = ["team_members", "list_info", "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 TeamMembersResponse 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 team_members (list) + _items = [] + if self.team_members: + for _item_team_members in self.team_members: + if _item_team_members: + _items.append(_item_team_members.to_dict()) + _dict['team_members'] = _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() + # 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 TeamMembersResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_members": [TeamMemberResponse.from_dict(_item) for _item in obj["team_members"]] if obj.get("team_members") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") 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 { + "team_members": "(List[TeamMemberResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "team_members", + "warnings", + ] + diff --git a/sdks/python/dropbox_sign/models/team_parent_response.py b/sdks/python/dropbox_sign/models/team_parent_response.py new file mode 100644 index 000000000..35cc1c00d --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_parent_response.py @@ -0,0 +1,124 @@ +# 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 TeamParentResponse(BaseModel): + """ + Information about the parent team if a team has one, set to `null` otherwise. + """ # noqa: E501 + team_id: Optional[StrictStr] = Field(default=None, description="The id of a team") + name: Optional[StrictStr] = Field(default=None, description="The name of a team") + __properties: ClassVar[List[str]] = ["team_id", "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 TeamParentResponse 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 TeamParentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_id": obj.get("team_id"), + "name": obj.get("name") + }) + 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 { + "team_id": "(str,)", + "name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/team_remove_member_request.py b/sdks/python/dropbox_sign/models/team_remove_member_request.py new file mode 100644 index 000000000..c1470da82 --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_remove_member_request.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, 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 TeamRemoveMemberRequest(BaseModel): + """ + TeamRemoveMemberRequest + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="**account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team.") + email_address: Optional[StrictStr] = Field(default=None, description="**account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team.") + new_owner_email_address: Optional[StrictStr] = Field(default=None, description="The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans.") + new_team_id: Optional[StrictStr] = Field(default=None, description="Id of the new Team.") + new_role: Optional[StrictStr] = Field(default=None, description="A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided.") + __properties: ClassVar[List[str]] = ["account_id", "email_address", "new_owner_email_address", "new_team_id", "new_role"] + + @field_validator('new_role') + def new_role_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Member', 'Developer', 'Team Manager', 'Admin']): + raise ValueError("must be one of enum values ('Member', 'Developer', 'Team Manager', 'Admin')") + 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 TeamRemoveMemberRequest 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 TeamRemoveMemberRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "new_owner_email_address": obj.get("new_owner_email_address"), + "new_team_id": obj.get("new_team_id"), + "new_role": obj.get("new_role") + }) + 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 { + "account_id": "(str,)", + "email_address": "(str,)", + "new_owner_email_address": "(str,)", + "new_team_id": "(str,)", + "new_role": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/team_response.py b/sdks/python/dropbox_sign/models/team_response.py new file mode 100644 index 000000000..cba0fc05f --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_response.py @@ -0,0 +1,148 @@ +# 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 dropbox_sign.models.account_response import AccountResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamResponse(BaseModel): + """ + Contains information about your team and its members + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of your Team") + accounts: Optional[List[AccountResponse]] = None + invited_accounts: Optional[List[AccountResponse]] = Field(default=None, description="A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`.") + invited_emails: Optional[List[StrictStr]] = Field(default=None, description="A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account.") + __properties: ClassVar[List[str]] = ["name", "accounts", "invited_accounts", "invited_emails"] + + 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 TeamResponse 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 accounts (list) + _items = [] + if self.accounts: + for _item_accounts in self.accounts: + if _item_accounts: + _items.append(_item_accounts.to_dict()) + _dict['accounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in invited_accounts (list) + _items = [] + if self.invited_accounts: + for _item_invited_accounts in self.invited_accounts: + if _item_invited_accounts: + _items.append(_item_invited_accounts.to_dict()) + _dict['invited_accounts'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamResponse 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"), + "accounts": [AccountResponse.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") is not None else None, + "invited_accounts": [AccountResponse.from_dict(_item) for _item in obj["invited_accounts"]] if obj.get("invited_accounts") is not None else None, + "invited_emails": obj.get("invited_emails") + }) + 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,)", + "accounts": "(List[AccountResponse],)", + "invited_accounts": "(List[AccountResponse],)", + "invited_emails": "(List[str],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "accounts", + "invited_accounts", + "invited_emails", + ] + diff --git a/sdks/python/dropbox_sign/models/team_sub_teams_response.py b/sdks/python/dropbox_sign/models/team_sub_teams_response.py new file mode 100644 index 000000000..99b767e3e --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_sub_teams_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, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.sub_team_response import SubTeamResponse +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 TeamSubTeamsResponse(BaseModel): + """ + TeamSubTeamsResponse + """ # noqa: E501 + sub_teams: List[SubTeamResponse] = Field(description="Contains a list with sub teams.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = None + __properties: ClassVar[List[str]] = ["sub_teams", "list_info", "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 TeamSubTeamsResponse 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 sub_teams (list) + _items = [] + if self.sub_teams: + for _item_sub_teams in self.sub_teams: + if _item_sub_teams: + _items.append(_item_sub_teams.to_dict()) + _dict['sub_teams'] = _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() + # 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 TeamSubTeamsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sub_teams": [SubTeamResponse.from_dict(_item) for _item in obj["sub_teams"]] if obj.get("sub_teams") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") 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 { + "sub_teams": "(List[SubTeamResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "sub_teams", + "warnings", + ] + diff --git a/sdks/python/dropbox_sign/models/team_update_request.py b/sdks/python/dropbox_sign/models/team_update_request.py new file mode 100644 index 000000000..48eed77ee --- /dev/null +++ b/sdks/python/dropbox_sign/models/team_update_request.py @@ -0,0 +1,121 @@ +# 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 TeamUpdateRequest(BaseModel): + """ + TeamUpdateRequest + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of your Team.") + __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 TeamUpdateRequest 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 TeamUpdateRequest 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") + }) + 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/python/dropbox_sign/models/template_add_user_request.py b/sdks/python/dropbox_sign/models/template_add_user_request.py new file mode 100644 index 000000000..bf8702fc6 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_add_user_request.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateAddUserRequest(BaseModel): + """ + TemplateAddUserRequest + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided.") + email_address: Optional[StrictStr] = Field(default=None, description="The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided.") + skip_notification: Optional[StrictBool] = Field(default=False, description="If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`.") + __properties: ClassVar[List[str]] = ["account_id", "email_address", "skip_notification"] + + 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 TemplateAddUserRequest 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 TemplateAddUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "skip_notification": obj.get("skip_notification") if obj.get("skip_notification") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account_id": "(str,)", + "email_address": "(str,)", + "skip_notification": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_create_embedded_draft_request.py b/sdks/python/dropbox_sign/models/template_create_embedded_draft_request.py new file mode 100644 index 000000000..cd27ea0ff --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_create_embedded_draft_request.py @@ -0,0 +1,259 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_merge_field import SubMergeField +from dropbox_sign.models.sub_template_role import SubTemplateRole +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateCreateEmbeddedDraftRequest(BaseModel): + """ + TemplateCreateEmbeddedDraftRequest + """ # noqa: E501 + client_id: StrictStr = Field(description="Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + allow_ccs: Optional[StrictBool] = Field(default=True, description="This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_roles: Optional[List[StrictStr]] = Field(default=None, description="The CC roles that must be assigned when using the template to send a signature request") + editor_options: Optional[SubEditorOptions] = None + field_options: Optional[SubFieldOptions] = None + force_signer_roles: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template signer roles.") + force_subject_message: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template subject and message.") + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field(default=None, description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + merge_fields: Optional[List[SubMergeField]] = Field(default=None, description="Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The default template email message.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + show_preview: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + signer_roles: Optional[List[SubTemplateRole]] = Field(default=None, description="An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") + skip_me_now: Optional[StrictBool] = Field(default=False, description="Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") + subject: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The template title (alias).") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[StrictStr] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + use_preexisting_fields: Optional[StrictBool] = Field(default=False, description="Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).") + __properties: ClassVar[List[str]] = ["client_id", "files", "file_urls", "allow_ccs", "allow_reassign", "attachments", "cc_roles", "editor_options", "field_options", "force_signer_roles", "force_subject_message", "form_field_groups", "form_field_rules", "form_fields_per_document", "merge_fields", "message", "metadata", "show_preview", "show_progress_stepper", "signer_roles", "skip_me_now", "subject", "test_mode", "title", "use_preexisting_fields"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateCreateEmbeddedDraftRequest 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 attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of editor_options + if self.editor_options: + _dict['editor_options'] = self.editor_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in merge_fields (list) + _items = [] + if self.merge_fields: + for _item_merge_fields in self.merge_fields: + if _item_merge_fields: + _items.append(_item_merge_fields.to_dict()) + _dict['merge_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signer_roles (list) + _items = [] + if self.signer_roles: + for _item_signer_roles in self.signer_roles: + if _item_signer_roles: + _items.append(_item_signer_roles.to_dict()) + _dict['signer_roles'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateCreateEmbeddedDraftRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "allow_ccs": obj.get("allow_ccs") if obj.get("allow_ccs") is not None else True, + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_roles": obj.get("cc_roles"), + "editor_options": SubEditorOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "force_signer_roles": obj.get("force_signer_roles") if obj.get("force_signer_roles") is not None else False, + "force_subject_message": obj.get("force_subject_message") if obj.get("force_subject_message") is not None else False, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "merge_fields": [SubMergeField.from_dict(_item) for _item in obj["merge_fields"]] if obj.get("merge_fields") is not None else None, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "show_preview": obj.get("show_preview") if obj.get("show_preview") is not None else False, + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "signer_roles": [SubTemplateRole.from_dict(_item) for _item in obj["signer_roles"]] if obj.get("signer_roles") is not None else None, + "skip_me_now": obj.get("skip_me_now") if obj.get("skip_me_now") is not None else False, + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "use_preexisting_fields": obj.get("use_preexisting_fields") if obj.get("use_preexisting_fields") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "allow_ccs": "(bool,)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_roles": "(List[str],)", + "editor_options": "(SubEditorOptions,)", + "field_options": "(SubFieldOptions,)", + "force_signer_roles": "(bool,)", + "force_subject_message": "(bool,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "merge_fields": "(List[SubMergeField],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "show_preview": "(bool,)", + "show_progress_stepper": "(bool,)", + "signer_roles": "(List[SubTemplateRole],)", + "skip_me_now": "(bool,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "use_preexisting_fields": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "attachments", + "cc_roles", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + "merge_fields", + "signer_roles", + ] + diff --git a/sdks/python/dropbox_sign/models/template_create_embedded_draft_response.py b/sdks/python/dropbox_sign/models/template_create_embedded_draft_response.py new file mode 100644 index 000000000..f3b951dc2 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_create_embedded_draft_response.py @@ -0,0 +1,137 @@ +# 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.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate +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 TemplateCreateEmbeddedDraftResponse(BaseModel): + """ + TemplateCreateEmbeddedDraftResponse + """ # noqa: E501 + template: TemplateCreateEmbeddedDraftResponseTemplate + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["template", "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 TemplateCreateEmbeddedDraftResponse 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 template + if self.template: + _dict['template'] = self.template.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 TemplateCreateEmbeddedDraftResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": TemplateCreateEmbeddedDraftResponseTemplate.from_dict(obj["template"]) if obj.get("template") 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 { + "template": "(TemplateCreateEmbeddedDraftResponseTemplate,)", + "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/template_create_embedded_draft_response_template.py b/sdks/python/dropbox_sign/models/template_create_embedded_draft_response_template.py new file mode 100644 index 000000000..8aea2c7bc --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_create_embedded_draft_response_template.py @@ -0,0 +1,139 @@ +# 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.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 TemplateCreateEmbeddedDraftResponseTemplate(BaseModel): + """ + Template object with parameters: `template_id`, `edit_url`, `expires_at`. + """ # noqa: E501 + template_id: Optional[StrictStr] = Field(default=None, description="The id of the Template.") + edit_url: Optional[StrictStr] = Field(default=None, description="Link to edit the template.") + expires_at: Optional[StrictInt] = Field(default=None, description="When the link expires.") + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["template_id", "edit_url", "expires_at", "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 TemplateCreateEmbeddedDraftResponseTemplate 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 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 TemplateCreateEmbeddedDraftResponseTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_id": obj.get("template_id"), + "edit_url": obj.get("edit_url"), + "expires_at": obj.get("expires_at"), + "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 { + "template_id": "(str,)", + "edit_url": "(str,)", + "expires_at": "(int,)", + "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/template_create_request.py b/sdks/python/dropbox_sign/models/template_create_request.py new file mode 100644 index 000000000..06a9870da --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_create_request.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_merge_field import SubMergeField +from dropbox_sign.models.sub_template_role import SubTemplateRole +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateCreateRequest(BaseModel): + """ + TemplateCreateRequest + """ # noqa: E501 + form_fields_per_document: List[SubFormFieldsPerDocumentBase] = Field(description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + signer_roles: List[SubTemplateRole] = Field(description="An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_roles: Optional[List[StrictStr]] = Field(default=None, description="The CC roles that must be assigned when using the template to send a signature request") + client_id: Optional[StrictStr] = Field(default=None, description="Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.") + field_options: Optional[SubFieldOptions] = None + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + merge_fields: Optional[List[SubMergeField]] = Field(default=None, description="Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The default template email message.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + subject: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The template title (alias).") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[StrictStr] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + use_preexisting_fields: Optional[StrictBool] = Field(default=False, description="Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).") + __properties: ClassVar[List[str]] = ["form_fields_per_document", "signer_roles", "files", "file_urls", "allow_reassign", "attachments", "cc_roles", "client_id", "field_options", "form_field_groups", "form_field_rules", "merge_fields", "message", "metadata", "subject", "test_mode", "title", "use_preexisting_fields"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateCreateRequest 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 form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signer_roles (list) + _items = [] + if self.signer_roles: + for _item_signer_roles in self.signer_roles: + if _item_signer_roles: + _items.append(_item_signer_roles.to_dict()) + _dict['signer_roles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in merge_fields (list) + _items = [] + if self.merge_fields: + for _item_merge_fields in self.merge_fields: + if _item_merge_fields: + _items.append(_item_merge_fields.to_dict()) + _dict['merge_fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "signer_roles": [SubTemplateRole.from_dict(_item) for _item in obj["signer_roles"]] if obj.get("signer_roles") is not None else None, + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_roles": obj.get("cc_roles"), + "client_id": obj.get("client_id"), + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "merge_fields": [SubMergeField.from_dict(_item) for _item in obj["merge_fields"]] if obj.get("merge_fields") is not None else None, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "use_preexisting_fields": obj.get("use_preexisting_fields") if obj.get("use_preexisting_fields") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "signer_roles": "(List[SubTemplateRole],)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_roles": "(List[str],)", + "client_id": "(str,)", + "field_options": "(SubFieldOptions,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "merge_fields": "(List[SubMergeField],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "use_preexisting_fields": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "form_fields_per_document", + "signer_roles", + "files", + "file_urls", + "attachments", + "cc_roles", + "form_field_groups", + "form_field_rules", + "merge_fields", + ] + diff --git a/sdks/python/dropbox_sign/models/template_create_response.py b/sdks/python/dropbox_sign/models/template_create_response.py new file mode 100644 index 000000000..b6191ba2d --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_create_response.py @@ -0,0 +1,137 @@ +# 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.template_create_response_template import TemplateCreateResponseTemplate +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 TemplateCreateResponse(BaseModel): + """ + TemplateCreateResponse + """ # noqa: E501 + template: TemplateCreateResponseTemplate + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["template", "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 TemplateCreateResponse 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 template + if self.template: + _dict['template'] = self.template.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 TemplateCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": TemplateCreateResponseTemplate.from_dict(obj["template"]) if obj.get("template") 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 { + "template": "(TemplateCreateResponseTemplate,)", + "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/template_create_response_template.py b/sdks/python/dropbox_sign/models/template_create_response_template.py new file mode 100644 index 000000000..aa5ab6f3e --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_create_response_template.py @@ -0,0 +1,121 @@ +# 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 TemplateCreateResponseTemplate(BaseModel): + """ + Template object with parameters: `template_id`. + """ # noqa: E501 + template_id: Optional[StrictStr] = Field(default=None, description="The id of the Template.") + __properties: ClassVar[List[str]] = ["template_id"] + + 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 TemplateCreateResponseTemplate 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 TemplateCreateResponseTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_id": obj.get("template_id") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_edit_response.py b/sdks/python/dropbox_sign/models/template_edit_response.py new file mode 100644 index 000000000..3e067aabd --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_edit_response.py @@ -0,0 +1,121 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateEditResponse(BaseModel): + """ + TemplateEditResponse + """ # noqa: E501 + template_id: StrictStr = Field(description="The id of the Template.") + __properties: ClassVar[List[str]] = ["template_id"] + + 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 TemplateEditResponse 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 TemplateEditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_id": obj.get("template_id") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_get_response.py b/sdks/python/dropbox_sign/models/template_get_response.py new file mode 100644 index 000000000..90d28f277 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_get_response.py @@ -0,0 +1,137 @@ +# 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.template_response import TemplateResponse +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 TemplateGetResponse(BaseModel): + """ + TemplateGetResponse + """ # noqa: E501 + template: TemplateResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["template", "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 TemplateGetResponse 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 template + if self.template: + _dict['template'] = self.template.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 TemplateGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": TemplateResponse.from_dict(obj["template"]) if obj.get("template") 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 { + "template": "(TemplateResponse,)", + "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/template_list_response.py b/sdks/python/dropbox_sign/models/template_list_response.py new file mode 100644 index 000000000..07dc9fa50 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_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, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.template_response import TemplateResponse +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 TemplateListResponse(BaseModel): + """ + TemplateListResponse + """ # noqa: E501 + templates: List[TemplateResponse] = Field(description="List of templates that the API caller has access to.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["templates", "list_info", "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 TemplateListResponse 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 templates (list) + _items = [] + if self.templates: + for _item_templates in self.templates: + if _item_templates: + _items.append(_item_templates.to_dict()) + _dict['templates'] = _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() + # 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 TemplateListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "templates": [TemplateResponse.from_dict(_item) for _item in obj["templates"]] if obj.get("templates") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") 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 { + "templates": "(List[TemplateResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "templates", + "warnings", + ] + diff --git a/sdks/python/dropbox_sign/models/template_remove_user_request.py b/sdks/python/dropbox_sign/models/template_remove_user_request.py new file mode 100644 index 000000000..335ef827d --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_remove_user_request.py @@ -0,0 +1,124 @@ +# 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 TemplateRemoveUserRequest(BaseModel): + """ + TemplateRemoveUserRequest + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.") + email_address: Optional[StrictStr] = Field(default=None, description="The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.") + __properties: ClassVar[List[str]] = ["account_id", "email_address"] + + 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 TemplateRemoveUserRequest 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 TemplateRemoveUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address") + }) + 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 { + "account_id": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response.py b/sdks/python/dropbox_sign/models/template_response.py new file mode 100644 index 000000000..246f4d312 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response.py @@ -0,0 +1,217 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_account import TemplateResponseAccount +from dropbox_sign.models.template_response_cc_role import TemplateResponseCCRole +from dropbox_sign.models.template_response_document import TemplateResponseDocument +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_signer_role import TemplateResponseSignerRole +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponse(BaseModel): + """ + Contains information about the templates you and your team have created. + """ # noqa: E501 + template_id: Optional[StrictStr] = Field(default=None, description="The id of the Template.") + title: Optional[StrictStr] = Field(default=None, description="The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.") + message: Optional[StrictStr] = Field(default=None, description="The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.") + updated_at: Optional[StrictInt] = Field(default=None, description="Time the template was last updated.") + is_embedded: Optional[StrictBool] = Field(default=None, description="`true` if this template was created using an embedded flow, `false` if it was created on our website.") + is_creator: Optional[StrictBool] = Field(default=None, description="`true` if you are the owner of this template, `false` if it's been shared with you by a team member.") + can_edit: Optional[StrictBool] = Field(default=None, description="Indicates whether edit rights have been granted to you by the owner (always `true` if that's you).") + is_locked: Optional[StrictBool] = Field(default=None, description="Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata attached to the template.") + signer_roles: Optional[List[TemplateResponseSignerRole]] = Field(default=None, description="An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") + cc_roles: Optional[List[TemplateResponseCCRole]] = Field(default=None, description="An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.") + documents: Optional[List[TemplateResponseDocument]] = Field(default=None, description="An array describing each document associated with this Template. Includes form field data for each document.") + custom_fields: Optional[List[TemplateResponseDocumentCustomFieldBase]] = Field(default=None, description="Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.") + named_form_fields: Optional[List[TemplateResponseDocumentFormFieldBase]] = Field(default=None, description="Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.") + accounts: Optional[List[TemplateResponseAccount]] = Field(default=None, description="An array of the Accounts that can use this Template.") + __properties: ClassVar[List[str]] = ["template_id", "title", "message", "updated_at", "is_embedded", "is_creator", "can_edit", "is_locked", "metadata", "signer_roles", "cc_roles", "documents", "custom_fields", "named_form_fields", "accounts"] + + 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 TemplateResponse 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 signer_roles (list) + _items = [] + if self.signer_roles: + for _item_signer_roles in self.signer_roles: + if _item_signer_roles: + _items.append(_item_signer_roles.to_dict()) + _dict['signer_roles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in cc_roles (list) + _items = [] + if self.cc_roles: + for _item_cc_roles in self.cc_roles: + if _item_cc_roles: + _items.append(_item_cc_roles.to_dict()) + _dict['cc_roles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in documents (list) + _items = [] + if self.documents: + for _item_documents in self.documents: + if _item_documents: + _items.append(_item_documents.to_dict()) + _dict['documents'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in named_form_fields (list) + _items = [] + if self.named_form_fields: + for _item_named_form_fields in self.named_form_fields: + if _item_named_form_fields: + _items.append(_item_named_form_fields.to_dict()) + _dict['named_form_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in accounts (list) + _items = [] + if self.accounts: + for _item_accounts in self.accounts: + if _item_accounts: + _items.append(_item_accounts.to_dict()) + _dict['accounts'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_id": obj.get("template_id"), + "title": obj.get("title"), + "message": obj.get("message"), + "updated_at": obj.get("updated_at"), + "is_embedded": obj.get("is_embedded"), + "is_creator": obj.get("is_creator"), + "can_edit": obj.get("can_edit"), + "is_locked": obj.get("is_locked"), + "metadata": obj.get("metadata"), + "signer_roles": [TemplateResponseSignerRole.from_dict(_item) for _item in obj["signer_roles"]] if obj.get("signer_roles") is not None else None, + "cc_roles": [TemplateResponseCCRole.from_dict(_item) for _item in obj["cc_roles"]] if obj.get("cc_roles") is not None else None, + "documents": [TemplateResponseDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None, + "custom_fields": [TemplateResponseDocumentCustomFieldBase.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "named_form_fields": [TemplateResponseDocumentFormFieldBase.from_dict(_item) for _item in obj["named_form_fields"]] if obj.get("named_form_fields") is not None else None, + "accounts": [TemplateResponseAccount.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") 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 { + "template_id": "(str,)", + "title": "(str,)", + "message": "(str,)", + "updated_at": "(int,)", + "is_embedded": "(bool,)", + "is_creator": "(bool,)", + "can_edit": "(bool,)", + "is_locked": "(bool,)", + "metadata": "(object,)", + "signer_roles": "(List[TemplateResponseSignerRole],)", + "cc_roles": "(List[TemplateResponseCCRole],)", + "documents": "(List[TemplateResponseDocument],)", + "custom_fields": "(List[TemplateResponseDocumentCustomFieldBase],)", + "named_form_fields": "(List[TemplateResponseDocumentFormFieldBase],)", + "accounts": "(List[TemplateResponseAccount],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "signer_roles", + "cc_roles", + "documents", + "custom_fields", + "named_form_fields", + "accounts", + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_account.py b/sdks/python/dropbox_sign/models/template_response_account.py new file mode 100644 index 000000000..9e8f4c1ff --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_account.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_account_quota import TemplateResponseAccountQuota +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseAccount(BaseModel): + """ + TemplateResponseAccount + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The id of the Account.") + email_address: Optional[StrictStr] = Field(default=None, description="The email address associated with the Account.") + is_locked: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has been locked out of their account by a team admin.") + is_paid_hs: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has a paid Dropbox Sign account.") + is_paid_hf: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has a paid HelloFax account.") + quotas: Optional[TemplateResponseAccountQuota] = None + __properties: ClassVar[List[str]] = ["account_id", "email_address", "is_locked", "is_paid_hs", "is_paid_hf", "quotas"] + + 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 TemplateResponseAccount 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 quotas + if self.quotas: + _dict['quotas'] = self.quotas.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseAccount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "is_locked": obj.get("is_locked"), + "is_paid_hs": obj.get("is_paid_hs"), + "is_paid_hf": obj.get("is_paid_hf"), + "quotas": TemplateResponseAccountQuota.from_dict(obj["quotas"]) if obj.get("quotas") 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 { + "account_id": "(str,)", + "email_address": "(str,)", + "is_locked": "(bool,)", + "is_paid_hs": "(bool,)", + "is_paid_hf": "(bool,)", + "quotas": "(TemplateResponseAccountQuota,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_account_quota.py b/sdks/python/dropbox_sign/models/template_response_account_quota.py new file mode 100644 index 000000000..8ffa3c46e --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_account_quota.py @@ -0,0 +1,130 @@ +# 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 +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 TemplateResponseAccountQuota(BaseModel): + """ + An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. + """ # noqa: E501 + templates_left: Optional[StrictInt] = Field(default=None, description="API templates remaining.") + api_signature_requests_left: Optional[StrictInt] = Field(default=None, description="API signature requests remaining.") + documents_left: Optional[StrictInt] = Field(default=None, description="Signature requests remaining.") + sms_verifications_left: Optional[StrictInt] = Field(default=None, description="SMS verifications remaining.") + __properties: ClassVar[List[str]] = ["templates_left", "api_signature_requests_left", "documents_left", "sms_verifications_left"] + + 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 TemplateResponseAccountQuota 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 TemplateResponseAccountQuota from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "templates_left": obj.get("templates_left"), + "api_signature_requests_left": obj.get("api_signature_requests_left"), + "documents_left": obj.get("documents_left"), + "sms_verifications_left": obj.get("sms_verifications_left") + }) + 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 { + "templates_left": "(int,)", + "api_signature_requests_left": "(int,)", + "documents_left": "(int,)", + "sms_verifications_left": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_cc_role.py b/sdks/python/dropbox_sign/models/template_response_cc_role.py new file mode 100644 index 000000000..953966e9c --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_cc_role.py @@ -0,0 +1,121 @@ +# 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 TemplateResponseCCRole(BaseModel): + """ + TemplateResponseCCRole + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the Role.") + __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 TemplateResponseCCRole 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 TemplateResponseCCRole 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") + }) + 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/python/dropbox_sign/models/template_response_document.py b/sdks/python/dropbox_sign/models/template_response_document.py new file mode 100644 index 000000000..d296ee21a --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document.py @@ -0,0 +1,172 @@ +# 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.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from dropbox_sign.models.template_response_document_field_group import TemplateResponseDocumentFieldGroup +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocument(BaseModel): + """ + TemplateResponseDocument + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name of the associated file.") + index: Optional[StrictInt] = Field(default=None, description="Document ordering, the lowest index is displayed first and the highest last (0-based indexing).") + field_groups: Optional[List[TemplateResponseDocumentFieldGroup]] = Field(default=None, description="An array of Form Field Group objects.") + form_fields: Optional[List[TemplateResponseDocumentFormFieldBase]] = Field(default=None, description="An array of Form Field objects containing the name and type of each named field.") + custom_fields: Optional[List[TemplateResponseDocumentCustomFieldBase]] = Field(default=None, description="An array of Form Field objects containing the name and type of each named field.") + static_fields: Optional[List[TemplateResponseDocumentStaticFieldBase]] = Field(default=None, description="An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.") + __properties: ClassVar[List[str]] = ["name", "index", "field_groups", "form_fields", "custom_fields", "static_fields"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocument 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 field_groups (list) + _items = [] + if self.field_groups: + for _item_field_groups in self.field_groups: + if _item_field_groups: + _items.append(_item_field_groups.to_dict()) + _dict['field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields (list) + _items = [] + if self.form_fields: + for _item_form_fields in self.form_fields: + if _item_form_fields: + _items.append(_item_form_fields.to_dict()) + _dict['form_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in static_fields (list) + _items = [] + if self.static_fields: + for _item_static_fields in self.static_fields: + if _item_static_fields: + _items.append(_item_static_fields.to_dict()) + _dict['static_fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocument 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"), + "index": obj.get("index"), + "field_groups": [TemplateResponseDocumentFieldGroup.from_dict(_item) for _item in obj["field_groups"]] if obj.get("field_groups") is not None else None, + "form_fields": [TemplateResponseDocumentFormFieldBase.from_dict(_item) for _item in obj["form_fields"]] if obj.get("form_fields") is not None else None, + "custom_fields": [TemplateResponseDocumentCustomFieldBase.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "static_fields": [TemplateResponseDocumentStaticFieldBase.from_dict(_item) for _item in obj["static_fields"]] if obj.get("static_fields") 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 { + "name": "(str,)", + "index": "(int,)", + "field_groups": "(List[TemplateResponseDocumentFieldGroup],)", + "form_fields": "(List[TemplateResponseDocumentFormFieldBase],)", + "custom_fields": "(List[TemplateResponseDocumentCustomFieldBase],)", + "static_fields": "(List[TemplateResponseDocumentStaticFieldBase],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "field_groups", + "form_fields", + "custom_fields", + "static_fields", + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_custom_field_base.py b/sdks/python/dropbox_sign/models/template_response_document_custom_field_base.py new file mode 100644 index 000000000..eddd05408 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_custom_field_base.py @@ -0,0 +1,153 @@ +# 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 importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, 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 + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.template_response_document_custom_field_checkbox import TemplateResponseDocumentCustomFieldCheckbox + from dropbox_sign.models.template_response_document_custom_field_text import TemplateResponseDocumentCustomFieldText + +class TemplateResponseDocumentCustomFieldBase(BaseModel): + """ + An array of Form Field objects containing the name and type of each named field. + """ # noqa: E501 + type: StrictStr + api_id: Optional[StrictStr] = Field(default=None, description="The unique ID for this field.") + name: Optional[StrictStr] = Field(default=None, description="The name of the Custom Field.") + signer: Union[StrictStr, StrictInt, None] = Field(description="The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).") + x: Optional[StrictInt] = Field(default=None, description="The horizontal offset in pixels for this form field.") + y: Optional[StrictInt] = Field(default=None, description="The vertical offset in pixels for this form field.") + width: Optional[StrictInt] = Field(default=None, description="The width in pixels of this form field.") + height: Optional[StrictInt] = Field(default=None, description="The height in pixels of this form field.") + required: Optional[StrictBool] = Field(default=None, description="Boolean showing whether or not this field is required.") + group: Optional[StrictStr] = Field(default=None, description="The name of the group this field is in. If this field is not a group, this defaults to `null`.") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'TemplateResponseDocumentCustomFieldCheckbox','text': 'TemplateResponseDocumentCustomFieldText' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + 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[Union[TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText]]: + """Create an instance of TemplateResponseDocumentCustomFieldBase 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: Dict[str, Any]) -> Optional[Union[TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText]]: + """Create an instance of TemplateResponseDocumentCustomFieldBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'TemplateResponseDocumentCustomFieldCheckbox': + return import_module("dropbox_sign.models.template_response_document_custom_field_checkbox").TemplateResponseDocumentCustomFieldCheckbox.from_dict(obj) + if object_type == 'TemplateResponseDocumentCustomFieldText': + return import_module("dropbox_sign.models.template_response_document_custom_field_text").TemplateResponseDocumentCustomFieldText.from_dict(obj) + + raise ValueError("TemplateResponseDocumentCustomFieldBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_custom_field_checkbox.py b/sdks/python/dropbox_sign/models/template_response_document_custom_field_checkbox.py new file mode 100644 index 000000000..6180833eb --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_custom_field_checkbox.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentCustomFieldCheckbox(TemplateResponseDocumentCustomFieldBase): + """ + This class extends `TemplateResponseDocumentCustomFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentCustomFieldCheckbox 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 TemplateResponseDocumentCustomFieldCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_custom_field_text.py b/sdks/python/dropbox_sign/models/template_response_document_custom_field_text.py new file mode 100644 index 000000000..761cfa6a0 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_custom_field_text.py @@ -0,0 +1,156 @@ +# 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 ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from dropbox_sign.models.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentCustomFieldText(TemplateResponseDocumentCustomFieldBase): + """ + This class extends `TemplateResponseDocumentCustomFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`") + avg_text_length: Optional[TemplateResponseFieldAvgTextLength] = None + is_multiline: Optional[StrictBool] = Field(default=None, description="Whether this form field is multiline text.", alias="isMultiline") + original_font_size: Optional[StrictInt] = Field(default=None, description="Original font size used in this form field's text.", alias="originalFontSize") + font_family: Optional[StrictStr] = Field(default=None, description="Font family used in this form field's text.", alias="fontFamily") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group", "avg_text_length", "isMultiline", "originalFontSize", "fontFamily"] + + 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 TemplateResponseDocumentCustomFieldText 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 avg_text_length + if self.avg_text_length: + _dict['avg_text_length'] = self.avg_text_length.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentCustomFieldText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'text', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group"), + "avg_text_length": TemplateResponseFieldAvgTextLength.from_dict(obj["avg_text_length"]) if obj.get("avg_text_length") is not None else None, + "isMultiline": obj.get("isMultiline"), + "originalFontSize": obj.get("originalFontSize"), + "fontFamily": obj.get("fontFamily") + }) + 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 { + "type": "(str,)", + "avg_text_length": "(TemplateResponseFieldAvgTextLength,)", + "is_multiline": "(bool,)", + "original_font_size": "(int,)", + "font_family": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_field_group.py b/sdks/python/dropbox_sign/models/template_response_document_field_group.py new file mode 100644 index 000000000..4d560744e --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_field_group.py @@ -0,0 +1,128 @@ +# 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 dropbox_sign.models.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFieldGroup(BaseModel): + """ + TemplateResponseDocumentFieldGroup + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the form field group.") + rule: Optional[TemplateResponseDocumentFieldGroupRule] = None + __properties: ClassVar[List[str]] = ["name", "rule"] + + 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 TemplateResponseDocumentFieldGroup 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 rule + if self.rule: + _dict['rule'] = self.rule.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFieldGroup 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"), + "rule": TemplateResponseDocumentFieldGroupRule.from_dict(obj["rule"]) if obj.get("rule") 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 { + "name": "(str,)", + "rule": "(TemplateResponseDocumentFieldGroupRule,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_field_group_rule.py b/sdks/python/dropbox_sign/models/template_response_document_field_group_rule.py new file mode 100644 index 000000000..b3e07181a --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_field_group_rule.py @@ -0,0 +1,124 @@ +# 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 TemplateResponseDocumentFieldGroupRule(BaseModel): + """ + The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping). + """ # noqa: E501 + requirement: Optional[StrictStr] = Field(default=None, description="Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.") + group_label: Optional[StrictStr] = Field(default=None, description="Name of the group", alias="groupLabel") + __properties: ClassVar[List[str]] = ["requirement", "groupLabel"] + + 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 TemplateResponseDocumentFieldGroupRule 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 TemplateResponseDocumentFieldGroupRule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "requirement": obj.get("requirement"), + "groupLabel": obj.get("groupLabel") + }) + 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 { + "requirement": "(str,)", + "group_label": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_form_field_base.py b/sdks/python/dropbox_sign/models/template_response_document_form_field_base.py new file mode 100644 index 000000000..dc851374c --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_form_field_base.py @@ -0,0 +1,171 @@ +# 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 importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, 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 + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.template_response_document_form_field_checkbox import TemplateResponseDocumentFormFieldCheckbox + from dropbox_sign.models.template_response_document_form_field_date_signed import TemplateResponseDocumentFormFieldDateSigned + from dropbox_sign.models.template_response_document_form_field_dropdown import TemplateResponseDocumentFormFieldDropdown + from dropbox_sign.models.template_response_document_form_field_hyperlink import TemplateResponseDocumentFormFieldHyperlink + from dropbox_sign.models.template_response_document_form_field_initials import TemplateResponseDocumentFormFieldInitials + from dropbox_sign.models.template_response_document_form_field_radio import TemplateResponseDocumentFormFieldRadio + from dropbox_sign.models.template_response_document_form_field_signature import TemplateResponseDocumentFormFieldSignature + from dropbox_sign.models.template_response_document_form_field_text import TemplateResponseDocumentFormFieldText + +class TemplateResponseDocumentFormFieldBase(BaseModel): + """ + An array of Form Field objects containing the name and type of each named field. + """ # noqa: E501 + type: StrictStr + api_id: Optional[StrictStr] = Field(default=None, description="A unique id for the form field.") + name: Optional[StrictStr] = Field(default=None, description="The name of the form field.") + signer: Union[StrictStr, StrictInt] = Field(description="The signer of the Form Field.") + x: Optional[StrictInt] = Field(default=None, description="The horizontal offset in pixels for this form field.") + y: Optional[StrictInt] = Field(default=None, description="The vertical offset in pixels for this form field.") + width: Optional[StrictInt] = Field(default=None, description="The width in pixels of this form field.") + height: Optional[StrictInt] = Field(default=None, description="The height in pixels of this form field.") + required: Optional[StrictBool] = Field(default=None, description="Boolean showing whether or not this field is required.") + group: Optional[StrictStr] = Field(default=None, description="The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'TemplateResponseDocumentFormFieldCheckbox','date_signed': 'TemplateResponseDocumentFormFieldDateSigned','dropdown': 'TemplateResponseDocumentFormFieldDropdown','hyperlink': 'TemplateResponseDocumentFormFieldHyperlink','initials': 'TemplateResponseDocumentFormFieldInitials','radio': 'TemplateResponseDocumentFormFieldRadio','signature': 'TemplateResponseDocumentFormFieldSignature','text': 'TemplateResponseDocumentFormFieldText' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + 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[Union[TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText]]: + """Create an instance of TemplateResponseDocumentFormFieldBase 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: Dict[str, Any]) -> Optional[Union[TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText]]: + """Create an instance of TemplateResponseDocumentFormFieldBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'TemplateResponseDocumentFormFieldCheckbox': + return import_module("dropbox_sign.models.template_response_document_form_field_checkbox").TemplateResponseDocumentFormFieldCheckbox.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldDateSigned': + return import_module("dropbox_sign.models.template_response_document_form_field_date_signed").TemplateResponseDocumentFormFieldDateSigned.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldDropdown': + return import_module("dropbox_sign.models.template_response_document_form_field_dropdown").TemplateResponseDocumentFormFieldDropdown.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldHyperlink': + return import_module("dropbox_sign.models.template_response_document_form_field_hyperlink").TemplateResponseDocumentFormFieldHyperlink.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldInitials': + return import_module("dropbox_sign.models.template_response_document_form_field_initials").TemplateResponseDocumentFormFieldInitials.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldRadio': + return import_module("dropbox_sign.models.template_response_document_form_field_radio").TemplateResponseDocumentFormFieldRadio.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldSignature': + return import_module("dropbox_sign.models.template_response_document_form_field_signature").TemplateResponseDocumentFormFieldSignature.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldText': + return import_module("dropbox_sign.models.template_response_document_form_field_text").TemplateResponseDocumentFormFieldText.from_dict(obj) + + raise ValueError("TemplateResponseDocumentFormFieldBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_form_field_checkbox.py b/sdks/python/dropbox_sign/models/template_response_document_form_field_checkbox.py new file mode 100644 index 000000000..9cd961d5f --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_form_field_checkbox.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldCheckbox(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentFormFieldCheckbox 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 TemplateResponseDocumentFormFieldCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_form_field_date_signed.py b/sdks/python/dropbox_sign/models/template_response_document_form_field_date_signed.py new file mode 100644 index 000000000..130dd8d26 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_form_field_date_signed.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldDateSigned(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentFormFieldDateSigned 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 TemplateResponseDocumentFormFieldDateSigned from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'date_signed', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_form_field_dropdown.py b/sdks/python/dropbox_sign/models/template_response_document_form_field_dropdown.py new file mode 100644 index 000000000..c135186f7 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_form_field_dropdown.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldDropdown(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentFormFieldDropdown 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 TemplateResponseDocumentFormFieldDropdown from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'dropdown', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_form_field_hyperlink.py b/sdks/python/dropbox_sign/models/template_response_document_form_field_hyperlink.py new file mode 100644 index 000000000..fb8eb9d4b --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_form_field_hyperlink.py @@ -0,0 +1,156 @@ +# 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 ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldHyperlink(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + avg_text_length: Optional[TemplateResponseFieldAvgTextLength] = None + is_multiline: Optional[StrictBool] = Field(default=None, description="Whether this form field is multiline text.", alias="isMultiline") + original_font_size: Optional[StrictInt] = Field(default=None, description="Original font size used in this form field's text.", alias="originalFontSize") + font_family: Optional[StrictStr] = Field(default=None, description="Font family used in this form field's text.", alias="fontFamily") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group", "avg_text_length", "isMultiline", "originalFontSize", "fontFamily"] + + 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 TemplateResponseDocumentFormFieldHyperlink 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 avg_text_length + if self.avg_text_length: + _dict['avg_text_length'] = self.avg_text_length.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldHyperlink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'hyperlink', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group"), + "avg_text_length": TemplateResponseFieldAvgTextLength.from_dict(obj["avg_text_length"]) if obj.get("avg_text_length") is not None else None, + "isMultiline": obj.get("isMultiline"), + "originalFontSize": obj.get("originalFontSize"), + "fontFamily": obj.get("fontFamily") + }) + 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 { + "type": "(str,)", + "avg_text_length": "(TemplateResponseFieldAvgTextLength,)", + "is_multiline": "(bool,)", + "original_font_size": "(int,)", + "font_family": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_form_field_initials.py b/sdks/python/dropbox_sign/models/template_response_document_form_field_initials.py new file mode 100644 index 000000000..2656c8903 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_form_field_initials.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldInitials(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentFormFieldInitials 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 TemplateResponseDocumentFormFieldInitials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'initials', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_form_field_radio.py b/sdks/python/dropbox_sign/models/template_response_document_form_field_radio.py new file mode 100644 index 000000000..5eb2cf39b --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_form_field_radio.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldRadio(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "group", "api_id", "name", "signer", "x", "y", "width", "height", "required"] + + 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 TemplateResponseDocumentFormFieldRadio 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 TemplateResponseDocumentFormFieldRadio from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'radio', + "group": obj.get("group"), + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required") + }) + 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 { + "type": "(str,)", + "group": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_form_field_signature.py b/sdks/python/dropbox_sign/models/template_response_document_form_field_signature.py new file mode 100644 index 000000000..94741f855 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_form_field_signature.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldSignature(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentFormFieldSignature 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 TemplateResponseDocumentFormFieldSignature from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'signature', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_form_field_text.py b/sdks/python/dropbox_sign/models/template_response_document_form_field_text.py new file mode 100644 index 000000000..617885ec8 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_form_field_text.py @@ -0,0 +1,169 @@ +# 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 ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldText(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + avg_text_length: Optional[TemplateResponseFieldAvgTextLength] = None + is_multiline: Optional[StrictBool] = Field(default=None, description="Whether this form field is multiline text.", alias="isMultiline") + original_font_size: Optional[StrictInt] = Field(default=None, description="Original font size used in this form field's text.", alias="originalFontSize") + font_family: Optional[StrictStr] = Field(default=None, description="Font family used in this form field's text.", alias="fontFamily") + validation_type: Optional[StrictStr] = Field(default=None, description="Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group", "avg_text_length", "isMultiline", "originalFontSize", "fontFamily", "validation_type"] + + @field_validator('validation_type') + def validation_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['numbers_only', 'letters_only', 'phone_number', 'bank_routing_number', 'bank_account_number', 'email_address', 'zip_code', 'social_security_number', 'employer_identification_number', 'custom_regex']): + raise ValueError("must be one of enum values ('numbers_only', 'letters_only', 'phone_number', 'bank_routing_number', 'bank_account_number', 'email_address', 'zip_code', 'social_security_number', 'employer_identification_number', 'custom_regex')") + 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 TemplateResponseDocumentFormFieldText 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 avg_text_length + if self.avg_text_length: + _dict['avg_text_length'] = self.avg_text_length.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'text', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group"), + "avg_text_length": TemplateResponseFieldAvgTextLength.from_dict(obj["avg_text_length"]) if obj.get("avg_text_length") is not None else None, + "isMultiline": obj.get("isMultiline"), + "originalFontSize": obj.get("originalFontSize"), + "fontFamily": obj.get("fontFamily"), + "validation_type": obj.get("validation_type") + }) + 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 { + "type": "(str,)", + "avg_text_length": "(TemplateResponseFieldAvgTextLength,)", + "is_multiline": "(bool,)", + "original_font_size": "(int,)", + "font_family": "(str,)", + "validation_type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_static_field_base.py b/sdks/python/dropbox_sign/models/template_response_document_static_field_base.py new file mode 100644 index 000000000..c0a530881 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_static_field_base.py @@ -0,0 +1,171 @@ +# 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 importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, 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 + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.template_response_document_static_field_checkbox import TemplateResponseDocumentStaticFieldCheckbox + from dropbox_sign.models.template_response_document_static_field_date_signed import TemplateResponseDocumentStaticFieldDateSigned + from dropbox_sign.models.template_response_document_static_field_dropdown import TemplateResponseDocumentStaticFieldDropdown + from dropbox_sign.models.template_response_document_static_field_hyperlink import TemplateResponseDocumentStaticFieldHyperlink + from dropbox_sign.models.template_response_document_static_field_initials import TemplateResponseDocumentStaticFieldInitials + from dropbox_sign.models.template_response_document_static_field_radio import TemplateResponseDocumentStaticFieldRadio + from dropbox_sign.models.template_response_document_static_field_signature import TemplateResponseDocumentStaticFieldSignature + from dropbox_sign.models.template_response_document_static_field_text import TemplateResponseDocumentStaticFieldText + +class TemplateResponseDocumentStaticFieldBase(BaseModel): + """ + An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. + """ # noqa: E501 + type: StrictStr + api_id: Optional[StrictStr] = Field(default=None, description="A unique id for the static field.") + name: Optional[StrictStr] = Field(default=None, description="The name of the static field.") + signer: Optional[StrictStr] = Field(default='me_now', description="The signer of the Static Field.") + x: Optional[StrictInt] = Field(default=None, description="The horizontal offset in pixels for this static field.") + y: Optional[StrictInt] = Field(default=None, description="The vertical offset in pixels for this static field.") + width: Optional[StrictInt] = Field(default=None, description="The width in pixels of this static field.") + height: Optional[StrictInt] = Field(default=None, description="The height in pixels of this static field.") + required: Optional[StrictBool] = Field(default=None, description="Boolean showing whether or not this field is required.") + group: Optional[StrictStr] = Field(default=None, description="The name of the group this field is in. If this field is not a group, this defaults to `null`.") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'TemplateResponseDocumentStaticFieldCheckbox','date_signed': 'TemplateResponseDocumentStaticFieldDateSigned','dropdown': 'TemplateResponseDocumentStaticFieldDropdown','hyperlink': 'TemplateResponseDocumentStaticFieldHyperlink','initials': 'TemplateResponseDocumentStaticFieldInitials','radio': 'TemplateResponseDocumentStaticFieldRadio','signature': 'TemplateResponseDocumentStaticFieldSignature','text': 'TemplateResponseDocumentStaticFieldText' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + 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[Union[TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText]]: + """Create an instance of TemplateResponseDocumentStaticFieldBase 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: Dict[str, Any]) -> Optional[Union[TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText]]: + """Create an instance of TemplateResponseDocumentStaticFieldBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'TemplateResponseDocumentStaticFieldCheckbox': + return import_module("dropbox_sign.models.template_response_document_static_field_checkbox").TemplateResponseDocumentStaticFieldCheckbox.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldDateSigned': + return import_module("dropbox_sign.models.template_response_document_static_field_date_signed").TemplateResponseDocumentStaticFieldDateSigned.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldDropdown': + return import_module("dropbox_sign.models.template_response_document_static_field_dropdown").TemplateResponseDocumentStaticFieldDropdown.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldHyperlink': + return import_module("dropbox_sign.models.template_response_document_static_field_hyperlink").TemplateResponseDocumentStaticFieldHyperlink.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldInitials': + return import_module("dropbox_sign.models.template_response_document_static_field_initials").TemplateResponseDocumentStaticFieldInitials.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldRadio': + return import_module("dropbox_sign.models.template_response_document_static_field_radio").TemplateResponseDocumentStaticFieldRadio.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldSignature': + return import_module("dropbox_sign.models.template_response_document_static_field_signature").TemplateResponseDocumentStaticFieldSignature.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldText': + return import_module("dropbox_sign.models.template_response_document_static_field_text").TemplateResponseDocumentStaticFieldText.from_dict(obj) + + raise ValueError("TemplateResponseDocumentStaticFieldBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_static_field_checkbox.py b/sdks/python/dropbox_sign/models/template_response_document_static_field_checkbox.py new file mode 100644 index 000000000..855f4a22f --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_static_field_checkbox.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldCheckbox(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentStaticFieldCheckbox 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 TemplateResponseDocumentStaticFieldCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_static_field_date_signed.py b/sdks/python/dropbox_sign/models/template_response_document_static_field_date_signed.py new file mode 100644 index 000000000..8006e779d --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_static_field_date_signed.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldDateSigned(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentStaticFieldDateSigned 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 TemplateResponseDocumentStaticFieldDateSigned from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'date_signed', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_static_field_dropdown.py b/sdks/python/dropbox_sign/models/template_response_document_static_field_dropdown.py new file mode 100644 index 000000000..efb9e4846 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_static_field_dropdown.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldDropdown(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentStaticFieldDropdown 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 TemplateResponseDocumentStaticFieldDropdown from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'dropdown', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_static_field_hyperlink.py b/sdks/python/dropbox_sign/models/template_response_document_static_field_hyperlink.py new file mode 100644 index 000000000..d84e5571c --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_static_field_hyperlink.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldHyperlink(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentStaticFieldHyperlink 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 TemplateResponseDocumentStaticFieldHyperlink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'hyperlink', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_static_field_initials.py b/sdks/python/dropbox_sign/models/template_response_document_static_field_initials.py new file mode 100644 index 000000000..e06d73931 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_static_field_initials.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldInitials(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentStaticFieldInitials 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 TemplateResponseDocumentStaticFieldInitials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'initials', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_static_field_radio.py b/sdks/python/dropbox_sign/models/template_response_document_static_field_radio.py new file mode 100644 index 000000000..6a509ef24 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_static_field_radio.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldRadio(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentStaticFieldRadio 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 TemplateResponseDocumentStaticFieldRadio from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'radio', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_static_field_signature.py b/sdks/python/dropbox_sign/models/template_response_document_static_field_signature.py new file mode 100644 index 000000000..08aaaaffc --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_static_field_signature.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldSignature(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentStaticFieldSignature 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 TemplateResponseDocumentStaticFieldSignature from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'signature', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_document_static_field_text.py b/sdks/python/dropbox_sign/models/template_response_document_static_field_text.py new file mode 100644 index 000000000..380a7d54b --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_document_static_field_text.py @@ -0,0 +1,140 @@ +# 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 ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldText(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + 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 TemplateResponseDocumentStaticFieldText 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 TemplateResponseDocumentStaticFieldText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'text', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + 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 { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_field_avg_text_length.py b/sdks/python/dropbox_sign/models/template_response_field_avg_text_length.py new file mode 100644 index 000000000..c53c9b253 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_field_avg_text_length.py @@ -0,0 +1,124 @@ +# 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 +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 TemplateResponseFieldAvgTextLength(BaseModel): + """ + Average text length in this field. + """ # noqa: E501 + num_lines: Optional[StrictInt] = Field(default=None, description="Number of lines.") + num_chars_per_line: Optional[StrictInt] = Field(default=None, description="Number of characters per line.") + __properties: ClassVar[List[str]] = ["num_lines", "num_chars_per_line"] + + 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 TemplateResponseFieldAvgTextLength 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 TemplateResponseFieldAvgTextLength from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "num_lines": obj.get("num_lines"), + "num_chars_per_line": obj.get("num_chars_per_line") + }) + 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 { + "num_lines": "(int,)", + "num_chars_per_line": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_response_signer_role.py b/sdks/python/dropbox_sign/models/template_response_signer_role.py new file mode 100644 index 000000000..45b77bbf6 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_response_signer_role.py @@ -0,0 +1,124 @@ +# 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 TemplateResponseSignerRole(BaseModel): + """ + TemplateResponseSignerRole + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the Role.") + order: Optional[StrictInt] = Field(default=None, description="If signer order is assigned this is the 0-based index for this role.") + __properties: ClassVar[List[str]] = ["name", "order"] + + 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 TemplateResponseSignerRole 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 TemplateResponseSignerRole 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"), + "order": obj.get("order") + }) + 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,)", + "order": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_update_files_request.py b/sdks/python/dropbox_sign/models/template_update_files_request.py new file mode 100644 index 000000000..476e09b96 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_update_files_request.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateUpdateFilesRequest(BaseModel): + """ + TemplateUpdateFilesRequest + """ # noqa: E501 + client_id: Optional[StrictStr] = Field(default=None, description="Client id of the app you're using to update this template.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The new default template email message.") + subject: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="The new default template email subject.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + __properties: ClassVar[List[str]] = ["client_id", "files", "file_urls", "message", "subject", "test_mode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateUpdateFilesRequest 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 TemplateUpdateFilesRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "message": obj.get("message"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "message": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + } + + @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/template_update_files_response.py b/sdks/python/dropbox_sign/models/template_update_files_response.py new file mode 100644 index 000000000..2c2806afa --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_update_files_response.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 +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_update_files_response_template import TemplateUpdateFilesResponseTemplate +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateUpdateFilesResponse(BaseModel): + """ + TemplateUpdateFilesResponse + """ # noqa: E501 + template: TemplateUpdateFilesResponseTemplate + __properties: ClassVar[List[str]] = ["template"] + + 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 TemplateUpdateFilesResponse 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 template + if self.template: + _dict['template'] = self.template.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateUpdateFilesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": TemplateUpdateFilesResponseTemplate.from_dict(obj["template"]) if obj.get("template") 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 { + "template": "(TemplateUpdateFilesResponseTemplate,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/template_update_files_response_template.py b/sdks/python/dropbox_sign/models/template_update_files_response_template.py new file mode 100644 index 000000000..0add592b7 --- /dev/null +++ b/sdks/python/dropbox_sign/models/template_update_files_response_template.py @@ -0,0 +1,133 @@ +# 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 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 TemplateUpdateFilesResponseTemplate(BaseModel): + """ + Contains template id + """ # noqa: E501 + template_id: Optional[StrictStr] = Field(default=None, description="The id of the Template.") + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["template_id", "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 TemplateUpdateFilesResponseTemplate 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 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 TemplateUpdateFilesResponseTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_id": obj.get("template_id"), + "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 { + "template_id": "(str,)", + "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/unclaimed_draft_create_embedded_request.py b/sdks/python/dropbox_sign/models/unclaimed_draft_create_embedded_request.py new file mode 100644 index 000000000..187b4c10e --- /dev/null +++ b/sdks/python/dropbox_sign/models/unclaimed_draft_create_embedded_request.py @@ -0,0 +1,306 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from dropbox_sign.models.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class UnclaimedDraftCreateEmbeddedRequest(BaseModel): + """ + + """ # noqa: E501 + client_id: StrictStr = Field(description="Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") + requester_email_address: StrictStr = Field(description="The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + allow_ccs: Optional[StrictBool] = Field(default=True, description="This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="The email addresses that should be CCed.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + editor_options: Optional[SubEditorOptions] = None + field_options: Optional[SubFieldOptions] = None + force_signer_page: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the signers.") + force_subject_message: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the subject and message.") + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field(default=None, description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + hide_text_tags: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.") + hold_request: Optional[StrictBool] = Field(default=False, description="The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.") + is_for_embedded_signing: Optional[StrictBool] = Field(default=False, description="The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + requesting_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully request a signature.") + show_preview: Optional[StrictBool] = Field(default=None, description="This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + signers: Optional[List[SubUnclaimedDraftSigner]] = Field(default=None, description="Add Signers to your Unclaimed Draft Signature Request.") + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + skip_me_now: Optional[StrictBool] = Field(default=False, description="Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") + subject: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + type: Optional[StrictStr] = Field(default='request_signature', description="The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it.") + use_preexisting_fields: Optional[StrictBool] = Field(default=False, description="Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") + use_text_tags: Optional[StrictBool] = Field(default=False, description="Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") + populate_auto_fill_fields: Optional[StrictBool] = Field(default=False, description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") + expires_at: Optional[StrictInt] = Field(default=None, description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.") + __properties: ClassVar[List[str]] = ["client_id", "requester_email_address", "files", "file_urls", "allow_ccs", "allow_decline", "allow_reassign", "attachments", "cc_email_addresses", "custom_fields", "editor_options", "field_options", "force_signer_page", "force_subject_message", "form_field_groups", "form_field_rules", "form_fields_per_document", "hide_text_tags", "hold_request", "is_for_embedded_signing", "message", "metadata", "requesting_redirect_url", "show_preview", "show_progress_stepper", "signers", "signing_options", "signing_redirect_url", "skip_me_now", "subject", "test_mode", "type", "use_preexisting_fields", "use_text_tags", "populate_auto_fill_fields", "expires_at"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['send_document', 'request_signature']): + raise ValueError("must be one of enum values ('send_document', 'request_signature')") + 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 UnclaimedDraftCreateEmbeddedRequest 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 attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of editor_options + if self.editor_options: + _dict['editor_options'] = self.editor_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateEmbeddedRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "requester_email_address": obj.get("requester_email_address"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "allow_ccs": obj.get("allow_ccs") if obj.get("allow_ccs") is not None else True, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_email_addresses": obj.get("cc_email_addresses"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "editor_options": SubEditorOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "force_signer_page": obj.get("force_signer_page") if obj.get("force_signer_page") is not None else False, + "force_subject_message": obj.get("force_subject_message") if obj.get("force_subject_message") is not None else False, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "hide_text_tags": obj.get("hide_text_tags") if obj.get("hide_text_tags") is not None else False, + "hold_request": obj.get("hold_request") if obj.get("hold_request") is not None else False, + "is_for_embedded_signing": obj.get("is_for_embedded_signing") if obj.get("is_for_embedded_signing") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "requesting_redirect_url": obj.get("requesting_redirect_url"), + "show_preview": obj.get("show_preview"), + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "signers": [SubUnclaimedDraftSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "signing_redirect_url": obj.get("signing_redirect_url"), + "skip_me_now": obj.get("skip_me_now") if obj.get("skip_me_now") is not None else False, + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "type": obj.get("type") if obj.get("type") is not None else 'request_signature', + "use_preexisting_fields": obj.get("use_preexisting_fields") if obj.get("use_preexisting_fields") is not None else False, + "use_text_tags": obj.get("use_text_tags") if obj.get("use_text_tags") is not None else False, + "populate_auto_fill_fields": obj.get("populate_auto_fill_fields") if obj.get("populate_auto_fill_fields") is not None else False, + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "requester_email_address": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "allow_ccs": "(bool,)", + "allow_decline": "(bool,)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_email_addresses": "(List[str],)", + "custom_fields": "(List[SubCustomField],)", + "editor_options": "(SubEditorOptions,)", + "field_options": "(SubFieldOptions,)", + "force_signer_page": "(bool,)", + "force_subject_message": "(bool,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "hide_text_tags": "(bool,)", + "hold_request": "(bool,)", + "is_for_embedded_signing": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "requesting_redirect_url": "(str,)", + "show_preview": "(bool,)", + "show_progress_stepper": "(bool,)", + "signers": "(List[SubUnclaimedDraftSigner],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "skip_me_now": "(bool,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "type": "(str,)", + "use_preexisting_fields": "(bool,)", + "use_text_tags": "(bool,)", + "populate_auto_fill_fields": "(bool,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "attachments", + "cc_email_addresses", + "custom_fields", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + "signers", + ] + diff --git a/sdks/python/dropbox_sign/models/unclaimed_draft_create_embedded_with_template_request.py b/sdks/python/dropbox_sign/models/unclaimed_draft_create_embedded_with_template_request.py new file mode 100644 index 000000000..1b9dd8bf0 --- /dev/null +++ b/sdks/python/dropbox_sign/models/unclaimed_draft_create_embedded_with_template_request.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from dropbox_sign.models.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class UnclaimedDraftCreateEmbeddedWithTemplateRequest(BaseModel): + """ + UnclaimedDraftCreateEmbeddedWithTemplateRequest + """ # noqa: E501 + client_id: StrictStr = Field(description="Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") + requester_email_address: StrictStr = Field(description="The email address of the user that should be designated as the requester of this draft.") + template_ids: List[StrictStr] = Field(description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") + ccs: Optional[List[SubCC]] = Field(default=None, description="Add CC email recipients. Required when a CC role exists for the Template.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="An array defining values and options for custom fields. Required when a custom field exists in the Template.") + editor_options: Optional[SubEditorOptions] = None + field_options: Optional[SubFieldOptions] = None + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.") + force_signer_roles: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template signer roles.") + force_subject_message: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template subject and message.") + hold_request: Optional[StrictBool] = Field(default=False, description="The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.") + is_for_embedded_signing: Optional[StrictBool] = Field(default=False, description="The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + preview_only: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set).") + requesting_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully request a signature.") + show_preview: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + signers: Optional[List[SubUnclaimedDraftTemplateSigner]] = Field(default=None, description="Add Signers to your Templated-based Signature Request.") + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + skip_me_now: Optional[StrictBool] = Field(default=False, description="Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + populate_auto_fill_fields: Optional[StrictBool] = Field(default=False, description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") + allow_ccs: Optional[StrictBool] = Field(default=False, description="This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.") + __properties: ClassVar[List[str]] = ["client_id", "requester_email_address", "template_ids", "allow_decline", "allow_reassign", "ccs", "custom_fields", "editor_options", "field_options", "files", "file_urls", "force_signer_roles", "force_subject_message", "hold_request", "is_for_embedded_signing", "message", "metadata", "preview_only", "requesting_redirect_url", "show_preview", "show_progress_stepper", "signers", "signing_options", "signing_redirect_url", "skip_me_now", "subject", "test_mode", "title", "populate_auto_fill_fields", "allow_ccs"] + + 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 UnclaimedDraftCreateEmbeddedWithTemplateRequest 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 ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict['ccs'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of editor_options + if self.editor_options: + _dict['editor_options'] = self.editor_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateEmbeddedWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "requester_email_address": obj.get("requester_email_address"), + "template_ids": obj.get("template_ids"), + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "ccs": [SubCC.from_dict(_item) for _item in obj["ccs"]] if obj.get("ccs") is not None else None, + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "editor_options": SubEditorOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "force_signer_roles": obj.get("force_signer_roles") if obj.get("force_signer_roles") is not None else False, + "force_subject_message": obj.get("force_subject_message") if obj.get("force_subject_message") is not None else False, + "hold_request": obj.get("hold_request") if obj.get("hold_request") is not None else False, + "is_for_embedded_signing": obj.get("is_for_embedded_signing") if obj.get("is_for_embedded_signing") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "preview_only": obj.get("preview_only") if obj.get("preview_only") is not None else False, + "requesting_redirect_url": obj.get("requesting_redirect_url"), + "show_preview": obj.get("show_preview") if obj.get("show_preview") is not None else False, + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "signers": [SubUnclaimedDraftTemplateSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "signing_redirect_url": obj.get("signing_redirect_url"), + "skip_me_now": obj.get("skip_me_now") if obj.get("skip_me_now") is not None else False, + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "populate_auto_fill_fields": obj.get("populate_auto_fill_fields") if obj.get("populate_auto_fill_fields") is not None else False, + "allow_ccs": obj.get("allow_ccs") if obj.get("allow_ccs") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "requester_email_address": "(str,)", + "template_ids": "(List[str],)", + "allow_decline": "(bool,)", + "allow_reassign": "(bool,)", + "ccs": "(List[SubCC],)", + "custom_fields": "(List[SubCustomField],)", + "editor_options": "(SubEditorOptions,)", + "field_options": "(SubFieldOptions,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "force_signer_roles": "(bool,)", + "force_subject_message": "(bool,)", + "hold_request": "(bool,)", + "is_for_embedded_signing": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "preview_only": "(bool,)", + "requesting_redirect_url": "(str,)", + "show_preview": "(bool,)", + "show_progress_stepper": "(bool,)", + "signers": "(List[SubUnclaimedDraftTemplateSigner],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "skip_me_now": "(bool,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "populate_auto_fill_fields": "(bool,)", + "allow_ccs": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "ccs", + "custom_fields", + "files", + "file_urls", + "signers", + ] + diff --git a/sdks/python/dropbox_sign/models/unclaimed_draft_create_request.py b/sdks/python/dropbox_sign/models/unclaimed_draft_create_request.py new file mode 100644 index 000000000..c685111e5 --- /dev/null +++ b/sdks/python/dropbox_sign/models/unclaimed_draft_create_request.py @@ -0,0 +1,263 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from dropbox_sign.models.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class UnclaimedDraftCreateRequest(BaseModel): + """ + + """ # noqa: E501 + type: StrictStr = Field(description="The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="The email addresses that should be CCed.") + client_id: Optional[StrictStr] = Field(default=None, description="Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + field_options: Optional[SubFieldOptions] = None + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field(default=None, description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + hide_text_tags: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + signers: Optional[List[SubUnclaimedDraftSigner]] = Field(default=None, description="Add Signers to your Unclaimed Draft Signature Request.") + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + subject: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + use_preexisting_fields: Optional[StrictBool] = Field(default=False, description="Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") + use_text_tags: Optional[StrictBool] = Field(default=False, description="Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") + expires_at: Optional[StrictInt] = Field(default=None, description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.") + __properties: ClassVar[List[str]] = ["type", "files", "file_urls", "allow_decline", "attachments", "cc_email_addresses", "client_id", "custom_fields", "field_options", "form_field_groups", "form_field_rules", "form_fields_per_document", "hide_text_tags", "message", "metadata", "show_progress_stepper", "signers", "signing_options", "signing_redirect_url", "subject", "test_mode", "use_preexisting_fields", "use_text_tags", "expires_at"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['send_document', 'request_signature']): + raise ValueError("must be one of enum values ('send_document', 'request_signature')") + 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 UnclaimedDraftCreateRequest 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 attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_email_addresses": obj.get("cc_email_addresses"), + "client_id": obj.get("client_id"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "hide_text_tags": obj.get("hide_text_tags") if obj.get("hide_text_tags") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "signers": [SubUnclaimedDraftSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "use_preexisting_fields": obj.get("use_preexisting_fields") if obj.get("use_preexisting_fields") is not None else False, + "use_text_tags": obj.get("use_text_tags") if obj.get("use_text_tags") is not None else False, + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "allow_decline": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_email_addresses": "(List[str],)", + "client_id": "(str,)", + "custom_fields": "(List[SubCustomField],)", + "field_options": "(SubFieldOptions,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "hide_text_tags": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "show_progress_stepper": "(bool,)", + "signers": "(List[SubUnclaimedDraftSigner],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "use_preexisting_fields": "(bool,)", + "use_text_tags": "(bool,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "attachments", + "cc_email_addresses", + "custom_fields", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + "signers", + ] + diff --git a/sdks/python/dropbox_sign/models/unclaimed_draft_create_response.py b/sdks/python/dropbox_sign/models/unclaimed_draft_create_response.py new file mode 100644 index 000000000..0ec98ba71 --- /dev/null +++ b/sdks/python/dropbox_sign/models/unclaimed_draft_create_response.py @@ -0,0 +1,137 @@ +# 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.unclaimed_draft_response import UnclaimedDraftResponse +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 UnclaimedDraftCreateResponse(BaseModel): + """ + UnclaimedDraftCreateResponse + """ # noqa: E501 + unclaimed_draft: UnclaimedDraftResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["unclaimed_draft", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateResponse 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 unclaimed_draft + if self.unclaimed_draft: + _dict['unclaimed_draft'] = self.unclaimed_draft.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "unclaimed_draft": UnclaimedDraftResponse.from_dict(obj["unclaimed_draft"]) if obj.get("unclaimed_draft") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "unclaimed_draft": "(UnclaimedDraftResponse,)", + "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/unclaimed_draft_edit_and_resend_request.py b/sdks/python/dropbox_sign/models/unclaimed_draft_edit_and_resend_request.py new file mode 100644 index 000000000..615828fbe --- /dev/null +++ b/sdks/python/dropbox_sign/models/unclaimed_draft_edit_and_resend_request.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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class UnclaimedDraftEditAndResendRequest(BaseModel): + """ + UnclaimedDraftEditAndResendRequest + """ # noqa: E501 + client_id: StrictStr = Field(description="Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") + editor_options: Optional[SubEditorOptions] = None + is_for_embedded_signing: Optional[StrictBool] = Field(default=None, description="The request created from this draft will also be signable in embedded mode if set to `true`.") + requester_email_address: Optional[StrictStr] = Field(default=None, description="The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used.") + requesting_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully request a signature.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + __properties: ClassVar[List[str]] = ["client_id", "editor_options", "is_for_embedded_signing", "requester_email_address", "requesting_redirect_url", "show_progress_stepper", "signing_redirect_url", "test_mode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnclaimedDraftEditAndResendRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of editor_options + if self.editor_options: + _dict['editor_options'] = self.editor_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftEditAndResendRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "editor_options": SubEditorOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None else None, + "is_for_embedded_signing": obj.get("is_for_embedded_signing"), + "requester_email_address": obj.get("requester_email_address"), + "requesting_redirect_url": obj.get("requesting_redirect_url"), + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "signing_redirect_url": obj.get("signing_redirect_url"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "editor_options": "(SubEditorOptions,)", + "is_for_embedded_signing": "(bool,)", + "requester_email_address": "(str,)", + "requesting_redirect_url": "(str,)", + "show_progress_stepper": "(bool,)", + "signing_redirect_url": "(str,)", + "test_mode": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/unclaimed_draft_response.py b/sdks/python/dropbox_sign/models/unclaimed_draft_response.py new file mode 100644 index 000000000..7f4c72adc --- /dev/null +++ b/sdks/python/dropbox_sign/models/unclaimed_draft_response.py @@ -0,0 +1,136 @@ +# 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, 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 UnclaimedDraftResponse(BaseModel): + """ + A group of documents that a user can take ownership of via the claim URL. + """ # noqa: E501 + signature_request_id: Optional[StrictStr] = Field(default=None, description="The ID of the signature request that is represented by this UnclaimedDraft.") + claim_url: Optional[StrictStr] = Field(default=None, description="The URL to be used to claim this UnclaimedDraft.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + requesting_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.).") + expires_at: Optional[StrictInt] = Field(default=None, description="When the link expires.") + test_mode: Optional[StrictBool] = Field(default=None, description="Whether this is a test draft. Signature requests made from test drafts have no legal value.") + __properties: ClassVar[List[str]] = ["signature_request_id", "claim_url", "signing_redirect_url", "requesting_redirect_url", "expires_at", "test_mode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnclaimedDraftResponse 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 UnclaimedDraftResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature_request_id": obj.get("signature_request_id"), + "claim_url": obj.get("claim_url"), + "signing_redirect_url": obj.get("signing_redirect_url"), + "requesting_redirect_url": obj.get("requesting_redirect_url"), + "expires_at": obj.get("expires_at"), + "test_mode": obj.get("test_mode") + }) + 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 { + "signature_request_id": "(str,)", + "claim_url": "(str,)", + "signing_redirect_url": "(str,)", + "requesting_redirect_url": "(str,)", + "expires_at": "(int,)", + "test_mode": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/models/warning_response.py b/sdks/python/dropbox_sign/models/warning_response.py new file mode 100644 index 000000000..3524ace59 --- /dev/null +++ b/sdks/python/dropbox_sign/models/warning_response.py @@ -0,0 +1,124 @@ +# 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 +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class WarningResponse(BaseModel): + """ + A list of warnings. + """ # noqa: E501 + warning_msg: StrictStr = Field(description="Warning message") + warning_name: StrictStr = Field(description="Warning name") + __properties: ClassVar[List[str]] = ["warning_msg", "warning_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 WarningResponse 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 WarningResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "warning_msg": obj.get("warning_msg"), + "warning_name": obj.get("warning_name") + }) + 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 { + "warning_msg": "(str,)", + "warning_name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/sdks/python/dropbox_sign/py.typed b/sdks/python/dropbox_sign/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/sdks/python/dropbox_sign/rest.py b/sdks/python/dropbox_sign/rest.py index 4f01302fd..0c57b2c6b 100644 --- a/sdks/python/dropbox_sign/rest.py +++ b/sdks/python/dropbox_sign/rest.py @@ -1,55 +1,69 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import io import json -import logging import re import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment + import urllib3 -import ipaddress -from dropbox_sign.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from dropbox_sign.exceptions import ApiException, ApiValueError +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -58,70 +72,79 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager - if configuration.proxy and not should_bypass_proxies(configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :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. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -133,60 +156,83 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', headers['Content-Type'], re.IGNORECASE)): + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -197,151 +243,16 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None , '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ',''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) + return RESTResponse(r) diff --git a/sdks/python/git_push.sh b/sdks/python/git_push.sh new file mode 100644 index 000000000..f53a75d4f --- /dev/null +++ b/sdks/python/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/sdks/python/openapi-config.yaml b/sdks/python/openapi-config.yaml index 43c6d710c..348a1f82f 100644 --- a/sdks/python/openapi-config.yaml +++ b/sdks/python/openapi-config.yaml @@ -1,16 +1,21 @@ generatorName: python -typeMappings: {} +typeMappings: + "bytearray": "io.IOBase" additionalProperties: generatorLanguageVersion: ">=3.7" packageName: dropbox_sign projectName: dropbox-sign - packageVersion: 1.5-dev + packageVersion: 1.6-dev sortModelPropertiesByRequiredFlag: true legacyDiscriminatorBehavior: true packageAuthor: Dropbox Sign API Team packageUrl: https://github.com/hellosign/dropbox-sign-python infoName: Official Python SDK for the Dropbox Sign API + useCustomTemplateCode: true files: + __init__apis.mustache: + templateType: SupportingFiles + destinationFilename: dropbox_sign/apis/__init__.py event_callback_helper.mustache: templateType: SupportingFiles destinationFilename: dropbox_sign/event_callback_helper.py diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml new file mode 100644 index 000000000..6eefc3900 --- /dev/null +++ b/sdks/python/pyproject.toml @@ -0,0 +1,71 @@ +[tool.poetry] +name = "dropbox_sign" +version = "1.6-dev" +description = "Dropbox Sign API" +authors = ["Official Python SDK for the Dropbox Sign API "] +license = "MIT" +readme = "README.md" +repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "Dropbox Sign API"] +include = ["dropbox_sign/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" +types-python-dateutil = ">=2.8.19.14" +mypy = "1.4.1" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "dropbox_sign", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/sdks/python/requirements.txt b/sdks/python/requirements.txt index 96947f604..cc85509ec 100644 --- a/sdks/python/requirements.txt +++ b/sdks/python/requirements.txt @@ -1,3 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/sdks/python/run-build b/sdks/python/run-build index aa54ddea0..1e3702718 100755 --- a/sdks/python/run-build +++ b/sdks/python/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/8b3cad0692b6c58f827c0a9b35f1ad733547504b/modules/openapi-generator/src/main/resources/python +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/python set -e @@ -9,7 +9,7 @@ WORKING_DIR="/app/python" docker run --rm \ -v "${DIR}/:/local" \ - openapitools/openapi-generator-cli:v5.3.0 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ diff --git a/sdks/python/setup.py b/sdks/python/setup.py index aab74260f..7d3d8d385 100644 --- a/sdks/python/setup.py +++ b/sdks/python/setup.py @@ -1,29 +1,35 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 from setuptools import setup, find_packages # noqa: H301 from pathlib import Path -NAME = "dropbox-sign" -VERSION = "1.5-dev" # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools - +NAME = "dropbox-sign" +VERSION = "1.6-dev" +PYTHON_REQUIRES = ">=3.7" REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", ] this_directory = Path(__file__).parent @@ -37,11 +43,11 @@ author_email="apisupport@hellosign.com", url="https://github.com/hellosign/dropbox-sign-python", keywords=["OpenAPI", "OpenAPI-Generator", "Dropbox Sign API"], - python_requires=">=3.7", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="MIT", long_description=long_description, - long_description_content_type='text/markdown' + long_description_content_type='text/markdown', + package_data={"dropbox_sign": ["py.typed"]}, ) diff --git a/sdks/python/templates/README.mustache b/sdks/python/templates/README.mustache index a8e53c571..5fe4264f5 100644 --- a/sdks/python/templates/README.mustache +++ b/sdks/python/templates/README.mustache @@ -1,9 +1,51 @@ # {{{projectName}}} - {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} +{{^useCustomTemplateCode}} +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} +- Build package: {{generatorClass}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Requirements. + +Python {{{generatorLanguageVersion}}} + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`) + +Then import the package: +```python +import {{{packageName}}} +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ## Migrating from legacy SDK This SDK is generated from our officially maintained [OpenAPI spec](https://github.com/hellosign/hellosign-openapi/blob/main/openapi.yaml). @@ -60,14 +102,20 @@ Alternatively: ```shell pip install git+https://github.com/hellosign/dropbox-sign-python.git ``` +{{/useCustomTemplateCode}} Then import the package: ```python import {{{packageName}}} ``` +{{^useCustomTemplateCode}} +### Tests +Execute `pytest` to run the tests. + +{{/useCustomTemplateCode}} ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: -{{> README_common }} +{{> common_README }} diff --git a/sdks/python/templates/README_common.mustache b/sdks/python/templates/README_common.mustache deleted file mode 100644 index 9de12f373..000000000 --- a/sdks/python/templates/README_common.mustache +++ /dev/null @@ -1,74 +0,0 @@ -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -```python -REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Python_CODE -``` -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -|Class | Method | HTTP request | Description| -|------------ | ------------- | ------------- | -------------| -{{#apiInfo}}{{#apis}}{{#operations}}|{{#operation}}```{{classname}}``` | [```{{operationId}}```]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | ```{{httpMethod}} {{path}}``` | {{summary}}| -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation For Models - -{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/model}}{{/models}} - -## Documentation For Authorization - -{{^authMethods}} - All endpoints do not require authorization. -{{/authMethods}} -{{#authMethods}} -{{#last}} Authentication schemes defined for the API:{{/last}} -## {{{name}}} - -{{#isApiKey}} -- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}} -{{#isBasicBasic}} -- **Type**: HTTP basic authentication -{{/isBasicBasic}} -{{#isBasicBearer}} -- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} -{{/isBasicBearer}} -{{#isHttpSignature}} -- **Type**: HTTP signature authentication -{{/isHttpSignature}} -{{/isBasic}} -{{#isOAuth}} -- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - **{{{scope}}}**: {{{description}}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} - -## About this package - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{^hideGenerationTimestamp}} - - Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} - For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} diff --git a/sdks/python/templates/README_onlypackage.mustache b/sdks/python/templates/README_onlypackage.mustache index ba08a3acf..ae547b1e6 100644 --- a/sdks/python/templates/README_onlypackage.mustache +++ b/sdks/python/templates/README_onlypackage.mustache @@ -10,6 +10,7 @@ The `{{packageName}}` package is automatically generated by the [OpenAPI Generat {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -33,10 +34,11 @@ To be able to use it, you will need these dependencies in your own package that {{#tornado}} * tornado>=4.2,<5 {{/tornado}} +* pydantic ## Getting Started In your own code, to use this library to connect and interact with {{{projectName}}}, you can run the following: -{{> README_common }} +{{> common_README }} diff --git a/sdks/python/templates/__init__api.mustache b/sdks/python/templates/__init__api.mustache index 8a9e6b91b..8870835c8 100644 --- a/sdks/python/templates/__init__api.mustache +++ b/sdks/python/templates/__init__api.mustache @@ -1,9 +1,5 @@ -{{#apiInfo}} -{{#apis}} -{{#-first}} -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from {{packageName}}.apis import {{classname}} -{{/-first}} -{{/apis}} -{{/apiInfo}} +# flake8: noqa + +# import apis into api package +{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} +{{/apis}}{{/apiInfo}} diff --git a/sdks/python/templates/__init__apis.mustache b/sdks/python/templates/__init__apis.mustache index 927bb6d52..868a7a603 100644 --- a/sdks/python/templates/__init__apis.mustache +++ b/sdks/python/templates/__init__apis.mustache @@ -1,23 +1,12 @@ +{{#useCustomTemplateCode}} {{#apiInfo}} {{#apis}} {{#-first}} - # flake8: noqa -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from {{packagename}}.api.{{classFilename}} import {{classname}} -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - # Import APIs into API package: {{/-first}} from {{apiPackage}}.{{classFilename}} import {{classname}} {{/apis}} {{/apiInfo}} +{{/useCustomTemplateCode}} diff --git a/sdks/python/templates/__init__model.mustache b/sdks/python/templates/__init__model.mustache index cfe32b784..0e1b55e2a 100644 --- a/sdks/python/templates/__init__model.mustache +++ b/sdks/python/templates/__init__model.mustache @@ -1,5 +1,11 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB +# coding: utf-8 + +# flake8: noqa +{{>partial_header}} + +# import models into model package +{{#models}} +{{#model}} +from {{modelPackage}}.{{classFilename}} import {{classname}} +{{/model}} +{{/models}} diff --git a/sdks/python/templates/__init__models.mustache b/sdks/python/templates/__init__models.mustache deleted file mode 100644 index 76d91fc5d..000000000 --- a/sdks/python/templates/__init__models.mustache +++ /dev/null @@ -1,16 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from {{modelPackage}}.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -{{#models}} -{{#model}} -from {{modelPackage}}.{{classFilename}} import {{classname}} -{{/model}} -{{/models}} diff --git a/sdks/python/templates/__init__package.mustache b/sdks/python/templates/__init__package.mustache index ce02cd628..e4d04b65b 100644 --- a/sdks/python/templates/__init__package.mustache +++ b/sdks/python/templates/__init__package.mustache @@ -1,28 +1,44 @@ +# coding: utf-8 + # flake8: noqa {{>partial_header}} __version__ = "{{packageVersion}}" +# import apis into sdk package +{{^useCustomTemplateCode}} +{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} +{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +from dropbox_sign.apis import * + +{{/useCustomTemplateCode}} # import ApiClient +from {{packageName}}.api_response import ApiResponse from {{packageName}}.api_client import ApiClient - -# import Configuration from {{packageName}}.configuration import Configuration -{{#hasHttpSignatureMethods}} -from {{packageName}}.signing import HttpSigningConfiguration -{{/hasHttpSignatureMethods}} - -# import exceptions from {{packageName}}.exceptions import OpenApiException -from {{packageName}}.exceptions import ApiAttributeError from {{packageName}}.exceptions import ApiTypeError from {{packageName}}.exceptions import ApiValueError from {{packageName}}.exceptions import ApiKeyError +from {{packageName}}.exceptions import ApiAttributeError from {{packageName}}.exceptions import ApiException +{{#hasHttpSignatureMethods}} +from {{packageName}}.signing import HttpSigningConfiguration +{{/hasHttpSignatureMethods}} + +# import models into sdk package +{{#models}} +{{#model}} +from {{modelPackage}}.{{classFilename}} import {{classname}} +{{/model}} +{{/models}} +{{#useCustomTemplateCode}} +from dropbox_sign.event_callback_helper import EventCallbackHelper +{{/useCustomTemplateCode}} {{#recursionLimit}} __import__('sys').setrecursionlimit({{{.}}}) {{/recursionLimit}} - -from dropbox_sign.event_callback_helper import EventCallbackHelper diff --git a/sdks/python/templates/api.mustache b/sdks/python/templates/api.mustache index dffd9a0b0..3a3c7cd29 100644 --- a/sdks/python/templates/api.mustache +++ b/sdks/python/templates/api.mustache @@ -1,376 +1,269 @@ -{{>partial_header}} +# coding: utf-8 -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 +{{>partial_header}} +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 {{packageName}}.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from {{packageName}}.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) {{#imports}} -{{{import}}} +{{import}} {{/imports}} +from {{packageName}}.api_client import ApiClient, RequestSerialized +from {{packageName}}.api_response import ApiResponse +from {{packageName}}.rest import RESTResponseType +{{#useCustomTemplateCode}} +import io +{{/useCustomTemplateCode}} + -class {{classname}}(object): +{{#operations}} +class {{classname}}: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client -{{#operations}} {{#operation}} - self.{{operationId}}_endpoint = _Endpoint( - settings={ - 'response_type': {{#returnType}}({{{.}}},){{/returnType}}{{^returnType}}None{{/returnType}}, -{{#authMethods}} -{{#-first}} - 'auth': [ -{{/-first}} - '{{name}}'{{^-last}},{{/-last}} -{{#-last}} - ], -{{/-last}} -{{/authMethods}} -{{^authMethods}} - 'auth': [], -{{/authMethods}} - 'endpoint_path': '{{{path}}}', - 'operation_id': '{{operationId}}', - 'http_method': '{{httpMethod}}', -{{#servers}} -{{#-first}} - 'servers': [ -{{/-first}} - { - 'url': "{{{url}}}", - 'description': "{{{description}}}{{^description}}No description provided{{/description}}", - {{#variables}} - {{#-first}} - 'variables': { - {{/-first}} - '{{{name}}}': { - 'description': "{{{description}}}{{^description}}No description provided{{/description}}", - 'default_value': "{{{defaultValue}}}", - {{#enumValues}} - {{#-first}} - 'enum_values': [ - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ] - {{/-last}} - {{/enumValues}} - }{{^-last}},{{/-last}} - {{#-last}} - } - {{/-last}} - {{/variables}} - }, -{{#-last}} - ] -{{/-last}} -{{/servers}} -{{^servers}} - 'servers': None, -{{/servers}} - }, - params_map={ - 'all': [ -{{#allParams}} - '{{paramName}}', -{{/allParams}} - ], -{{#requiredParams}} -{{#-first}} - 'required': [ -{{/-first}} - '{{paramName}}', -{{#-last}} - ], -{{/-last}} -{{/requiredParams}} -{{^requiredParams}} - 'required': [], -{{/requiredParams}} - 'nullable': [ -{{#allParams}} -{{#isNullable}} - '{{paramName}}', -{{/isNullable}} -{{/allParams}} - ], - 'enum': [ -{{#allParams}} -{{#isEnum}} - '{{paramName}}', -{{/isEnum}} -{{/allParams}} - ], - 'validation': [ -{{#allParams}} -{{#hasValidation}} - '{{paramName}}', -{{/hasValidation}} -{{/allParams}} - ] - }, - root_map={ - 'validations': { -{{#allParams}} -{{#hasValidation}} - ('{{paramName}}',): { -{{#maxLength}} - 'max_length': {{.}},{{/maxLength}}{{#minLength}} - 'min_length': {{.}},{{/minLength}}{{#maxItems}} - 'max_items': {{.}},{{/maxItems}}{{#minItems}} - 'min_items': {{.}},{{/minItems}}{{#maximum}} - {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}{{^exclusiveMaximum}}'inclusive_maximum'{{/exclusiveMaximum}}: {{maximum}},{{/maximum}}{{#minimum}} - {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}{{^exclusiveMinimum}}'inclusive_minimum'{{/exclusiveMinimum}}: {{minimum}},{{/minimum}}{{#pattern}} - 'regex': { - 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} - {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} - },{{/pattern}} - }, -{{/hasValidation}} -{{/allParams}} - }, - 'allowed_values': { -{{#allParams}} -{{#isEnum}} - ('{{paramName}}',): { -{{#isNullable}} - 'None': None,{{/isNullable}}{{#allowableValues}}{{#enumVars}} - "{{name}}": {{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} - }, -{{/isEnum}} -{{/allParams}} - }, - 'openapi_types': { -{{#allParams}} - '{{paramName}}': - ({{{dataType}}},), -{{/allParams}} - }, - 'attribute_map': { -{{#allParams}} -{{^isBodyParam}} - '{{paramName}}': '{{baseName}}', -{{/isBodyParam}} -{{/allParams}} - }, - 'location_map': { -{{#allParams}} - '{{paramName}}': '{{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isCookieParam}}cookie{{/isCookieParam}}{{#isBodyParam}}body{{/isBodyParam}}', -{{/allParams}} - }, - 'collection_format_map': { -{{#allParams}} -{{#collectionFormat}} - '{{paramName}}': '{{collectionFormat}}', -{{/collectionFormat}} -{{/allParams}} - } - }, - headers_map={ -{{#hasProduces}} - 'accept': [ -{{#produces}} - '{{{mediaType}}}'{{^-last}},{{/-last}} -{{/produces}} - ], -{{/hasProduces}} -{{^hasProduces}} - 'accept': [], -{{/hasProduces}} -{{#hasConsumes}} - 'content_type': [ -{{#consumes}} - '{{{mediaType}}}'{{^-last}},{{/-last}} -{{/consumes}} - ] -{{/hasConsumes}} -{{^hasConsumes}} - 'content_type': [], -{{/hasConsumes}} - }, - api_client=api_client + + + @validate_call + {{#asyncio}}async {{/asyncio}}def {{operationId}}{{>partial_api_args}} -> {{{returnType}}}{{^returnType}}None{{/returnType}}: +{{>partial_api}} + response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) -{{/operation}} -{{/operations}} + {{#asyncio}}await {{/asyncio}}response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data -{{#operations}} -{{#operation}} - def {{operationId}}( + + @validate_call + {{#asyncio}}async {{/asyncio}}def {{operationId}}_with_http_info{{>partial_api_args}} -> ApiResponse[{{{returnType}}}{{^returnType}}None{{/returnType}}]: +{{>partial_api}} + response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + {{#asyncio}}await {{/asyncio}}response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + {{#asyncio}}async {{/asyncio}}def {{operationId}}_without_preload_content{{>partial_api_args}} -> RESTResponseType: +{{>partial_api}} + response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _{{operationId}}_serialize( self, -{{#requiredParams}} -{{^defaultValue}} + {{#allParams}} {{paramName}}, -{{/defaultValue}} -{{/requiredParams}} -{{#requiredParams}} -{{#defaultValue}} - {{paramName}}={{{defaultValue}}}, -{{/defaultValue}} -{{/requiredParams}} - **kwargs - ) -> {{#returnType}}{{.}}{{/returnType}}{{^returnType}}None{{/returnType}}: - """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + {{/allParams}} + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: -{{#notes}} - {{{.}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + {{#servers.0}} + _hosts = [{{#servers}} + '{{{url}}}'{{^-last}},{{/-last}}{{/servers}} + ] + _host = _hosts[_host_index] + {{/servers.0}} + {{^servers.0}} + _host = None + {{/servers.0}} - >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True) - >>> result = thread.get() + _collection_formats: Dict[str, str] = { + {{#allParams}} + {{#isArray}} + '{{baseName}}': '{{collectionFormat}}', + {{/isArray}} + {{/allParams}} + } -{{#requiredParams}} -{{#-last}} - Args: -{{/-last}} -{{/requiredParams}} -{{#requiredParams}} -{{^defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/requiredParams}} -{{#requiredParams}} -{{#defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}] -{{/defaultValue}} -{{/requiredParams}} + _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 - Keyword Args:{{#optionalParams}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}{{/optionalParams}} - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously +{{#useCustomTemplateCode}} + {{#bodyParam}} + has_files = False + body_param = {{#bodyParam}}{{paramName}}{{/bodyParam}} + 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 - Returns: - {{returnType}}{{^returnType}}None{{/returnType}} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') -{{#requiredParams}} - kwargs['{{paramName}}'] = \ - {{paramName}} -{{/requiredParams}} - {{^returnType}} - return self.{{operationId}}_endpoint.call_with_http_info(**kwargs) - {{/returnType}} - {{#returnType}} - try: - return self.{{operationId}}_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - {{#responses}} - {{#dataType}} - {{^isWildcard}} - {{^isRange}} - if e.status == {{code}}: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[{{{dataType}}}], - _check_type=True, - ) + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) - raise e - {{/isRange}} - {{/isWildcard}} - {{/dataType}} - {{/responses}} - {{#responses}} - {{#dataType}} - {{#isRange}} - range_code = "{{code}}"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + 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 range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[{{{dataType}}}], - _check_type=True, + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + {{/bodyParam}} +{{/useCustomTemplateCode}} + # process the path parameters +{{#pathParams}} + if {{paramName}} is not None: + _path_params['{{baseName}}'] = {{paramName}}{{#isEnumRef}}.value{{/isEnumRef}} +{{/pathParams}} + # process the query parameters +{{#queryParams}} + if {{paramName}} is not None: + {{#isDateTime}} + if isinstance({{paramName}}, datetime): + _query_params.append( + ( + '{{baseName}}', + {{paramName}}.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('{{baseName}}', {{paramName}})) + {{/isDateTime}} + {{#isDate}} + if isinstance({{paramName}}, date): + _query_params.append( + ( + '{{baseName}}', + {{paramName}}.strftime( + self.api_client.configuration.date_format + ) + ) ) + else: + _query_params.append(('{{baseName}}', {{paramName}})) + {{/isDate}} + {{^isDateTime}}{{^isDate}} + _query_params.append(('{{baseName}}', {{paramName}}{{#isEnumRef}}.value{{/isEnumRef}})) + {{/isDate}}{{/isDateTime}} +{{/queryParams}} + # process the header parameters +{{#headerParams}} + if {{paramName}} is not None: + _header_params['{{baseName}}'] = {{paramName}} +{{/headerParams}} + # process the form parameters +{{#formParams}} + if {{paramName}} is not None: + {{#isFile}} + _files['{{{baseName}}}'] = {{paramName}} + {{/isFile}} + {{^isFile}} + _form_params.append(('{{{baseName}}}', {{paramName}})) + {{/isFile}} +{{/formParams}} + # process the body parameter +{{#bodyParam}} +{{^useCustomTemplateCode}} + if {{paramName}} is not None: +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + if {{paramName}} is not None and has_files is False: +{{/useCustomTemplateCode}} + {{#isBinary}} + # convert to byte array if the input is a file name (str) + if isinstance({{paramName}}, str): + with open({{paramName}}, "rb") as _fp: + _body_params = _fp.read() + else: + _body_params = {{paramName}} + {{/isBinary}} + {{^isBinary}} + _body_params = {{paramName}} + {{/isBinary}} +{{/bodyParam}} + + {{#constantParams}} + {{#isQueryParam}} + # Set client side default value of Query Param "{{baseName}}". + _query_params.append(('{{baseName}}', {{#_enum}}'{{{.}}}'{{/_enum}})) + {{/isQueryParam}} + {{#isHeaderParam}} + # Set client side default value of Header Param "{{baseName}}". + _header_params['{{baseName}}'] = {{#_enum}}'{{{.}}}'{{/_enum}} + {{/isHeaderParam}} + {{/constantParams}} + + {{#hasProduces}} + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [{{#produces}} + '{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}} + ] + ) + {{/hasProduces}} - raise e - {{/isRange}} - {{/dataType}} - {{/responses}} - {{#responses}} - {{#dataType}} - {{#isWildcard}} - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[{{{dataType}}}], - _check_type=True, + {{#hasConsumes}} + # 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( + [{{#consumes}} + '{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}} + ] + ) ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + {{/hasConsumes}} + + # authentication setting + _auth_settings: List[str] = [{{#authMethods}} + '{{name}}'{{^-last}}, {{/-last}}{{/authMethods}} + ] + + return self.api_client.param_serialize( + method='{{httpMethod}}', + resource_path='{{{path}}}', + 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 + ) - raise e - {{/isWildcard}} - {{/dataType}} - {{/responses}} - {{/returnType}} {{/operation}} {{/operations}} diff --git a/sdks/python/templates/api_client.mustache b/sdks/python/templates/api_client.mustache index 4891673e4..69e75c9db 100644 --- a/sdks/python/templates/api_client.mustache +++ b/sdks/python/templates/api_client.mustache @@ -1,40 +1,44 @@ +# coding: utf-8 + {{>partial_header}} +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal import json -import atexit import mimetypes -from multiprocessing.pool import ThreadPool -import io import os import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField +import tempfile +{{#useCustomTemplateCode}} +import io +{{/useCustomTemplateCode}} +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr {{#tornado}} import tornado.gen {{/tornado}} -from {{packageName}} import rest from {{packageName}}.configuration import Configuration -from {{packageName}}.exceptions import ApiTypeError, ApiValueError, ApiException -from {{packageName}}.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types +from {{packageName}}.api_response import ApiResponse, T as ApiResponseT +import {{modelPackage}} +from {{packageName}} import rest +from {{packageName}}.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException ) +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] -class ApiClient(object): +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -42,28 +46,39 @@ class ApiClient(object): the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided if configuration is None: - configuration = Configuration.get_default_copy() + configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -72,30 +87,25 @@ class ApiClient(object): self.cookie = cookie # Set default User-Agent. self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' + self.client_side_validation = configuration.client_side_validation - def __enter__(self): +{{#asyncio}} + async def __aenter__(self): return self - def __exit__(self, exc_type, exc_value, traceback): - self.close() + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) + async def close(self): + await self.rest_client.close() +{{/asyncio}} +{{^asyncio}} + def __enter__(self): + return self - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + def __exit__(self, exc_type, exc_value, traceback): + pass +{{/asyncio}} @property def user_agent(self): @@ -109,29 +119,69 @@ class ApiClient(object): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - {{#tornado}} - @tornado.gen.coroutine - {{/tornado}} - {{#asyncio}}async {{/asyncio}}def __call_api( + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None - ): + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :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. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -142,14 +192,17 @@ class ApiClient(object): header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -157,350 +210,272 @@ class ApiClient(object): quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict) ) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) - # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead url = _host + resource_path + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + {{#tornado}} + @tornado.gen.coroutine + {{/tornado}} + {{#asyncio}}async {{/asyncio}}def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except ApiException as e: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ - return_data = response_data + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg - if not _preload_content: - {{^tornado}} - return (return_data) - {{/tornado}} - {{#tornado}} - raise tornado.gen.Return(return_data) - {{/tornado}} - return return_data + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None content_type = response_data.getheader('content-type') if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - -{{^tornado}} - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) -{{/tornado}} -{{#tornado}} - if _return_http_data_only: - raise tornado.gen.Return(return_data) - else: - raise tornado.gen.Return((return_data, response_data.status, - response_data.getheaders())) -{{/tornado}} + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes + :param obj: The data to serialize. :return: The serialized form of data. """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() - } - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): return obj - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item) for item in obj] - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) # fetch data from response object - try: - received_data = json.loads(response.data) - except TypeError: - received_data = response.data - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. + return self.__deserialize(data, response_type) - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :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. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr({{modelPackage}}, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) + return self.__deserialize_model(data, klass) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -509,10 +484,10 @@ class ApiClient(object): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -532,405 +507,312 @@ class ApiClient(object): new_params.append((k, v)) return new_params - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): - """Builds form parameters. + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) """ - if files is None: - return [] + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) + else: + new_params.append((k, quote(str(v)))) + return "&".join(["=".join(map(str, item)) for item in new_params]) + +{{^useCustomTemplateCode}} + def files_parameters(self, files: Dict[str, Union[str, bytes]]): +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + def files_parameters(self, files: Dict[str, Union[str, bytes, io.IOBase]]): +{{/useCustomTemplateCode}} + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v +{{#useCustomTemplateCode}} + elif isinstance(v, io.IOBase): + filename = os.path.basename(v.name) + filedata = v.read() +{{/useCustomTemplateCode}} + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] - def select_header_content_type(self, content_types, method=None, body=None): + def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' + return None - content_types = [x.lower() for x in content_types] + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' + return content_types[0] - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body): + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] -{{#hasHttpSignatureMethods}} - else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, queries) - headers.update(auth_headers) -{{/hasHttpSignatureMethods}} - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting ) + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + {{#hasHttpSignatureMethods}} + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, queries) + headers.update(auth_headers) + {{/hasHttpSignatureMethods}} + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) + def __deserialize_file(self, response): + """Deserializes body to file - if kwargs['_check_input_type'] is False: - return + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - """We want to support a single typed object parameter for all endpoints, - including of multipart/form-data content-types. - """ - body = param_value.to_dict() - remove_files = [] - - for oas_name in param_value.openapi_types: - if hasattr(param_value, oas_name): - obj = param_value[oas_name] - if isinstance(obj, file_type): - params['file'][oas_name] = [obj] - remove_files.append(oas_name) - elif isinstance(obj, list): - i = 0 - for obj_value in obj: - if isinstance(obj_value, file_type): - key = oas_name + '[' + str(i) + ']' - params['file'][key] = [obj_value] - remove_files.append(oas_name) - i += 1 - - # remove duplicates - remove_files = list(set(remove_files)) - - for remove in remove_files: - body.pop(remove) - - if len(remove_files): - for param in body: - param_value_full = (param, body[param]) - - # do not change non-JSON values - if (not isinstance(body[param], (str, bool, int, float))): - param_value_full = (param, json.dumps(body[param])) - - params['form'].append(param_value_full) - else: - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][base_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format + with open(path, "wb") as f: + f.write(response.data) - return params + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} - api_instance = {{classname}}() - api_instance.{{operationId}} # this is an instance of the class Endpoint - api_instance.{{operationId}}() # this invokes api_instance.{{operationId}}.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.{{operationId}}.callable or self.callable in this class -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. """ - return self.callable(self, *args, **kwargs) + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data - def call_with_http_info(self, **kwargs): + def __deserialize_object(self, value): + """Return an original value. + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) + def __deserialize_datetime(self, string): + """Deserializes string to datetime. - self.__validate_inputs(kwargs) + The string should be in iso8601 datetime format. - params = self.__gather_params(kwargs) + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) - # Remove None values from query parameters - query_to_keep = [] - for key, value in params['query']: - if value is not None: - query_to_keep = query_to_keep + [(key, value)] + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. - params['query'] = query_to_keep + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if len(params['form']) > 0 or ('file' in params.keys() and len(params['file']) > 0): - params['header']['Content-Type'] = 'multipart/form-data' - elif params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/sdks/python/templates/api_doc.mustache b/sdks/python/templates/api_doc.mustache index 7e690ca1f..ac6d3f8f2 100644 --- a/sdks/python/templates/api_doc.mustache +++ b/sdks/python/templates/api_doc.mustache @@ -1,17 +1,35 @@ +{{^useCustomTemplateCode}} +# {{packageName}}.{{classname}}{{#description}} +{{.}}{{/description}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} # ```{{packageName}}.{{classname}}```{{#description}} {{.}}{{/description}} +{{/useCustomTemplateCode}} All URIs are relative to *{{basePath}}* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- +{{^useCustomTemplateCode}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#operations}}{{#operation}}|[```{{operationId}}```]({{classname}}.md#{{operationId}}) | ```{{httpMethod}} {{path}}``` | {{summary}}| {{/operation}}{{/operations}} +{{/useCustomTemplateCode}} {{#operations}} {{#operation}} +{{^useCustomTemplateCode}} +# **{{{operationId}}}** +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} # ```{{{operationId}}}``` > ```{{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}})``` +{{/useCustomTemplateCode}} {{{summary}}}{{#notes}} @@ -37,11 +55,17 @@ All URIs are relative to *{{basePath}}* {{/isOAuth }} {{/authMethods}} {{/hasAuthMethods}} - {{> api_doc_example }} ### Parameters - +{{^useCustomTemplateCode}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} +{{/allParams}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{^allParams}} This endpoint does not need any parameter. {{/allParams}} @@ -52,6 +76,7 @@ This endpoint does not need any parameter. {{/-first}} | `{{paramName}}` | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | {{/allParams}} +{{/useCustomTemplateCode}} ### Return type @@ -67,7 +92,6 @@ This endpoint does not need any parameter. - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} {{#responses.0}} - ### HTTP response details | Status code | Description | Response headers | diff --git a/sdks/python/templates/api_doc_example.mustache b/sdks/python/templates/api_doc_example.mustache index 587840326..2392430e9 100644 --- a/sdks/python/templates/api_doc_example.mustache +++ b/sdks/python/templates/api_doc_example.mustache @@ -1,3 +1,45 @@ + +{{^useCustomTemplateCode}} +```python +import {{{packageName}}} +{{#vendorExtensions.x-py-example-import}} +{{{.}}} +{{/vendorExtensions.x-py-example-import}} +from {{{packageName}}}.rest import ApiException +from pprint import pprint + +{{> python_doc_auth_partial}} +# Enter a context with an instance of the API client +{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = {{{packageName}}}.{{{classname}}}(api_client) + {{#allParams}} + {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} + + try: + {{#summary}} + # {{{.}}} + {{/summary}} + {{#returnType}}api_response = {{/returnType}}{{#asyncio}}await {{/asyncio}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + {{#returnType}} + print("The response of {{classname}}->{{operationId}}:\n") + pprint(api_response) + {{/returnType}} + except Exception as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +``` + +{{#vendorExtensions.x-py-postponed-example-imports.size}} +{{#vendorExtensions.x-py-postponed-example-imports}} +{{{.}}} +{{/vendorExtensions.x-py-postponed-example-imports}} +{{classname}}.update_forward_refs() +{{/vendorExtensions.x-py-postponed-example-imports.size}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ```python REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Python_CODE ``` +{{/useCustomTemplateCode}} +``` \ No newline at end of file diff --git a/sdks/python/templates/api_response.mustache b/sdks/python/templates/api_response.mustache new file mode 100644 index 000000000..9bc7c11f6 --- /dev/null +++ b/sdks/python/templates/api_response.mustache @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/sdks/python/templates/api_test.mustache b/sdks/python/templates/api_test.mustache index 8f3d764d0..5354d3cba 100644 --- a/sdks/python/templates/api_test.mustache +++ b/sdks/python/templates/api_test.mustache @@ -1,26 +1,27 @@ +# coding: utf-8 + {{>partial_header}} import unittest -import {{packageName}} -from {{apiPackage}}.{{classFilename}} import {{classname}} # noqa: E501 +from {{apiPackage}}.{{classFilename}} import {{classname}} class {{#operations}}Test{{classname}}(unittest.TestCase): """{{classname}} unit test stubs""" - def setUp(self): - self.api = {{classname}}() # noqa: E501 + def setUp(self) -> None: + self.api = {{classname}}() - def tearDown(self): + def tearDown(self) -> None: pass {{#operation}} - def test_{{operationId}}(self): + def test_{{operationId}}(self) -> None: """Test case for {{{operationId}}} {{#summary}} - {{{.}}} # noqa: E501 + {{{.}}} {{/summary}} """ pass diff --git a/sdks/python/templates/asyncio/rest.mustache b/sdks/python/templates/asyncio/rest.mustache index d69e7fd83..c3f864368 100644 --- a/sdks/python/templates/asyncio/rest.mustache +++ b/sdks/python/templates/asyncio/rest.mustache @@ -1,46 +1,54 @@ +# coding: utf-8 + {{>partial_header}} import io import json -import logging import re import ssl +from typing import Optional, Union import aiohttp -# python 2 and python 3 compatibility library -from six.moves.urllib.parse import urlencode +import aiohttp_retry from {{packageName}}.exceptions import ApiException, ApiValueError -logger = logging.getLogger(__name__) +RESTResponseType = aiohttp.ClientResponse +ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'}) class RESTResponse(io.IOBase): - def __init__(self, resp, data): - self.aiohttp_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = data + self.data = None + + async def read(self): + if self.data is None: + self.data = await self.response.read() + return self.data def getheaders(self): """Returns a CIMultiDictProxy of the response headers.""" - return self.aiohttp_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.aiohttp_response.headers.get(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # maxsize is number of requests to host that are allowed in parallel - if maxsize is None: - maxsize = configuration.connection_pool_maxsize + maxsize = configuration.connection_pool_maxsize - ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert + ) if configuration.cert_file: ssl_context.load_cert_chain( configuration.cert_file, keyfile=configuration.key_file @@ -64,32 +72,59 @@ class RESTClientObject(object): trust_env=True ) + retries = configuration.retries + self.retry_client: Optional[aiohttp_retry.RetryClient] + if retries is not None: + self.retry_client = aiohttp_retry.RetryClient( + client_session=self.pool_manager, + retry_options=aiohttp_retry.ExponentialRetry( + attempts=retries, + factor=2.0, + start_timeout=0.1, + max_timeout=120.0 + ) + ) + else: + self.retry_client = None + async def close(self): await self.pool_manager.close() - - async def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + if self.retry_client is not None: + await self.retry_client.close() + + async def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Execute request :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. :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. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -98,6 +133,7 @@ class RESTClientObject(object): post_params = post_params or {} headers = headers or {} + # url already contains the URL query string timeout = _request_timeout or 5 * 60 if 'Content-Type' not in headers: @@ -115,16 +151,13 @@ class RESTClientObject(object): if self.proxy_headers: args["proxy_headers"] = self.proxy_headers - if query_params: - args["url"] += '?' + urlencode(query_params) - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: if re.search('json', headers['Content-Type'], re.IGNORECASE): if body is not None: body = json.dumps(body) args["data"] = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': args["data"] = aiohttp.FormData(post_params) elif headers['Content-Type'] == 'multipart/form-data': # must del headers['Content-Type'], or the correct @@ -134,18 +167,20 @@ class RESTClientObject(object): for param in post_params: k, v = param if isinstance(v, tuple) and len(v) == 3: - data.add_field(k, - value=v[1], - filename=v[0], - content_type=v[2]) + data.add_field( + k, + value=v[1], + filename=v[0], + content_type=v[2] + ) else: data.add_field(k, v) args["data"] = data - # Pass a `bytes` parameter directly in the body to support + # Pass a `bytes` or `str` parameter directly in the body to support # other content types than Json when `body` argument is provided # in serialized form - elif isinstance(body, bytes): + elif isinstance(body, str) or isinstance(body, bytes): args["data"] = body else: # Cannot generate the request from given parameters @@ -154,84 +189,17 @@ class RESTClientObject(object): declared content type.""" raise ApiException(status=0, reason=msg) - r = await self.pool_manager.request(**args) - if _preload_content: - - data = await r.read() - r = RESTResponse(r, data) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - async def GET(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - return (await self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def HEAD(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - return (await self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def OPTIONS(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return (await self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def POST(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return (await self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PATCH(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) + pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient] + if self.retry_client is not None and method in ALLOW_RETRY_METHODS: + pool_manager = self.retry_client + else: + pool_manager = self.pool_manager + + r = await pool_manager.request(**args) + + return RESTResponse(r) + + + + + diff --git a/sdks/python/templates/common_README.mustache b/sdks/python/templates/common_README.mustache new file mode 100644 index 000000000..163470c0b --- /dev/null +++ b/sdks/python/templates/common_README.mustache @@ -0,0 +1,115 @@ +{{^useCustomTemplateCode}} +```python +{{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}} +import {{{packageName}}} +from {{{packageName}}}.rest import ApiException +from pprint import pprint +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +{{> python_doc_auth_partial}} + +# Enter a context with an instance of the API client +{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = {{{packageName}}}.{{{classname}}}(api_client) + {{#allParams}} + {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} + + try: + {{#summary}} + # {{{.}}} + {{/summary}} + {{#returnType}}api_response = {{/returnType}}{{#asyncio}}await {{/asyncio}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + {{#returnType}} + print("The response of {{classname}}->{{operationId}}:\n") + pprint(api_response) + {{/returnType}} + except ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +```python +REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Python_CODE +``` +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{^useCustomTemplateCode}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +{{#apiInfo}}{{#apis}}{{#operations}}|{{#operation}}```{{classname}}``` | [```{{operationId}}```]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | ```{{httpMethod}} {{path}}``` | {{summary}}| +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} + + +## Documentation For Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{{name}}} + +{{#isApiKey}} +- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}} +{{#isBasicBasic}} +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} +- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} +- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{/isBasic}} +{{#isOAuth}} +- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorization URL**: {{{authorizationUrl}}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - **{{{scope}}}**: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} +{{/-last}}{{/apis}}{{/apiInfo}} + +{{#useCustomTemplateCode}} +## About this package + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{^hideGenerationTimestamp}} + - Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} +{{/useCustomTemplateCode}} diff --git a/sdks/python/templates/configuration.mustache b/sdks/python/templates/configuration.mustache index 150aff3b4..009658941 100644 --- a/sdks/python/templates/configuration.mustache +++ b/sdks/python/templates/configuration.mustache @@ -1,16 +1,18 @@ +# coding: utf-8 + {{>partial_header}} import copy import logging +from logging import FileHandler {{^asyncio}} import multiprocessing {{/asyncio}} import sys +from typing import Optional import urllib3 -from http import client as http_client -from {{packageName}}.exceptions import ApiValueError - +import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -18,46 +20,23 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. +class Configuration: + """This class contains various settings of the API client. - :param host: Base url + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. {{#hasHttpSignatureMethods}} :param signing_info: Configuration parameters for the HTTP signature security scheme. Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration @@ -70,9 +49,11 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format + in PEM format. + :param retries: Number of retries for API requests. {{#hasAuthMethods}} :Example: @@ -110,8 +91,13 @@ conf = {{{packageName}}}.Configuration( Configure API client with HTTP basic authentication: conf = {{{packageName}}}.Configuration( +{{^useCustomTemplateCode}} username='the-user', password='the-password', +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + username='YOUR_API_KEY', +{{/useCustomTemplateCode}} ) {{/hasHttpBasicMethods}} @@ -163,17 +149,19 @@ conf = {{{packageName}}}.Configuration( def __init__(self, host=None, api_key=None, api_key_prefix=None, - access_token=None, username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", + access_token=None, {{#hasHttpSignatureMethods}} signing_info=None, {{/hasHttpSignatureMethods}} server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, - ): + retries=None, + *, + debug: Optional[bool] = None + ) -> None: """Constructor """ self._base_path = "{{{basePath}}}" if host is None else host @@ -187,13 +175,20 @@ conf = {{{packageName}}}.Configuration( self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} +{{^useCustomTemplateCode}} if api_key: +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + if api_key and not username: +{{/useCustomTemplateCode}} self.api_key = api_key """dict to store API key(s) """ @@ -211,8 +206,9 @@ conf = {{{packageName}}}.Configuration( self.password = password """Password for HTTP basic authentication """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations + self.access_token = access_token + """Access token + """ {{#hasHttpSignatureMethods}} if signing_info is not None: signing_info.host = host @@ -231,13 +227,16 @@ conf = {{{packageName}}}.Configuration( self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -258,6 +257,10 @@ conf = {{{packageName}}}.Configuration( self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ {{#asyncio}} self.connection_pool_maxsize = 100 @@ -275,26 +278,32 @@ conf = {{{packageName}}}.Configuration( """ {{/asyncio}} - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation self.client_side_validation = True - # Options to pass down to the underlying urllib3 socket self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "{{{datetimeFormat}}}" + """datetime format + """ + + self.date_format = "{{{dateFormat}}}" + """date format + """ def __deepcopy__(self, memo): cls = self.__class__ @@ -312,13 +321,6 @@ conf = {{{packageName}}}.Configuration( def __setattr__(self, name, value): object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s {{#hasHttpSignatureMethods}} if name == "signing_info" and value is not None: # Ensure the host parameter from signing info is the same as @@ -335,21 +337,31 @@ conf = {{{packageName}}}.Configuration( :param default: object of Configuration """ - cls._default = copy.deepcopy(default) + cls._default = default @classmethod def get_default_copy(cls): - """Return new instance of configuration. + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default - configuration passed by the set_default method. + configuration. :return: The configuration object. """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() + if cls._default is None: + cls._default = Configuration() + return cls._default @property def logger_file(self): @@ -403,15 +415,15 @@ conf = {{{packageName}}}.Configuration( # if debug status is True, turn on debug logging for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 @property def logger_format(self): @@ -489,7 +501,12 @@ conf = {{{packageName}}}.Configuration( {{/isApiKey}} {{#isBasic}} {{#isBasicBasic}} - if self.username is not None or self.password is not None: +{{^useCustomTemplateCode}} + if self.username is not None and self.password is not None: +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + if self.username is not None: +{{/useCustomTemplateCode}} auth['{{name}}'] = { 'type': 'basic', 'in': 'header', diff --git a/sdks/python/templates/exceptions.mustache b/sdks/python/templates/exceptions.mustache index 046dcd9a5..65781d4c2 100644 --- a/sdks/python/templates/exceptions.mustache +++ b/sdks/python/templates/exceptions.mustache @@ -1,5 +1,11 @@ -{{>partial_header}} +# coding: utf-8 +{{>partial_header}} +from typing import Any, Optional +from typing_extensions import Self +{{#useCustomTemplateCode}} +from dropbox_sign.models.error_response import ErrorResponse +{{/useCustomTemplateCode}} class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -7,7 +13,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -35,7 +41,7 @@ class ApiTypeError(OpenApiException, TypeError): class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -53,7 +59,7 @@ class ApiValueError(OpenApiException, ValueError): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -72,7 +78,7 @@ class ApiAttributeError(OpenApiException, AttributeError): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -90,17 +96,61 @@ class ApiKeyError(OpenApiException, KeyError): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body +{{^useCustomTemplateCode}} + self.data = data +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + self.data: ErrorResponse = data +{{/useCustomTemplateCode}} + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -110,34 +160,30 @@ class ApiException(OpenApiException): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message -class NotFoundException(ApiException): +class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) +class NotFoundException(ApiException): + pass -class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) +class UnauthorizedException(ApiException): + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) + pass def render_path(path_to_item): diff --git a/sdks/python/templates/github-workflow.mustache b/sdks/python/templates/github-workflow.mustache new file mode 100644 index 000000000..868124c0b --- /dev/null +++ b/sdks/python/templates/github-workflow.mustache @@ -0,0 +1,39 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: {{packageName}} Python package +{{=<% %>=}} + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/sdks/python/templates/gitignore.mustache b/sdks/python/templates/gitignore.mustache index 491b7085b..609c20138 100644 --- a/sdks/python/templates/gitignore.mustache +++ b/sdks/python/templates/gitignore.mustache @@ -65,4 +65,7 @@ target/ #Ipython Notebook .ipynb_checkpoints +{{#useCustomTemplateCode}} +.openapi-generator /vendor +{{/useCustomTemplateCode}} \ No newline at end of file diff --git a/sdks/python/templates/gitlab-ci.mustache b/sdks/python/templates/gitlab-ci.mustache index cf785a80a..8a6130a2f 100644 --- a/sdks/python/templates/gitlab-ci.mustache +++ b/sdks/python/templates/gitlab-ci.mustache @@ -1,29 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# # ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml stages: - test -.tests: +.pytest: stage: test script: - pip install -r requirements.txt - pip install -r test-requirements.txt - {{#useNose}} - - nosetests - {{/useNose}} - {{^useNose}} - pytest --cov={{{packageName}}} - {{/useNose}} -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests +pytest-3.7: + extends: .pytest image: python:3.7-alpine -test-3.8: - extends: .tests +pytest-3.8: + extends: .pytest image: python:3.8-alpine -test-3.9: - extends: .tests +pytest-3.9: + extends: .pytest image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine diff --git a/sdks/python/templates/model.mustache b/sdks/python/templates/model.mustache index e6705eb48..84792dde1 100644 --- a/sdks/python/templates/model.mustache +++ b/sdks/python/templates/model.mustache @@ -1,87 +1,14 @@ -{{> partial_header }} +# coding: utf-8 -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from {{packageName}} import ApiClient -from {{packageName}}.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from {{packageName}}.exceptions import ApiAttributeError -{{#imports}} -{{#-first}} -if TYPE_CHECKING: -{{/-first}} - {{{import}}} -{{/imports}} +{{>partial_header}} {{#models}} {{#model}} -{{#discriminator}} -{{#-first}} -if TYPE_CHECKING: -{{/-first}} -{{#discriminator.mappedModels}} - from {{packageName}}.models import {{modelName}} -{{#-last}} - -{{/-last}} -{{/discriminator.mappedModels}} - -def lazy_import(): -{{#discriminator.mappedModels}} - from {{packageName}}.models import {{modelName}} -{{/discriminator.mappedModels}} -{{#discriminator.mappedModels}} - globals()['{{modelName}}'] = {{modelName}} -{{/discriminator.mappedModels}} -{{/discriminator}} -{{#imports}} -{{#-first}} - -def lazy_import(): -{{/-first}} - {{{.}}} -{{/imports}} - - -{{^interfaces}} -{{#isArray}} -{{> model_templates/model_simple }} -{{/isArray}} {{#isEnum}} -{{> model_templates/model_simple }} +{{>model_enum}} {{/isEnum}} -{{#isAlias}} -{{> model_templates/model_simple }} -{{/isAlias}} -{{^isArray}} {{^isEnum}} -{{^isAlias}} -{{> model_templates/model_normal }} -{{/isAlias}} +{{#oneOf}}{{#-first}}{{>model_oneof}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>model_anyof}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>model_generic}}{{/anyOf}}{{/oneOf}} {{/isEnum}} -{{/isArray}} -{{/interfaces}} -{{#interfaces}} -{{#-last}} -{{> model_templates/model_composed }} -{{/-last}} -{{/interfaces}} {{/model}} {{/models}} \ No newline at end of file diff --git a/sdks/python/templates/model_anyof.mustache b/sdks/python/templates/model_anyof.mustache new file mode 100644 index 000000000..e035e4829 --- /dev/null +++ b/sdks/python/templates/model_anyof.mustache @@ -0,0 +1,182 @@ +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +{{#vendorExtensions.x-py-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-model-imports}} +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +{{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ANY_OF_SCHEMAS = [{{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}}] + +class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): + """ + {{{description}}}{{^description}}{{{classname}}}{{/description}} + """ + +{{#composedSchemas.anyOf}} + # data type: {{{dataType}}} + {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}} +{{/composedSchemas.anyOf}} + if TYPE_CHECKING: + actual_instance: Optional[Union[{{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { {{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}} } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } +{{#discriminator}} + + discriminator_value_class_map: Dict[str, str] = { +{{#children}} + '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}} +{{/children}} + } +{{/discriminator}} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + {{#isNullable}} + if v is None: + return v + + {{/isNullable}} + instance = {{{classname}}}.model_construct() + error_messages = [] + {{#composedSchemas.anyOf}} + # validate data type: {{{dataType}}} + {{#isContainer}} + try: + instance.{{vendorExtensions.x-py-name}} = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} + try: + instance.{{vendorExtensions.x-py-name}} = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if not isinstance(v, {{{dataType}}}): + error_messages.append(f"Error! Input type `{type(v)}` is not `{{{dataType}}}`") + else: + return v + + {{/isPrimitiveType}} + {{/isContainer}} + {{/composedSchemas.anyOf}} + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in {{{classname}}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + {{#isNullable}} + if json_str is None: + return instance + + {{/isNullable}} + error_messages = [] + {{#composedSchemas.anyOf}} + {{#isContainer}} + # deserialize data into {{{dataType}}} + try: + # validation + instance.{{vendorExtensions.x-py-name}} = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.{{vendorExtensions.x-py-name}} + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} + # deserialize data into {{{dataType}}} + try: + # validation + instance.{{vendorExtensions.x-py-name}} = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.{{vendorExtensions.x-py-name}} + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{^isPrimitiveType}} + # {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}} + try: + instance.actual_instance = {{{dataType}}}.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{/isContainer}} + {{/composedSchemas.anyOf}} + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into {{{classname}}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], {{#anyOf}}{{.}}{{^-last}}, {{/-last}}{{/anyOf}}]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + +{{#vendorExtensions.x-py-postponed-model-imports.size}} +{{#vendorExtensions.x-py-postponed-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-postponed-model-imports}} +# TODO: Rewrite to not use raise_errors +{{classname}}.model_rebuild(raise_errors=False) +{{/vendorExtensions.x-py-postponed-model-imports.size}} diff --git a/sdks/python/templates/model_doc.mustache b/sdks/python/templates/model_doc.mustache index b81c150bd..a63aea6a0 100644 --- a/sdks/python/templates/model_doc.mustache +++ b/sdks/python/templates/model_doc.mustache @@ -1,15 +1,56 @@ {{#models}}{{#model}}# {{classname}} +{{^useCustomTemplateCode}} +{{#description}}{{&description}} +{{/description}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{unescapedDescription}} +{{/useCustomTemplateCode}} +{{^useCustomTemplateCode}} +{{^isEnum}} ## Properties -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -{{#vars}}| `{{name}}`{{#required}}*_required_{{/required}} | {{#isPrimitiveType}}```{{{dataType}}}```{{/isPrimitiveType}}{{^isPrimitiveType}}[```{{{dataType}}}```]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{#isReadOnly}} [readonly]{{/isReadOnly}}{{#defaultValue}} [default to {{{.}}}]{{/defaultValue}} | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} +## Example + +```python +from {{modelPackage}}.{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}} import {{classname}} + +# TODO update the JSON string below +json = "{}" +# create an instance of {{classname}} from a JSON string +{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_instance = {{classname}}.from_json(json) +# print the JSON string representation of the object +print({{classname}}.to_json()) + +# convert the object into a dict +{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict = {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_instance.to_dict() +# create an instance of {{classname}} from a dict +{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_from_dict = {{classname}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) +``` +{{/isEnum}} +{{#isEnum}} +## Enum +{{#allowableValues}}{{#enumVars}} +* `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} +{{/isEnum}} +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}| `{{name}}`{{#required}}*_required_{{/required}} | {{#isPrimitiveType}}```{{{dataType}}}```{{/isPrimitiveType}}{{^isPrimitiveType}}[```{{{dataType}}}```]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{#isReadOnly}} [readonly]{{/isReadOnly}}{{#defaultValue}} [default to {{{.}}}]{{/defaultValue}} | +{{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +{{/useCustomTemplateCode}} -{{/model}}{{/models}} +{{/model}}{{/models}} \ No newline at end of file diff --git a/sdks/python/templates/model_enum.mustache b/sdks/python/templates/model_enum.mustache new file mode 100644 index 000000000..3f449b121 --- /dev/null +++ b/sdks/python/templates/model_enum.mustache @@ -0,0 +1,36 @@ +from __future__ import annotations +import json +from enum import Enum +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +from typing_extensions import Self + + +class {{classname}}({{vendorExtensions.x-py-enum-type}}, Enum): + """ + {{{description}}}{{^description}}{{{classname}}}{{/description}} + """ + + """ + allowed enum values + """ +{{#allowableValues}} + {{#enumVars}} + {{{name}}} = {{{value}}} + {{/enumVars}} + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of {{classname}} from a JSON string""" + return cls(json.loads(json_str)) + + {{#defaultValue}} + + # + @classmethod + def _missing_value_(cls, value): + if value is no_arg: + return cls.{{{.}}} + {{/defaultValue}} +{{/allowableValues}} diff --git a/sdks/python/templates/model_generic.mustache b/sdks/python/templates/model_generic.mustache new file mode 100644 index 000000000..6ffec5380 --- /dev/null +++ b/sdks/python/templates/model_generic.mustache @@ -0,0 +1,470 @@ +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +{{#vendorExtensions.x-py-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-model-imports}} +{{^useCustomTemplateCode}} +from typing import Optional, Set +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +from typing import Optional, Set, Tuple +{{/useCustomTemplateCode}} +from typing_extensions import Self +{{#useCustomTemplateCode}} +import io +from pydantic import StrictBool +from typing import Union +{{/useCustomTemplateCode}} + +{{#hasChildren}} +{{#discriminator}} +{{! If this model is a super class, importlib is used. So import the necessary modules for the type here. }} +from typing import TYPE_CHECKING +if TYPE_CHECKING: +{{#mappedModels}} + from {{packageName}}.models.{{model.classVarName}} import {{modelName}} +{{/mappedModels}} + +{{/discriminator}} +{{/hasChildren}} +class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): + """ + {{#description}}{{{description}}}{{/description}}{{^description}}{{{classname}}}{{/description}} + """ # noqa: E501 +{{#vars}} +{{^useCustomTemplateCode}} + {{name}}: {{{vendorExtensions.x-py-typing}}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + {{name}}: {{#vendorExtensions.x-int-or-string}}Union[StrictStr, StrictInt{{#isNullable}}, None{{/isNullable}}]{{#description}} = Field(description="{{{description}}}"){{/description}}{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{vendorExtensions.x-py-typing}}}{{/vendorExtensions.x-int-or-string}} +{{/useCustomTemplateCode}} +{{/vars}} +{{#isAdditionalPropertiesTrue}} + additional_properties: Dict[str, Any] = {} +{{/isAdditionalPropertiesTrue}} + __properties: ClassVar[List[str]] = [{{#allVars}}"{{baseName}}"{{^-last}}, {{/-last}}{{/allVars}}] +{{#vars}} + {{#vendorExtensions.x-regex}} + + @field_validator('{{{name}}}') + def {{{name}}}_validate_regular_expression(cls, value): + """Validates the regular expression""" + {{^required}} + if value is None: + return value + + {{/required}} + {{#required}} + {{#isNullable}} + if value is None: + return value + + {{/isNullable}} + {{/required}} + if not re.match(r"{{{.}}}", value{{#vendorExtensions.x-modifiers}} ,re.{{{.}}}{{/vendorExtensions.x-modifiers}}): + raise ValueError(r"must validate the regular expression {{{vendorExtensions.x-pattern}}}") + return value + {{/vendorExtensions.x-regex}} + {{#isEnum}} + + @field_validator('{{{name}}}') + def {{{name}}}_validate_enum(cls, value): + """Validates the enum""" + {{^required}} + if value is None: + return value + + {{/required}} + {{#required}} + {{#isNullable}} + if value is None: + return value + + {{/isNullable}} + {{/required}} + {{#isArray}} + for i in value: + if i not in set([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]): + raise ValueError("each list item must be one of ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isArray}} + {{^isArray}} + if value not in set([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]): + raise ValueError("must be one of enum values ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isArray}} + return value + {{/isEnum}} +{{/vars}} + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), +{{#useCustomTemplateCode}} + arbitrary_types_allowed=True, +{{/useCustomTemplateCode}} + ) + + +{{#hasChildren}} +{{#discriminator}} + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = '{{discriminator.propertyBaseName}}' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + {{#mappedModels}}'{{{mappingName}}}': '{{{modelName}}}'{{^-last}},{{/-last}}{{/mappedModels}} + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + +{{/discriminator}} +{{/hasChildren}} + 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()) +{{#useCustomTemplateCode}} + + 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 +{{/useCustomTemplateCode}} + + @classmethod + def from_json(cls, json_str: str) -> Optional[{{^hasChildren}}Self{{/hasChildren}}{{#hasChildren}}{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}{{/hasChildren}}]: + """Create an instance of {{{classname}}} from a JSON string""" + return cls.from_dict(json.loads(json_str)) + +{{^useCustomTemplateCode}} + def to_dict(self) -> Dict[str, Any]: +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: +{{/useCustomTemplateCode}} + """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. + {{#vendorExtensions.x-py-readonly}} + * OpenAPI `readOnly` fields are excluded. + {{/vendorExtensions.x-py-readonly}} + {{#isAdditionalPropertiesTrue}} + * Fields in `self.additional_properties` are added to the output dict. + {{/isAdditionalPropertiesTrue}} + """ +{{^useCustomTemplateCode}} + excluded_fields: Set[str] = set([ + {{#vendorExtensions.x-py-readonly}} + "{{{.}}}", + {{/vendorExtensions.x-py-readonly}} + {{#isAdditionalPropertiesTrue}} + "additional_properties", + {{/isAdditionalPropertiesTrue}} + ]) +{{/useCustomTemplateCode}} + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + {{#allVars}} + {{#isContainer}} + {{#isArray}} + {{#items.isArray}} + {{^items.items.isPrimitiveType}} + # override the default output from pydantic by calling `to_dict()` of each item in {{{name}}} (list of list) + _items = [] + if self.{{{name}}}: + for _item_{{{name}}} in self.{{{name}}}: + if _item_{{{name}}}: + _items.append( + [_inner_item.to_dict() for _inner_item in _item_{{{name}}} if _inner_item is not None] + ) + _dict['{{{baseName}}}'] = _items + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of each item in {{{name}}} (list) + _items = [] + if self.{{{name}}}: + for _item_{{{name}}} in self.{{{name}}}: + if _item_{{{name}}}: + _items.append(_item_{{{name}}}.to_dict()) + _dict['{{{baseName}}}'] = _items + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isArray}} + {{#isMap}} + {{#items.isArray}} + {{^items.items.isPrimitiveType}} + # override the default output from pydantic by calling `to_dict()` of each value in {{{name}}} (dict of array) + _field_dict_of_array = {} + if self.{{{name}}}: + for _key_{{{name}}} in self.{{{name}}}: + if self.{{{name}}}[_key_{{{name}}}] is not None: + _field_dict_of_array[_key_{{{name}}}] = [ + _item.to_dict() for _item in self.{{{name}}}[_key_{{{name}}}] + ] + _dict['{{{baseName}}}'] = _field_dict_of_array + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of each value in {{{name}}} (dict) + _field_dict = {} + if self.{{{name}}}: + for _key_{{{name}}} in self.{{{name}}}: + if self.{{{name}}}[_key_{{{name}}}]: + _field_dict[_key_{{{name}}}] = self.{{{name}}}[_key_{{{name}}}].to_dict() + _dict['{{{baseName}}}'] = _field_dict + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + {{^isPrimitiveType}} + {{^isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of {{{name}}} + if self.{{{name}}}: + _dict['{{{baseName}}}'] = self.{{{name}}}.to_dict() + {{/isEnumOrRef}} + {{/isPrimitiveType}} + {{/isContainer}} + {{/allVars}} + {{#isAdditionalPropertiesTrue}} + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + {{/isAdditionalPropertiesTrue}} +{{^useCustomTemplateCode}} + {{#allVars}} + {{#isNullable}} + # set to None if {{{name}}} (nullable) is None + # and model_fields_set contains the field + if self.{{name}} is None and "{{{name}}}" in self.model_fields_set: + _dict['{{{baseName}}}'] = None + + {{/isNullable}} + {{/allVars}} +{{/useCustomTemplateCode}} + return _dict + + {{#hasChildren}} + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}]: + """Create an instance of {{{classname}}} from a dict""" + {{#discriminator}} + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + {{#mappedModels}} + if object_type == '{{{modelName}}}': + return import_module("{{packageName}}.models.{{model.classVarName}}").{{modelName}}.from_dict(obj) + {{/mappedModels}} + + raise ValueError("{{{classname}}} failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + {{/discriminator}} + {{/hasChildren}} + {{^hasChildren}} + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of {{{classname}}} from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + {{#disallowAdditionalPropertiesIfNotPresent}} + {{^isAdditionalPropertiesTrue}} + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in {{classname}}) in the input: " + _key) + + {{/isAdditionalPropertiesTrue}} + {{/disallowAdditionalPropertiesIfNotPresent}} + _obj = cls.model_validate({ + {{#allVars}} + {{#isContainer}} + {{#isArray}} + {{#items.isArray}} + {{#items.items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.items.isPrimitiveType}} + {{^items.items.isPrimitiveType}} + "{{{baseName}}}": [ + [{{{items.items.dataType}}}.from_dict(_inner_item) for _inner_item in _item] + for _item in obj["{{{baseName}}}"] + ] if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{#items.isEnumOrRef}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{^items.isEnumOrRef}} + "{{{baseName}}}": [{{{items.dataType}}}.from_dict(_item) for _item in obj["{{{baseName}}}"]] if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{#items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isArray}} + {{#isMap}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + {{#items.isContainer}} + {{#items.isMap}} + "{{{baseName}}}": dict( + (_k, dict( + (_ik, {{{items.items.dataType}}}.from_dict(_iv)) + for _ik, _iv in _v.items() + ) + if _v is not None + else None + ) + for _k, _v in obj.get("{{{baseName}}}").items() + ) + if obj.get("{{{baseName}}}") is not None + else None{{^-last}},{{/-last}} + {{/items.isMap}} + {{#items.isArray}} + "{{{baseName}}}": dict( + (_k, + [{{{items.items.dataType}}}.from_dict(_item) for _item in _v] + if _v is not None + else None + ) + for _k, _v in obj.get("{{{baseName}}}", {}).items() + ){{^-last}},{{/-last}} + {{/items.isArray}} + {{/items.isContainer}} + {{^items.isContainer}} + "{{{baseName}}}": dict( + (_k, {{{items.dataType}}}.from_dict(_v)) + for _k, _v in obj["{{{baseName}}}"].items() + ) + if obj.get("{{{baseName}}}") is not None + else None{{^-last}},{{/-last}} + {{/items.isContainer}} + {{/items.isEnumOrRef}} + {{#items.isEnumOrRef}} + "{{{baseName}}}": dict((_k, _v) for _k, _v in obj.get("{{{baseName}}}").items()){{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{#items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isPrimitiveType}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + {{^isPrimitiveType}} + {{^isEnumOrRef}} + "{{{baseName}}}": {{{dataType}}}.from_dict(obj["{{{baseName}}}"]) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/isEnumOrRef}} + {{#isEnumOrRef}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{#defaultValue}} if obj.get("{{baseName}}") is not None else {{defaultValue}}{{/defaultValue}}{{^-last}},{{/-last}} + {{/isEnumOrRef}} + {{/isPrimitiveType}} + {{#isPrimitiveType}} + {{#defaultValue}} + "{{{baseName}}}": obj.get("{{{baseName}}}") if obj.get("{{{baseName}}}") is not None else {{{defaultValue}}}{{^-last}},{{/-last}} + {{/defaultValue}} + {{^defaultValue}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/defaultValue}} + {{/isPrimitiveType}} + {{/isContainer}} + {{/allVars}} + }) + {{#isAdditionalPropertiesTrue}} + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + {{/isAdditionalPropertiesTrue}} + return _obj + {{/hasChildren}} + +{{#useCustomTemplateCode}} +{{^discriminator}} + @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) +{{/discriminator}} + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { +{{#requiredVars}} + "{{name}}": "({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},)", +{{/requiredVars}} +{{#optionalVars}} + "{{name}}": "({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},)", +{{/optionalVars}} + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + {{#vars}} + {{#isArray}} + "{{{name}}}", + {{/isArray}} + {{/vars}} + ] +{{/useCustomTemplateCode}} +{{#vendorExtensions.x-py-postponed-model-imports.size}} +{{#vendorExtensions.x-py-postponed-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-postponed-model-imports}} +# TODO: Rewrite to not use raise_errors +{{classname}}.model_rebuild(raise_errors=False) +{{/vendorExtensions.x-py-postponed-model-imports.size}} diff --git a/sdks/python/templates/model_oneof.mustache b/sdks/python/templates/model_oneof.mustache new file mode 100644 index 000000000..07a4d93f9 --- /dev/null +++ b/sdks/python/templates/model_oneof.mustache @@ -0,0 +1,209 @@ +from __future__ import annotations +import json +import pprint +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +{{#vendorExtensions.x-py-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-model-imports}} +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +{{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ONE_OF_SCHEMAS = [{{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}}] + +class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): + """ + {{{description}}}{{^description}}{{{classname}}}{{/description}} + """ +{{#composedSchemas.oneOf}} + # data type: {{{dataType}}} + {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}} +{{/composedSchemas.oneOf}} + actual_instance: Optional[Union[{{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}]] = None + one_of_schemas: Set[str] = { {{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}} } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + +{{#discriminator}} + + discriminator_value_class_map: Dict[str, str] = { +{{#children}} + '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}} +{{/children}} + } +{{/discriminator}} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + {{#isNullable}} + if v is None: + return v + + {{/isNullable}} + instance = {{{classname}}}.model_construct() + error_messages = [] + match = 0 + {{#composedSchemas.oneOf}} + # validate data type: {{{dataType}}} + {{#isContainer}} + try: + instance.{{vendorExtensions.x-py-name}} = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} + try: + instance.{{vendorExtensions.x-py-name}} = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if not isinstance(v, {{{dataType}}}): + error_messages.append(f"Error! Input type `{type(v)}` is not `{{{dataType}}}`") + else: + match += 1 + {{/isPrimitiveType}} + {{/isContainer}} + {{/composedSchemas.oneOf}} + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + {{#isNullable}} + def from_json(cls, json_str: Optional[str]) -> Self: + {{/isNullable}} + {{^isNullable}} + def from_json(cls, json_str: str) -> Self: + {{/isNullable}} + """Returns the object represented by the json string""" + instance = cls.model_construct() + {{#isNullable}} + if json_str is None: + return instance + + {{/isNullable}} + error_messages = [] + match = 0 + + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + {{#mappedModels}} + {{#-first}} + # use oneOf discriminator to lookup the data type + _data_type = json.loads(json_str).get("{{{propertyBaseName}}}") + if not _data_type: + raise ValueError("Failed to lookup data type from the field `{{{propertyBaseName}}}` in the input.") + + {{/-first}} + # check if data type is `{{{modelName}}}` + if _data_type == "{{{mappingName}}}": + instance.actual_instance = {{{modelName}}}.from_json(json_str) + return instance + + {{/mappedModels}} + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + {{#composedSchemas.oneOf}} + {{#isContainer}} + # deserialize data into {{{dataType}}} + try: + # validation + instance.{{vendorExtensions.x-py-name}} = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.{{vendorExtensions.x-py-name}} + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} + # deserialize data into {{{dataType}}} + try: + # validation + instance.{{vendorExtensions.x-py-name}} = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.{{vendorExtensions.x-py-name}} + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{^isPrimitiveType}} + # deserialize data into {{{dataType}}} + try: + instance.actual_instance = {{{dataType}}}.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{/isContainer}} + {{/composedSchemas.oneOf}} + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + +{{#vendorExtensions.x-py-postponed-model-imports.size}} +{{#vendorExtensions.x-py-postponed-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-postponed-model-imports}} +# TODO: Rewrite to not use raise_errors +{{classname}}.model_rebuild(raise_errors=False) +{{/vendorExtensions.x-py-postponed-model-imports.size}} diff --git a/sdks/python/templates/model_templates/classvars.mustache b/sdks/python/templates/model_templates/classvars.mustache deleted file mode 100644 index e22c33e58..000000000 --- a/sdks/python/templates/model_templates/classvars.mustache +++ /dev/null @@ -1,157 +0,0 @@ - allowed_values = { -{{#isEnum}} - ('value',): { -{{#isNullable}} - 'None': None, -{{/isNullable}} -{{#allowableValues}} -{{#enumVars}} - '{{name}}': {{{value}}}, -{{/enumVars}} -{{/allowableValues}} - }, -{{/isEnum}} -{{#requiredVars}} -{{#isEnum}} - ('{{name}}',): { -{{#isNullable}} - 'None': None, -{{/isNullable}} -{{#allowableValues}} -{{#enumVars}} - '{{name}}': {{{value}}}, -{{/enumVars}} -{{/allowableValues}} - }, -{{/isEnum}} -{{/requiredVars}} -{{#optionalVars}} -{{#isEnum}} - ('{{name}}',): { -{{#isNullable}} - 'None': None, -{{/isNullable}} -{{#allowableValues}} -{{#enumVars}} - '{{name}}': {{{value}}}, -{{/enumVars}} -{{/allowableValues}} - }, -{{/isEnum}} -{{/optionalVars}} - } - - validations = { -{{#hasValidation}} - ('value',): { -{{> model_templates/validations }} -{{/hasValidation}} -{{#requiredVars}} -{{#hasValidation}} - ('{{name}}',): { -{{> model_templates/validations }} -{{/hasValidation}} -{{/requiredVars}} -{{#optionalVars}} -{{#hasValidation}} - ('{{name}}',): { -{{> model_templates/validations }} -{{/hasValidation}} -{{/optionalVars}} - } - -{{#additionalProperties}} - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ -{{#discriminator}} -{{^imports}} - lazy_import() -{{/imports}} -{{/discriminator}} -{{#imports}} -{{#-first}} - lazy_import() -{{/-first}} -{{/imports}} - return ({{{dataType}}},) # noqa: E501 -{{/additionalProperties}} -{{^additionalProperties}} - additional_properties_type = None -{{/additionalProperties}} - - _nullable = {{#isNullable}}True{{/isNullable}}{{^isNullable}}False{{/isNullable}} - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ -{{#discriminator}} -{{^imports}} - lazy_import() -{{/imports}} -{{/discriminator}} -{{#imports}} -{{#-first}} - lazy_import() -{{/-first}} -{{/imports}} - return { -{{#isAlias}} - 'value': ({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},), -{{/isAlias}} -{{#isEnum}} - 'value': ({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},), -{{/isEnum}} -{{#isArray}} - 'value': ({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},), -{{/isArray}} -{{#requiredVars}} - '{{name}}': ({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},), # noqa: E501 -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': ({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},), # noqa: E501 -{{/optionalVars}} - } - - @cached_property - def discriminator(): -{{^discriminator}} - return None -{{/discriminator}} -{{#discriminator}} - lazy_import() - val = { -{{#mappedModels}} - '{{mappingName}}': {{{modelName}}}, -{{/mappedModels}} - } - if not val: - return None - return {'{{{discriminatorName}}}': val}{{/discriminator}} -{{^discriminator}} - @staticmethod - def init(data: any) -> {{classname}}: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[{{classname}}], - _check_type=True, - ) -{{/discriminator}} diff --git a/sdks/python/templates/model_templates/docstring_allowed.mustache b/sdks/python/templates/model_templates/docstring_allowed.mustache deleted file mode 100644 index ab20932b2..000000000 --- a/sdks/python/templates/model_templates/docstring_allowed.mustache +++ /dev/null @@ -1,4 +0,0 @@ - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. \ No newline at end of file diff --git a/sdks/python/templates/model_templates/docstring_init_required_kwargs.mustache b/sdks/python/templates/model_templates/docstring_init_required_kwargs.mustache deleted file mode 100644 index a9abdf18b..000000000 --- a/sdks/python/templates/model_templates/docstring_init_required_kwargs.mustache +++ /dev/null @@ -1,30 +0,0 @@ - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) \ No newline at end of file diff --git a/sdks/python/templates/model_templates/docstring_openapi_validations.mustache b/sdks/python/templates/model_templates/docstring_openapi_validations.mustache deleted file mode 100644 index f933b86c5..000000000 --- a/sdks/python/templates/model_templates/docstring_openapi_validations.mustache +++ /dev/null @@ -1,7 +0,0 @@ - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. \ No newline at end of file diff --git a/sdks/python/templates/model_templates/invalid_pos_args.mustache b/sdks/python/templates/model_templates/invalid_pos_args.mustache deleted file mode 100644 index 143d50c82..000000000 --- a/sdks/python/templates/model_templates/invalid_pos_args.mustache +++ /dev/null @@ -1,9 +0,0 @@ - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) \ No newline at end of file diff --git a/sdks/python/templates/model_templates/method_from_openapi_data_composed.mustache b/sdks/python/templates/model_templates/method_from_openapi_data_composed.mustache deleted file mode 100644 index ad21665c3..000000000 --- a/sdks/python/templates/model_templates/method_from_openapi_data_composed.mustache +++ /dev/null @@ -1,66 +0,0 @@ - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - - Keyword Args: -{{#requiredVars}} -{{#defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{^defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self \ No newline at end of file diff --git a/sdks/python/templates/model_templates/method_from_openapi_data_normal.mustache b/sdks/python/templates/model_templates/method_from_openapi_data_normal.mustache deleted file mode 100644 index 3b82ba7fc..000000000 --- a/sdks/python/templates/model_templates/method_from_openapi_data_normal.mustache +++ /dev/null @@ -1,17 +0,0 @@ -{{> model_templates/method_from_openapi_data_shared }} - -{{#isEnum}} - self.value = value -{{/isEnum}} -{{#requiredVars}} - self.{{name}} = {{name}} -{{/requiredVars}} - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self \ No newline at end of file diff --git a/sdks/python/templates/model_templates/method_from_openapi_data_shared.mustache b/sdks/python/templates/model_templates/method_from_openapi_data_shared.mustache deleted file mode 100644 index 4b9335fcb..000000000 --- a/sdks/python/templates/model_templates/method_from_openapi_data_shared.mustache +++ /dev/null @@ -1,49 +0,0 @@ - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}, *args, **kwargs): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - -{{#requiredVars}} -{{#-first}} - Args: -{{/-first}} -{{^defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{#-last}} - -{{/-last}} -{{/requiredVars}} - Keyword Args: -{{#requiredVars}} -{{#defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) \ No newline at end of file diff --git a/sdks/python/templates/model_templates/method_from_openapi_data_simple.mustache b/sdks/python/templates/model_templates/method_from_openapi_data_simple.mustache deleted file mode 100644 index 11f237c07..000000000 --- a/sdks/python/templates/model_templates/method_from_openapi_data_simple.mustache +++ /dev/null @@ -1,62 +0,0 @@ - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """{{classname}} - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 - - Keyword Args: - value ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{> model_templates/docstring_init_required_kwargs }} - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) -{{#defaultValue}} - else: - value = {{{.}}} -{{/defaultValue}} -{{^defaultValue}} - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) -{{/defaultValue}} - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self \ No newline at end of file diff --git a/sdks/python/templates/model_templates/method_init_composed.mustache b/sdks/python/templates/model_templates/method_init_composed.mustache deleted file mode 100644 index 15d83c925..000000000 --- a/sdks/python/templates/model_templates/method_init_composed.mustache +++ /dev/null @@ -1,80 +0,0 @@ - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - - Keyword Args: -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{^defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") \ No newline at end of file diff --git a/sdks/python/templates/model_templates/method_init_normal.mustache b/sdks/python/templates/model_templates/method_init_normal.mustache deleted file mode 100644 index bc5e7686f..000000000 --- a/sdks/python/templates/model_templates/method_init_normal.mustache +++ /dev/null @@ -1,30 +0,0 @@ - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - -{{> model_templates/method_init_shared }} - -{{#isEnum}} - self.value = value -{{/isEnum}} -{{#requiredVars}} -{{^isReadOnly}} - self.{{name}} = {{name}} -{{/isReadOnly}} -{{/requiredVars}} - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") \ No newline at end of file diff --git a/sdks/python/templates/model_templates/method_init_shared.mustache b/sdks/python/templates/model_templates/method_init_shared.mustache deleted file mode 100644 index 9debb409a..000000000 --- a/sdks/python/templates/model_templates/method_init_shared.mustache +++ /dev/null @@ -1,52 +0,0 @@ - @convert_js_args_to_python_args - def __init__(self{{#requiredVars}}{{^isReadOnly}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/isReadOnly}}{{/requiredVars}}, *args, **kwargs): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - -{{#requiredVars}} -{{^isReadOnly}} -{{#-first}} - Args: -{{/-first}} -{{^defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{#-last}} - -{{/-last}} -{{/isReadOnly}} -{{/requiredVars}} - Keyword Args: -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) \ No newline at end of file diff --git a/sdks/python/templates/model_templates/method_init_simple.mustache b/sdks/python/templates/model_templates/method_init_simple.mustache deleted file mode 100644 index ec111f6e7..000000000 --- a/sdks/python/templates/model_templates/method_init_simple.mustache +++ /dev/null @@ -1,66 +0,0 @@ - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """{{classname}} - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 - - Keyword Args: - value ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{> model_templates/docstring_init_required_kwargs }} - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) -{{#defaultValue}} - else: - value = {{{.}}} -{{/defaultValue}} -{{^defaultValue}} - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) -{{/defaultValue}} - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) \ No newline at end of file diff --git a/sdks/python/templates/model_templates/method_set_attribute.mustache b/sdks/python/templates/model_templates/method_set_attribute.mustache deleted file mode 100644 index 8ba0529cd..000000000 --- a/sdks/python/templates/model_templates/method_set_attribute.mustache +++ /dev/null @@ -1,51 +0,0 @@ - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value \ No newline at end of file diff --git a/sdks/python/templates/model_templates/methods_setattr_getattr_composed.mustache b/sdks/python/templates/model_templates/methods_setattr_getattr_composed.mustache deleted file mode 100644 index ada739e75..000000000 --- a/sdks/python/templates/model_templates/methods_setattr_getattr_composed.mustache +++ /dev/null @@ -1,103 +0,0 @@ - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False \ No newline at end of file diff --git a/sdks/python/templates/model_templates/methods_setattr_getattr_normal.mustache b/sdks/python/templates/model_templates/methods_setattr_getattr_normal.mustache deleted file mode 100644 index 9540c194d..000000000 --- a/sdks/python/templates/model_templates/methods_setattr_getattr_normal.mustache +++ /dev/null @@ -1,28 +0,0 @@ - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - return None - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] \ No newline at end of file diff --git a/sdks/python/templates/model_templates/methods_shared.mustache b/sdks/python/templates/model_templates/methods_shared.mustache deleted file mode 100644 index eddad2533..000000000 --- a/sdks/python/templates/model_templates/methods_shared.mustache +++ /dev/null @@ -1,34 +0,0 @@ - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.{{#attrNoneIfUnset}}get{{/attrNoneIfUnset}}{{^attrNoneIfUnset}}__getitem__{{/attrNoneIfUnset}}(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return new_cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst diff --git a/sdks/python/templates/model_templates/methods_todict_tostr_eq_shared.mustache b/sdks/python/templates/model_templates/methods_todict_tostr_eq_shared.mustache deleted file mode 100644 index 17c441196..000000000 --- a/sdks/python/templates/model_templates/methods_todict_tostr_eq_shared.mustache +++ /dev/null @@ -1,24 +0,0 @@ - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True \ No newline at end of file diff --git a/sdks/python/templates/model_templates/methods_tostr_eq_simple.mustache b/sdks/python/templates/model_templates/methods_tostr_eq_simple.mustache deleted file mode 100644 index 4a7ef6ae5..000000000 --- a/sdks/python/templates/model_templates/methods_tostr_eq_simple.mustache +++ /dev/null @@ -1,16 +0,0 @@ - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal \ No newline at end of file diff --git a/sdks/python/templates/model_templates/model_composed.mustache b/sdks/python/templates/model_templates/model_composed.mustache deleted file mode 100644 index 92c528d35..000000000 --- a/sdks/python/templates/model_templates/model_composed.mustache +++ /dev/null @@ -1,91 +0,0 @@ -class {{classname}}(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: -{{> model_templates/docstring_allowed }} - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. -{{> model_templates/docstring_openapi_validations }} - """ - -{{> model_templates/classvars }} - - attribute_map = { -{{#requiredVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/optionalVars}} - } - - read_only_vars = { -{{#requiredVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/requiredVars}} -{{#optionalVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/optionalVars}} - } - {{#requiredVars}} - - @property - def {{name}}(self) -> {{#vendorExtensions.x-int-or-string}}Union[int, str]{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}: - return self.get("{{name}}") - {{^isReadOnly}} - - @{{name}}.setter - def {{name}}(self, value: {{#vendorExtensions.x-int-or-string}}Union[int, str]{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}): - setattr(self, "{{name}}", value) - {{/isReadOnly}} - {{/requiredVars}} - {{#optionalVars}} - - @property - def {{name}}(self) -> {{{dataType}}}: - return self.get("{{name}}") - - @{{name}}.setter - def {{name}}(self, value: {{{dataType}}}): - setattr(self, "{{name}}", value) - {{/optionalVars}} - -{{> model_templates/method_from_openapi_data_composed }} - -{{> model_templates/method_init_composed }} - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading -{{#imports}} -{{#-first}} - lazy_import() -{{/-first}} -{{/imports}} - return { - 'anyOf': [ -{{#anyOf}} - {{{.}}}, -{{/anyOf}} - ], - 'oneOf': [ -{{#oneOf}} - {{{.}}}, -{{/oneOf}} - ], - } \ No newline at end of file diff --git a/sdks/python/templates/model_templates/model_normal.mustache b/sdks/python/templates/model_templates/model_normal.mustache deleted file mode 100644 index e1e0ca3f3..000000000 --- a/sdks/python/templates/model_templates/model_normal.mustache +++ /dev/null @@ -1,65 +0,0 @@ -class {{classname}}(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: -{{> model_templates/docstring_allowed }} - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. -{{> model_templates/docstring_openapi_validations }} - """ - -{{> model_templates/classvars }} - attribute_map = { -{{#requiredVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/optionalVars}} - } - - read_only_vars = { -{{#requiredVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/requiredVars}} -{{#optionalVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/optionalVars}} - } - - _composed_schemas = {} - {{#requiredVars}} - - @property - def {{name}}(self) -> {{#vendorExtensions.x-int-or-string}}Union[int, str]{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}: - return self.get("{{name}}") - {{^isReadOnly}} - - @{{name}}.setter - def {{name}}(self, value: {{#vendorExtensions.x-int-or-string}}Union[int, str]{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}): - setattr(self, "{{name}}", value) - {{/isReadOnly}} - {{/requiredVars}} - {{#optionalVars}} - - @property - def {{name}}(self) -> {{{dataType}}}: - return self.get("{{name}}") - - @{{name}}.setter - def {{name}}(self, value: {{{dataType}}}): - setattr(self, "{{name}}", value) - {{/optionalVars}} - -{{> model_templates/method_from_openapi_data_normal}} - -{{> model_templates/method_init_normal}} \ No newline at end of file diff --git a/sdks/python/templates/model_templates/model_simple.mustache b/sdks/python/templates/model_templates/model_simple.mustache deleted file mode 100644 index 1a41a9cf7..000000000 --- a/sdks/python/templates/model_templates/model_simple.mustache +++ /dev/null @@ -1,22 +0,0 @@ -class {{classname}}(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: -{{> model_templates/docstring_allowed }} -{{> model_templates/docstring_openapi_validations }} - """ - -{{> model_templates/classvars }} - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - -{{> model_templates/method_init_simple}} - -{{> model_templates/method_from_openapi_data_simple}} \ No newline at end of file diff --git a/sdks/python/templates/model_templates/validations.mustache b/sdks/python/templates/model_templates/validations.mustache deleted file mode 100644 index 758dc41d9..000000000 --- a/sdks/python/templates/model_templates/validations.mustache +++ /dev/null @@ -1,34 +0,0 @@ -{{#maxLength}} - 'max_length': {{.}}, -{{/maxLength}} -{{#minLength}} - 'min_length': {{.}}, -{{/minLength}} -{{#maxItems}} - 'max_items': {{.}}, -{{/maxItems}} -{{#minProperties}} - 'min_properties': {{.}}, -{{/minProperties}} -{{#maxProperties}} - 'max_properties': {{.}}, -{{/maxProperties}} -{{#minItems}} - 'min_items': {{.}}, -{{/minItems}} -{{#maximum}} - {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum': {{maximum}}, -{{/maximum}} -{{#minimum}} - {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum': {{minimum}}, -{{/minimum}} -{{#pattern}} - 'regex': { - 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} - {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} - }, -{{/pattern}} -{{#multipleOf}} - 'multiple_of': {{.}}, -{{/multipleOf}} - }, \ No newline at end of file diff --git a/sdks/python/templates/model_test.mustache b/sdks/python/templates/model_test.mustache index aa95f6494..08088557c 100644 --- a/sdks/python/templates/model_test.mustache +++ b/sdks/python/templates/model_test.mustache @@ -1,17 +1,13 @@ +# coding: utf-8 + {{>partial_header}} -import sys import unittest -import {{packageName}} {{#models}} {{#model}} -{{#imports}} -{{{.}}} -{{/imports}} from {{modelPackage}}.{{classFilename}} import {{classname}} - class Test{{classname}}(unittest.TestCase): """{{classname}} unit test stubs""" @@ -20,13 +16,42 @@ class Test{{classname}}(unittest.TestCase): def tearDown(self): pass +{{^isEnum}} + + def make_instance(self, include_optional) -> {{classname}}: + """Test {{classname}} + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `{{{classname}}}` + """ + model = {{classname}}() + if include_optional: + return {{classname}}( + {{#vars}} + {{name}} = {{{example}}}{{^example}}None{{/example}}{{^-last}},{{/-last}} + {{/vars}} + ) + else: + return {{classname}}( + {{#vars}} + {{#required}} + {{name}} = {{{example}}}{{^example}}None{{/example}}, + {{/required}} + {{/vars}} + ) + """ +{{/isEnum}} def test{{classname}}(self): """Test {{classname}}""" - # FIXME: construct object with mandatory attributes with example values - # model = {{classname}}() # noqa: E501 - pass - +{{^isEnum}} + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) +{{/isEnum}} +{{#isEnum}} + # inst = {{{classname}}}() +{{/isEnum}} {{/model}} {{/models}} diff --git a/sdks/python/templates/model_utils.mustache b/sdks/python/templates/model_utils.mustache deleted file mode 100644 index c92ed1910..000000000 --- a/sdks/python/templates/model_utils.mustache +++ /dev/null @@ -1,1732 +0,0 @@ -{{>partial_header}} - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile - -from dateutil.parser import parse - -from {{packageName}}.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - -{{> model_templates/method_set_attribute }} - -{{> model_templates/methods_shared }} - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - -{{> model_templates/methods_setattr_getattr_normal }} - -{{> model_templates/methods_tostr_eq_simple }} - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - -{{> model_templates/methods_setattr_getattr_normal }} - -{{> model_templates/methods_todict_tostr_eq_shared}} - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - -{{> model_templates/methods_setattr_getattr_composed }} - -{{> model_templates/methods_todict_tostr_eq_shared}} - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - # leave ints as-is - if type(current_item) is int and required_type_class_simplified == current_type_simple: - results_classes.append(int) - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - - # allow casting int to string - if type(current_item) is int: - results_classes.append(str) - - if type(current_item) is none_type: - results_classes.append(none_type) - return results_classes - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - elif data is None: - # This SDK does not support nullable params unless they are explicitly marked as nullable - return data - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - if input_value is None: - return input_value - - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if configuration: - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item - - model_instances = [model_instance] - if model_instance._composed_schemas: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - result[attr] = model_to_dict_recursive(value, serialize, extract_item) - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def model_to_dict_recursive(value, serialize, extract_item): - if isinstance(value, list): - res = [] - - for v in value: - res.append(model_to_dict_recursive(v, serialize, extract_item)) - - return res - elif isinstance(value, dict): - return dict(map( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - return value.value - elif hasattr(value, '_data_store'): - return model_to_dict(value, serialize=serialize) - elif isinstance(value, io.BufferedReader): - return value.name - else: - return value - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - if 'allOf' in self._composed_schemas.keys(): - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data(**model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data(model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + composed_instances - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] \ No newline at end of file diff --git a/sdks/python/templates/partial_api.mustache b/sdks/python/templates/partial_api.mustache new file mode 100644 index 000000000..dd3a9a1fa --- /dev/null +++ b/sdks/python/templates/partial_api.mustache @@ -0,0 +1,52 @@ + """{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} + + {{#notes}} + {{{.}}} + {{/notes}} + + {{#allParams}} + :param {{paramName}}:{{#description}} {{{.}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} + :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}} + {{/allParams}} + :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 + {{#isDeprecated}} + warnings.warn("{{{httpMethod}}} {{{path}}} is deprecated.", DeprecationWarning) + {{/isDeprecated}} + + _param = self._{{operationId}}_serialize( + {{#allParams}} + {{paramName}}={{paramName}}, + {{/allParams}} + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + {{#responses}} + {{^isWildcard}} + '{{code}}': {{#dataType}}"{{.}}"{{/dataType}}{{^dataType}}None{{/dataType}}, + {{/isWildcard}} + {{/responses}} + } \ No newline at end of file diff --git a/sdks/python/templates/partial_api_args.mustache b/sdks/python/templates/partial_api_args.mustache new file mode 100644 index 000000000..379b67de9 --- /dev/null +++ b/sdks/python/templates/partial_api_args.mustache @@ -0,0 +1,18 @@ +( + self, + {{#allParams}} + {{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, + {{/allParams}} + _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={{#servers.size}}{{servers.size}}{{/servers.size}}{{^servers.size}}1{{/servers.size}})] = 0, + ) \ No newline at end of file diff --git a/sdks/python/templates/partial_header.mustache b/sdks/python/templates/partial_header.mustache index dc3c8f3d8..50aa81171 100644 --- a/sdks/python/templates/partial_header.mustache +++ b/sdks/python/templates/partial_header.mustache @@ -1,17 +1,19 @@ """ {{#appName}} {{{.}}} -{{/appName}} +{{/appName}} {{#appDescription}} - {{{.}}} # noqa: E501 -{{/appDescription}} + {{{.}}} +{{/appDescription}} {{#version}} The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} Contact: {{{.}}} {{/infoEmail}} - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 diff --git a/sdks/python/templates/py.typed.mustache b/sdks/python/templates/py.typed.mustache new file mode 100644 index 000000000..e69de29bb diff --git a/sdks/python/templates/pyproject.mustache b/sdks/python/templates/pyproject.mustache new file mode 100644 index 000000000..24030f9e9 --- /dev/null +++ b/sdks/python/templates/pyproject.mustache @@ -0,0 +1,82 @@ +[tool.poetry] +name = "{{{packageName}}}" +version = "{{{packageVersion}}}" +description = "{{{appName}}}" +authors = ["{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}} <{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}>"] +license = "{{{licenseInfo}}}{{^licenseInfo}}NoLicense{{/licenseInfo}}" +readme = "README.md" +repository = "https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}" +keywords = ["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"] +include = ["{{packageName}}/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +{{#asyncio}} +aiohttp = ">= 3.8.4" +aiohttp-retry = ">= 2.8.3" +{{/asyncio}} +{{#tornado}} +tornado = ">=4.2,<5" +{{/tornado}} +{{#hasHttpSignatureMethods}} +pem = ">= 19.3.0" +pycryptodome = ">= 3.9.0" +{{/hasHttpSignatureMethods}} +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" +types-python-dateutil = ">=2.8.19.14" +mypy = "1.4.1" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "{{{packageName}}}", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/sdks/python/templates/python_doc_auth_partial.mustache b/sdks/python/templates/python_doc_auth_partial.mustache index 5106632d2..f478fe0f1 100644 --- a/sdks/python/templates/python_doc_auth_partial.mustache +++ b/sdks/python/templates/python_doc_auth_partial.mustache @@ -15,15 +15,15 @@ configuration = {{{packageName}}}.Configuration( # Configure HTTP basic authorization: {{{name}}} configuration = {{{packageName}}}.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) {{/isBasicBasic}} {{#isBasicBearer}} # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} configuration = {{{packageName}}}.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) {{/isBasicBearer}} {{#isHttpSignature}} @@ -64,9 +64,12 @@ configuration = {{{packageName}}}.Configuration( # the API server. # # See {{{packageName}}}.signing for a list of all supported parameters. +from {{{packageName}}} import signing +import datetime + configuration = {{{packageName}}}.Configuration( host = "{{{basePath}}}", - signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + signing_info = {{{packageName}}}.HttpSigningConfiguration( key_id = 'my-key-id', private_key_path = 'private_key.pem', private_key_passphrase = 'YOUR_PASSPHRASE', @@ -92,18 +95,14 @@ configuration = {{{packageName}}}.Configuration( {{#isApiKey}} # Configure API key authorization: {{{name}}} -configuration.api_key['{{{name}}}'] = 'YOUR_API_KEY' +configuration.api_key['{{{name}}}'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['{{name}}'] = 'Bearer' {{/isApiKey}} {{#isOAuth}} -# Configure OAuth2 access token for authorization: {{{name}}} -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' +configuration.access_token = os.environ["ACCESS_TOKEN"] {{/isOAuth}} {{/authMethods}} {{/hasAuthMethods}} diff --git a/sdks/python/templates/requirements.mustache b/sdks/python/templates/requirements.mustache index 96947f604..5412515b5 100644 --- a/sdks/python/templates/requirements.mustache +++ b/sdks/python/templates/requirements.mustache @@ -1,3 +1,12 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 +{{#asyncio}} +aiohttp >= 3.0.0 +aiohttp-retry >= 2.8.3 +{{/asyncio}} +{{#hasHttpSignatureMethods}} +pycryptodome >= 3.9.0 +{{/hasHttpSignatureMethods}} diff --git a/sdks/python/templates/rest.mustache b/sdks/python/templates/rest.mustache index a66740247..07aa7ee3f 100644 --- a/sdks/python/templates/rest.mustache +++ b/sdks/python/templates/rest.mustache @@ -1,46 +1,58 @@ +# coding: utf-8 + {{>partial_header}} import io import json -import logging import re import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment + import urllib3 -import ipaddress -from {{packageName}}.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from {{packageName}}.exceptions import ApiException, ApiValueError +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -49,70 +61,79 @@ class RESTClientObject(object): else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager - if configuration.proxy and not should_bypass_proxies(configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :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. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -124,60 +145,83 @@ class RESTClientObject(object): timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', headers['Content-Type'], re.IGNORECASE)): + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: - request_body = json.dumps(body) + request_body = json.dumps(body{{#setEnsureAsciiToFalse}}, ensure_ascii=False{{/setEnsureAsciiToFalse}}) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -188,151 +232,16 @@ class RESTClientObject(object): raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None , '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ',''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) + return RESTResponse(r) diff --git a/sdks/python/templates/setup.mustache b/sdks/python/templates/setup.mustache index 3d88fb387..ec5a2efff 100644 --- a/sdks/python/templates/setup.mustache +++ b/sdks/python/templates/setup.mustache @@ -1,53 +1,75 @@ +# coding: utf-8 + {{>partial_header}} from setuptools import setup, find_packages # noqa: H301 +{{#useCustomTemplateCode}} from pathlib import Path +{{/useCustomTemplateCode}} -NAME = "{{{projectName}}}" -VERSION = "{{packageVersion}}" -{{#apiInfo}} -{{#apis}} -{{#-last}} # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools - +NAME = "{{{projectName}}}" +VERSION = "{{packageVersion}}" +PYTHON_REQUIRES = ">=3.7" +{{#apiInfo}} +{{#apis}} +{{#-last}} REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", {{#asyncio}} - "aiohttp >= 3.0.0", + "aiohttp >= 3.0.0", + "aiohttp-retry >= 2.8.3", {{/asyncio}} {{#tornado}} - "tornado>=4.2,<5", + "tornado>=4.2,<5", {{/tornado}} {{#hasHttpSignatureMethods}} - "pem>=19.3.0", - "pycryptodome>=3.9.0", + "pem>=19.3.0", + "pycryptodome>=3.9.0", {{/hasHttpSignatureMethods}} + "pydantic >= 2", + "typing-extensions >= 4.7.1", ] +{{#useCustomTemplateCode}} this_directory = Path(__file__).parent long_description = (this_directory / "README.md").read_text() +{{/useCustomTemplateCode}} setup( name=NAME, version=VERSION, description="{{appName}}", +{{^useCustomTemplateCode}} + author="{{infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}", +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} author="{{packageAuthor}}", +{{/useCustomTemplateCode}} author_email="{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", url="{{packageUrl}}", keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], - python_requires="{{{generatorLanguageVersion}}}", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, +{{^useCustomTemplateCode}} + {{#licenseInfo}}license="{{.}}", + {{/licenseInfo}}long_description="""\ + {{appDescription}} # noqa: E501 + """ +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#licenseInfo}}license="{{.}}", {{/licenseInfo}}long_description=long_description, - long_description_content_type='text/markdown' + long_description_content_type='text/markdown', +{{/useCustomTemplateCode}} + package_data={"{{{packageName}}}": ["py.typed"]}, ) {{/-last}} {{/apis}} diff --git a/sdks/python/templates/setup_cfg.mustache b/sdks/python/templates/setup_cfg.mustache index 931f02c5d..11433ee87 100644 --- a/sdks/python/templates/setup_cfg.mustache +++ b/sdks/python/templates/setup_cfg.mustache @@ -1,13 +1,2 @@ -{{#useNose}} -[nosetests] -logging-clear-handlers=true -verbosity=2 -randomize=true -exe=true -with-coverage=true -cover-package={{{packageName}}} -cover-erase=true - -{{/useNose}} [flake8] max-line-length=99 diff --git a/sdks/python/templates/signing.mustache b/sdks/python/templates/signing.mustache index e39866a53..4d00424ea 100644 --- a/sdks/python/templates/signing.mustache +++ b/sdks/python/templates/signing.mustache @@ -3,13 +3,16 @@ from base64 import b64encode from Crypto.IO import PEM, PKCS8 from Crypto.Hash import SHA256, SHA512 +from Crypto.Hash.SHA512 import SHA512Hash +from Crypto.Hash.SHA256 import SHA256Hash from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS +from datetime import timedelta from email.utils import formatdate -import json import os import re from time import time +from typing import List, Optional, Union from urllib.parse import urlencode, urlparse # The constants below define a subset of HTTP headers that can be included in the @@ -56,25 +59,22 @@ HASH_SHA256 = 'sha256' HASH_SHA512 = 'sha512' -class HttpSigningConfiguration(object): +class HttpSigningConfiguration: """The configuration parameters for the HTTP signature security scheme. + The HTTP signature security scheme is used to sign HTTP requests with a private key which is in possession of the API client. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key. The 'Authorization' header is added to outbound HTTP requests. - NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. + An ``Authorization`` header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key. The ``Authorization`` header is added to outbound HTTP requests. :param key_id: A string value specifying the identifier of the cryptographic key, when signing HTTP requests. :param signing_scheme: A string value specifying the signature scheme, when signing HTTP requests. - Supported value are hs2019, rsa-sha256, rsa-sha512. - Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are + Supported value are: ``hs2019``, ``rsa-sha256``, ``rsa-sha512``. + Avoid using ``rsa-sha256``, ``rsa-sha512`` as they are deprecated. These values are available for server-side applications that only support the older HTTP signature algorithms. :param private_key_path: A string value specifying the path of the file containing @@ -83,18 +83,19 @@ class HttpSigningConfiguration(object): the private key. :param signed_headers: A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be + The two special signature headers ``(request-target)`` and ``(created)`` SHOULD be included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an + The ``(created)`` header expresses when the signature was created. + The ``(request-target)`` header is a concatenation of the lowercased :method, an ASCII space, and the :path pseudo-headers. When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. + ``(created)``, in the list of HTTP headers. When SignedHeaders contains the 'Digest' value, the client performs the following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. + 1. Calculate a digest of request body, as specified in `RFC3230, + section 4.3.2`_. + 2. Set the ``Digest`` header in the request body. + 3. Include the ``Digest`` header and value in the HTTP signature. :param signing_algorithm: A string value specifying the signature algorithm, when signing HTTP requests. Supported values are: @@ -112,12 +113,16 @@ class HttpSigningConfiguration(object): :param signature_max_validity: The signature max validity, expressed as a datetime.timedelta value. It must be a positive value. """ - def __init__(self, key_id, signing_scheme, private_key_path, - private_key_passphrase=None, - signed_headers=None, - signing_algorithm=None, - hash_algorithm=None, - signature_max_validity=None): + def __init__(self, + key_id: str, + signing_scheme: str, + private_key_path: str, + private_key_passphrase: Union[None, str]=None, + signed_headers: Optional[List[str]]=None, + signing_algorithm: Optional[str]=None, + hash_algorithm: Optional[str]=None, + signature_max_validity: Optional[timedelta]=None, + ) -> None: self.key_id = key_id if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) @@ -161,11 +166,11 @@ class HttpSigningConfiguration(object): if HEADER_AUTHORIZATION in signed_headers: raise Exception("'Authorization' header cannot be included in signed headers") self.signed_headers = signed_headers - self.private_key = None + self.private_key: Optional[Union[ECC.EccKey, RSA.RsaKey]] = None """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. """ - self.host = None + self.host: Optional[str] = None """The host name, optionally followed by a colon and TCP port number. """ self._load_private_key() @@ -203,7 +208,7 @@ class HttpSigningConfiguration(object): def get_public_key(self): """Returns the public key object associated with the private key. """ - pubkey = None + pubkey: Optional[Union[ECC.EccKey, RSA.RsaKey]] = None if isinstance(self.private_key, RSA.RsaKey): pubkey = self.private_key.publickey() elif isinstance(self.private_key, ECC.EccKey): @@ -232,8 +237,11 @@ class HttpSigningConfiguration(object): elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: # Key is in PKCS8 format, which is capable of holding many different # types of private keys, not just EC keys. - (key_binary, pem_header, is_encrypted) = \ - PEM.decode(pem_data, self.private_key_passphrase) + if self.private_key_passphrase is not None: + passphrase = self.private_key_passphrase.encode("utf-8") + else: + passphrase = None + (key_binary, pem_header, is_encrypted) = PEM.decode(pem_data, passphrase) (oid, privkey, params) = \ PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) if oid == '1.2.840.10045.2.1': @@ -273,7 +281,7 @@ class HttpSigningConfiguration(object): if body is None: body = '' else: - body = json.dumps(body) + body = body.to_json() # Build the '(request-target)' HTTP signature parameter. target_host = urlparse(self.host).netloc @@ -314,8 +322,11 @@ class HttpSigningConfiguration(object): request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( digest_prefix, b64_body_digest.decode('ascii')) elif hdr_key == HEADER_HOST.lower(): - value = target_host - request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) + if isinstance(target_host, bytes): + value = target_host.decode('ascii') + else: + value = target_host + request_headers_dict[HEADER_HOST] = value else: value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) if value is None: @@ -336,6 +347,9 @@ class HttpSigningConfiguration(object): The prefix is a string that identifies the cryptographic hash. It is used to generate the 'Digest' header as specified in RFC 3230. """ + + digest: Union[SHA256Hash, SHA512Hash] + if self.hash_algorithm == HASH_SHA512: digest = SHA512.new() prefix = 'SHA-512=' diff --git a/sdks/python/templates/test-requirements.mustache b/sdks/python/templates/test-requirements.mustache index 635b816e7..8e6d8cb13 100644 --- a/sdks/python/templates/test-requirements.mustache +++ b/sdks/python/templates/test-requirements.mustache @@ -1,13 +1,5 @@ -{{#useNose}} -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 -{{/useNose}} -{{^useNose}} +pytest~=7.1.3 pytest-cov>=2.8.1 -{{/useNose}} -{{#hasHttpSignatureMethods}} -pycryptodome>=3.9.0 -{{/hasHttpSignatureMethods}} +pytest-randomly>=3.12.0 +mypy>=1.4.1 +types-python-dateutil>=2.8.19 diff --git a/sdks/python/templates/tornado/rest.mustache b/sdks/python/templates/tornado/rest.mustache index 9e5cc1209..f4bfbfb23 100644 --- a/sdks/python/templates/tornado/rest.mustache +++ b/sdks/python/templates/tornado/rest.mustache @@ -1,12 +1,12 @@ +# coding: utf-8 + {{>partial_header}} import io import json -import logging import re -# python 2 and python 3 compatibility library -from six.moves.urllib.parse import urlencode +from urllib.parse import urlencode import tornado import tornado.gen from tornado import httpclient @@ -14,34 +14,33 @@ from urllib3.filepost import encode_multipart_formdata from {{packageName}}.exceptions import ApiException, ApiValueError -logger = logging.getLogger(__name__) - +RESTResponseType = httpclient.HTTPResponse class RESTResponse(io.IOBase): - def __init__(self, resp): - self.tornado_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.code self.reason = resp.reason + self.data = None - if resp.body: - self.data = resp.body - else: - self.data = None + def read(self): + if self.data is None: + self.data = self.response.body + return self.data def getheaders(self): """Returns a CIMultiDictProxy of the response headers.""" - return self.tornado_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.tornado_response.headers.get(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=4): - # maxsize is number of requests to host that are allowed in parallel + def __init__(self, configuration) -> None: self.ca_certs = configuration.ssl_ca_cert self.client_key = configuration.key_file @@ -57,29 +56,39 @@ class RESTClientObject(object): self.pool_manager = httpclient.AsyncHTTPClient() @tornado.gen.coroutine - def request(self, method, url, query_params=None, headers=None, body=None, - post_params=None, _preload_content=True, - _request_timeout=None): + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Execute Request :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. :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. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -102,16 +111,13 @@ class RESTClientObject(object): post_params = post_params or {} - if query_params: - request.url += '?' + urlencode(query_params) - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: if re.search('json', headers['Content-Type'], re.IGNORECASE): if body: body = json.dumps(body) request.body = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': request.body = urlencode(post_params) elif headers['Content-Type'] == 'multipart/form-data': multipart = encode_multipart_formdata(post_params) @@ -130,93 +136,7 @@ class RESTClientObject(object): r = yield self.pool_manager.fetch(request, raise_error=False) - if _preload_content: - - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) + r = RESTResponse(r) raise tornado.gen.Return(r) - - @tornado.gen.coroutine - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - result = yield self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - result = yield self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - result = yield self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) diff --git a/sdks/python/templates/tox.mustache b/sdks/python/templates/tox.mustache index 4c771c472..9d717c3dd 100644 --- a/sdks/python/templates/tox.mustache +++ b/sdks/python/templates/tox.mustache @@ -6,4 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - {{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}} + pytest --cov={{{packageName}}} diff --git a/sdks/python/templates/travis.mustache b/sdks/python/templates/travis.mustache index a26c984f3..53cb57e84 100644 --- a/sdks/python/templates/travis.mustache +++ b/sdks/python/templates/travis.mustache @@ -1,18 +1,17 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.6" - "3.7" - "3.8" - "3.9" + - "3.10" + - "3.11" + # uncomment the following if needed + #- "3.11-dev" # 3.11 development branch + #- "nightly" # nightly build # command to install dependencies install: - "pip install -r requirements.txt" - "pip install -r test-requirements.txt" # command to run tests -{{#useNose}} -script: nosetests -{{/useNose}} -{{^useNose}} script: pytest --cov={{{packageName}}} -{{/useNose}} diff --git a/sdks/python/test-requirements.txt b/sdks/python/test-requirements.txt index bb4f22bb7..8e6d8cb13 100644 --- a/sdks/python/test-requirements.txt +++ b/sdks/python/test-requirements.txt @@ -1 +1,5 @@ +pytest~=7.1.3 pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 +mypy>=1.4.1 +types-python-dateutil>=2.8.19 diff --git a/sdks/python/tests/test_account_api.py b/sdks/python/tests/test_account_api.py index 626550a36..c11171457 100644 --- a/sdks/python/tests/test_account_api.py +++ b/sdks/python/tests/test_account_api.py @@ -35,8 +35,8 @@ def test_http_code_range(self): try: self.api.account_create(obj) except ApiException as e: - self.assertEqual(e.body.__class__.__name__, response_class) - self.assertEqual(e.body, expected) + self.assertEqual(e.data.__class__.__name__, response_class) + self.assertEqual(e.data, expected) def test_account_create(self): request_class = 'AccountCreateRequest' diff --git a/sdks/python/tests/test_api_app_api.py b/sdks/python/tests/test_api_app_api.py index 46d76f27c..58b4ecee3 100644 --- a/sdks/python/tests/test_api_app_api.py +++ b/sdks/python/tests/test_api_app_api.py @@ -23,7 +23,8 @@ def test_api_app_create(self): self.mock_pool.expect_request( content_type='multipart/form-data', data=request_data, - response=response_data + response=response_data, + status=201, ) obj = m.ApiAppCreateRequest.init(request_data) diff --git a/sdks/python/tests/test_fixtures.py b/sdks/python/tests/test_fixtures.py index 252d2df74..626d38d3b 100644 --- a/sdks/python/tests/test_fixtures.py +++ b/sdks/python/tests/test_fixtures.py @@ -50,17 +50,16 @@ def test_is_valid(self): yanked_files = {} data = {} - openapi_types = class_type.openapi_types - for param, param_value in openapi_types.items(): + for param, param_value in class_type.openapi_types().items(): if param not in fixt_data.keys(): continue data[param] = fixt_data[param] obj = api_client.deserialize( - response=type('obj_dict', (object,), {'data': json.dumps(data)}), - response_type=[class_type], - _check_type=True, + response_text=json.dumps(data), + response_type=class_type, + content_type="application/json", ) for yanked_key, yanked_file in yanked_files.items(): diff --git a/sdks/python/tests/test_model_signature_request_send_request.py b/sdks/python/tests/test_model_signature_request_send_request.py index 82947b4b0..54d36435c 100644 --- a/sdks/python/tests/test_model_signature_request_send_request.py +++ b/sdks/python/tests/test_model_signature_request_send_request.py @@ -59,6 +59,7 @@ def test_is_valid(self): height=16, x=112, y=328, + required=False, ) data = models.SignatureRequestSendRequest( diff --git a/sdks/python/tests/test_signature_request_api.py b/sdks/python/tests/test_signature_request_api.py index 1146f3580..d09ca2549 100644 --- a/sdks/python/tests/test_signature_request_api.py +++ b/sdks/python/tests/test_signature_request_api.py @@ -39,7 +39,6 @@ def test_init_allows_binary_file(self): "required": True, "signer": "0", "page": 1, - "placeholder": "My placeholder value", } ], "files": [open(get_base_path() + "/../test_fixtures/pdf-sample.pdf", "rb")] @@ -67,7 +66,6 @@ def test_init_allows_binary_file(self): self.assertEqual(data["form_fields_per_document"][0]["required"], obj.form_fields_per_document[0].required) self.assertEqual(data["form_fields_per_document"][0]["signer"], obj.form_fields_per_document[0].signer) self.assertEqual(data["form_fields_per_document"][0]["page"], obj.form_fields_per_document[0].page) - self.assertEqual(data["form_fields_per_document"][0]["placeholder"], obj.form_fields_per_document[0].placeholder) self.assertEqual(data["files"][0], obj.files[0]) @@ -93,21 +91,24 @@ def test_init_allows_jsony_chars_in_strings(self): "files": [open(get_base_path() + "/../test_fixtures/pdf-sample.pdf", "rb")] } + response_class = 'SignatureRequestGetResponse' + response_data = get_fixture_data(response_class)['default'] + obj = m.SignatureRequestSendRequest.init(request_data) self.mock_pool.expect_request( content_type='multipart/form-data', data=request_data, - response={} + response=response_data, ) self.api.signature_request_send(obj) fields = self.mock_pool.get_fields() - title_result = fields[1] - subject_result = fields[2] - message_result = fields[3] + title_result = fields[9] + subject_result = fields[7] + message_result = fields[6] self.assertEqual(title_result[1], title) self.assertEqual(subject_result[1], subject) @@ -254,7 +255,7 @@ def test_signature_request_list_null_query_value_removed(self): self.api.signature_request_list(account_id=account_id) - request_fields = self.mock_pool.get_fields() + request_fields = self.mock_pool.get_query_params() self.assertTrue(not request_fields) account_id = None @@ -267,7 +268,7 @@ def test_signature_request_list_null_query_value_removed(self): self.api.signature_request_list(account_id=account_id, query=query) - request_fields = self.mock_pool.get_fields() + request_fields = self.mock_pool.get_query_params() self.assertTrue(not request_fields) account_id = 'ABC123' @@ -280,11 +281,11 @@ def test_signature_request_list_null_query_value_removed(self): self.api.signature_request_list(account_id=account_id, query=query) - request_fields = self.mock_pool.get_fields() - expected_fields = [ - ('account_id', account_id), - ] - self.assertTrue(expected_fields == request_fields) + request_fields = self.mock_pool.get_query_params() + expected_fields = { + 'account_id': [account_id], + } + self.assertEqual(expected_fields, request_fields) account_id = 'ABC123' query = 'My amazing query' @@ -296,12 +297,12 @@ def test_signature_request_list_null_query_value_removed(self): self.api.signature_request_list(account_id=account_id, query=query) - request_fields = self.mock_pool.get_fields() - expected_fields = [ - ('account_id', account_id), - ('query', query), - ] - self.assertTrue(expected_fields == request_fields) + request_fields = self.mock_pool.get_query_params() + expected_fields = { + 'account_id': [account_id], + 'query': [query], + } + self.assertEqual(expected_fields, request_fields) def test_signature_request_release_hold(self): signature_request_id = 'fa5c8a0b0f492d768749333ad6fcc214c111e967' diff --git a/sdks/python/tests/test_team_api.py b/sdks/python/tests/test_team_api.py index 0701770ec..f0a8a8cbc 100644 --- a/sdks/python/tests/test_team_api.py +++ b/sdks/python/tests/test_team_api.py @@ -101,7 +101,8 @@ def test_team_remove_member(self): self.mock_pool.expect_request( content_type='application/json', data=request_data, - response=response_data + response=response_data, + status=201, ) expected = m.TeamGetResponse.init(response_data) obj = m.TeamRemoveMemberRequest.init(request_data) diff --git a/sdks/python/tests/test_utils.py b/sdks/python/tests/test_utils.py index 18e70a279..952c7e40d 100644 --- a/sdks/python/tests/test_utils.py +++ b/sdks/python/tests/test_utils.py @@ -1,6 +1,8 @@ import os import json import urllib3 +from urllib.parse import urlparse +from urllib.parse import parse_qs def get_base_path(): @@ -23,6 +25,7 @@ def __init__(self, tc): self._expected_request = {} self._expected_response = {} self._request_fields = [] + self._query_params = {} def expect_request(self, content_type, data=None, response=None, status=200): self._expected_request = { @@ -44,6 +47,8 @@ def request(self, *args, **kwargs): if 'fields' in kwargs: self._request_fields = kwargs['fields'] + self._query_params = parse_qs(urlparse(args[1]).query) + return urllib3.HTTPResponse( status=self._expected_response['status'], preload_content=True, @@ -52,3 +57,6 @@ def request(self, *args, **kwargs): def get_fields(self): return self._request_fields + + def get_query_params(self): + return self._query_params diff --git a/sdks/ruby/.gitignore b/sdks/ruby/.gitignore index 94d312172..ebd198d3b 100644 --- a/sdks/ruby/.gitignore +++ b/sdks/ruby/.gitignore @@ -38,4 +38,4 @@ build/ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc -vendor \ No newline at end of file +vendor diff --git a/sdks/ruby/.openapi-generator/FILES b/sdks/ruby/.openapi-generator/FILES index f02adf49e..2ff1424e3 100644 --- a/sdks/ruby/.openapi-generator/FILES +++ b/sdks/ruby/.openapi-generator/FILES @@ -45,6 +45,18 @@ docs/ErrorResponseError.md docs/EventCallbackRequest.md docs/EventCallbackRequestEvent.md docs/EventCallbackRequestEventMetadata.md +docs/FaxLineAddUserRequest.md +docs/FaxLineApi.md +docs/FaxLineAreaCodeGetCountryEnum.md +docs/FaxLineAreaCodeGetProvinceEnum.md +docs/FaxLineAreaCodeGetResponse.md +docs/FaxLineAreaCodeGetStateEnum.md +docs/FaxLineCreateRequest.md +docs/FaxLineDeleteRequest.md +docs/FaxLineListResponse.md +docs/FaxLineRemoveUserRequest.md +docs/FaxLineResponse.md +docs/FaxLineResponseFaxLine.md docs/FileResponse.md docs/FileResponseDataUri.md docs/ListInfoResponse.md @@ -195,6 +207,7 @@ lib/dropbox-sign/api/account_api.rb lib/dropbox-sign/api/api_app_api.rb lib/dropbox-sign/api/bulk_send_job_api.rb lib/dropbox-sign/api/embedded_api.rb +lib/dropbox-sign/api/fax_line_api.rb lib/dropbox-sign/api/o_auth_api.rb lib/dropbox-sign/api/report_api.rb lib/dropbox-sign/api/signature_request_api.rb @@ -239,6 +252,17 @@ lib/dropbox-sign/models/error_response_error.rb lib/dropbox-sign/models/event_callback_request.rb lib/dropbox-sign/models/event_callback_request_event.rb lib/dropbox-sign/models/event_callback_request_event_metadata.rb +lib/dropbox-sign/models/fax_line_add_user_request.rb +lib/dropbox-sign/models/fax_line_area_code_get_country_enum.rb +lib/dropbox-sign/models/fax_line_area_code_get_province_enum.rb +lib/dropbox-sign/models/fax_line_area_code_get_response.rb +lib/dropbox-sign/models/fax_line_area_code_get_state_enum.rb +lib/dropbox-sign/models/fax_line_create_request.rb +lib/dropbox-sign/models/fax_line_delete_request.rb +lib/dropbox-sign/models/fax_line_list_response.rb +lib/dropbox-sign/models/fax_line_remove_user_request.rb +lib/dropbox-sign/models/fax_line_response.rb +lib/dropbox-sign/models/fax_line_response_fax_line.rb lib/dropbox-sign/models/file_response.rb lib/dropbox-sign/models/file_response_data_uri.rb lib/dropbox-sign/models/list_info_response.rb diff --git a/sdks/ruby/.openapi-generator/VERSION b/sdks/ruby/.openapi-generator/VERSION index 1985849fb..09a6d3084 100644 --- a/sdks/ruby/.openapi-generator/VERSION +++ b/sdks/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -7.7.0 +7.8.0 diff --git a/sdks/ruby/.travis.yml b/sdks/ruby/.travis.yml index 5d149dd89..5dac9b73b 100644 --- a/sdks/ruby/.travis.yml +++ b/sdks/ruby/.travis.yml @@ -8,4 +8,4 @@ script: - bundle install --path vendor/bundle - bundle exec rspec - gem build dropbox-sign.gemspec - - gem install ./dropbox-sign-1.5-dev.gem + - gem install ./dropbox-sign-1.6-dev.gem diff --git a/sdks/ruby/Gemfile.lock b/sdks/ruby/Gemfile.lock index 8fb3191e0..dc00b226d 100644 --- a/sdks/ruby/Gemfile.lock +++ b/sdks/ruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - dropbox-sign (1.5.pre.dev) + dropbox-sign (1.6.pre.dev) typhoeus (~> 1.0, >= 1.0.1) GEM diff --git a/sdks/ruby/README.md b/sdks/ruby/README.md index 784af10dc..1dd16ae20 100644 --- a/sdks/ruby/README.md +++ b/sdks/ruby/README.md @@ -25,8 +25,8 @@ directory that corresponds to the file you want updated. This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 3.0.0 -- Package version: 1.5-dev -- Generator version: 7.7.0 +- Package version: 1.6-dev +- Generator version: 7.8.0 - Build package: org.openapitools.codegen.languages.RubyClientCodegen ## Installation @@ -47,14 +47,15 @@ gem build dropbox-sign.gemspec Then install the gem locally: ```shell -gem install ./dropbox-sign-1.5-dev.gem +gem install ./dropbox-sign-1.6-dev.gem ``` -(for development, run `gem install --dev ./dropbox-sign-1.5-dev.gem` to install the development dependencies) +(for development, run `gem install --dev ./dropbox-sign-1.6-dev.gem` to install the development dependencies) + Finally add this to the Gemfile: - gem 'dropbox-sign', '~> 1.5-dev' + gem 'dropbox-sign', '~> 1.6-dev' ### Install from Git @@ -120,6 +121,13 @@ 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::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 | +|*Dropbox::Sign::FaxLineApi* | [**fax_line_delete**](docs/FaxLineApi.md#fax_line_delete) | **DELETE** /fax_line | Delete Fax Line | +|*Dropbox::Sign::FaxLineApi* | [**fax_line_get**](docs/FaxLineApi.md#fax_line_get) | **GET** /fax_line | Get Fax Line | +|*Dropbox::Sign::FaxLineApi* | [**fax_line_list**](docs/FaxLineApi.md#fax_line_list) | **GET** /fax_line/list | List Fax Lines | +|*Dropbox::Sign::FaxLineApi* | [**fax_line_remove_user**](docs/FaxLineApi.md#fax_line_remove_user) | **PUT** /fax_line/remove_user | Remove Fax Line Access | |*Dropbox::Sign::OAuthApi* | [**oauth_token_generate**](docs/OAuthApi.md#oauth_token_generate) | **POST** /oauth/token | OAuth Token Generate | |*Dropbox::Sign::OAuthApi* | [**oauth_token_refresh**](docs/OAuthApi.md#oauth_token_refresh) | **POST** /oauth/token?refresh | OAuth Token Refresh | |*Dropbox::Sign::ReportApi* | [**report_create**](docs/ReportApi.md#report_create) | **POST** /report/create | Create Report | @@ -202,6 +210,17 @@ 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::FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) + - [Dropbox::Sign::FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) + - [Dropbox::Sign::FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) + - [Dropbox::Sign::FaxLineAreaCodeGetResponse](docs/FaxLineAreaCodeGetResponse.md) + - [Dropbox::Sign::FaxLineAreaCodeGetStateEnum](docs/FaxLineAreaCodeGetStateEnum.md) + - [Dropbox::Sign::FaxLineCreateRequest](docs/FaxLineCreateRequest.md) + - [Dropbox::Sign::FaxLineDeleteRequest](docs/FaxLineDeleteRequest.md) + - [Dropbox::Sign::FaxLineListResponse](docs/FaxLineListResponse.md) + - [Dropbox::Sign::FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) + - [Dropbox::Sign::FaxLineResponse](docs/FaxLineResponse.md) + - [Dropbox::Sign::FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [Dropbox::Sign::FileResponse](docs/FileResponse.md) - [Dropbox::Sign::FileResponseDataUri](docs/FileResponseDataUri.md) - [Dropbox::Sign::ListInfoResponse](docs/ListInfoResponse.md) diff --git a/sdks/ruby/VERSION b/sdks/ruby/VERSION index 6f3dd2f48..78ca9a102 100644 --- a/sdks/ruby/VERSION +++ b/sdks/ruby/VERSION @@ -1 +1 @@ -1.5-dev +1.6-dev diff --git a/sdks/ruby/docs/AccountCreateResponse.md b/sdks/ruby/docs/AccountCreateResponse.md index f3c06e6a5..0a15db35d 100644 --- a/sdks/ruby/docs/AccountCreateResponse.md +++ b/sdks/ruby/docs/AccountCreateResponse.md @@ -6,7 +6,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `account` | [```AccountResponse```](AccountResponse.md) | | | +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `oauth_data` | [```OAuthTokenResponse```](OAuthTokenResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/AccountGetResponse.md b/sdks/ruby/docs/AccountGetResponse.md index 9c5a3e080..f3b133461 100644 --- a/sdks/ruby/docs/AccountGetResponse.md +++ b/sdks/ruby/docs/AccountGetResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `account` | [```AccountResponse```](AccountResponse.md) | | | +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/ApiAppGetResponse.md b/sdks/ruby/docs/ApiAppGetResponse.md index 37e238fed..51a6a9c60 100644 --- a/sdks/ruby/docs/ApiAppGetResponse.md +++ b/sdks/ruby/docs/ApiAppGetResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `api_app` | [```ApiAppResponse```](ApiAppResponse.md) | | | +| `api_app`*_required_ | [```ApiAppResponse```](ApiAppResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/ApiAppListResponse.md b/sdks/ruby/docs/ApiAppListResponse.md index 31e4563eb..fe9d1f067 100644 --- a/sdks/ruby/docs/ApiAppListResponse.md +++ b/sdks/ruby/docs/ApiAppListResponse.md @@ -6,7 +6,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `api_apps` | [```Array```](ApiAppResponse.md) | Contains information about API Apps. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `api_apps`*_required_ | [```Array```](ApiAppResponse.md) | Contains information about API Apps. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/BulkSendJobGetResponse.md b/sdks/ruby/docs/BulkSendJobGetResponse.md index 09344b154..b110bcc5d 100644 --- a/sdks/ruby/docs/BulkSendJobGetResponse.md +++ b/sdks/ruby/docs/BulkSendJobGetResponse.md @@ -6,8 +6,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `bulk_send_job` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `signature_requests` | [```Array```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | +| `bulk_send_job`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `signature_requests`*_required_ | [```Array```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/BulkSendJobListResponse.md b/sdks/ruby/docs/BulkSendJobListResponse.md index 44b4301ce..deae21323 100644 --- a/sdks/ruby/docs/BulkSendJobListResponse.md +++ b/sdks/ruby/docs/BulkSendJobListResponse.md @@ -6,7 +6,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `bulk_send_jobs` | [```Array```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `bulk_send_jobs`*_required_ | [```Array```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/BulkSendJobSendResponse.md b/sdks/ruby/docs/BulkSendJobSendResponse.md index 0e291c0fd..a352d838c 100644 --- a/sdks/ruby/docs/BulkSendJobSendResponse.md +++ b/sdks/ruby/docs/BulkSendJobSendResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `bulk_send_job` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `bulk_send_job`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/EmbeddedEditUrlResponse.md b/sdks/ruby/docs/EmbeddedEditUrlResponse.md index 9ad0b6522..00e1f28c3 100644 --- a/sdks/ruby/docs/EmbeddedEditUrlResponse.md +++ b/sdks/ruby/docs/EmbeddedEditUrlResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `embedded` | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | +| `embedded`*_required_ | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/EmbeddedSignUrlResponse.md b/sdks/ruby/docs/EmbeddedSignUrlResponse.md index 174cfb73b..fcd693876 100644 --- a/sdks/ruby/docs/EmbeddedSignUrlResponse.md +++ b/sdks/ruby/docs/EmbeddedSignUrlResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `embedded` | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | +| `embedded`*_required_ | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/FaxLineAddUserRequest.md b/sdks/ruby/docs/FaxLineAddUserRequest.md new file mode 100644 index 000000000..272d38367 --- /dev/null +++ b/sdks/ruby/docs/FaxLineAddUserRequest.md @@ -0,0 +1,12 @@ +# Dropbox::Sign::FaxLineAddUserRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `number`*_required_ | ```String``` | The Fax Line number. | | +| `account_id` | ```String``` | Account ID | | +| `email_address` | ```String``` | Email address | | + diff --git a/sdks/ruby/docs/FaxLineApi.md b/sdks/ruby/docs/FaxLineApi.md new file mode 100644 index 000000000..f5b1d3b43 --- /dev/null +++ b/sdks/ruby/docs/FaxLineApi.md @@ -0,0 +1,503 @@ +# Dropbox::Sign::FaxLineApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [`fax_line_add_user`](FaxLineApi.md#fax_line_add_user) | **PUT** `/fax_line/add_user` | Add Fax Line User | +| [`fax_line_area_code_get`](FaxLineApi.md#fax_line_area_code_get) | **GET** `/fax_line/area_codes` | Get Available Fax Line Area Codes | +| [`fax_line_create`](FaxLineApi.md#fax_line_create) | **POST** `/fax_line/create` | Purchase Fax Line | +| [`fax_line_delete`](FaxLineApi.md#fax_line_delete) | **DELETE** `/fax_line` | Delete Fax Line | +| [`fax_line_get`](FaxLineApi.md#fax_line_get) | **GET** `/fax_line` | Get Fax Line | +| [`fax_line_list`](FaxLineApi.md#fax_line_list) | **GET** `/fax_line/list` | List Fax Lines | +| [`fax_line_remove_user`](FaxLineApi.md#fax_line_remove_user) | **PUT** `/fax_line/remove_user` | Remove Fax Line Access | + + +## `fax_line_add_user` + +> ` fax_line_add_user(fax_line_add_user_request)` + +Add Fax Line User + +Grants a user access to the specified Fax Line. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +data = Dropbox::Sign::FaxLineAddUserRequest.new +data.number = "[FAX_NUMBER]" +data.email_address = "member@dropboxsign.com" + +begin + result = fax_line_api.fax_line_add_user(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `fax_line_add_user_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> fax_line_add_user_with_http_info(fax_line_add_user_request)` + +```ruby +begin + # Add Fax Line User + data, status_code, headers = api_instance.fax_line_add_user_with_http_info(fax_line_add_user_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxLineApi->fax_line_add_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_add_user_request` | [**FaxLineAddUserRequest**](FaxLineAddUserRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## `fax_line_area_code_get` + +> ` fax_line_area_code_get(country, opts)` + +Get Available Fax Line Area Codes + +Returns a response with the area codes available for a given state/provice and city. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +begin + result = fax_line_api.fax_line_area_code_get("US", "CA") + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `fax_line_area_code_get_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> fax_line_area_code_get_with_http_info(country, opts)` + +```ruby +begin + # Get Available Fax Line Area Codes + data, status_code, headers = api_instance.fax_line_area_code_get_with_http_info(country, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxLineApi->fax_line_area_code_get_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `country` | **String** | Filter area codes by country. | | +| `state` | **String** | Filter area codes by state. | [optional] | +| `province` | **String** | Filter area codes by province. | [optional] | +| `city` | **String** | Filter area codes by city. | [optional] | + +### Return type + +[**FaxLineAreaCodeGetResponse**](FaxLineAreaCodeGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## `fax_line_create` + +> ` fax_line_create(fax_line_create_request)` + +Purchase Fax Line + +Purchases a new Fax Line. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +data = Dropbox::Sign::FaxLineCreateRequest.new +data.area_code = 209 +data.country = "US" + +begin + result = fax_line_api.fax_line_create(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `fax_line_create_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> fax_line_create_with_http_info(fax_line_create_request)` + +```ruby +begin + # Purchase Fax Line + data, status_code, headers = api_instance.fax_line_create_with_http_info(fax_line_create_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxLineApi->fax_line_create_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_create_request` | [**FaxLineCreateRequest**](FaxLineCreateRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## `fax_line_delete` + +> `fax_line_delete(fax_line_delete_request)` + +Delete Fax Line + +Deletes the specified Fax Line from the subscription. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +data = Dropbox::Sign::FaxLineDeleteRequest.new +data.number = "[FAX_NUMBER]" + +begin + fax_line_api.fax_line_delete(data) +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `fax_line_delete_with_http_info` variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> ` fax_line_delete_with_http_info(fax_line_delete_request)` + +```ruby +begin + # Delete Fax Line + data, status_code, headers = api_instance.fax_line_delete_with_http_info(fax_line_delete_request) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxLineApi->fax_line_delete_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_delete_request` | [**FaxLineDeleteRequest**](FaxLineDeleteRequest.md) | | | + +### Return type + +nil (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## `fax_line_get` + +> ` fax_line_get(number)` + +Get Fax Line + +Returns the properties and settings of a Fax Line. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +begin + result = fax_line_api.fax_line_get("[NUMBER]") + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `fax_line_get_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> fax_line_get_with_http_info(number)` + +```ruby +begin + # Get Fax Line + data, status_code, headers = api_instance.fax_line_get_with_http_info(number) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxLineApi->fax_line_get_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `number` | **String** | The Fax Line number. | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## `fax_line_list` + +> ` fax_line_list(opts)` + +List Fax Lines + +Returns the properties and settings of multiple Fax Lines. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +begin + result = fax_line_api.fax_line_list() + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `fax_line_list_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> fax_line_list_with_http_info(opts)` + +```ruby +begin + # List Fax Lines + data, status_code, headers = api_instance.fax_line_list_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxLineApi->fax_line_list_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `account_id` | **String** | Account ID | [optional] | +| `page` | **Integer** | Page | [optional][default to 1] | +| `page_size` | **Integer** | Page size | [optional][default to 20] | +| `show_team_lines` | **Boolean** | Show team lines | [optional] | + +### Return type + +[**FaxLineListResponse**](FaxLineListResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## `fax_line_remove_user` + +> ` fax_line_remove_user(fax_line_remove_user_request)` + +Remove Fax Line Access + +Removes a user's access to the specified Fax Line. + +### Examples + +```ruby +require "dropbox-sign" + +Dropbox::Sign.configure do |config| + # Configure HTTP basic authorization: api_key + config.username = "YOUR_API_KEY" +end + +fax_line_api = Dropbox::Sign::FaxLineApi.new + +data = Dropbox::Sign::FaxLineRemoveUserRequest.new +data.number = "[FAX_NUMBER]" +data.email_address = "member@dropboxsign.com" + +begin + result = fax_line_api.fax_line_remove_user(data) + p result +rescue Dropbox::Sign::ApiError => e + puts "Exception when calling Dropbox Sign API: #{e}" +end + +``` + +#### Using the `fax_line_remove_user_with_http_info` variant + +This returns an Array which contains the response data, status code and headers. + +> `, Integer, Hash)> fax_line_remove_user_with_http_info(fax_line_remove_user_request)` + +```ruby +begin + # Remove Fax Line Access + data, status_code, headers = api_instance.fax_line_remove_user_with_http_info(fax_line_remove_user_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Dropbox::Sign::ApiError => e + puts "Error when calling FaxLineApi->fax_line_remove_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_remove_user_request` | [**FaxLineRemoveUserRequest**](FaxLineRemoveUserRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/sdks/ruby/docs/FaxLineAreaCodeGetCountryEnum.md b/sdks/ruby/docs/FaxLineAreaCodeGetCountryEnum.md new file mode 100644 index 000000000..1b6b5aaa5 --- /dev/null +++ b/sdks/ruby/docs/FaxLineAreaCodeGetCountryEnum.md @@ -0,0 +1,9 @@ +# Dropbox::Sign::FaxLineAreaCodeGetCountryEnum + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + diff --git a/sdks/ruby/docs/FaxLineAreaCodeGetProvinceEnum.md b/sdks/ruby/docs/FaxLineAreaCodeGetProvinceEnum.md new file mode 100644 index 000000000..26d51f7c1 --- /dev/null +++ b/sdks/ruby/docs/FaxLineAreaCodeGetProvinceEnum.md @@ -0,0 +1,9 @@ +# Dropbox::Sign::FaxLineAreaCodeGetProvinceEnum + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + diff --git a/sdks/ruby/docs/FaxLineAreaCodeGetResponse.md b/sdks/ruby/docs/FaxLineAreaCodeGetResponse.md new file mode 100644 index 000000000..217a33523 --- /dev/null +++ b/sdks/ruby/docs/FaxLineAreaCodeGetResponse.md @@ -0,0 +1,10 @@ +# Dropbox::Sign::FaxLineAreaCodeGetResponse + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `area_codes`*_required_ | ```Array``` | | | + diff --git a/sdks/ruby/docs/FaxLineAreaCodeGetStateEnum.md b/sdks/ruby/docs/FaxLineAreaCodeGetStateEnum.md new file mode 100644 index 000000000..92f903f1c --- /dev/null +++ b/sdks/ruby/docs/FaxLineAreaCodeGetStateEnum.md @@ -0,0 +1,9 @@ +# Dropbox::Sign::FaxLineAreaCodeGetStateEnum + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + diff --git a/sdks/ruby/docs/FaxLineCreateRequest.md b/sdks/ruby/docs/FaxLineCreateRequest.md new file mode 100644 index 000000000..bbe5312c6 --- /dev/null +++ b/sdks/ruby/docs/FaxLineCreateRequest.md @@ -0,0 +1,13 @@ +# Dropbox::Sign::FaxLineCreateRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `area_code`*_required_ | ```Integer``` | Area code | | +| `country`*_required_ | ```String``` | Country | | +| `city` | ```String``` | City | | +| `account_id` | ```String``` | Account ID | | + diff --git a/sdks/ruby/docs/FaxLineDeleteRequest.md b/sdks/ruby/docs/FaxLineDeleteRequest.md new file mode 100644 index 000000000..5c781f3b4 --- /dev/null +++ b/sdks/ruby/docs/FaxLineDeleteRequest.md @@ -0,0 +1,10 @@ +# Dropbox::Sign::FaxLineDeleteRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `number`*_required_ | ```String``` | The Fax Line number. | | + diff --git a/sdks/ruby/docs/FaxLineListResponse.md b/sdks/ruby/docs/FaxLineListResponse.md new file mode 100644 index 000000000..660716ac2 --- /dev/null +++ b/sdks/ruby/docs/FaxLineListResponse.md @@ -0,0 +1,12 @@ +# Dropbox::Sign::FaxLineListResponse + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `fax_lines`*_required_ | [```Array```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + diff --git a/sdks/ruby/docs/FaxLineRemoveUserRequest.md b/sdks/ruby/docs/FaxLineRemoveUserRequest.md new file mode 100644 index 000000000..98388f6f4 --- /dev/null +++ b/sdks/ruby/docs/FaxLineRemoveUserRequest.md @@ -0,0 +1,12 @@ +# Dropbox::Sign::FaxLineRemoveUserRequest + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `number`*_required_ | ```String``` | The Fax Line number. | | +| `account_id` | ```String``` | Account ID | | +| `email_address` | ```String``` | Email address | | + diff --git a/sdks/ruby/docs/FaxLineResponse.md b/sdks/ruby/docs/FaxLineResponse.md new file mode 100644 index 000000000..af09d875c --- /dev/null +++ b/sdks/ruby/docs/FaxLineResponse.md @@ -0,0 +1,11 @@ +# Dropbox::Sign::FaxLineResponse + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line`*_required_ | [```FaxLineResponseFaxLine```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + diff --git a/sdks/ruby/docs/FaxLineResponseFaxLine.md b/sdks/ruby/docs/FaxLineResponseFaxLine.md new file mode 100644 index 000000000..03d2a1d95 --- /dev/null +++ b/sdks/ruby/docs/FaxLineResponseFaxLine.md @@ -0,0 +1,13 @@ +# Dropbox::Sign::FaxLineResponseFaxLine + + + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `number` | ```String``` | Number | | +| `created_at` | ```Integer``` | Created at | | +| `updated_at` | ```Integer``` | Updated at | | +| `accounts` | [```Array```](AccountResponse.md) | | | + diff --git a/sdks/ruby/docs/FileResponse.md b/sdks/ruby/docs/FileResponse.md index 639e4c949..0716b74a6 100644 --- a/sdks/ruby/docs/FileResponse.md +++ b/sdks/ruby/docs/FileResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `file_url` | ```String``` | URL to the file. | | -| `expires_at` | ```Integer``` | When the link expires. | | +| `file_url`*_required_ | ```String``` | URL to the file. | | +| `expires_at`*_required_ | ```Integer``` | When the link expires. | | diff --git a/sdks/ruby/docs/FileResponseDataUri.md b/sdks/ruby/docs/FileResponseDataUri.md index 8536b9d4f..57ebb1e79 100644 --- a/sdks/ruby/docs/FileResponseDataUri.md +++ b/sdks/ruby/docs/FileResponseDataUri.md @@ -6,5 +6,5 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `data_uri` | ```String``` | File as base64 encoded string. | | +| `data_uri`*_required_ | ```String``` | File as base64 encoded string. | | diff --git a/sdks/ruby/docs/ReportCreateResponse.md b/sdks/ruby/docs/ReportCreateResponse.md index cf9b22aba..970ef627f 100644 --- a/sdks/ruby/docs/ReportCreateResponse.md +++ b/sdks/ruby/docs/ReportCreateResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `report` | [```ReportResponse```](ReportResponse.md) | | | +| `report`*_required_ | [```ReportResponse```](ReportResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/SignatureRequestGetResponse.md b/sdks/ruby/docs/SignatureRequestGetResponse.md index b38bc8e7e..8afab07d9 100644 --- a/sdks/ruby/docs/SignatureRequestGetResponse.md +++ b/sdks/ruby/docs/SignatureRequestGetResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `signature_request` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | +| `signature_request`*_required_ | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/SignatureRequestListResponse.md b/sdks/ruby/docs/SignatureRequestListResponse.md index 0e4c47aa5..24dc69fbd 100644 --- a/sdks/ruby/docs/SignatureRequestListResponse.md +++ b/sdks/ruby/docs/SignatureRequestListResponse.md @@ -6,7 +6,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `signature_requests` | [```Array```](SignatureRequestResponse.md) | Contains information about signature requests. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `signature_requests`*_required_ | [```Array```](SignatureRequestResponse.md) | Contains information about signature requests. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/TeamGetInfoResponse.md b/sdks/ruby/docs/TeamGetInfoResponse.md index d82624999..f2ed62785 100644 --- a/sdks/ruby/docs/TeamGetInfoResponse.md +++ b/sdks/ruby/docs/TeamGetInfoResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `team` | [```TeamInfoResponse```](TeamInfoResponse.md) | | | +| `team`*_required_ | [```TeamInfoResponse```](TeamInfoResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/TeamGetResponse.md b/sdks/ruby/docs/TeamGetResponse.md index 92bc3c99a..9c5bd49a6 100644 --- a/sdks/ruby/docs/TeamGetResponse.md +++ b/sdks/ruby/docs/TeamGetResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `team` | [```TeamResponse```](TeamResponse.md) | | | +| `team`*_required_ | [```TeamResponse```](TeamResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/TeamInvitesResponse.md b/sdks/ruby/docs/TeamInvitesResponse.md index bd9e904a2..6adccaf7e 100644 --- a/sdks/ruby/docs/TeamInvitesResponse.md +++ b/sdks/ruby/docs/TeamInvitesResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `team_invites` | [```Array```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | +| `team_invites`*_required_ | [```Array```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | | `warnings` | [```Array```](WarningResponse.md) | | | diff --git a/sdks/ruby/docs/TeamMembersResponse.md b/sdks/ruby/docs/TeamMembersResponse.md index 4f30c70d1..15683188f 100644 --- a/sdks/ruby/docs/TeamMembersResponse.md +++ b/sdks/ruby/docs/TeamMembersResponse.md @@ -6,7 +6,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `team_members` | [```Array```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `team_members`*_required_ | [```Array```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | | | diff --git a/sdks/ruby/docs/TeamSubTeamsResponse.md b/sdks/ruby/docs/TeamSubTeamsResponse.md index ebc1fbe4c..77990a6a8 100644 --- a/sdks/ruby/docs/TeamSubTeamsResponse.md +++ b/sdks/ruby/docs/TeamSubTeamsResponse.md @@ -6,7 +6,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `sub_teams` | [```Array```](SubTeamResponse.md) | Contains a list with sub teams. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `sub_teams`*_required_ | [```Array```](SubTeamResponse.md) | Contains a list with sub teams. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | | | diff --git a/sdks/ruby/docs/TemplateCreateEmbeddedDraftResponse.md b/sdks/ruby/docs/TemplateCreateEmbeddedDraftResponse.md index 7dba9434d..74fdd9ff4 100644 --- a/sdks/ruby/docs/TemplateCreateEmbeddedDraftResponse.md +++ b/sdks/ruby/docs/TemplateCreateEmbeddedDraftResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `template` | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | +| `template`*_required_ | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/TemplateCreateResponse.md b/sdks/ruby/docs/TemplateCreateResponse.md index 759215017..217f81d55 100644 --- a/sdks/ruby/docs/TemplateCreateResponse.md +++ b/sdks/ruby/docs/TemplateCreateResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `template` | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | +| `template`*_required_ | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/TemplateEditResponse.md b/sdks/ruby/docs/TemplateEditResponse.md index 7d0979205..5b46080d2 100644 --- a/sdks/ruby/docs/TemplateEditResponse.md +++ b/sdks/ruby/docs/TemplateEditResponse.md @@ -6,5 +6,5 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `template_id` | ```String``` | The id of the Template. | | +| `template_id`*_required_ | ```String``` | The id of the Template. | | diff --git a/sdks/ruby/docs/TemplateGetResponse.md b/sdks/ruby/docs/TemplateGetResponse.md index 886548fbc..73127d1b7 100644 --- a/sdks/ruby/docs/TemplateGetResponse.md +++ b/sdks/ruby/docs/TemplateGetResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `template` | [```TemplateResponse```](TemplateResponse.md) | | | +| `template`*_required_ | [```TemplateResponse```](TemplateResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/TemplateListResponse.md b/sdks/ruby/docs/TemplateListResponse.md index 25d72e446..7708321ae 100644 --- a/sdks/ruby/docs/TemplateListResponse.md +++ b/sdks/ruby/docs/TemplateListResponse.md @@ -6,7 +6,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `templates` | [```Array```](TemplateResponse.md) | List of templates that the API caller has access to. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `templates`*_required_ | [```Array```](TemplateResponse.md) | List of templates that the API caller has access to. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/docs/TemplateUpdateFilesResponse.md b/sdks/ruby/docs/TemplateUpdateFilesResponse.md index c7d63a10e..11677a022 100644 --- a/sdks/ruby/docs/TemplateUpdateFilesResponse.md +++ b/sdks/ruby/docs/TemplateUpdateFilesResponse.md @@ -6,5 +6,5 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `template` | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | +| `template`*_required_ | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | diff --git a/sdks/ruby/docs/UnclaimedDraftCreateResponse.md b/sdks/ruby/docs/UnclaimedDraftCreateResponse.md index 986a52ff4..33608757c 100644 --- a/sdks/ruby/docs/UnclaimedDraftCreateResponse.md +++ b/sdks/ruby/docs/UnclaimedDraftCreateResponse.md @@ -6,6 +6,6 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| `unclaimed_draft` | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | +| `unclaimed_draft`*_required_ | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | | `warnings` | [```Array```](WarningResponse.md) | A list of warnings. | | diff --git a/sdks/ruby/dropbox-sign.gemspec b/sdks/ruby/dropbox-sign.gemspec index b0b43f3e1..b547a06fd 100755 --- a/sdks/ruby/dropbox-sign.gemspec +++ b/sdks/ruby/dropbox-sign.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end diff --git a/sdks/ruby/lib/dropbox-sign.rb b/sdks/ruby/lib/dropbox-sign.rb index 9e790e34b..147b296a5 100644 --- a/sdks/ruby/lib/dropbox-sign.rb +++ b/sdks/ruby/lib/dropbox-sign.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -51,6 +51,17 @@ 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_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' +require 'dropbox-sign/models/fax_line_area_code_get_response' +require 'dropbox-sign/models/fax_line_area_code_get_state_enum' +require 'dropbox-sign/models/fax_line_create_request' +require 'dropbox-sign/models/fax_line_delete_request' +require 'dropbox-sign/models/fax_line_list_response' +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/file_response' require 'dropbox-sign/models/file_response_data_uri' require 'dropbox-sign/models/list_info_response' @@ -195,6 +206,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_line_api' require 'dropbox-sign/api/o_auth_api' require 'dropbox-sign/api/report_api' require 'dropbox-sign/api/signature_request_api' diff --git a/sdks/ruby/lib/dropbox-sign/api/account_api.rb b/sdks/ruby/lib/dropbox-sign/api/account_api.rb index 1a8236db0..0354c00e5 100644 --- a/sdks/ruby/lib/dropbox-sign/api/account_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/account_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,7 +54,7 @@ def account_create_with_http_info(account_create_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -163,7 +163,7 @@ def account_get_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -257,7 +257,7 @@ def account_update_with_http_info(account_update_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -366,7 +366,7 @@ def account_verify_with_http_info(account_verify_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/sdks/ruby/lib/dropbox-sign/api/api_app_api.rb b/sdks/ruby/lib/dropbox-sign/api/api_app_api.rb index 809c7e834..0fdc9a624 100644 --- a/sdks/ruby/lib/dropbox-sign/api/api_app_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/api_app_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,7 +54,7 @@ def api_app_create_with_http_info(api_app_create_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -163,7 +163,7 @@ def api_app_delete_with_http_info(client_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -230,7 +230,7 @@ def api_app_get_with_http_info(client_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -324,7 +324,7 @@ def api_app_list_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -424,7 +424,7 @@ def api_app_update_with_http_info(client_id, api_app_update_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? diff --git a/sdks/ruby/lib/dropbox-sign/api/bulk_send_job_api.rb b/sdks/ruby/lib/dropbox-sign/api/bulk_send_job_api.rb index 199add7c4..567b8c371 100644 --- a/sdks/ruby/lib/dropbox-sign/api/bulk_send_job_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/bulk_send_job_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -60,7 +60,7 @@ def bulk_send_job_get_with_http_info(bulk_send_job_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -154,7 +154,7 @@ def bulk_send_job_list_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} diff --git a/sdks/ruby/lib/dropbox-sign/api/embedded_api.rb b/sdks/ruby/lib/dropbox-sign/api/embedded_api.rb index 0d153aed8..1dc01980e 100644 --- a/sdks/ruby/lib/dropbox-sign/api/embedded_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/embedded_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -60,7 +60,7 @@ def embedded_edit_url_with_http_info(template_id, embedded_edit_url_request, opt # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -169,7 +169,7 @@ def embedded_sign_url_with_http_info(signature_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} diff --git a/sdks/ruby/lib/dropbox-sign/api/fax_line_api.rb b/sdks/ruby/lib/dropbox-sign/api/fax_line_api.rb new file mode 100644 index 000000000..67815a05c --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/api/fax_line_api.rb @@ -0,0 +1,746 @@ +=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 FaxLineApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Add Fax Line User + # Grants a user access to the specified Fax Line. + # @param fax_line_add_user_request [FaxLineAddUserRequest] + # @param [Hash] opts the optional parameters + # @return [FaxLineResponse] + def fax_line_add_user(fax_line_add_user_request, opts = {}) + data, _status_code, _headers = fax_line_add_user_with_http_info(fax_line_add_user_request, opts) + data + end + + # Add Fax Line User + # Grants a user access to the specified Fax Line. + # @param fax_line_add_user_request [FaxLineAddUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(FaxLineResponse, Integer, Hash)>] FaxLineResponse data, response status code and response headers + def fax_line_add_user_with_http_info(fax_line_add_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxLineApi.fax_line_add_user ...' + end + # verify the required parameter 'fax_line_add_user_request' is set + if @api_client.config.client_side_validation && fax_line_add_user_request.nil? + fail ArgumentError, "Missing the required parameter 'fax_line_add_user_request' when calling FaxLineApi.fax_line_add_user" + end + # resource path + local_var_path = '/fax_line/add_user' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + post_body = {} + form_params = opts[:form_params] || {} + result = @api_client.generate_form_data( + fax_line_add_user_request, + Dropbox::Sign::FaxLineAddUserRequest.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] || 'FaxLineResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxLineApi.fax_line_add_user", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + begin + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::FaxLineResponse" + ) + + 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: FaxLineApi#fax_line_add_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Available Fax Line Area Codes + # Returns a response with the area codes available for a given state/provice and city. + # @param country [String] Filter area codes by country. + # @param [Hash] opts the optional parameters + # @option opts [String] :state Filter area codes by state. + # @option opts [String] :province Filter area codes by province. + # @option opts [String] :city Filter area codes by city. + # @return [FaxLineAreaCodeGetResponse] + def fax_line_area_code_get(country, opts = {}) + data, _status_code, _headers = fax_line_area_code_get_with_http_info(country, opts) + data + end + + # Get Available Fax Line Area Codes + # Returns a response with the area codes available for a given state/provice and city. + # @param country [String] Filter area codes by country. + # @param [Hash] opts the optional parameters + # @option opts [String] :state Filter area codes by state. + # @option opts [String] :province Filter area codes by province. + # @option opts [String] :city Filter area codes by city. + # @return [Array<(FaxLineAreaCodeGetResponse, Integer, Hash)>] FaxLineAreaCodeGetResponse data, response status code and response headers + def fax_line_area_code_get_with_http_info(country, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxLineApi.fax_line_area_code_get ...' + end + # verify the required parameter 'country' is set + if @api_client.config.client_side_validation && country.nil? + fail ArgumentError, "Missing the required parameter 'country' when calling FaxLineApi.fax_line_area_code_get" + end + # verify enum value + allowable_values = ["CA", "US", "UK"] + if @api_client.config.client_side_validation && !allowable_values.include?(country) + fail ArgumentError, "invalid value for \"country\", must be one of #{allowable_values}" + end + allowable_values = ["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 @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state']) + fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}" + end + allowable_values = ["AB", "BC", "MB", "NB", "NL", "NT", "NS", "NU", "ON", "PE", "QC", "SK", "YT"] + if @api_client.config.client_side_validation && opts[:'province'] && !allowable_values.include?(opts[:'province']) + fail ArgumentError, "invalid value for \"province\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/fax_line/area_codes' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'country'] = country + query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil? + query_params[:'province'] = opts[:'province'] if !opts[:'province'].nil? + query_params[:'city'] = opts[:'city'] if !opts[:'city'].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] || 'FaxLineAreaCodeGetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxLineApi.fax_line_area_code_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::FaxLineAreaCodeGetResponse" + ) + + 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: FaxLineApi#fax_line_area_code_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Purchase Fax Line + # Purchases a new Fax Line. + # @param fax_line_create_request [FaxLineCreateRequest] + # @param [Hash] opts the optional parameters + # @return [FaxLineResponse] + def fax_line_create(fax_line_create_request, opts = {}) + data, _status_code, _headers = fax_line_create_with_http_info(fax_line_create_request, opts) + data + end + + # Purchase Fax Line + # Purchases a new Fax Line. + # @param fax_line_create_request [FaxLineCreateRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(FaxLineResponse, Integer, Hash)>] FaxLineResponse data, response status code and response headers + def fax_line_create_with_http_info(fax_line_create_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxLineApi.fax_line_create ...' + end + # verify the required parameter 'fax_line_create_request' is set + if @api_client.config.client_side_validation && fax_line_create_request.nil? + fail ArgumentError, "Missing the required parameter 'fax_line_create_request' when calling FaxLineApi.fax_line_create" + end + # resource path + local_var_path = '/fax_line/create' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + 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_line_create_request, + Dropbox::Sign::FaxLineCreateRequest.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] || 'FaxLineResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxLineApi.fax_line_create", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + begin + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::FaxLineResponse" + ) + + 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: FaxLineApi#fax_line_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Fax Line + # Deletes the specified Fax Line from the subscription. + # @param fax_line_delete_request [FaxLineDeleteRequest] + # @param [Hash] opts the optional parameters + # @return [nil] + def fax_line_delete(fax_line_delete_request, opts = {}) + fax_line_delete_with_http_info(fax_line_delete_request, opts) + nil + end + + # Delete Fax Line + # Deletes the specified Fax Line from the subscription. + # @param fax_line_delete_request [FaxLineDeleteRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def fax_line_delete_with_http_info(fax_line_delete_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxLineApi.fax_line_delete ...' + end + # verify the required parameter 'fax_line_delete_request' is set + if @api_client.config.client_side_validation && fax_line_delete_request.nil? + fail ArgumentError, "Missing the required parameter 'fax_line_delete_request' when calling FaxLineApi.fax_line_delete" + end + # resource path + local_var_path = '/fax_line' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + post_body = {} + form_params = opts[:form_params] || {} + result = @api_client.generate_form_data( + fax_line_delete_request, + Dropbox::Sign::FaxLineDeleteRequest.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] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxLineApi.fax_line_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: FaxLineApi#fax_line_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get Fax Line + # Returns the properties and settings of a Fax Line. + # @param number [String] The Fax Line number. + # @param [Hash] opts the optional parameters + # @return [FaxLineResponse] + def fax_line_get(number, opts = {}) + data, _status_code, _headers = fax_line_get_with_http_info(number, opts) + data + end + + # Get Fax Line + # Returns the properties and settings of a Fax Line. + # @param number [String] The Fax Line number. + # @param [Hash] opts the optional parameters + # @return [Array<(FaxLineResponse, Integer, Hash)>] FaxLineResponse data, response status code and response headers + def fax_line_get_with_http_info(number, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxLineApi.fax_line_get ...' + end + # verify the required parameter 'number' is set + if @api_client.config.client_side_validation && number.nil? + fail ArgumentError, "Missing the required parameter 'number' when calling FaxLineApi.fax_line_get" + end + # resource path + local_var_path = '/fax_line' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'number'] = number + + # 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] || 'FaxLineResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxLineApi.fax_line_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::FaxLineResponse" + ) + + 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: FaxLineApi#fax_line_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Fax Lines + # Returns the properties and settings of multiple Fax Lines. + # @param [Hash] opts the optional parameters + # @option opts [String] :account_id Account ID + # @option opts [Integer] :page Page (default to 1) + # @option opts [Integer] :page_size Page size (default to 20) + # @option opts [Boolean] :show_team_lines Show team lines + # @return [FaxLineListResponse] + def fax_line_list(opts = {}) + data, _status_code, _headers = fax_line_list_with_http_info(opts) + data + end + + # List Fax Lines + # Returns the properties and settings of multiple Fax Lines. + # @param [Hash] opts the optional parameters + # @option opts [String] :account_id Account ID + # @option opts [Integer] :page Page (default to 1) + # @option opts [Integer] :page_size Page size (default to 20) + # @option opts [Boolean] :show_team_lines Show team lines + # @return [Array<(FaxLineListResponse, Integer, Hash)>] FaxLineListResponse data, response status code and response headers + def fax_line_list_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxLineApi.fax_line_list ...' + end + # resource path + local_var_path = '/fax_line/list' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'show_team_lines'] = opts[:'show_team_lines'] if !opts[:'show_team_lines'].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] || 'FaxLineListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxLineApi.fax_line_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::FaxLineListResponse" + ) + + 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: FaxLineApi#fax_line_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Remove Fax Line Access + # Removes a user's access to the specified Fax Line. + # @param fax_line_remove_user_request [FaxLineRemoveUserRequest] + # @param [Hash] opts the optional parameters + # @return [FaxLineResponse] + def fax_line_remove_user(fax_line_remove_user_request, opts = {}) + data, _status_code, _headers = fax_line_remove_user_with_http_info(fax_line_remove_user_request, opts) + data + end + + # Remove Fax Line Access + # Removes a user's access to the specified Fax Line. + # @param fax_line_remove_user_request [FaxLineRemoveUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(FaxLineResponse, Integer, Hash)>] FaxLineResponse data, response status code and response headers + def fax_line_remove_user_with_http_info(fax_line_remove_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FaxLineApi.fax_line_remove_user ...' + end + # verify the required parameter 'fax_line_remove_user_request' is set + if @api_client.config.client_side_validation && fax_line_remove_user_request.nil? + fail ArgumentError, "Missing the required parameter 'fax_line_remove_user_request' when calling FaxLineApi.fax_line_remove_user" + end + # resource path + local_var_path = '/fax_line/remove_user' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + post_body = {} + form_params = opts[:form_params] || {} + result = @api_client.generate_form_data( + fax_line_remove_user_request, + Dropbox::Sign::FaxLineRemoveUserRequest.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] || 'FaxLineResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api_key'] + + new_options = opts.merge( + :operation => :"FaxLineApi.fax_line_remove_user", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + begin + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + rescue Dropbox::Sign::ApiError => e + if e.code === 200 + body = @api_client.convert_to_type( + JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], + "Dropbox::Sign::FaxLineResponse" + ) + + 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: FaxLineApi#fax_line_remove_user\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/api/o_auth_api.rb b/sdks/ruby/lib/dropbox-sign/api/o_auth_api.rb index 03926e1fb..11c31ce71 100644 --- a/sdks/ruby/lib/dropbox-sign/api/o_auth_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/o_auth_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,7 +54,7 @@ def oauth_token_generate_with_http_info(o_auth_token_generate_request, opts = {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -149,7 +149,7 @@ def oauth_token_refresh_with_http_info(o_auth_token_refresh_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/sdks/ruby/lib/dropbox-sign/api/report_api.rb b/sdks/ruby/lib/dropbox-sign/api/report_api.rb index b545d5c16..25b642d4e 100644 --- a/sdks/ruby/lib/dropbox-sign/api/report_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/report_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,7 +54,7 @@ def report_create_with_http_info(report_create_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/sdks/ruby/lib/dropbox-sign/api/signature_request_api.rb b/sdks/ruby/lib/dropbox-sign/api/signature_request_api.rb index 48026cd2d..8003ba208 100644 --- a/sdks/ruby/lib/dropbox-sign/api/signature_request_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/signature_request_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,7 +54,7 @@ def signature_request_bulk_create_embedded_with_template_with_http_info(signatur # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -163,7 +163,7 @@ def signature_request_bulk_send_with_template_with_http_info(signature_request_b # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -272,7 +272,7 @@ def signature_request_cancel_with_http_info(signature_request_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -339,7 +339,7 @@ def signature_request_create_embedded_with_http_info(signature_request_create_em # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -448,7 +448,7 @@ def signature_request_create_embedded_with_template_with_http_info(signature_req # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -564,7 +564,7 @@ def signature_request_files_with_http_info(signature_request_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/zip', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/zip', 'application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -658,7 +658,7 @@ def signature_request_files_as_data_uri_with_http_info(signature_request_id, opt # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -755,7 +755,7 @@ def signature_request_files_as_file_url_with_http_info(signature_request_id, opt # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -849,7 +849,7 @@ def signature_request_get_with_http_info(signature_request_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -949,7 +949,7 @@ def signature_request_list_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -1043,7 +1043,7 @@ def signature_request_release_hold_with_http_info(signature_request_id, opts = { # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -1143,7 +1143,7 @@ def signature_request_remind_with_http_info(signature_request_id, signature_requ # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -1252,7 +1252,7 @@ def signature_request_remove_with_http_info(signature_request_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -1319,7 +1319,7 @@ def signature_request_send_with_http_info(signature_request_send_request, opts = # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -1428,7 +1428,7 @@ def signature_request_send_with_template_with_http_info(signature_request_send_w # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -1543,7 +1543,7 @@ def signature_request_update_with_http_info(signature_request_id, signature_requ # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/sdks/ruby/lib/dropbox-sign/api/team_api.rb b/sdks/ruby/lib/dropbox-sign/api/team_api.rb index a5de16415..ac7fe9552 100644 --- a/sdks/ruby/lib/dropbox-sign/api/team_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/team_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -57,7 +57,7 @@ def team_add_member_with_http_info(team_add_member_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -166,7 +166,7 @@ def team_create_with_http_info(team_create_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -269,7 +269,7 @@ def team_delete_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -330,7 +330,7 @@ def team_get_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -421,7 +421,7 @@ def team_info_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -512,7 +512,7 @@ def team_invites_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -620,7 +620,7 @@ def team_members_with_http_info(team_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -714,7 +714,7 @@ def team_remove_member_with_http_info(team_remove_member_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -837,7 +837,7 @@ def team_sub_teams_with_http_info(team_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -931,7 +931,7 @@ def team_update_with_http_info(team_update_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/sdks/ruby/lib/dropbox-sign/api/template_api.rb b/sdks/ruby/lib/dropbox-sign/api/template_api.rb index c764bfd5f..7a30ecaaa 100644 --- a/sdks/ruby/lib/dropbox-sign/api/template_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/template_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -60,7 +60,7 @@ def template_add_user_with_http_info(template_id, template_add_user_request, opt # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -169,7 +169,7 @@ def template_create_with_http_info(template_create_request, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -278,7 +278,7 @@ def template_create_embedded_draft_with_http_info(template_create_embedded_draft # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -387,7 +387,7 @@ def template_delete_with_http_info(template_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -461,7 +461,7 @@ def template_files_with_http_info(template_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/zip', 'application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/zip', 'application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -555,7 +555,7 @@ def template_files_as_data_uri_with_http_info(template_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -652,7 +652,7 @@ def template_files_as_file_url_with_http_info(template_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -746,7 +746,7 @@ def template_get_with_http_info(template_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -854,7 +854,7 @@ def template_list_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] post_body = {} form_params = opts[:form_params] || {} @@ -954,7 +954,7 @@ def template_remove_user_with_http_info(template_id, template_remove_user_reques # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -1069,7 +1069,7 @@ def template_update_files_with_http_info(template_id, template_update_files_requ # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? diff --git a/sdks/ruby/lib/dropbox-sign/api/unclaimed_draft_api.rb b/sdks/ruby/lib/dropbox-sign/api/unclaimed_draft_api.rb index b45e740ae..f54f8cb5d 100644 --- a/sdks/ruby/lib/dropbox-sign/api/unclaimed_draft_api.rb +++ b/sdks/ruby/lib/dropbox-sign/api/unclaimed_draft_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,7 +54,7 @@ def unclaimed_draft_create_with_http_info(unclaimed_draft_create_request, opts = # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -163,7 +163,7 @@ def unclaimed_draft_create_embedded_with_http_info(unclaimed_draft_create_embedd # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -272,7 +272,7 @@ def unclaimed_draft_create_embedded_with_template_with_http_info(unclaimed_draft # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + 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? @@ -387,7 +387,7 @@ def unclaimed_draft_edit_and_resend_with_http_info(signature_request_id, unclaim # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/sdks/ruby/lib/dropbox-sign/api_client.rb b/sdks/ruby/lib/dropbox-sign/api_client.rb index 598c81784..e8a364035 100644 --- a/sdks/ruby/lib/dropbox-sign/api_client.rb +++ b/sdks/ruby/lib/dropbox-sign/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -199,7 +199,7 @@ def download_file(request) "will be deleted automatically with GC. It's also recommended to delete the temp file "\ "explicitly with `tempfile.delete`" else - fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}") + fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}") end tempfile @@ -281,7 +281,6 @@ def convert_to_type(data, return_type) data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } end else - # models (e.g. Pet) klass = Dropbox::Sign.const_get(return_type) klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data) end diff --git a/sdks/ruby/lib/dropbox-sign/api_error.rb b/sdks/ruby/lib/dropbox-sign/api_error.rb index b914641c7..59c00cc87 100644 --- a/sdks/ruby/lib/dropbox-sign/api_error.rb +++ b/sdks/ruby/lib/dropbox-sign/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -15,7 +15,10 @@ module Dropbox module Dropbox::Sign class ApiError < StandardError - attr_reader :code, :response_headers, :response_body + attr_reader :code, :response_headers + + # @return [ErrorResponse] + attr_accessor :response_body # Usage examples: # ApiError.new diff --git a/sdks/ruby/lib/dropbox-sign/configuration.rb b/sdks/ruby/lib/dropbox-sign/configuration.rb index 3fb654f70..b730f09db 100644 --- a/sdks/ruby/lib/dropbox-sign/configuration.rb +++ b/sdks/ruby/lib/dropbox-sign/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end diff --git a/sdks/ruby/lib/dropbox-sign/event_callback_helper.rb b/sdks/ruby/lib/dropbox-sign/event_callback_helper.rb index 57a3b3605..50730c442 100644 --- a/sdks/ruby/lib/dropbox-sign/event_callback_helper.rb +++ b/sdks/ruby/lib/dropbox-sign/event_callback_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end diff --git a/sdks/ruby/lib/dropbox-sign/models/account_create_request.rb b/sdks/ruby/lib/dropbox-sign/models/account_create_request.rb index ec9e2fa0e..d2976866e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/account_create_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/account_create_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -49,11 +49,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -64,17 +59,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -229,7 +229,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/account_create_response.rb b/sdks/ruby/lib/dropbox-sign/models/account_create_response.rb index 4a256322e..ce46c3463 100644 --- a/sdks/ruby/lib/dropbox-sign/models/account_create_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/account_create_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -42,11 +42,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -56,17 +51,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -116,12 +116,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @account.nil? + invalid_properties.push('invalid value for "account", account 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 @account.nil? true end @@ -213,7 +218,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/account_get_response.rb b/sdks/ruby/lib/dropbox-sign/models/account_get_response.rb index 9dab132d8..66a4f1f59 100644 --- a/sdks/ruby/lib/dropbox-sign/models/account_get_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/account_get_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @account.nil? + invalid_properties.push('invalid value for "account", account 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 @account.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/account_response.rb b/sdks/ruby/lib/dropbox-sign/models/account_response.rb index dfef0e17c..f0b103c8e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/account_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/account_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -82,11 +82,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -104,11 +99,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -119,6 +109,16 @@ def self.openapi_nullable ]) 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 @@ -303,7 +303,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/account_response_quotas.rb b/sdks/ruby/lib/dropbox-sign/models/account_response_quotas.rb index e2b9731a7..3cdfba5ab 100644 --- a/sdks/ruby/lib/dropbox-sign/models/account_response_quotas.rb +++ b/sdks/ruby/lib/dropbox-sign/models/account_response_quotas.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -60,11 +60,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -77,11 +72,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -94,6 +84,16 @@ def self.openapi_nullable ]) 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 @@ -253,7 +253,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/account_response_usage.rb b/sdks/ruby/lib/dropbox-sign/models/account_response_usage.rb index ee53f33a9..fb0009132 100644 --- a/sdks/ruby/lib/dropbox-sign/models/account_response_usage.rb +++ b/sdks/ruby/lib/dropbox-sign/models/account_response_usage.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -47,11 +42,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -59,6 +49,16 @@ def self.openapi_nullable ]) 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 @@ -193,7 +193,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/account_update_request.rb b/sdks/ruby/lib/dropbox-sign/models/account_update_request.rb index e493e7d31..5ad8392c3 100644 --- a/sdks/ruby/lib/dropbox-sign/models/account_update_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/account_update_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -44,11 +44,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -58,11 +53,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -70,6 +60,16 @@ def self.openapi_nullable ]) 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 @@ -214,7 +214,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/account_verify_request.rb b/sdks/ruby/lib/dropbox-sign/models/account_verify_request.rb index ecc203b72..ebe2196b0 100644 --- a/sdks/ruby/lib/dropbox-sign/models/account_verify_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/account_verify_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -34,11 +34,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -46,17 +41,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -196,7 +196,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/account_verify_response.rb b/sdks/ruby/lib/dropbox-sign/models/account_verify_response.rb index fec9993f4..cf7d982af 100644 --- a/sdks/ruby/lib/dropbox-sign/models/account_verify_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/account_verify_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/account_verify_response_account.rb b/sdks/ruby/lib/dropbox-sign/models/account_verify_response_account.rb index 6316b91df..c98b7bfd8 100644 --- a/sdks/ruby/lib/dropbox-sign/models/account_verify_response_account.rb +++ b/sdks/ruby/lib/dropbox-sign/models/account_verify_response_account.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -34,11 +34,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -46,17 +41,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -191,7 +191,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/api_app_create_request.rb b/sdks/ruby/lib/dropbox-sign/models/api_app_create_request.rb index 12bcc4c05..c11b8d8dd 100644 --- a/sdks/ruby/lib/dropbox-sign/models/api_app_create_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/api_app_create_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -61,11 +61,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -79,17 +74,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -190,7 +190,6 @@ def domains=(domains) if domains.nil? fail ArgumentError, 'domains cannot be nil' end - if domains.length > 2 fail ArgumentError, 'invalid value for "domains", number of items must be less than or equal to 2.' end @@ -294,7 +293,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/api_app_get_response.rb b/sdks/ruby/lib/dropbox-sign/models/api_app_get_response.rb index f0c4397ce..e8d797223 100644 --- a/sdks/ruby/lib/dropbox-sign/models/api_app_get_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/api_app_get_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @api_app.nil? + invalid_properties.push('invalid value for "api_app", api_app 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 @api_app.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/api_app_list_response.rb b/sdks/ruby/lib/dropbox-sign/models/api_app_list_response.rb index eb5640055..702133344 100644 --- a/sdks/ruby/lib/dropbox-sign/models/api_app_list_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/api_app_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -43,11 +43,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -57,17 +52,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -119,12 +119,22 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @api_apps.nil? + invalid_properties.push('invalid value for "api_apps", api_apps 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 @api_apps.nil? + return false if @list_info.nil? true end @@ -216,7 +226,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/api_app_response.rb b/sdks/ruby/lib/dropbox-sign/models/api_app_response.rb index b0f461683..727d4fb44 100644 --- a/sdks/ruby/lib/dropbox-sign/models/api_app_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/api_app_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -76,11 +76,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -97,11 +92,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -112,6 +102,16 @@ def self.openapi_nullable ]) 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 @@ -293,7 +293,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/api_app_response_o_auth.rb b/sdks/ruby/lib/dropbox-sign/models/api_app_response_o_auth.rb index a05cef9e1..86e81f9d5 100644 --- a/sdks/ruby/lib/dropbox-sign/models/api_app_response_o_auth.rb +++ b/sdks/ruby/lib/dropbox-sign/models/api_app_response_o_auth.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -50,11 +50,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -65,17 +60,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -227,7 +227,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/api_app_response_options.rb b/sdks/ruby/lib/dropbox-sign/models/api_app_response_options.rb index 8cb41c594..223ce31ba 100644 --- a/sdks/ruby/lib/dropbox-sign/models/api_app_response_options.rb +++ b/sdks/ruby/lib/dropbox-sign/models/api_app_response_options.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -192,7 +192,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/api_app_response_owner_account.rb b/sdks/ruby/lib/dropbox-sign/models/api_app_response_owner_account.rb index e7a2c7f5e..f7627ec70 100644 --- a/sdks/ruby/lib/dropbox-sign/models/api_app_response_owner_account.rb +++ b/sdks/ruby/lib/dropbox-sign/models/api_app_response_owner_account.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/api_app_response_white_labeling_options.rb b/sdks/ruby/lib/dropbox-sign/models/api_app_response_white_labeling_options.rb index 8c421aa0c..141de8bbc 100644 --- a/sdks/ruby/lib/dropbox-sign/models/api_app_response_white_labeling_options.rb +++ b/sdks/ruby/lib/dropbox-sign/models/api_app_response_white_labeling_options.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -86,11 +86,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -111,17 +106,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -321,7 +321,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/api_app_update_request.rb b/sdks/ruby/lib/dropbox-sign/models/api_app_update_request.rb index db9518ed3..6d2574651 100644 --- a/sdks/ruby/lib/dropbox-sign/models/api_app_update_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/api_app_update_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -61,11 +61,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -79,17 +74,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -271,7 +271,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_get_response.rb b/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_get_response.rb index a4a5e6de4..71c2b1ade 100644 --- a/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_get_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_get_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -47,11 +47,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -62,17 +57,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -128,12 +128,27 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @bulk_send_job.nil? + invalid_properties.push('invalid value for "bulk_send_job", bulk_send_job cannot be nil.') + end + + if @list_info.nil? + invalid_properties.push('invalid value for "list_info", list_info cannot be nil.') + end + + if @signature_requests.nil? + invalid_properties.push('invalid value for "signature_requests", signature_requests 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 @bulk_send_job.nil? + return false if @list_info.nil? + return false if @signature_requests.nil? true end @@ -226,7 +241,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_get_response_signature_requests.rb b/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_get_response_signature_requests.rb index 0deeffdb2..489013c98 100644 --- a/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_get_response_signature_requests.rb +++ b/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_get_response_signature_requests.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -154,11 +154,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -190,11 +185,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -211,6 +201,16 @@ def self.openapi_nullable ]) 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 @@ -479,7 +479,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_list_response.rb b/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_list_response.rb index 9e63c14fc..4a1a90662 100644 --- a/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_list_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -43,11 +43,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -57,17 +52,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -119,12 +119,22 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @bulk_send_jobs.nil? + invalid_properties.push('invalid value for "bulk_send_jobs", bulk_send_jobs 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 @bulk_send_jobs.nil? + return false if @list_info.nil? true end @@ -216,7 +226,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_response.rb b/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_response.rb index 1b9532fcd..7373d6f4a 100644 --- a/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -50,11 +50,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -65,11 +60,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -77,6 +67,16 @@ def self.openapi_nullable ]) 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 @@ -226,7 +226,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_send_response.rb b/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_send_response.rb index 22e2e86aa..ddc24be8e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_send_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/bulk_send_job_send_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @bulk_send_job.nil? + invalid_properties.push('invalid value for "bulk_send_job", bulk_send_job 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 @bulk_send_job.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_request.rb b/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_request.rb index 1826c0f4b..48891c112 100644 --- a/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -78,11 +78,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -99,17 +94,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -307,7 +307,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_response.rb b/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_response.rb index 1d15ffdef..644563395 100644 --- a/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @embedded.nil? + invalid_properties.push('invalid value for "embedded", embedded 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 @embedded.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_response_embedded.rb b/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_response_embedded.rb index 303b60de6..5045efc48 100644 --- a/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_response_embedded.rb +++ b/sdks/ruby/lib/dropbox-sign/models/embedded_edit_url_response_embedded.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/embedded_sign_url_response.rb b/sdks/ruby/lib/dropbox-sign/models/embedded_sign_url_response.rb index 1b17f4e2a..532683c19 100644 --- a/sdks/ruby/lib/dropbox-sign/models/embedded_sign_url_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/embedded_sign_url_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @embedded.nil? + invalid_properties.push('invalid value for "embedded", embedded 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 @embedded.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/embedded_sign_url_response_embedded.rb b/sdks/ruby/lib/dropbox-sign/models/embedded_sign_url_response_embedded.rb index b21bef9e6..a9cda8261 100644 --- a/sdks/ruby/lib/dropbox-sign/models/embedded_sign_url_response_embedded.rb +++ b/sdks/ruby/lib/dropbox-sign/models/embedded_sign_url_response_embedded.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/error_response.rb b/sdks/ruby/lib/dropbox-sign/models/error_response.rb index 44ca97582..07eba4eb7 100644 --- a/sdks/ruby/lib/dropbox-sign/models/error_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/error_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -33,11 +33,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -45,17 +40,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -195,7 +195,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/error_response_error.rb b/sdks/ruby/lib/dropbox-sign/models/error_response_error.rb index f9e5c412b..0339a4eae 100644 --- a/sdks/ruby/lib/dropbox-sign/models/error_response_error.rb +++ b/sdks/ruby/lib/dropbox-sign/models/error_response_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -45,11 +45,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -59,17 +54,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -224,7 +224,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/event_callback_request.rb b/sdks/ruby/lib/dropbox-sign/models/event_callback_request.rb index 211e322da..8d29b4948 100644 --- a/sdks/ruby/lib/dropbox-sign/models/event_callback_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/event_callback_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -45,11 +45,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -60,17 +55,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -225,7 +225,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/event_callback_request_event.rb b/sdks/ruby/lib/dropbox-sign/models/event_callback_request_event.rb index c1c22c3dd..f8a9a1a07 100644 --- a/sdks/ruby/lib/dropbox-sign/models/event_callback_request_event.rb +++ b/sdks/ruby/lib/dropbox-sign/models/event_callback_request_event.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -71,11 +71,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -86,17 +81,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -273,7 +273,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/event_callback_request_event_metadata.rb b/sdks/ruby/lib/dropbox-sign/models/event_callback_request_event_metadata.rb index 99f0558b4..3ae44dc45 100644 --- a/sdks/ruby/lib/dropbox-sign/models/event_callback_request_event_metadata.rb +++ b/sdks/ruby/lib/dropbox-sign/models/event_callback_request_event_metadata.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -50,11 +50,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -65,11 +60,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -80,6 +70,16 @@ def self.openapi_nullable ]) 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 @@ -229,7 +229,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_line_add_user_request.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_add_user_request.rb new file mode 100644 index 000000000..0bed0ccaa --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_add_user_request.rb @@ -0,0 +1,275 @@ +=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 FaxLineAddUserRequest + # The Fax Line number. + # @return [String] + attr_accessor :number + + # Account ID + # @return [String] + attr_accessor :account_id + + # Email address + # @return [String] + attr_accessor :email_address + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'number' => :'number', + :'account_id' => :'account_id', + :'email_address' => :'email_address' + } + 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 + { + :'number' => :'String', + :'account_id' => :'String', + :'email_address' => :'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 [FaxLineAddUserRequest] + def self.init(data) + return ApiClient.default.convert_to_type( + data, + "FaxLineAddUserRequest" + ) || FaxLineAddUserRequest.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::FaxLineAddUserRequest` 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::FaxLineAddUserRequest`. 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?(:'number') + self.number = attributes[:'number'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'email_address') + self.email_address = attributes[:'email_address'] + 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 @number.nil? + invalid_properties.push('invalid value for "number", number 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 @number.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 && + number == o.number && + account_id == o.account_id && + email_address == o.email_address + 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 + [number, account_id, email_address].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_line_area_code_get_country_enum.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_area_code_get_country_enum.rb new file mode 100644 index 000000000..837596e5b --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_area_code_get_country_enum.rb @@ -0,0 +1,44 @@ +=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 FaxLineAreaCodeGetCountryEnum + CA = "CA".freeze + US = "US".freeze + UK = "UK".freeze + + def self.all_vars + @all_vars ||= [CA, US, UK].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if FaxLineAreaCodeGetCountryEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #FaxLineAreaCodeGetCountryEnum" + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_line_area_code_get_province_enum.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_area_code_get_province_enum.rb new file mode 100644 index 000000000..df6d0c2de --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_area_code_get_province_enum.rb @@ -0,0 +1,54 @@ +=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 FaxLineAreaCodeGetProvinceEnum + AB = "AB".freeze + BC = "BC".freeze + MB = "MB".freeze + NB = "NB".freeze + NL = "NL".freeze + NT = "NT".freeze + NS = "NS".freeze + NU = "NU".freeze + ON = "ON".freeze + PE = "PE".freeze + QC = "QC".freeze + SK = "SK".freeze + YT = "YT".freeze + + def self.all_vars + @all_vars ||= [AB, BC, MB, NB, NL, NT, NS, NU, ON, PE, QC, SK, YT].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if FaxLineAreaCodeGetProvinceEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #FaxLineAreaCodeGetProvinceEnum" + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_line_area_code_get_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_area_code_get_response.rb new file mode 100644 index 000000000..bcfd8b681 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_area_code_get_response.rb @@ -0,0 +1,254 @@ +=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 FaxLineAreaCodeGetResponse + # @return [Array] + attr_accessor :area_codes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'area_codes' => :'area_codes' + } + 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 + { + :'area_codes' => :'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 [FaxLineAreaCodeGetResponse] + def self.init(data) + return ApiClient.default.convert_to_type( + data, + "FaxLineAreaCodeGetResponse" + ) || FaxLineAreaCodeGetResponse.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::FaxLineAreaCodeGetResponse` 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::FaxLineAreaCodeGetResponse`. 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?(:'area_codes') + if (value = attributes[:'area_codes']).is_a?(Array) + self.area_codes = 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 @area_codes.nil? + invalid_properties.push('invalid value for "area_codes", area_codes 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 @area_codes.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 && + area_codes == o.area_codes + 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 + [area_codes].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_line_area_code_get_state_enum.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_area_code_get_state_enum.rb new file mode 100644 index 000000000..ceaa724ca --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_area_code_get_state_enum.rb @@ -0,0 +1,92 @@ +=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 FaxLineAreaCodeGetStateEnum + AK = "AK".freeze + AL = "AL".freeze + AR = "AR".freeze + AZ = "AZ".freeze + CA = "CA".freeze + CO = "CO".freeze + CT = "CT".freeze + DC = "DC".freeze + DE = "DE".freeze + FL = "FL".freeze + GA = "GA".freeze + HI = "HI".freeze + IA = "IA".freeze + ID = "ID".freeze + IL = "IL".freeze + IN = "IN".freeze + KS = "KS".freeze + KY = "KY".freeze + LA = "LA".freeze + MA = "MA".freeze + MD = "MD".freeze + ME = "ME".freeze + MI = "MI".freeze + MN = "MN".freeze + MO = "MO".freeze + MS = "MS".freeze + MT = "MT".freeze + NC = "NC".freeze + ND = "ND".freeze + NE = "NE".freeze + NH = "NH".freeze + NJ = "NJ".freeze + NM = "NM".freeze + NV = "NV".freeze + NY = "NY".freeze + OH = "OH".freeze + OK = "OK".freeze + OR = "OR".freeze + PA = "PA".freeze + RI = "RI".freeze + SC = "SC".freeze + SD = "SD".freeze + TN = "TN".freeze + TX = "TX".freeze + UT = "UT".freeze + VA = "VA".freeze + VT = "VT".freeze + WA = "WA".freeze + WI = "WI".freeze + WV = "WV".freeze + WY = "WY".freeze + + def self.all_vars + @all_vars ||= [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].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if FaxLineAreaCodeGetStateEnum.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #FaxLineAreaCodeGetStateEnum" + end + end +end diff --git a/sdks/ruby/lib/dropbox-sign/models/fax_line_create_request.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_create_request.rb new file mode 100644 index 000000000..261e3bd1d --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_create_request.rb @@ -0,0 +1,325 @@ +=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 FaxLineCreateRequest + # Area code + # @return [Integer] + attr_accessor :area_code + + # Country + # @return [String] + attr_accessor :country + + # City + # @return [String] + attr_accessor :city + + # Account ID + # @return [String] + attr_accessor :account_id + + 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 + { + :'area_code' => :'area_code', + :'country' => :'country', + :'city' => :'city', + :'account_id' => :'account_id' + } + 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 + { + :'area_code' => :'Integer', + :'country' => :'String', + :'city' => :'String', + :'account_id' => :'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 [FaxLineCreateRequest] + def self.init(data) + return ApiClient.default.convert_to_type( + data, + "FaxLineCreateRequest" + ) || FaxLineCreateRequest.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::FaxLineCreateRequest` 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::FaxLineCreateRequest`. 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?(:'area_code') + self.area_code = attributes[:'area_code'] + end + + if attributes.key?(:'country') + self.country = attributes[:'country'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + 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 @area_code.nil? + invalid_properties.push('invalid value for "area_code", area_code cannot be nil.') + end + + if @country.nil? + invalid_properties.push('invalid value for "country", country 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 @area_code.nil? + return false if @country.nil? + country_validator = EnumAttributeValidator.new('String', ["CA", "US", "UK"]) + return false unless country_validator.valid?(@country) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] country Object to be assigned + def country=(country) + validator = EnumAttributeValidator.new('String', ["CA", "US", "UK"]) + unless validator.valid?(country) + fail ArgumentError, "invalid value for \"country\", must be one of #{validator.allowable_values}." + end + @country = country + 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 && + area_code == o.area_code && + country == o.country && + city == o.city && + account_id == o.account_id + 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 + [area_code, country, city, account_id].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_line_delete_request.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_delete_request.rb new file mode 100644 index 000000000..632b2cbdb --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_delete_request.rb @@ -0,0 +1,253 @@ +=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 FaxLineDeleteRequest + # The Fax Line number. + # @return [String] + attr_accessor :number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'number' => :'number' + } + 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 + { + :'number' => :'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 [FaxLineDeleteRequest] + def self.init(data) + return ApiClient.default.convert_to_type( + data, + "FaxLineDeleteRequest" + ) || FaxLineDeleteRequest.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::FaxLineDeleteRequest` 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::FaxLineDeleteRequest`. 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?(:'number') + self.number = attributes[:'number'] + 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 @number.nil? + invalid_properties.push('invalid value for "number", number 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 @number.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 && + number == o.number + 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 + [number].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_line_list_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_list_response.rb new file mode 100644 index 000000000..5aac0f5a7 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_list_response.rb @@ -0,0 +1,279 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.8.0 + +=end + +require 'date' +require 'time' + +module Dropbox +end + +module Dropbox::Sign + class FaxLineListResponse + # @return [ListInfoResponse] + attr_accessor :list_info + + # @return [Array] + attr_accessor :fax_lines + + # @return [WarningResponse] + attr_accessor :warnings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'list_info' => :'list_info', + :'fax_lines' => :'fax_lines', + :'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 + { + :'list_info' => :'ListInfoResponse', + :'fax_lines' => :'Array', + :'warnings' => :'WarningResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [FaxLineListResponse] + def self.init(data) + return ApiClient.default.convert_to_type( + data, + "FaxLineListResponse" + ) || FaxLineListResponse.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::FaxLineListResponse` 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::FaxLineListResponse`. 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?(:'list_info') + self.list_info = attributes[:'list_info'] + end + + if attributes.key?(:'fax_lines') + if (value = attributes[:'fax_lines']).is_a?(Array) + self.fax_lines = value + end + end + + if attributes.key?(:'warnings') + self.warnings = attributes[:'warnings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @list_info.nil? + invalid_properties.push('invalid value for "list_info", list_info cannot be nil.') + end + + if @fax_lines.nil? + invalid_properties.push('invalid value for "fax_lines", fax_lines 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 @list_info.nil? + return false if @fax_lines.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 && + list_info == o.list_info && + fax_lines == o.fax_lines && + 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 + [list_info, fax_lines, 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_line_remove_user_request.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_remove_user_request.rb new file mode 100644 index 000000000..b2b0a6c9c --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_remove_user_request.rb @@ -0,0 +1,275 @@ +=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 FaxLineRemoveUserRequest + # The Fax Line number. + # @return [String] + attr_accessor :number + + # Account ID + # @return [String] + attr_accessor :account_id + + # Email address + # @return [String] + attr_accessor :email_address + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'number' => :'number', + :'account_id' => :'account_id', + :'email_address' => :'email_address' + } + 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 + { + :'number' => :'String', + :'account_id' => :'String', + :'email_address' => :'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 [FaxLineRemoveUserRequest] + def self.init(data) + return ApiClient.default.convert_to_type( + data, + "FaxLineRemoveUserRequest" + ) || FaxLineRemoveUserRequest.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::FaxLineRemoveUserRequest` 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::FaxLineRemoveUserRequest`. 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?(:'number') + self.number = attributes[:'number'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'email_address') + self.email_address = attributes[:'email_address'] + 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 @number.nil? + invalid_properties.push('invalid value for "number", number 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 @number.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 && + number == o.number && + account_id == o.account_id && + email_address == o.email_address + 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 + [number, account_id, email_address].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_line_response.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_response.rb new file mode 100644 index 000000000..491b618b3 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_response.rb @@ -0,0 +1,262 @@ +=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 FaxLineResponse + # @return [FaxLineResponseFaxLine] + attr_accessor :fax_line + + # @return [WarningResponse] + attr_accessor :warnings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'fax_line' => :'fax_line', + :'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_line' => :'FaxLineResponseFaxLine', + :'warnings' => :'WarningResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Returns attribute map of this model + parent + def self.merged_attributes + self.attribute_map + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.openapi_types + end + + # Returns list of attributes with nullable: true of this model + parent + def self.merged_nullable + self.openapi_nullable + end + + # Attempt to instantiate and hydrate a new instance of this class + # @param [Object] data Data to be converted + # @return [FaxLineResponse] + def self.init(data) + return ApiClient.default.convert_to_type( + data, + "FaxLineResponse" + ) || FaxLineResponse.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::FaxLineResponse` 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::FaxLineResponse`. 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_line') + self.fax_line = attributes[:'fax_line'] + end + + if attributes.key?(:'warnings') + self.warnings = attributes[:'warnings'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @fax_line.nil? + invalid_properties.push('invalid value for "fax_line", fax_line 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_line.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_line == o.fax_line && + 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_line, 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_line_response_fax_line.rb b/sdks/ruby/lib/dropbox-sign/models/fax_line_response_fax_line.rb new file mode 100644 index 000000000..2d39e7fd1 --- /dev/null +++ b/sdks/ruby/lib/dropbox-sign/models/fax_line_response_fax_line.rb @@ -0,0 +1,282 @@ +=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 FaxLineResponseFaxLine + # Number + # @return [String] + attr_accessor :number + + # Created at + # @return [Integer] + attr_accessor :created_at + + # Updated at + # @return [Integer] + attr_accessor :updated_at + + # @return [Array] + attr_accessor :accounts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'number' => :'number', + :'created_at' => :'created_at', + :'updated_at' => :'updated_at', + :'accounts' => :'accounts' + } + 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 + { + :'number' => :'String', + :'created_at' => :'Integer', + :'updated_at' => :'Integer', + :'accounts' => :'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 [FaxLineResponseFaxLine] + def self.init(data) + return ApiClient.default.convert_to_type( + data, + "FaxLineResponseFaxLine" + ) || FaxLineResponseFaxLine.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::FaxLineResponseFaxLine` 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::FaxLineResponseFaxLine`. 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?(:'number') + self.number = attributes[:'number'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'accounts') + if (value = attributes[:'accounts']).is_a?(Array) + self.accounts = 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 + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + number == o.number && + created_at == o.created_at && + updated_at == o.updated_at && + accounts == o.accounts + 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 + [number, created_at, updated_at, accounts].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/file_response.rb b/sdks/ruby/lib/dropbox-sign/models/file_response.rb index 8836237a4..6a2deff5b 100644 --- a/sdks/ruby/lib/dropbox-sign/models/file_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/file_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -106,12 +106,22 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @file_url.nil? + invalid_properties.push('invalid value for "file_url", file_url cannot be nil.') + end + + if @expires_at.nil? + invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.') + end + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return false if @file_url.nil? + return false if @expires_at.nil? true end @@ -202,7 +212,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/file_response_data_uri.rb b/sdks/ruby/lib/dropbox-sign/models/file_response_data_uri.rb index 7c11af518..d35727bdc 100644 --- a/sdks/ruby/lib/dropbox-sign/models/file_response_data_uri.rb +++ b/sdks/ruby/lib/dropbox-sign/models/file_response_data_uri.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -34,11 +34,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -46,17 +41,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -96,12 +96,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @data_uri.nil? + invalid_properties.push('invalid value for "data_uri", data_uri 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 @data_uri.nil? true end @@ -191,7 +196,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/list_info_response.rb b/sdks/ruby/lib/dropbox-sign/models/list_info_response.rb index 78525c9b3..17768f90f 100644 --- a/sdks/ruby/lib/dropbox-sign/models/list_info_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/list_info_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -50,11 +50,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -65,11 +60,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -77,6 +67,16 @@ def self.openapi_nullable ]) 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 @@ -226,7 +226,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/o_auth_token_generate_request.rb b/sdks/ruby/lib/dropbox-sign/models/o_auth_token_generate_request.rb index 65705aca5..d835479a5 100644 --- a/sdks/ruby/lib/dropbox-sign/models/o_auth_token_generate_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/o_auth_token_generate_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,11 +54,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -70,17 +65,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -262,7 +262,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/o_auth_token_refresh_request.rb b/sdks/ruby/lib/dropbox-sign/models/o_auth_token_refresh_request.rb index 30b3c9c4d..737180ee0 100644 --- a/sdks/ruby/lib/dropbox-sign/models/o_auth_token_refresh_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/o_auth_token_refresh_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -214,7 +214,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/o_auth_token_response.rb b/sdks/ruby/lib/dropbox-sign/models/o_auth_token_response.rb index 874c41743..5acda2f21 100644 --- a/sdks/ruby/lib/dropbox-sign/models/o_auth_token_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/o_auth_token_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -50,11 +50,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -66,11 +61,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -78,6 +68,16 @@ def self.openapi_nullable ]) 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 @@ -232,7 +232,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/report_create_request.rb b/sdks/ruby/lib/dropbox-sign/models/report_create_request.rb index 906f13393..95b86e158 100644 --- a/sdks/ruby/lib/dropbox-sign/models/report_create_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/report_create_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -66,11 +66,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -80,17 +75,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -262,7 +262,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/report_create_response.rb b/sdks/ruby/lib/dropbox-sign/models/report_create_response.rb index e2c840341..5ff6010b4 100644 --- a/sdks/ruby/lib/dropbox-sign/models/report_create_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/report_create_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @report.nil? + invalid_properties.push('invalid value for "report", report 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 @report.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/report_response.rb b/sdks/ruby/lib/dropbox-sign/models/report_response.rb index dfc290245..a7940862a 100644 --- a/sdks/ruby/lib/dropbox-sign/models/report_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/report_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -72,11 +72,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -87,17 +82,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -249,7 +249,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb index f7bc3b707..3e2e1534f 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -94,11 +94,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -118,17 +113,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -398,7 +398,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb index da98e8797..894d2b0c8 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -94,11 +94,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -118,17 +113,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -393,7 +393,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_request.rb index 842a341ea..f5d87ca44 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -147,11 +147,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -182,11 +177,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -194,6 +184,16 @@ def self.openapi_nullable ]) 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 @@ -533,7 +533,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_with_template_request.rb index 2ca96b6ce..3238f8bb5 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_with_template_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_create_embedded_with_template_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -103,11 +103,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -129,17 +124,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -430,7 +430,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_get_response.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_get_response.rb index 6b0931714..51cabcca3 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_get_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_get_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @signature_request.nil? + invalid_properties.push('invalid value for "signature_request", signature_request 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 @signature_request.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_list_response.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_list_response.rb index 11aefe57f..0d365cc76 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_list_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -43,11 +43,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -57,17 +52,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -119,12 +119,22 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @signature_requests.nil? + invalid_properties.push('invalid value for "signature_requests", signature_requests 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 @signature_requests.nil? + return false if @list_info.nil? true end @@ -216,7 +226,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_remind_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_remind_request.rb index 87fa9f182..eb20a87f9 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_remind_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_remind_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -207,7 +207,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response.rb index c6c8ff11d..2d4a9b2ec 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -155,11 +155,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -191,11 +186,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -213,6 +203,16 @@ def self.openapi_nullable ]) 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 @@ -481,7 +481,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_attachment.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_attachment.rb index f44274223..2d4e6c41c 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_attachment.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_attachment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -24,7 +24,7 @@ class SignatureRequestResponseAttachment attr_accessor :id # The Signer this attachment is assigned to. - # @return [String] + # @return [Integer, String] attr_accessor :signer # The name of this attachment. @@ -60,11 +60,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -77,11 +72,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -90,6 +80,16 @@ def self.openapi_nullable ]) 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 @@ -269,7 +269,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_base.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_base.rb index 8645b255e..4694488e0 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_base.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_base.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -55,11 +55,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -71,17 +66,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -261,7 +261,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_checkbox.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_checkbox.rb index cb119c85e..71a9680c8 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_checkbox.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_checkbox.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -214,7 +214,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_text.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_text.rb index d61464643..47169c9cd 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_text.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_text.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -214,7 +214,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_type_enum.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_type_enum.rb index 38d4cd604..63f61f1aa 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_type_enum.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_custom_field_type_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,5 +40,4 @@ def build_from_hash(value) raise "Invalid ENUM value #{value} for class #SignatureRequestResponseCustomFieldTypeEnum" end end - end diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_base.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_base.rb index 2f6a5154b..492c3a4f5 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_base.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_base.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,11 +54,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -70,17 +65,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -271,7 +271,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_type_enum.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_type_enum.rb index a8dcbb734..74f03f229 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_type_enum.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_type_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -47,5 +47,4 @@ def build_from_hash(value) raise "Invalid ENUM value #{value} for class #SignatureRequestResponseDataTypeEnum" end end - end diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_checkbox.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_checkbox.rb index ec714d431..aed01252b 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_checkbox.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_checkbox.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -208,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_checkbox_merge.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_checkbox_merge.rb index 60f6e8134..605e3a703 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_checkbox_merge.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_checkbox_merge.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -208,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_date_signed.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_date_signed.rb index 2fb316dc3..dfd5b1d72 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_date_signed.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_date_signed.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -208,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_dropdown.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_dropdown.rb index 162f875e1..fc0db092a 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_dropdown.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_dropdown.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -208,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_initials.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_initials.rb index 070722e7f..9a13903f6 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_initials.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_initials.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -208,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_radio.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_radio.rb index 1d6846041..ddfcd8bbe 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_radio.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_radio.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -208,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_signature.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_signature.rb index 18ef029fb..7831d4b3e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_signature.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_signature.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -208,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_text.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_text.rb index ebe37746d..31829b46e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_text.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_text.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -208,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_text_merge.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_text_merge.rb index 3b8f95c8b..0d69a1e18 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_text_merge.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_data_value_text_merge.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -208,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_signatures.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_signatures.rb index c543fcb62..9588867d2 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_response_signatures.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_response_signatures.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -125,11 +125,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -155,11 +150,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -181,6 +171,16 @@ def self.openapi_nullable ]) 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 @@ -405,7 +405,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_send_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_send_request.rb index 999fdd302..189a0aab6 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_send_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_send_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -157,11 +157,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -194,11 +189,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -206,6 +196,16 @@ def self.openapi_nullable ]) 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 @@ -552,7 +552,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_send_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_send_with_template_request.rb index c6afc6548..c0b1c6e83 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_send_with_template_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_send_with_template_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -114,11 +114,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -142,17 +137,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -450,7 +450,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/signature_request_update_request.rb b/sdks/ruby/lib/dropbox-sign/models/signature_request_update_request.rb index 72ce65152..773b7058a 100644 --- a/sdks/ruby/lib/dropbox-sign/models/signature_request_update_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/signature_request_update_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -49,11 +49,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -64,11 +59,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -76,6 +66,16 @@ def self.openapi_nullable ]) 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 @@ -230,7 +230,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_attachment.rb b/sdks/ruby/lib/dropbox-sign/models/sub_attachment.rb index a34d70302..1f4d6db03 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_attachment.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_attachment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -49,11 +49,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -64,17 +59,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -236,7 +236,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_bulk_signer_list.rb b/sdks/ruby/lib/dropbox-sign/models/sub_bulk_signer_list.rb index 5457753b7..d1049ea10 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_bulk_signer_list.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_bulk_signer_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -206,7 +206,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_bulk_signer_list_custom_field.rb b/sdks/ruby/lib/dropbox-sign/models/sub_bulk_signer_list_custom_field.rb index 18162fe89..9cda4201e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_bulk_signer_list_custom_field.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_bulk_signer_list_custom_field.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -212,7 +212,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_cc.rb b/sdks/ruby/lib/dropbox-sign/models/sub_cc.rb index 36b50fbcc..aff761072 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_cc.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_cc.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -212,7 +212,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_custom_field.rb b/sdks/ruby/lib/dropbox-sign/models/sub_custom_field.rb index d5b7a8ede..65a95e7ff 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_custom_field.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_custom_field.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -50,11 +50,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -65,17 +60,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -232,7 +232,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_editor_options.rb b/sdks/ruby/lib/dropbox-sign/models/sub_editor_options.rb index 807df8f32..28f85220c 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_editor_options.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_editor_options.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -207,7 +207,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_field_options.rb b/sdks/ruby/lib/dropbox-sign/models/sub_field_options.rb index 39b24eb1a..6c76569e5 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_field_options.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_field_options.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -57,11 +57,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -69,17 +64,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -231,7 +231,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_field_group.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_field_group.rb index f5228ab27..5f5a738bc 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_field_group.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_field_group.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -44,11 +44,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -58,17 +53,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -228,7 +228,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule.rb index 6962f1455..1090465d3 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -49,11 +49,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -64,17 +59,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -182,7 +182,6 @@ def triggers=(triggers) if triggers.nil? fail ArgumentError, 'triggers cannot be nil' end - if triggers.length > 1 fail ArgumentError, 'invalid value for "triggers", number of items must be less than or equal to 1.' end @@ -200,7 +199,6 @@ def actions=(actions) if actions.nil? fail ArgumentError, 'actions cannot be nil' end - if actions.length < 1 fail ArgumentError, 'invalid value for "actions", number of items must be greater than or equal to 1.' end @@ -297,7 +295,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule_action.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule_action.rb index c72934c86..4ebaabc48 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule_action.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule_action.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -70,11 +70,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -85,17 +80,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -267,7 +267,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule_trigger.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule_trigger.rb index d5e041d17..4bfc6d52a 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule_trigger.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_field_rule_trigger.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -71,11 +71,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -86,17 +81,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -270,7 +270,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_base.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_base.rb index 9c57bcad2..9b8a0fba1 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_base.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_base.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -84,11 +84,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -106,11 +101,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -118,6 +108,16 @@ def self.openapi_nullable ]) 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 @@ -386,7 +386,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_checkbox.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_checkbox.rb index 2587fd3bd..542397966 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_checkbox.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_checkbox.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -45,11 +45,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -59,17 +54,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -230,7 +230,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_checkbox_merge.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_checkbox_merge.rb index bcfc7bc17..f9e3c2832 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_checkbox_merge.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_checkbox_merge.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_date_signed.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_date_signed.rb index 4d1d03a63..f9c9e0ff3 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_date_signed.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_date_signed.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -67,11 +67,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -81,17 +76,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -261,7 +261,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_dropdown.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_dropdown.rb index 9f3351fe3..873e3cb65 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_dropdown.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_dropdown.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -77,11 +77,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -93,17 +88,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -200,7 +200,6 @@ def options=(options) if options.nil? fail ArgumentError, 'options cannot be nil' end - if options.length < 1 fail ArgumentError, 'invalid value for "options", number of items must be greater than or equal to 1.' end @@ -309,7 +308,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_font_enum.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_font_enum.rb index a82167834..77ba1ddcd 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_font_enum.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_font_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,5 +54,4 @@ def build_from_hash(value) raise "Invalid ENUM value #{value} for class #SubFormFieldsPerDocumentFontEnum" end end - end diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_hyperlink.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_hyperlink.rb index 86db89d2b..886cd7a64 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_hyperlink.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_hyperlink.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -77,11 +77,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -93,17 +88,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -293,7 +293,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_initials.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_initials.rb index c06271f46..266bc1f83 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_initials.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_initials.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_radio.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_radio.rb index 17b1a2dfb..4bcf2c26e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_radio.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_radio.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -45,11 +45,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -59,17 +54,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -235,7 +235,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_signature.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_signature.rb index b8d5ee8f7..7d82ef22d 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_signature.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_signature.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_text.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_text.rb index d6e149e54..bfda46a41 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_text.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_text.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -105,11 +105,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -127,17 +122,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -359,7 +359,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_text_merge.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_text_merge.rb index 3aface53b..42a4192b2 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_text_merge.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_text_merge.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -67,11 +67,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -81,17 +76,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -261,7 +261,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_type_enum.rb b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_type_enum.rb index 3c7c37847..bc0fd0029 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_type_enum.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_form_fields_per_document_type_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -48,5 +48,4 @@ def build_from_hash(value) raise "Invalid ENUM value #{value} for class #SubFormFieldsPerDocumentTypeEnum" end end - end diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_merge_field.rb b/sdks/ruby/lib/dropbox-sign/models/sub_merge_field.rb index 768856c3d..2d2cbe415 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_merge_field.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_merge_field.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -61,11 +61,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -74,17 +69,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -246,7 +246,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_o_auth.rb b/sdks/ruby/lib/dropbox-sign/models/sub_o_auth.rb index 97923c366..11c8c603d 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_o_auth.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_o_auth.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -62,11 +62,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -75,17 +70,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -227,7 +227,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_options.rb b/sdks/ruby/lib/dropbox-sign/models/sub_options.rb index 6d1a3de8c..f8263c690 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_options.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_options.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -194,7 +194,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_grouped_signers.rb b/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_grouped_signers.rb index 06749cfd3..8c6338b84 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_grouped_signers.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_grouped_signers.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -44,11 +44,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -58,11 +53,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -70,6 +60,16 @@ def self.openapi_nullable ]) 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 @@ -226,7 +226,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_signer.rb b/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_signer.rb index 9f76fca44..002b9c51d 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_signer.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_signer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -81,11 +81,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -98,11 +93,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -110,6 +100,16 @@ def self.openapi_nullable ]) 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 @@ -315,7 +315,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_template_signer.rb b/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_template_signer.rb index 3191b6268..a238d5188 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_template_signer.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_signature_request_template_signer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -81,11 +81,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -98,17 +93,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -319,7 +319,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_signing_options.rb b/sdks/ruby/lib/dropbox-sign/models/sub_signing_options.rb index 4156b034c..bc0a3ca79 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_signing_options.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_signing_options.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -77,11 +77,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -93,17 +88,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -283,7 +283,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_team_response.rb b/sdks/ruby/lib/dropbox-sign/models/sub_team_response.rb index c6fb00d45..6ef8fc906 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_team_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_team_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -202,7 +202,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_template_role.rb b/sdks/ruby/lib/dropbox-sign/models/sub_template_role.rb index 88a43b975..f0ccab9c0 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_template_role.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_template_role.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -52,11 +47,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -64,6 +54,16 @@ def self.openapi_nullable ]) 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 @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_unclaimed_draft_signer.rb b/sdks/ruby/lib/dropbox-sign/models/sub_unclaimed_draft_signer.rb index 05f8cca07..f593c47b7 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_unclaimed_draft_signer.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_unclaimed_draft_signer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -44,11 +44,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -58,11 +53,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -70,6 +60,16 @@ def self.openapi_nullable ]) 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 @@ -224,7 +224,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_unclaimed_draft_template_signer.rb b/sdks/ruby/lib/dropbox-sign/models/sub_unclaimed_draft_template_signer.rb index 3bcbee3bf..a58474adc 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_unclaimed_draft_template_signer.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_unclaimed_draft_template_signer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -44,11 +44,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -58,17 +53,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -228,7 +228,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/sub_white_labeling_options.rb b/sdks/ruby/lib/dropbox-sign/models/sub_white_labeling_options.rb index 4d34636f6..b601240d0 100644 --- a/sdks/ruby/lib/dropbox-sign/models/sub_white_labeling_options.rb +++ b/sdks/ruby/lib/dropbox-sign/models/sub_white_labeling_options.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -113,11 +113,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -139,17 +134,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -394,7 +394,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_add_member_request.rb b/sdks/ruby/lib/dropbox-sign/models/team_add_member_request.rb index f09af189f..7a538485b 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_add_member_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_add_member_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -66,11 +66,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -80,17 +75,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -247,7 +247,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_create_request.rb b/sdks/ruby/lib/dropbox-sign/models/team_create_request.rb index ef4d9061c..1ec4c2fe3 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_create_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_create_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -34,11 +34,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -46,17 +41,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -193,7 +193,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_get_info_response.rb b/sdks/ruby/lib/dropbox-sign/models/team_get_info_response.rb index b8719b60e..130dd8a04 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_get_info_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_get_info_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @team.nil? + invalid_properties.push('invalid value for "team", team 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 @team.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_get_response.rb b/sdks/ruby/lib/dropbox-sign/models/team_get_response.rb index 409acdaab..f844f06e1 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_get_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_get_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @team.nil? + invalid_properties.push('invalid value for "team", team 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 @team.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_info_response.rb b/sdks/ruby/lib/dropbox-sign/models/team_info_response.rb index 31b39ab86..095ecf8e0 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_info_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_info_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -53,11 +53,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -69,11 +64,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -81,6 +71,16 @@ def self.openapi_nullable ]) 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 @@ -235,7 +235,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_invite_response.rb b/sdks/ruby/lib/dropbox-sign/models/team_invite_response.rb index 41e022fe8..2d8187bd8 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_invite_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_invite_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -59,11 +59,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -76,17 +71,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -246,7 +246,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_invites_response.rb b/sdks/ruby/lib/dropbox-sign/models/team_invites_response.rb index 11c138fd0..7625af4a4 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_invites_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_invites_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -109,12 +109,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @team_invites.nil? + invalid_properties.push('invalid value for "team_invites", team_invites 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 @team_invites.nil? true end @@ -205,7 +210,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_member_response.rb b/sdks/ruby/lib/dropbox-sign/models/team_member_response.rb index 19549cb82..7308392c4 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_member_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_member_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -44,11 +44,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -58,17 +53,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -213,7 +213,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_members_response.rb b/sdks/ruby/lib/dropbox-sign/models/team_members_response.rb index 916000f7f..6635222c6 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_members_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_members_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -42,11 +42,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -56,17 +51,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -118,12 +118,22 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @team_members.nil? + invalid_properties.push('invalid value for "team_members", team_members 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 @team_members.nil? + return false if @list_info.nil? true end @@ -215,7 +225,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_parent_response.rb b/sdks/ruby/lib/dropbox-sign/models/team_parent_response.rb index b16bc6ed6..c1fde1886 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_parent_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_parent_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_remove_member_request.rb b/sdks/ruby/lib/dropbox-sign/models/team_remove_member_request.rb index cf53f5a2b..38564ba3e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_remove_member_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_remove_member_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -76,11 +76,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -92,17 +87,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -269,7 +269,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_response.rb b/sdks/ruby/lib/dropbox-sign/models/team_response.rb index 69b48d297..68974df03 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -49,11 +49,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -64,17 +59,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -230,7 +230,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_sub_teams_response.rb b/sdks/ruby/lib/dropbox-sign/models/team_sub_teams_response.rb index 7bf682066..8228d58e1 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_sub_teams_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_sub_teams_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -42,11 +42,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -56,17 +51,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -118,12 +118,22 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @sub_teams.nil? + invalid_properties.push('invalid value for "sub_teams", sub_teams 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 @sub_teams.nil? + return false if @list_info.nil? true end @@ -215,7 +225,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/team_update_request.rb b/sdks/ruby/lib/dropbox-sign/models/team_update_request.rb index 2e9095c45..975762378 100644 --- a/sdks/ruby/lib/dropbox-sign/models/team_update_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/team_update_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -34,11 +34,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -46,17 +41,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -191,7 +191,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_add_user_request.rb b/sdks/ruby/lib/dropbox-sign/models/template_add_user_request.rb index d158c71b0..9d31bf46f 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_add_user_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_add_user_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -44,11 +44,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -58,17 +53,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -215,7 +215,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_request.rb b/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_request.rb index 267e6a8b4..768dbd548 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -152,11 +152,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -188,17 +183,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -532,7 +532,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_response.rb b/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_response.rb index 21fe69585..d49272378 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @template.nil? + invalid_properties.push('invalid value for "template", template 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 @template.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_response_template.rb b/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_response_template.rb index 32f6e4a27..840c72a5b 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_response_template.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_create_embedded_draft_response_template.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -50,11 +50,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -65,17 +60,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -227,7 +227,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_create_request.rb b/sdks/ruby/lib/dropbox-sign/models/template_create_request.rb index ada67c6c1..7e2937c13 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_create_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_create_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -118,11 +118,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -147,17 +142,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -449,7 +449,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_create_response.rb b/sdks/ruby/lib/dropbox-sign/models/template_create_response.rb index fd6621565..4b238ca0a 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_create_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_create_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @template.nil? + invalid_properties.push('invalid value for "template", template 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 @template.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_create_response_template.rb b/sdks/ruby/lib/dropbox-sign/models/template_create_response_template.rb index 9cc402daf..863dd2490 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_create_response_template.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_create_response_template.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -192,7 +192,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb b/sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb index 3232a7a14..9a11cbf2d 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_edit_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -34,11 +34,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -46,17 +41,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -96,12 +96,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @template_id.nil? + invalid_properties.push('invalid value for "template_id", template_id 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 @template_id.nil? true end @@ -191,7 +196,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_get_response.rb b/sdks/ruby/lib/dropbox-sign/models/template_get_response.rb index 05b1b12d6..00c7c6fd4 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_get_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_get_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @template.nil? + invalid_properties.push('invalid value for "template", template 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 @template.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_list_response.rb b/sdks/ruby/lib/dropbox-sign/models/template_list_response.rb index ac89c1405..fc60e7337 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_list_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_list_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -43,11 +43,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -57,17 +52,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -119,12 +119,22 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @templates.nil? + invalid_properties.push('invalid value for "templates", templates 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 @templates.nil? + return false if @list_info.nil? true end @@ -216,7 +226,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_remove_user_request.rb b/sdks/ruby/lib/dropbox-sign/models/template_remove_user_request.rb index 9b2541321..1fadb7933 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_remove_user_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_remove_user_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -202,7 +202,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response.rb b/sdks/ruby/lib/dropbox-sign/models/template_response.rb index 8cccc09f2..0846cd13c 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -105,11 +105,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -131,11 +126,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -149,6 +139,16 @@ def self.openapi_nullable ]) 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 @@ -365,7 +365,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_account.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_account.rb index a50192718..9b40044d0 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_account.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_account.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -58,11 +58,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -75,17 +70,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -245,7 +245,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_account_quota.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_account_quota.rb index 3158b0ef9..39946275d 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_account_quota.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_account_quota.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -50,11 +50,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -65,17 +60,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -225,7 +225,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_cc_role.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_cc_role.rb index a22b6b267..641a3883b 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_cc_role.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_cc_role.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -34,11 +34,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -46,17 +41,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -191,7 +191,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document.rb index 3aca3b069..e5cad9ef6 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -59,11 +59,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -76,11 +71,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -88,6 +78,16 @@ def self.openapi_nullable ]) 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 @@ -255,7 +255,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_base.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_base.rb index 5c7d09966..34dedc1cd 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_base.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_base.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -31,7 +31,7 @@ class TemplateResponseDocumentCustomFieldBase attr_accessor :name # The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). - # @return [String, nil] + # @return [Integer, String, nil] attr_accessor :signer # The horizontal offset in pixels for this form field. @@ -79,11 +79,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -100,11 +95,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -113,6 +103,16 @@ def self.openapi_nullable ]) 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 @@ -312,7 +312,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_checkbox.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_checkbox.rb index 4740d8976..0f03a44c2 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_checkbox.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_checkbox.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_text.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_text.rb index f1c017ea5..7c3a08f43 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_text.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_custom_field_text.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,11 +54,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -70,17 +65,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -246,7 +246,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_field_group.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_field_group.rb index 376201721..0a73d2799 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_field_group.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_field_group.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -201,7 +201,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_field_group_rule.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_field_group_rule.rb index 06cb5cb02..6471f6eec 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_field_group_rule.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_field_group_rule.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_base.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_base.rb index 0b5b6cd15..ebb61a42d 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_base.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_base.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -31,7 +31,7 @@ class TemplateResponseDocumentFormFieldBase attr_accessor :name # The signer of the Form Field. - # @return [String] + # @return [Integer, String] attr_accessor :signer # The horizontal offset in pixels for this form field. @@ -79,11 +79,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -100,11 +95,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -112,6 +102,16 @@ def self.openapi_nullable ]) 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 @@ -329,7 +329,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_checkbox.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_checkbox.rb index 15d5e6355..21e81c212 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_checkbox.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_checkbox.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_date_signed.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_date_signed.rb index 1e29dfb50..9157ba6c6 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_date_signed.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_date_signed.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_dropdown.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_dropdown.rb index 7106be31d..b2f4a970e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_dropdown.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_dropdown.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_hyperlink.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_hyperlink.rb index 1732efebe..6ef91fb6e 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_hyperlink.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_hyperlink.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -54,11 +54,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -70,17 +65,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -246,7 +246,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_initials.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_initials.rb index 798686d8a..479d127b8 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_initials.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_initials.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_radio.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_radio.rb index c5055af76..983d0dc67 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_radio.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_radio.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_signature.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_signature.rb index 9bdd4fdee..5474593ec 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_signature.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_signature.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_text.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_text.rb index b5c12a275..bc4dba185 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_text.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_form_field_text.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -81,11 +81,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -98,11 +93,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -110,6 +100,16 @@ def self.openapi_nullable ]) end + # Returns attribute map of this model + parent + def self.merged_attributes + self.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -292,7 +292,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_base.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_base.rb index 37f808544..b2581cfa9 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_base.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_base.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -79,11 +79,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -100,11 +95,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -112,6 +102,16 @@ def self.openapi_nullable ]) 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 @@ -331,7 +331,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_checkbox.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_checkbox.rb index 051f8a707..e0ea2cae1 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_checkbox.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_checkbox.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_date_signed.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_date_signed.rb index 88ffa8e1f..ac229946c 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_date_signed.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_date_signed.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_dropdown.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_dropdown.rb index a326332dc..d14e31cde 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_dropdown.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_dropdown.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_hyperlink.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_hyperlink.rb index 0cbfed71d..412d23207 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_hyperlink.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_hyperlink.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_initials.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_initials.rb index cc058cdef..4b64b3ae3 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_initials.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_initials.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_radio.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_radio.rb index 47e993b81..761dd4e84 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_radio.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_radio.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_signature.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_signature.rb index 3cfcedf81..ba3825fc4 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_signature.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_signature.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_text.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_text.rb index 44f94567f..a216f1559 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_text.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_document_static_field_text.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -35,11 +35,6 @@ def self.acceptable_attributes attribute_map.values.concat(superclass.acceptable_attributes) end - # Returns attribute map of this model + parent - def self.merged_attributes - self.superclass.attribute_map.merge(self.attribute_map) - end - # Attribute type mapping. def self.openapi_types { @@ -47,17 +42,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.superclass.openapi_types.merge(self.openapi_types) - 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.superclass.attribute_map.merge(self.attribute_map) + end + + # Attribute type mapping of this model + parent + def self.merged_types + self.superclass.openapi_types.merge(self.openapi_types) + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable self.superclass.openapi_nullable.merge(self.openapi_nullable) @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_field_avg_text_length.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_field_avg_text_length.rb index 14c10f905..d82e85e58 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_field_avg_text_length.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_field_avg_text_length.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -203,7 +203,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_response_signer_role.rb b/sdks/ruby/lib/dropbox-sign/models/template_response_signer_role.rb index 36a2a7459..e30aa48e3 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_response_signer_role.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_response_signer_role.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -39,11 +39,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -52,17 +47,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -202,7 +202,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_update_files_request.rb b/sdks/ruby/lib/dropbox-sign/models/template_update_files_request.rb index 41c951c37..ee795bcb7 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_update_files_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_update_files_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -59,11 +59,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -76,17 +71,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -282,7 +282,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_update_files_response.rb b/sdks/ruby/lib/dropbox-sign/models/template_update_files_response.rb index fe17fbd74..67d30f262 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_update_files_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_update_files_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -33,11 +33,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -45,17 +40,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -95,12 +95,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @template.nil? + invalid_properties.push('invalid value for "template", template 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 @template.nil? true end @@ -190,7 +195,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/template_update_files_response_template.rb b/sdks/ruby/lib/dropbox-sign/models/template_update_files_response_template.rb index d2e59261f..f2a30ad77 100644 --- a/sdks/ruby/lib/dropbox-sign/models/template_update_files_response_template.rb +++ b/sdks/ruby/lib/dropbox-sign/models/template_update_files_response_template.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -205,7 +205,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_embedded_request.rb b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_embedded_request.rb index aedbab5ef..1c5dea7ef 100644 --- a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_embedded_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_embedded_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -229,11 +229,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -276,11 +271,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -288,6 +278,16 @@ def self.openapi_nullable ]) 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 @@ -705,7 +705,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_embedded_with_template_request.rb b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_embedded_with_template_request.rb index 50e7e43b3..6314e7646 100644 --- a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_embedded_with_template_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_embedded_with_template_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -176,11 +176,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -217,17 +212,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -613,7 +613,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_request.rb b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_request.rb index 4b64c81b8..289b71b5c 100644 --- a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -170,11 +170,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -205,11 +200,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -217,6 +207,16 @@ def self.openapi_nullable ]) 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 @@ -551,7 +551,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_response.rb b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_response.rb index ccb3d71ef..792586be5 100644 --- a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_create_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -38,11 +38,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -51,17 +46,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -107,12 +107,17 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if @unclaimed_draft.nil? + invalid_properties.push('invalid value for "unclaimed_draft", unclaimed_draft cannot be nil.') + end + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return false if @unclaimed_draft.nil? true end @@ -203,7 +208,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_edit_and_resend_request.rb b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_edit_and_resend_request.rb index 7d56b5e4e..9059dd3a1 100644 --- a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_edit_and_resend_request.rb +++ b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_edit_and_resend_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -68,11 +68,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -87,17 +82,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -276,7 +276,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_response.rb b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_response.rb index ddcc68f7d..3e1b226c9 100644 --- a/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/unclaimed_draft_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -60,11 +60,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -77,11 +72,6 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -92,6 +82,16 @@ def self.openapi_nullable ]) 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 @@ -251,7 +251,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/models/warning_response.rb b/sdks/ruby/lib/dropbox-sign/models/warning_response.rb index 92156f416..0869a0a85 100644 --- a/sdks/ruby/lib/dropbox-sign/models/warning_response.rb +++ b/sdks/ruby/lib/dropbox-sign/models/warning_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -40,11 +40,6 @@ def self.acceptable_attributes attribute_map.values end - # Returns attribute map of this model + parent - def self.merged_attributes - self.attribute_map - end - # Attribute type mapping. def self.openapi_types { @@ -53,17 +48,22 @@ def self.openapi_types } end - # Attribute type mapping of this model + parent - def self.merged_types - self.openapi_types - 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 @@ -213,7 +213,6 @@ def _deserialize(type, value) end end else # model - # models (e.g. Pet) 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 diff --git a/sdks/ruby/lib/dropbox-sign/version.rb b/sdks/ruby/lib/dropbox-sign/version.rb index 735f509c0..af126e37a 100644 --- a/sdks/ruby/lib/dropbox-sign/version.rb +++ b/sdks/ruby/lib/dropbox-sign/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end @@ -14,5 +14,5 @@ module Dropbox end module Dropbox::Sign - VERSION = '1.5-dev' + VERSION = '1.6-dev' end diff --git a/sdks/ruby/openapi-config.yaml b/sdks/ruby/openapi-config.yaml index 96399d268..84ac951d4 100644 --- a/sdks/ruby/openapi-config.yaml +++ b/sdks/ruby/openapi-config.yaml @@ -9,11 +9,12 @@ additionalProperties: gemName: dropbox-sign gemRequiredRubyVersion: '>= 2.7' moduleName: "Dropbox::Sign" - gemVersion: 1.5-dev + gemVersion: 1.6-dev sortModelPropertiesByRequiredFlag: true legacyDiscriminatorBehavior: true gitUserId: hellosign gitRepoId: dropbox-sign-ruby + useCustomTemplateCode: true files: event_callback_helper.mustache: templateType: SupportingFiles diff --git a/sdks/ruby/run-build b/sdks/ruby/run-build index 8639977ed..eb99122c8 100755 --- a/sdks/ruby/run-build +++ b/sdks/ruby/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/08296c2b1dc732829e3aaa2c2cad7c2c8c44eb8d/modules/openapi-generator/src/main/resources/ruby-client +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/ruby-client set -e @@ -9,7 +9,7 @@ WORKING_DIR="/app/ruby" docker run --rm \ -v "${DIR}/:/local" \ - openapitools/openapi-generator-cli:v7.7.0 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ diff --git a/sdks/ruby/spec/spec_helper.rb b/sdks/ruby/spec/spec_helper.rb index 59e8c7ef7..a365de3db 100644 --- a/sdks/ruby/spec/spec_helper.rb +++ b/sdks/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech -Generator version: 7.7.0 +Generator version: 7.8.0 =end diff --git a/sdks/ruby/templates/Gemfile.mustache b/sdks/ruby/templates/Gemfile.mustache index d68dd9109..9e92ba56d 100644 --- a/sdks/ruby/templates/Gemfile.mustache +++ b/sdks/ruby/templates/Gemfile.mustache @@ -6,5 +6,7 @@ group :development, :test do gem 'rake', '~> 13.0.1' gem 'pry-byebug' gem 'rubocop', '~> 0.66.0' +{{#useCustomTemplateCode}} gem 'json_spec', '~> 1.1.5' +{{/useCustomTemplateCode}} end diff --git a/sdks/ruby/templates/README.mustache b/sdks/ruby/templates/README.mustache index 0c47d5ca1..a8e4a9cde 100644 --- a/sdks/ruby/templates/README.mustache +++ b/sdks/ruby/templates/README.mustache @@ -6,6 +6,7 @@ {{{.}}} {{/appDescriptionWithNewLines}} +{{#useCustomTemplateCode}} ## Migrating from legacy SDK This SDK is generated from our officially maintained [OpenAPI spec](https://github.com/hellosign/hellosign-openapi/blob/main/openapi.yaml). @@ -24,6 +25,7 @@ Pull Requests *must* be opened against the You must make SDK code changes in the mustache file within the `templates` directory that corresponds to the file you want updated. +{{/useCustomTemplateCode}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} @@ -39,11 +41,13 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Installation +{{#useCustomTemplateCode}} ### Install gem ```shell gem install {{{gemName}}} ``` +{{/useCustomTemplateCode}} ### Build a gem To build the Ruby code into a gem: @@ -52,7 +56,12 @@ To build the Ruby code into a gem: gem build {{{gemName}}}.gemspec ``` +{{^useCustomTemplateCode}} +Then either install the gem locally: +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} Then install the gem locally: +{{/useCustomTemplateCode}} ```shell gem install ./{{{gemName}}}-{{{gemVersion}}}.gem @@ -60,6 +69,10 @@ gem install ./{{{gemName}}}-{{{gemVersion}}}.gem (for development, run `gem install --dev ./{{{gemName}}}-{{{gemVersion}}}.gem` to install the development dependencies) +{{^useCustomTemplateCode}} +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). +{{/useCustomTemplateCode}} + Finally add this to the Gemfile: gem '{{{gemName}}}', '~> {{{gemVersion}}}' @@ -82,20 +95,87 @@ ruby -Ilib script.rb Please follow the [installation](#installation) procedure and then run the following code: +{{^useCustomTemplateCode}} +```ruby +# Load the gem +require '{{{gemName}}}' +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}} +# Setup authorization +{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + # Configure HTTP basic authorization: {{{name}}} + config.username = 'YOUR_USERNAME' + config.password = 'YOUR_PASSWORD'{{/isBasicBasic}}{{#isBasicBearer}} + # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} + config.access_token = 'YOUR_BEARER_TOKEN' + # Configure a proc to get access tokens in lieu of the static access_token configuration + config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } {{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + # Configure API key authorization: {{{name}}} + config.api_key['{{{name}}}'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['{{{name}}}'] = 'Bearer'{{/isApiKey}}{{#isOAuth}} + # Configure OAuth2 access token for authorization: {{{name}}} + config.access_token = 'YOUR ACCESS TOKEN' + # Configure a proc to get access tokens in lieu of the static access_token configuration + config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } {{/isOAuth}} + {{#isFaraday}} + # Configure faraday connection + config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' } + {{/isFaraday}} + {{#isHttpx}} + # Configure httpx session + config.configure_session { |session| 'YOUR CONNECTION CONFIG PROC' } + {{/isHttpx}} +{{/authMethods}}end +{{/hasAuthMethods}} + +api_instance = {{{moduleName}}}::{{{classname}}}.new +{{#requiredParams}} +{{{paramName}}} = {{{vendorExtensions.x-ruby-example}}} # {{{dataType}}} | {{{description}}} +{{/requiredParams}} +{{#optionalParams}} +{{#-first}} +opts = { +{{/-first}} + {{{paramName}}}: {{{vendorExtensions.x-ruby-example}}}{{^-last}},{{/-last}} # {{{dataType}}} | {{{description}}} +{{#-last}} +} +{{/-last}} +{{/optionalParams}} + +begin +{{#summary}} #{{{.}}} +{{/summary}} {{#returnType}}result = {{/returnType}}api_instance.{{{operationId}}}{{#hasParams}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}){{/hasParams}}{{#returnType}} + p result{{/returnType}} +rescue {{{moduleName}}}::ApiError => e + puts "Exception when calling {{classname}}->{{{operationId}}}: #{e}" +end +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} ```ruby REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Ruby_CODE ``` {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} ## Documentation for API Endpoints All URIs are relative to *{{basePath}}* +{{^useCustomTemplateCode}} +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}::{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{{summary}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} |Class | Method | HTTP request | Description| |------------ | ------------- | ------------- | -------------| {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}|*{{moduleName}}::{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{{summary}}} | {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} ## Documentation for Models @@ -104,9 +184,16 @@ All URIs are relative to *{{basePath}}* ## Documentation for Authorization +{{^useCustomTemplateCode}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{^authMethods}} All endpoints do not require authorization. {{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} -{{#authMethods}}### {{name}} +{{/useCustomTemplateCode}} +{{#authMethods}} +### {{name}} {{#isApiKey}} @@ -117,7 +204,8 @@ All URIs are relative to *{{basePath}}* {{#isBasic}} {{#isBasicBasic}}- **Type**: HTTP basic authentication {{/isBasicBasic}}{{#isBasicBearer}}- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} -{{/isBasicBearer}} +{{/isBasicBearer}}{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{/isBasic}} {{#isOAuth}} diff --git a/sdks/ruby/templates/api.mustache b/sdks/ruby/templates/api.mustache index 2519dd5b7..e5611a33d 100644 --- a/sdks/ruby/templates/api.mustache +++ b/sdks/ruby/templates/api.mustache @@ -4,9 +4,11 @@ require 'cgi' +{{#useCustomTemplateCode}} module Dropbox end +{{/useCustomTemplateCode}} module {{moduleName}} {{#operations}} class {{classname}} @@ -191,7 +193,7 @@ module {{moduleName}} header_params = opts[:header_params] || {} {{#hasProduces}} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept([{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}]) + header_params['Accept'] = @api_client.select_header_accept([{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}]) unless header_params['Accept'] {{/hasProduces}} {{#hasConsumes}} # HTTP header 'Content-Type' @@ -202,7 +204,7 @@ module {{moduleName}} {{/hasConsumes}} {{#headerParams}} {{#required}} - header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}} + header_params[{{#lambdaFixHeaderKey}}:'{{{baseName}}}'{{/lambdaFixHeaderKey}}] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}} {{/required}} {{/headerParams}} {{#headerParams}} @@ -211,6 +213,24 @@ module {{moduleName}} {{/required}} {{/headerParams}} +{{^useCustomTemplateCode}} + # form parameters + form_params = opts[:form_params] || {} + {{#formParams}} + {{#required}} + form_params['{{baseName}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}} + {{/required}} + {{/formParams}} + {{#formParams}} + {{^required}} + form_params['{{baseName}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if !opts[:'{{paramName}}'].nil? + {{/required}} + {{/formParams}} + + # http body (model) + post_body = opts[:debug_body]{{#bodyParam}} || @api_client.object_to_http_body({{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}){{/bodyParam}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} post_body = {} form_params = opts[:form_params] || {} {{#bodyParam}} @@ -233,6 +253,7 @@ module {{moduleName}} # http body (model) post_body = opts[:debug_body]{{#bodyParam}} || @api_client.object_to_http_body({{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}){{/bodyParam}} {{/bodyParam}} +{{/useCustomTemplateCode}} # return_type return_type = opts[:debug_return_type]{{#returnType}} || '{{{.}}}'{{/returnType}} @@ -250,6 +271,10 @@ module {{moduleName}} :return_type => return_type ) +{{^useCustomTemplateCode}} + data, status_code, headers = @api_client.call_api(:{{httpMethod}}, local_var_path, new_options) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} begin data, status_code, headers = @api_client.call_api(:{{httpMethod}}, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e @@ -315,6 +340,7 @@ module {{moduleName}} {{/returnType}} end +{{/useCustomTemplateCode}} if @api_client.config.debugging @api_client.config.logger.debug "API called: {{classname}}#{{operationId}}\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/sdks/ruby/templates/api_client.mustache b/sdks/ruby/templates/api_client.mustache index cba9c7cba..8cc1f01ab 100644 --- a/sdks/ruby/templates/api_client.mustache +++ b/sdks/ruby/templates/api_client.mustache @@ -20,8 +20,10 @@ require 'httpx' require 'net/http/status' {{/isHttpx}} +{{#useCustomTemplateCode}} module Dropbox end +{{/useCustomTemplateCode}} module {{moduleName}} class ApiClient @@ -133,7 +135,9 @@ module {{moduleName}} data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } end else - # models (e.g. Pet) +{{^useCustomTemplateCode}} + # models (e.g. Pet) or oneOf +{{/useCustomTemplateCode}} klass = {{moduleName}}.const_get(return_type) klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data) end @@ -244,6 +248,7 @@ module {{moduleName}} fail "unknown collection format: #{collection_format.inspect}" end end +{{#useCustomTemplateCode}} def generate_form_data(obj, openapi_types) params = {} @@ -268,5 +273,6 @@ module {{moduleName}} :params => params, } end +{{/useCustomTemplateCode}} end end diff --git a/sdks/ruby/templates/api_client_faraday_partial.mustache b/sdks/ruby/templates/api_client_faraday_partial.mustache index 1a85fc69c..11ae6450f 100644 --- a/sdks/ruby/templates/api_client_faraday_partial.mustache +++ b/sdks/ruby/templates/api_client_faraday_partial.mustache @@ -117,35 +117,41 @@ request.options.on_data = Proc.new do |chunk, overall_received_bytes| stream << chunk end + stream end def deserialize_file(response, stream) - body = response.body - if @config.return_binary_data == true - # return byte stream - encoding = body.encoding - stream.join.force_encoding(encoding) + body = response.body + encoding = body.encoding + + # reconstruct content + content = stream.join + content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'binary' + content = content.force_encoding(encoding) + + # return byte stream + return content if @config.return_binary_data == true + + # return file instead of binary data + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) else - # return file instead of binary data - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - tempfile.write(stream.join.force_encoding(encoding)) - tempfile.close - config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - tempfile + prefix = 'download-' end + prefix = prefix + '-' unless prefix.end_with?('-') + + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + tempfile.write(content) + tempfile.close + + config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + tempfile end def connection(opts) diff --git a/sdks/ruby/templates/api_client_typhoeus_partial.mustache b/sdks/ruby/templates/api_client_typhoeus_partial.mustache index e8162ac7f..39792eb73 100644 --- a/sdks/ruby/templates/api_client_typhoeus_partial.mustache +++ b/sdks/ruby/templates/api_client_typhoeus_partial.mustache @@ -154,7 +154,7 @@ "will be deleted automatically with GC. It's also recommended to delete the temp file "\ "explicitly with `tempfile.delete`" else - fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}") + fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}") end tempfile diff --git a/sdks/ruby/templates/api_doc.mustache b/sdks/ruby/templates/api_doc.mustache index e9677529d..818343d64 100644 --- a/sdks/ruby/templates/api_doc.mustache +++ b/sdks/ruby/templates/api_doc.mustache @@ -8,16 +8,28 @@ All URIs are relative to *{{basePath}}* | ------ | ------------ | ----------- | {{#operations}} {{#operation}} +{{^useCustomTemplateCode}} +| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} | [`{{operationId}}`]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** `{{path}}` | {{summary}} | +{{/useCustomTemplateCode}} {{/operation}} {{/operations}} {{#operations}} {{#operation}} +{{^useCustomTemplateCode}} +## {{operationId}} + +> {{#returnType}}{{#returnTypeIsPrimitive}}{{returnType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}<{{{returnType}}}>{{/returnTypeIsPrimitive}} {{/returnType}}{{operationId}}{{#hasParams}}({{^vendorExtensions.x-group-parameters}}{{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}opts{{/vendorExtensions.x-group-parameters}}){{/hasParams}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ## `{{operationId}}` > `{{#returnType}}{{#returnTypeIsPrimitive}}{{returnType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}<{{{returnType}}}>{{/returnTypeIsPrimitive}} {{/returnType}}{{operationId}}{{#hasParams}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}){{/hasParams}}` +{{/useCustomTemplateCode}} {{{summary}}}{{#notes}} @@ -26,14 +38,84 @@ All URIs are relative to *{{basePath}}* ### Examples ```ruby +{{^useCustomTemplateCode}} +require 'time' +require '{{{gemName}}}' +{{#hasAuthMethods}} +# setup authorization +{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + # Configure HTTP basic authorization: {{{name}}} + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD'{{/isBasicBasic}}{{#isBasicBearer}} + # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} + config.access_token = 'YOUR_BEARER_TOKEN'{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + # Configure API key authorization: {{{name}}} + config.api_key['{{{name}}}'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + # config.api_key_prefix['{{{name}}}'] = 'Bearer'{{/isApiKey}}{{#isOAuth}} + # Configure OAuth2 access token for authorization: {{{name}}} + config.access_token = 'YOUR ACCESS TOKEN'{{/isOAuth}} +{{/authMethods}}end +{{/hasAuthMethods}} + +api_instance = {{{moduleName}}}::{{{classname}}}.new +{{^vendorExtensions.x-group-parameters}} +{{#requiredParams}} +{{{paramName}}} = {{{vendorExtensions.x-ruby-example}}} # {{{dataType}}} | {{{description}}} +{{/requiredParams}} +{{#optionalParams}} +{{#-first}} +opts = { +{{/-first}} + {{{paramName}}}: {{{vendorExtensions.x-ruby-example}}}{{^-last}},{{/-last}} # {{{dataType}}} | {{{description}}} +{{#-last}} +} +{{/-last}} +{{/optionalParams}} +{{/vendorExtensions.x-group-parameters}} +{{#vendorExtensions.x-group-parameters}} +{{#hasParams}} +opts = { +{{#requiredParams}} + {{{paramName}}}: {{{vendorExtensions.x-ruby-example}}}, # {{{dataType}}} | {{{description}}} (required) +{{/requiredParams}} +{{#optionalParams}} + {{{paramName}}}: {{{vendorExtensions.x-ruby-example}}}, # {{{dataType}}} | {{{description}}} +{{/optionalParams}} +} +{{/hasParams}} +{{/vendorExtensions.x-group-parameters}} + +begin + {{#summary}}# {{{.}}}{{/summary}} + {{#returnType}}result = {{/returnType}}api_instance.{{{operationId}}}{{#hasParams}}({{^vendorExtensions.x-group-parameters}}{{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}opts{{/vendorExtensions.x-group-parameters}}){{/hasParams}} + {{#returnType}} + p result + {{/returnType}} +rescue {{{moduleName}}}::ApiError => e + puts "Error when calling {{classname}}->{{{operationId}}}: #{e}" +end +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Ruby_CODE +{{/useCustomTemplateCode}} ``` +{{^useCustomTemplateCode}} +#### Using the {{operationId}}_with_http_info variant +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} #### Using the `{{operationId}}_with_http_info` variant +{{/useCustomTemplateCode}} This returns an Array which contains the response data{{^returnType}} (`nil` in this case){{/returnType}}, status code and headers. +{{^useCustomTemplateCode}} +> {{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}nil{{/returnType}}, Integer, Hash)> {{operationId}}_with_http_info{{#hasParams}}({{^vendorExtensions.x-group-parameters}}{{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}opts{{/vendorExtensions.x-group-parameters}}){{/hasParams}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} > `{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}nil{{/returnType}}, Integer, Hash)> {{operationId}}_with_http_info{{#hasParams}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}){{/hasParams}}` +{{/useCustomTemplateCode}} ```ruby begin @@ -57,7 +139,12 @@ This endpoint does not need any parameter. | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | {{/-first}} +{{^useCustomTemplateCode}} +| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} | `{{paramName}}` | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | +{{/useCustomTemplateCode}} {{/allParams}} ### Return type diff --git a/sdks/ruby/templates/api_error.mustache b/sdks/ruby/templates/api_error.mustache index ef2e6dfc4..5e7e0531f 100644 --- a/sdks/ruby/templates/api_error.mustache +++ b/sdks/ruby/templates/api_error.mustache @@ -2,12 +2,22 @@ {{> api_info}} =end +{{#useCustomTemplateCode}} module Dropbox end +{{/useCustomTemplateCode}} module {{moduleName}} class ApiError < StandardError +{{^useCustomTemplateCode}} attr_reader :code, :response_headers, :response_body +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + attr_reader :code, :response_headers + + # @return [ErrorResponse] + attr_accessor :response_body +{{/useCustomTemplateCode}} # Usage examples: # ApiError.new diff --git a/sdks/ruby/templates/base_object.mustache b/sdks/ruby/templates/base_object.mustache index 03ea14145..773f80116 100644 --- a/sdks/ruby/templates/base_object.mustache +++ b/sdks/ruby/templates/base_object.mustache @@ -1,6 +1,31 @@ # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself +{{^useCustomTemplateCode}} + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + {{#parent}} + super(attributes) + {{/parent}} + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif 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) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} def self.build_from_hash(attributes) {{#discriminator}} if !attributes[self.openapi_discriminator_name].nil? @@ -38,12 +63,18 @@ self end +{{/useCustomTemplateCode}} # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data +{{^useCustomTemplateCode}} + def self._deserialize(type, value) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} def _deserialize(type, value) +{{/useCustomTemplateCode}} case type.to_sym when :Time Time.parse(value) @@ -76,7 +107,9 @@ end end else # model - # models (e.g. Pet) +{{^useCustomTemplateCode}} + # models (e.g. Pet) or oneOf +{{/useCustomTemplateCode}} klass = {{moduleName}}.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end @@ -96,17 +129,37 @@ # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash +{{^useCustomTemplateCode}} + def to_hash +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} def to_hash(include_nil = true) +{{/useCustomTemplateCode}} hash = {{^parent}}{}{{/parent}}{{#parent}}super{{/parent}} +{{^useCustomTemplateCode}} + self.class.attribute_map.each_pair do |attr, param| +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} self.class.merged_attributes.each_pair do |attr, param| +{{/useCustomTemplateCode}} value = self.send(attr) if value.nil? +{{^useCustomTemplateCode}} + is_nullable = self.class.openapi_nullable.include?(attr) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} next unless include_nil is_nullable = self.class.merged_nullable.include?(attr) +{{/useCustomTemplateCode}} next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end +{{^useCustomTemplateCode}} + hash[param] = _to_hash(value) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} hash[param] = _to_hash(value, include_nil) +{{/useCustomTemplateCode}} end hash end @@ -115,15 +168,35 @@ # 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 +{{^useCustomTemplateCode}} + def _to_hash(value) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} def _to_hash(value, include_nil = true) +{{/useCustomTemplateCode}} if value.is_a?(Array) +{{^useCustomTemplateCode}} + value.compact.map { |v| _to_hash(v) } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} value.compact.map { |v| _to_hash(v, include_nil) } +{{/useCustomTemplateCode}} elsif value.is_a?(Hash) {}.tap do |hash| +{{^useCustomTemplateCode}} + value.each { |k, v| hash[k] = _to_hash(v) } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} value.each { |k, v| hash[k] = _to_hash(v, include_nil) } +{{/useCustomTemplateCode}} end elsif value.respond_to? :to_hash +{{^useCustomTemplateCode}} + value.to_hash +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} value.to_hash(include_nil) +{{/useCustomTemplateCode}} else value end diff --git a/sdks/ruby/templates/configuration.mustache b/sdks/ruby/templates/configuration.mustache index 7a323624b..312790387 100644 --- a/sdks/ruby/templates/configuration.mustache +++ b/sdks/ruby/templates/configuration.mustache @@ -2,9 +2,11 @@ {{> api_info}} =end +{{#useCustomTemplateCode}} module Dropbox end +{{/useCustomTemplateCode}} module {{moduleName}} class Configuration # Defines url scheme @@ -225,6 +227,55 @@ module {{moduleName}} end # Returns Auth Settings hash for api client. +{{^useCustomTemplateCode}} + def auth_settings + { +{{#authMethods}} +{{#isApiKey}} + '{{name}}' => + { + type: 'api_key', + in: {{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, + key: '{{keyParamName}}', + value: api_key_with_prefix('{{name}}'{{#vendorExtensions.x-auth-id-alias}}, '{{.}}'{{/vendorExtensions.x-auth-id-alias}}) + }, +{{/isApiKey}} +{{#isBasic}} +{{#isBasicBasic}} + '{{name}}' => + { + type: 'basic', + in: 'header', + key: 'Authorization', + value: basic_auth_token + }, +{{/isBasicBasic}} +{{#isBasicBearer}} + '{{name}}' => + { + type: 'bearer', + in: 'header', + {{#bearerFormat}} + format: '{{{.}}}', + {{/bearerFormat}} + key: 'Authorization', + value: "Bearer #{access_token_with_refresh}" + }, +{{/isBasicBearer}} +{{/isBasic}} +{{#isOAuth}} + '{{name}}' => + { + type: 'oauth2', + in: 'header', + key: 'Authorization', + value: "Bearer #{access_token_with_refresh}" + }, +{{/isOAuth}} +{{/authMethods}} + } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} def auth_settings() result = {} {{#authMethods}} @@ -255,6 +306,7 @@ module {{moduleName}} {{/isBasic}} {{/authMethods}} return result +{{/useCustomTemplateCode}} end # Returns an array of Server setting @@ -262,7 +314,12 @@ module {{moduleName}} [ {{#servers}} { +{{^useCustomTemplateCode}} + url: "{{{url}}}", +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} url: "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, ''), +{{/useCustomTemplateCode}} description: "{{{description}}}{{^description}}No description provided{{/description}}", {{#variables}} {{#-first}} diff --git a/sdks/ruby/templates/configuration_spec.mustache b/sdks/ruby/templates/configuration_spec.mustache deleted file mode 100644 index 8c298397e..000000000 --- a/sdks/ruby/templates/configuration_spec.mustache +++ /dev/null @@ -1,32 +0,0 @@ -=begin -{{> api_info}} -=end - -require 'spec_helper' - -describe {{moduleName}}::Configuration do - let(:config) { {{moduleName}}::Configuration.default } - - before(:each) do - # uncomment below to setup host and base_path - {{moduleName}}.configure do |c| - c.host = "{{host}}" - c.base_path = "{{contextPath}}" - end - end - - describe '#base_url' do - it 'should have the default value' do - # uncomment below to test default value of the base path - expect(config.base_url).to eq("{{{basePath}}}") - end - - it 'should remove trailing slashes' do - [nil, '', '/', '//'].each do |base_path| - config.base_path = base_path - # uncomment below to test trailing slashes - # expect(config.base_url).to eq("{{{basePath}}}") - end - end - end -end diff --git a/sdks/ruby/templates/gem.mustache b/sdks/ruby/templates/gem.mustache index 9b5e31384..a49c2aa6a 100644 --- a/sdks/ruby/templates/gem.mustache +++ b/sdks/ruby/templates/gem.mustache @@ -45,11 +45,13 @@ require '{{importPath}}' {{/apis}} {{/apiInfo}} +{{#useCustomTemplateCode}} require '{{gemName}}/event_callback_helper' module Dropbox end +{{/useCustomTemplateCode}} module {{moduleName}} class << self # Customize default settings for the SDK using block. diff --git a/sdks/ruby/templates/gitignore.mustache b/sdks/ruby/templates/gitignore.mustache index 94d312172..a97a94f24 100644 --- a/sdks/ruby/templates/gitignore.mustache +++ b/sdks/ruby/templates/gitignore.mustache @@ -38,4 +38,6 @@ build/ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc -vendor \ No newline at end of file +{{#useCustomTemplateCode}} +vendor +{{/useCustomTemplateCode}} diff --git a/sdks/ruby/templates/gitlab-ci.mustache b/sdks/ruby/templates/gitlab-ci.mustache new file mode 100644 index 000000000..3a253c45c --- /dev/null +++ b/sdks/ruby/templates/gitlab-ci.mustache @@ -0,0 +1,26 @@ +.ruby: &ruby + variables: + LANG: "C.UTF-8" + before_script: + - ruby -v + - bundle config set --local deployment true + - bundle install -j $(nproc) + parallel: + matrix: + - RUBY_VERSION: ['2.7', '3.0', '3.1'] + image: "ruby:$RUBY_VERSION" + cache: + paths: + - vendor/ruby + key: 'ruby-$RUBY_VERSION' + +gem: + extends: .ruby + script: + - bundle exec rspec + - bundle exec rake build + - bundle exec rake install + artifacts: + paths: + - pkg/*.gem + diff --git a/sdks/ruby/templates/model.mustache b/sdks/ruby/templates/model.mustache index c099cc655..651e992d2 100644 --- a/sdks/ruby/templates/model.mustache +++ b/sdks/ruby/templates/model.mustache @@ -5,9 +5,11 @@ require 'date' require 'time' +{{#useCustomTemplateCode}} module Dropbox end +{{/useCustomTemplateCode}} module {{moduleName}} {{#models}} {{#model}} @@ -20,8 +22,22 @@ module {{moduleName}} {{>partial_oneof_module}} {{/-first}} {{/oneOf}} +{{^useCustomTemplateCode}} +{{#anyOf}} +{{#-first}} +{{>partial_anyof_module}} +{{/-first}} +{{/anyOf}} +{{/useCustomTemplateCode}} {{^oneOf}} +{{^useCustomTemplateCode}} +{{^anyOf}} +{{>partial_model_generic}} +{{/anyOf}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{>partial_model_generic}} +{{/useCustomTemplateCode}} {{/oneOf}} {{/isEnum}} {{/model}} diff --git a/sdks/ruby/templates/model_test.mustache b/sdks/ruby/templates/model_test.mustache index b6b078da5..24f3a582f 100644 --- a/sdks/ruby/templates/model_test.mustache +++ b/sdks/ruby/templates/model_test.mustache @@ -13,13 +13,16 @@ require 'date' {{#model}} describe {{moduleName}}::{{classname}} do {{^oneOf}} +{{^anyOf}} let(:instance) { {{moduleName}}::{{classname}}.new } describe 'test an instance of {{classname}}' do it 'should create an instance of {{classname}}' do - expect(instance).to be_instance_of({{moduleName}}::{{classname}}) + # uncomment below to test the instance creation + #expect(instance).to be_instance_of({{moduleName}}::{{classname}}) end end + {{#vars}} describe 'test attribute "{{{name}}}"' do it 'should work' do @@ -37,6 +40,7 @@ describe {{moduleName}}::{{classname}} do end {{/vars}} +{{/anyOf}} {{/oneOf}} {{#oneOf}} {{#-first}} diff --git a/sdks/ruby/templates/partial_anyof_module.mustache b/sdks/ruby/templates/partial_anyof_module.mustache new file mode 100644 index 000000000..a7e571e8a --- /dev/null +++ b/sdks/ruby/templates/partial_anyof_module.mustache @@ -0,0 +1,96 @@ +{{^useCustomTemplateCode}} + {{#description}} + # {{{.}}} + {{/description}} + module {{classname}} + class << self + {{#anyOf}} + {{#-first}} + # List of class defined in anyOf (OpenAPI v3) + def openapi_any_of + [ + {{/-first}} + :'{{{.}}}'{{^-last}},{{/-last}} + {{#-last}} + ] + end + + {{/-last}} + {{/anyOf}} + # Builds the object + # @param [Mixed] Data to be matched against the list of anyOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of anyOf items and attempt to identify the appropriate one. + # Note: + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_any_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_any_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = {{moduleName}}.const_get(klass) + if const + if const.respond_to?(:openapi_any_of) # nested anyOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end +{{/useCustomTemplateCode}} diff --git a/sdks/ruby/templates/partial_model_enum_class.mustache b/sdks/ruby/templates/partial_model_enum_class.mustache index 3880ae8b5..d2ddbff19 100644 --- a/sdks/ruby/templates/partial_model_enum_class.mustache +++ b/sdks/ruby/templates/partial_model_enum_class.mustache @@ -20,4 +20,4 @@ return value if {{classname}}.all_vars.include?(value) raise "Invalid ENUM value #{value} for class #{{{classname}}}" end - end + end \ No newline at end of file diff --git a/sdks/ruby/templates/partial_model_generic.mustache b/sdks/ruby/templates/partial_model_generic.mustache index 497a3d3aa..4d9c5a82c 100644 --- a/sdks/ruby/templates/partial_model_generic.mustache +++ b/sdks/ruby/templates/partial_model_generic.mustache @@ -6,7 +6,9 @@ {{#description}} # {{{.}}} {{/description}} +{{#useCustomTemplateCode}} # @return [{{#vendorExtensions.x-int-or-string}}Integer, String{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}{{#isNullable}}, nil{{/isNullable}}] +{{/useCustomTemplateCode}} attr_accessor :{{{name}}} {{/vars}} @@ -53,16 +55,6 @@ {{/parent}} end - # Returns attribute map of this model + parent - def self.merged_attributes - {{#parent}} - self.superclass.attribute_map.merge(self.attribute_map) - {{/parent}} - {{^parent}} - self.attribute_map - {{/parent}} - end - # Attribute type mapping. def self.openapi_types { @@ -72,16 +64,6 @@ } end - # Attribute type mapping of this model + parent - def self.merged_types - {{#parent}} - self.superclass.openapi_types.merge(self.openapi_types) - {{/parent}} - {{^parent}} - self.openapi_types - {{/parent}} - end - # List of attributes with nullable: true def self.openapi_nullable Set.new([ @@ -93,6 +75,27 @@ ]) end +{{#useCustomTemplateCode}} + # Returns attribute map of this model + parent + def self.merged_attributes + {{#parent}} + self.superclass.attribute_map.merge(self.attribute_map) + {{/parent}} + {{^parent}} + self.attribute_map + {{/parent}} + end + + # Attribute type mapping of this model + parent + def self.merged_types + {{#parent}} + self.superclass.openapi_types.merge(self.openapi_types) + {{/parent}} + {{^parent}} + self.openapi_types + {{/parent}} + end + # Returns list of attributes with nullable: true of this model + parent def self.merged_nullable {{#parent}} @@ -103,6 +106,7 @@ {{/parent}} end +{{/useCustomTemplateCode}} {{#anyOf}} {{#-first}} # List of class defined in anyOf (OpenAPI v3) @@ -116,6 +120,21 @@ {{/-last}} {{/anyOf}} +{{^useCustomTemplateCode}} + {{#allOf}} + {{#-first}} + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + {{/-first}} + :'{{{.}}}'{{^-last}},{{/-last}} + {{#-last}} + ] + end + + {{/-last}} + {{/allOf}} +{{/useCustomTemplateCode}} {{#discriminator}} {{#propertyName}} # discriminator's property name in OpenAPI v3 @@ -123,6 +142,7 @@ :'{{{.}}}' end +{{#useCustomTemplateCode}} {{#discriminator}} def self.discriminator_class_name(value) return nil unless value.is_a?(String) @@ -137,8 +157,10 @@ end {{/discriminator}} +{{/useCustomTemplateCode}} {{/propertyName}} {{/discriminator}} +{{#useCustomTemplateCode}} {{^discriminator}} # Attempt to instantiate and hydrate a new instance of this class # @param [Object] data Data to be converted @@ -151,6 +173,7 @@ end {{/discriminator}} +{{/useCustomTemplateCode}} # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) @@ -160,7 +183,12 @@ # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| +{{^useCustomTemplateCode}} + if (!self.class.attribute_map.key?(k.to_sym)) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} if (!self.class.merged_attributes.key?(k.to_sym)) +{{/useCustomTemplateCode}} fail ArgumentError, "`#{k}` is not a valid attribute in `{{{moduleName}}}::{{{classname}}}`. 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 @@ -190,6 +218,14 @@ else self.{{{name}}} = {{{defaultValue}}} {{/defaultValue}} +{{^useCustomTemplateCode}} + {{^defaultValue}} + {{#required}} + else + self.{{{name}}} = nil + {{/required}} + {{/defaultValue}} +{{/useCustomTemplateCode}} end {{/vars}} end @@ -197,6 +233,9 @@ # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties +{{^useCustomTemplateCode}} + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' +{{/useCustomTemplateCode}} invalid_properties = {{^parent}}Array.new{{/parent}}{{#parent}}super{{/parent}} {{#vars}} {{^isNullable}} @@ -259,6 +298,9 @@ # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? +{{^useCustomTemplateCode}} + warn '[DEPRECATED] the `valid?` method is obsolete' +{{/useCustomTemplateCode}} {{#vars}} {{^isNullable}} {{#required}} @@ -335,12 +377,19 @@ # @param [Object] {{{name}}} Value to be assigned def {{{name}}}=({{{name}}}) {{^isNullable}} - {{#required}} +{{^useCustomTemplateCode}} if {{{name}}}.nil? fail ArgumentError, '{{{name}}} cannot be nil' end +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + {{#required}} + if {{{name}}}.nil? + fail ArgumentError, '{{{name}}} cannot be nil' + end {{/required}} +{{/useCustomTemplateCode}} {{/isNullable}} {{#maxLength}} if {{#isNullable}}!{{{name}}}.nil? && {{/isNullable}}{{{name}}}.to_s.length > {{{maxLength}}} diff --git a/sdks/ruby/templates/partial_model_generic_doc.mustache b/sdks/ruby/templates/partial_model_generic_doc.mustache index 336185b84..87fd73a83 100644 --- a/sdks/ruby/templates/partial_model_generic_doc.mustache +++ b/sdks/ruby/templates/partial_model_generic_doc.mustache @@ -1,10 +1,38 @@ # {{moduleName}}::{{classname}} +{{#useCustomTemplateCode}} {{unescapedDescription}} +{{/useCustomTemplateCode}} ## Properties | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +{{^useCustomTemplateCode}} +{{#vars}} +| **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#isReadOnly}}[readonly]{{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | +{{/vars}} + +## Example + +```ruby +require '{{{gemName}}}' + +{{^vars}} +instance = {{moduleName}}::{{classname}}.new() +{{/vars}} +{{#vars}} +{{#-first}} +instance = {{moduleName}}::{{classname}}.new( +{{/-first}} + {{name}}: {{example}}{{^-last}},{{/-last}} +{{#-last}} +) +{{/-last}} +{{/vars}} +``` +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#vars}}| `{{name}}`{{#required}}*_required_{{/required}} | {{#isPrimitiveType}}```{{{dataType}}}```{{/isPrimitiveType}}{{^isPrimitiveType}}[```{{{dataType}}}```]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{#isReadOnly}} [readonly]{{/isReadOnly}}{{#defaultValue}} [default to {{{.}}}]{{/defaultValue}} | {{/vars}} +{{/useCustomTemplateCode}} diff --git a/sdks/ruby/templates/version.mustache b/sdks/ruby/templates/version.mustache index 41eff126b..f495a0c93 100644 --- a/sdks/ruby/templates/version.mustache +++ b/sdks/ruby/templates/version.mustache @@ -2,9 +2,11 @@ {{> api_info}} =end +{{#useCustomTemplateCode}} module Dropbox end +{{/useCustomTemplateCode}} module {{moduleName}} VERSION = '{{gemVersion}}' end diff --git a/translations/en.yaml b/translations/en.yaml index 2e8cd816a..6925e38a4 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -21,6 +21,7 @@ "OpenApi::TAG::UNCLAIMED_DRAFT::DESCRIPTION": ./markdown/en/tags/unclaimed-draft-tag-description.md "OpenApi::TAG::OAUTH::DESCRIPTION": ./markdown/en/tags/oauth-tag-description.md "OpenApi::TAG::CALLBACKS_AND_EVENTS::DESCRIPTION": ./markdown/en/tags/callbacks-tag-description.md +"OpenApi::TAG::TAG_FAX_LINE::DESCRIPTION": ./markdown/en/tags/fax-lines-tag-description.md "OpenApi::ACCOUNT_CALLBACK::SUMMARY": Account Callbacks "OpenApi::ACCOUNT_CALLBACK::DESCRIPTION": ./markdown/en/descriptions/account-callback-description.md @@ -129,6 +130,47 @@ "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. +"FaxLineAddUser::SUMMARY": Add Fax Line User +"FaxLineAddUser::DESCRIPTION": Grants a user access to the specified Fax Line. +"FaxLineAddUser::NUMBER": The Fax Line number. +"FaxLineAddUser::ACCOUNT_ID": Account ID +"FaxLineAddUser::EMAIL_ADDRESS": Email address +"FaxLineAreaCodeGet::SUMMARY": Get Available Fax Line Area Codes +"FaxLineAreaCodeGet::DESCRIPTION": Returns a response with the area codes available for a given state/provice and city. +"FaxLineAreaCodeGet::CITY": Filter area codes by city. +"FaxLineAreaCodeGet::STATE": Filter area codes by state. +"FaxLineAreaCodeGet::PROVINCE": Filter area codes by province. +"FaxLineAreaCodeGet::COUNTRY": Filter area codes by country. +"FaxLineCreate::SUMMARY": Purchase Fax Line +"FaxLineCreate::DESCRIPTION": Purchases a new Fax Line. +"FaxLineDelete::SUMMARY": Delete Fax Line +"FaxLineDelete::DESCRIPTION": Deletes the specified Fax Line from the subscription. +"FaxLineGet::SUMMARY": Get Fax Line +"FaxLineGet::DESCRIPTION": Returns the properties and settings of a Fax Line. +"FaxLineGet::NUMBER": The Fax Line number. +"FaxLineList::SUMMARY": List Fax Lines +"FaxLineList::DESCRIPTION": Returns the properties and settings of multiple Fax Lines. +"FaxLineList::ACCOUNT_ID": Account ID +"FaxLineList::PAGE": Page +"FaxLineList::PAGE_SIZE": Page size +"FaxLineList::SHOW_TEAM_LINES": Show team lines +"FaxLineRemoveUser::SUMMARY": Remove Fax Line Access +"FaxLineRemoveUser::DESCRIPTION": Removes a user's access to the specified Fax Line. +"FaxLineRemoveUser::NUMBER": The Fax Line number. +"FaxLineRemoveUser::ACCOUNT_ID": Account ID +"FaxLineRemoveUser::EMAIL_ADDRESS": Email address +"FaxLineCreate::AREA_CODE": Area code +"FaxLineCreate::CITY": City +"FaxLineCreate::COUNTRY": Country +"FaxLineCreate::ACCOUNT_ID": Account ID +"FaxLineDelete::NUMBER": The Fax Line number. +"FaxLineResponseExample::SUMMARY": Sample Fax Line Response +"FaxLineAreaCodeGetResponseExample::SUMMARY": Sample Area Code Response +"FaxLineListResponseExample::SUMMARY": Sample Fax Line List Response +"FaxLineResponseFaxLine::NUMBER": Number +"FaxLineResponseFaxLine::CREATED_AT": Created at +"FaxLineResponseFaxLine::UPDATED_AT": Updated at + "OAuthTokenGenerate::SUMMARY": OAuth Token Generate "OAuthTokenGenerate::DESCRIPTION": Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. "OAuthTokenGenerate::CLIENT_ID": The client id of the app requesting authorization. @@ -1617,6 +1659,20 @@ "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." +"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" +"FaxLineAreaCodeGet::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to purchase a new fax line, click here." +"FaxLineCreate::SEO::TITLE": "Purchase Fax Line | API Documentation | Dropbox Fax for Developers" +"FaxLineCreate::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to purchase a new fax line, click here." +"FaxLineDelete::SEO::TITLE": "Delete Fax Line | API Documentation | Dropbox Fax for Developers" +"FaxLineDelete::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to delete a fax line, click here." +"FaxLineGet::SEO::TITLE": "Get Fax Line | API Documentation | Dropbox Fax for Developers" +"FaxLineGet::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to retrieve a fax line, click here." +"FaxLineList::SEO::TITLE": "List Fax Lines | API Documentation | Dropbox Fax for Developers" +"FaxLineList::SEO::DESCRIPTION": "The Dropbox Fax API allows you to build custom integrations. To find out how to list your fax lines, click here." +"FaxLineRemoveUser::SEO::TITLE": "Fax Line Remove User | API Documentation | Dropbox Fax for Developers" +"FaxLineRemoveUser::SEO::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." "OAuthTokenGenerate::SEO::TITLE": "Generate OAuth Token | Documentation | Dropbox Sign for Developers" "OAuthTokenGenerate::SEO::DESCRIPTION": "The RESTful Dropbox Sign API easily allows you to build custom eSign integrations. To find out how to generate a new OAuth token with the API, click here." "OAuthTokenRefresh::SEO::TITLE": "OAuth Token Refresh | Documentation | Dropbox Sign for Developers"